vim navigate - RawIron/rawiron.github.io GitHub Wiki

navigate code

  • llist
  • clist
  • changelist
  • jumplist
  • taglist

jump to definition, declaration

use tags

" jump to tag under cursor
<ctrl-]>
" previous tag
<ctrl-t>

use YouCompleteMe plugin

" ycm
:YcmCompleter GoToDefinition

" key map intelliJ
nnoremap <c-b> :YcmCompleter GoTo<CR> 
nnoremap <c-s-b> :YcmCompleter GoToDefinition<CR>
nnoremap <c-a-b> :YcmCompleter GoToDeclaration<CR>

nnoremap <leader>dj :YcmCompleter GoToDefinition<CR>
nnoremap <leader>dcj :YcmCompleter GoToDeclaration<CR>

jump to next or previous error

location list

in the list of all errors detected by syntastic in the source

" jumps in the location list of the current window
:lprevious
:lnext

nnoremap <leader>lp :lprevious<CR>
nnoremap <leader>ln :lnext<CR>

Quickfix

" jumps in quickfix window
:cprevious
:cnext

nnoremap <leader>cp :cprevious<CR>
nnoremap <leader>cn :cnext<CR>

# open a new window and jump to error there
ctrl-W_<enter>

select surrounding block

Tim Pope surround.vim

" not really but something like that ..
yap
ya}

move to next or previous method/function

curly braces {} as pattern

[[
]]

might be a feature of tagbar or ctags

[m
]m

use tagbar plugin

" jump to tagbar
" one line down = next method
" jump to method
<leader>t 
k
<CR>

cursor position history movements

<ctrl-i> " next
<ctrl-o> " previous

change list history movement

:changes

" previous
g;
" next 
g,

show call hierarchy

⚠️ **GitHub.com Fallback** ⚠️