2019-04-20 20:24:14 +00:00
|
|
|
|
---
|
|
|
|
|
title: "Vim: навигация по тексту с помощью easymotion"
|
|
|
|
|
category: Vim
|
2019-04-23 17:40:06 +00:00
|
|
|
|
tags: Vim, команды Vim,
|
2019-04-20 20:24:14 +00:00
|
|
|
|
summary:
|
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
Плагин [easymotion](https://github.com/easymotion/vim-easymotion)
|
|
|
|
|
предоставляет функции для удобного перемещения по тексту.
|
|
|
|
|
Пример настройки:
|
|
|
|
|
|
|
|
|
|
```vim
|
|
|
|
|
" Не включать команды по умолчанию
|
|
|
|
|
let g:EasyMotion_do_mapping = 0
|
|
|
|
|
|
|
|
|
|
" Умный регистр
|
|
|
|
|
let g:EasyMotion_smartcase = 1
|
|
|
|
|
|
|
|
|
|
" <Leader>ec{char} для перехода к {char}
|
|
|
|
|
map <Leader>ec <Plug>(easymotion-bd-f)
|
|
|
|
|
nmap <Leader>ec <Plug>(easymotion-overwin-f)
|
|
|
|
|
|
|
|
|
|
" s{char}{char} для перехода к {char}{char}
|
|
|
|
|
nmap s <Plug>(easymotion-overwin-f2)
|
|
|
|
|
|
|
|
|
|
" Переход к строке
|
|
|
|
|
map <Leader>eg <Plug>(easymotion-bd-jk)
|
|
|
|
|
nmap <Leader>eg <Plug>(easymotion-overwin-line)
|
|
|
|
|
|
|
|
|
|
" Переход к слову
|
|
|
|
|
map <Leader>ew <Plug>(easymotion-bd-w)
|
|
|
|
|
nmap <Leader>ew <Plug>(easymotion-overwin-w)
|
|
|
|
|
|
|
|
|
|
" Навигация по строкам
|
|
|
|
|
map <Leader>el <Plug>(easymotion-lineforward)
|
|
|
|
|
map <Leader>ej <Plug>(easymotion-j)
|
|
|
|
|
map <Leader>ek <Plug>(easymotion-k)
|
|
|
|
|
map <Leader>eh <Plug>(easymotion-linebackward)
|
|
|
|
|
|
|
|
|
|
" Повторить последний переход
|
|
|
|
|
map <Leader>er <Plug>(easymotion-repeat)
|
|
|
|
|
|
|
|
|
|
" Замена стандартного поиска по тексту
|
|
|
|
|
map / <Plug>(easymotion-sn)
|
|
|
|
|
omap / <Plug>(easymotion-tn)
|
|
|
|
|
|
|
|
|
|
" These `n` & `N` mappings are options. You do not have to map `n` & `N` to EasyMotion.
|
|
|
|
|
" Without these mappings, `n` & `N` works fine. (These mappings just provide
|
|
|
|
|
" different highlight method and have some other features )
|
|
|
|
|
map n <Plug>(easymotion-next)
|
|
|
|
|
map N <Plug>(easymotion-prev)
|
|
|
|
|
```
|
|
|
|
|
|