From 98922a45d80595b2f2666d81fefce9f7c5710207 Mon Sep 17 00:00:00 2001 From: Cosson2017 Date: Tue, 19 Sep 2017 21:34:29 +0800 Subject: [PATCH 1/3] add rtags map leader key --- plugin/rtags.vim | 41 +++++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/plugin/rtags.vim b/plugin/rtags.vim index 796e8b70..5b3b9ca1 100644 --- a/plugin/rtags.vim +++ b/plugin/rtags.vim @@ -65,25 +65,30 @@ let s:LOC_OPEN_OPTS = { \ g:NEW_TAB : 'tab' \ } +if !exists("g:rtagsLeader") + let g:rtagsLeader = '\' +endif +exec 'map ' . g:rtagsLeader . ' (rtags-prefix)' + if g:rtagsUseDefaultMappings == 1 - noremap ri :call rtags#SymbolInfo() - noremap rj :call rtags#JumpTo(g:SAME_WINDOW) - noremap rJ :call rtags#JumpTo(g:SAME_WINDOW, { '--declaration-only' : '' }) - noremap rS :call rtags#JumpTo(g:H_SPLIT) - noremap rV :call rtags#JumpTo(g:V_SPLIT) - noremap rT :call rtags#JumpTo(g:NEW_TAB) - noremap rp :call rtags#JumpToParent() - noremap rf :call rtags#FindRefs() - noremap rn :call rtags#FindRefsByName(input("Pattern? ", "", "customlist,rtags#CompleteSymbols")) - noremap rs :call rtags#FindSymbols(input("Pattern? ", "", "customlist,rtags#CompleteSymbols")) - noremap rr :call rtags#ReindexFile() - noremap rl :call rtags#ProjectList() - noremap rw :call rtags#RenameSymbolUnderCursor() - noremap rv :call rtags#FindVirtuals() - noremap rb :call rtags#JumpBack() - noremap rC :call rtags#FindSuperClasses() - noremap rc :call rtags#FindSubClasses() - noremap rd :call rtags#Diagnostics() + noremap (rtags-prefix)i :call rtags#SymbolInfo() + noremap (rtags-prefix)j :call rtags#JumpTo(g:SAME_WINDOW) + noremap (rtags-prefix)J :call rtags#JumpTo(g:SAME_WINDOW, { '--declaration-only' : '' }) + noremap (rtags-prefix)S :call rtags#JumpTo(g:H_SPLIT) + noremap (rtags-prefix)V :call rtags#JumpTo(g:V_SPLIT) + noremap (rtags-prefix)T :call rtags#JumpTo(g:NEW_TAB) + noremap (rtags-prefix)p :call rtags#JumpToParent() + noremap (rtags-prefix)f :call rtags#FindRefs() + noremap (rtags-prefix)n :call rtags#FindRefsByName(input("Pattern? ", "", "customlist,rtags#CompleteSymbols")) + noremap (rtags-prefix)s :call rtags#FindSymbols(input("Pattern? ", "", "customlist,rtags#CompleteSymbols")) + noremap (rtags-prefix)r :call rtags#ReindexFile() + noremap (rtags-prefix)l :call rtags#ProjectList() + noremap (rtags-prefix)w :call rtags#RenameSymbolUnderCursor() + noremap (rtags-prefix)v :call rtags#FindVirtuals() + noremap (rtags-prefix)b :call rtags#JumpBack() + noremap (rtags-prefix)C :call rtags#FindSuperClasses() + noremap (rtags-prefix)c :call rtags#FindSubClasses() + noremap (rtags-prefix)d :call rtags#Diagnostics() endif """ From 7445c228e1a72bbc0b03ac2fa1dd16ae2ce698b0 Mon Sep 17 00:00:00 2001 From: Cosson2017 Date: Tue, 19 Sep 2017 21:42:08 +0800 Subject: [PATCH 2/3] r replace \ --- plugin/rtags.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/rtags.vim b/plugin/rtags.vim index 5b3b9ca1..ddc89543 100644 --- a/plugin/rtags.vim +++ b/plugin/rtags.vim @@ -66,7 +66,7 @@ let s:LOC_OPEN_OPTS = { \ } if !exists("g:rtagsLeader") - let g:rtagsLeader = '\' + let g:rtagsLeader = 'r' endif exec 'map ' . g:rtagsLeader . ' (rtags-prefix)' From 1b3a207e79493acc4ceaeae1f222ebf1a8f77875 Mon Sep 17 00:00:00 2001 From: liukesheng <850174971@qq.com> Date: Tue, 16 Jan 2018 18:17:01 +0800 Subject: [PATCH 3/3] modify doc --- README.md | 5 +++++ doc/rtags.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 1ec589ea..fd310e15 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ default mappings can be disabled: let g:rtagsUseDefaultMappings = 0 +Define custom mappings prefix: + let g:rtagsLeader +default: + '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: diff --git a/doc/rtags.txt b/doc/rtags.txt index abc7f026..a816dab6 100644 --- a/doc/rtags.txt +++ b/doc/rtags.txt @@ -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: 'r' + If you want to custom mappings prefix, set it. + *g:rtagsMinCharsForCommandCompletion* *rtags-variable-min-chars-for-cmd-compl* g:rtagsMinCharsForCommandCompletion