aboutsummaryrefslogtreecommitdiff
path: root/.vim/plugins/leaderf.vim
diff options
context:
space:
mode:
authorgxlin <[email protected]>2021-03-16 10:42:48 +0800
committergxlin <[email protected]>2021-03-16 10:42:48 +0800
commit06929ba11c0ef83da2462f60ee8c6dc07a2aa9a4 (patch)
tree7eede7fef35e892ec41b0db529819ce33871b016 /.vim/plugins/leaderf.vim
parent4d3b20b9445c1bcdd015e2babc03da91651898ed (diff)
downloaddotfiles-06929ba11c0ef83da2462f60ee8c6dc07a2aa9a4.tar.gz
dotfiles-06929ba11c0ef83da2462f60ee8c6dc07a2aa9a4.tar.bz2
dotfiles-06929ba11c0ef83da2462f60ee8c6dc07a2aa9a4.zip
Split .vimrc to multiple vimscript files
Diffstat (limited to '.vim/plugins/leaderf.vim')
-rw-r--r--.vim/plugins/leaderf.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/.vim/plugins/leaderf.vim b/.vim/plugins/leaderf.vim
new file mode 100644
index 0000000..4d6d0ac
--- /dev/null
+++ b/.vim/plugins/leaderf.vim
@@ -0,0 +1,22 @@
+Plug 'Yggdroot/LeaderF', {'do': './install.sh'}
+
+" " Show icons, icons are shown by default
+let g:Lf_ShowDevIcons = 1
+
+" For GUI vim, the icon font can be specify like this, for example
+let g:Lf_DevIconsFont = "DejaVuSansMono Nerd Font Mono"
+let g:Lf_WindowPosition = 'popup'
+let g:Lf_ShortcutF = "<leader>ff"
+
+noremap <leader>fb :<C-U><C-R>=printf("Leaderf buffer %s", "")<CR><CR>
+noremap <leader>fm :<C-U><C-R>=printf("Leaderf mru %s", "")<CR><CR>
+noremap <leader>ft :<C-U><C-R>=printf("Leaderf bufTag %s", "")<CR><CR>
+noremap <leader>fl :<C-U><C-R>=printf("Leaderf line %s", "")<CR><CR>
+noremap <C-B> :<C-U><C-R>=printf("Leaderf! rg --current-buffer -e %s ", expand("<cword>"))<CR>
+noremap <C-F> :<C-U><C-R>=printf("Leaderf! rg -e %s ", expand("<cword>"))<CR>
+
+" search visually selected text literally
+xnoremap gf :<C-U><C-R>=printf("Leaderf! rg -F -e %s ", leaderf#Rg#visual())<CR>
+noremap go :<C-U>Leaderf! rg --recall<CR>
+let g:Lf_RootMarkers = ['.project', '.root', '.svn', '.git']
+let g:Lf_WorkingDirectoryMode = 'AF'