Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ default mappings can be disabled:

let g:rtagsUseDefaultMappings = 0

Define custom mappings prefix:
let g:rtagsLeader
default:
'<leader>r'

By default, search results are showed in a location list. Location lists
are local to the current window. To use the vim QuickFix window, which is
shared between all windows, set:
Expand Down
5 changes: 5 additions & 0 deletions doc/rtags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ g:rtagsUseDefaultMappings
Otherwise, no mappings are set up and custom mappings can be configured by
a user.

*g:rtagsLeader*
g:rtagsLeader
Default: '<leader>r'
If you want to custom mappings prefix, set it.

*g:rtagsMinCharsForCommandCompletion*
*rtags-variable-min-chars-for-cmd-compl*
g:rtagsMinCharsForCommandCompletion
Expand Down
43 changes: 24 additions & 19 deletions plugin/rtags.vim
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,31 @@ let s:LOC_OPEN_OPTS = {
\ g:NEW_TAB : 'tab'
\ }

if !exists("g:rtagsLeader")
let g:rtagsLeader = '<leader>r'
endif
exec 'map ' . g:rtagsLeader . ' <Plug>(rtags-prefix)'

if g:rtagsUseDefaultMappings == 1
noremap <Leader>ri :call rtags#SymbolInfo()<CR>
noremap <Leader>rj :call rtags#JumpTo(g:SAME_WINDOW)<CR>
noremap <Leader>rJ :call rtags#JumpTo(g:SAME_WINDOW, { '--declaration-only' : '' })<CR>
noremap <Leader>rS :call rtags#JumpTo(g:H_SPLIT)<CR>
noremap <Leader>rV :call rtags#JumpTo(g:V_SPLIT)<CR>
noremap <Leader>rT :call rtags#JumpTo(g:NEW_TAB)<CR>
noremap <Leader>rp :call rtags#JumpToParent()<CR>
noremap <Leader>rf :call rtags#FindRefs()<CR>
noremap <Leader>rF :call rtags#FindRefsCallTree()<CR>
noremap <Leader>rn :call rtags#FindRefsByName(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
noremap <Leader>rs :call rtags#FindSymbols(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
noremap <Leader>rr :call rtags#ReindexFile()<CR>
noremap <Leader>rl :call rtags#ProjectList()<CR>
noremap <Leader>rw :call rtags#RenameSymbolUnderCursor()<CR>
noremap <Leader>rv :call rtags#FindVirtuals()<CR>
noremap <Leader>rb :call rtags#JumpBack()<CR>
noremap <Leader>rC :call rtags#FindSuperClasses()<CR>
noremap <Leader>rc :call rtags#FindSubClasses()<CR>
noremap <Leader>rd :call rtags#Diagnostics()<CR>
noremap <Plug>(rtags-prefix)i :call rtags#SymbolInfo()<CR>
noremap <Plug>(rtags-prefix)j :call rtags#JumpTo(g:SAME_WINDOW)<CR>
noremap <Plug>(rtags-prefix)J :call rtags#JumpTo(g:SAME_WINDOW, { '--declaration-only' : '' })<CR>
noremap <Plug>(rtags-prefix)S :call rtags#JumpTo(g:H_SPLIT)<CR>
noremap <Plug>(rtags-prefix)V :call rtags#JumpTo(g:V_SPLIT)<CR>
noremap <Plug>(rtags-prefix)T :call rtags#JumpTo(g:NEW_TAB)<CR>
noremap <Plug>(rtags-prefix)p :call rtags#JumpToParent()<CR>
noremap <Plug>(rtags-prefix)f :call rtags#FindRefs()<CR>
noremap <Plug>(rtags-prefix)F :call rtags#FindRefsCallTree()<CR>
noremap <Plug>(rtags-prefix)n :call rtags#FindRefsByName(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
noremap <Plug>(rtags-prefix)s :call rtags#FindSymbols(input("Pattern? ", "", "customlist,rtags#CompleteSymbols"))<CR>
noremap <Plug>(rtags-prefix)r :call rtags#ReindexFile()<CR>
noremap <Plug>(rtags-prefix)l :call rtags#ProjectList()<CR>
noremap <Plug>(rtags-prefix)w :call rtags#RenameSymbolUnderCursor()<CR>
noremap <Plug>(rtags-prefix)v :call rtags#FindVirtuals()<CR>
noremap <Plug>(rtags-prefix)b :call rtags#JumpBack()<CR>
noremap <Plug>(rtags-prefix)C :call rtags#FindSuperClasses()<CR>
noremap <Plug>(rtags-prefix)c :call rtags#FindSubClasses()<CR>
noremap <Plug>(rtags-prefix)d :call rtags#Diagnostics()<CR>
endif

let s:script_folder_path = escape( expand( '<sfile>:p:h' ), '\' )
Expand Down