2019-06-01 21:08:41 +00:00
|
|
|
|
= Vim: навигация по тексту с помощью easymotion
|
2019-06-02 16:31:29 +00:00
|
|
|
|
:title-separator: {sp}|
|
2019-06-01 21:08:41 +00:00
|
|
|
|
:category: Vim
|
|
|
|
|
:tags: Vim, команды Vim,
|
|
|
|
|
|
|
|
|
|
Плагин https://github.com/easymotion/vim-easymotion[easymotion]
|
|
|
|
|
предоставляет функции для удобного перемещения по тексту. Пример
|
|
|
|
|
настройки:
|
|
|
|
|
|
|
|
|
|
[source,vim]
|
|
|
|
|
----
|
2019-04-20 20:24:14 +00:00
|
|
|
|
" Не включать команды по умолчанию
|
|
|
|
|
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)
|
2019-06-01 21:08:41 +00:00
|
|
|
|
----
|