我是靠谱客的博主 眯眯眼皮皮虾,这篇文章主要介绍vim插件Leaderf的功能补充,现在分享给大家,希望可以做个参考。

 1、快捷键及排除搜索目录设置:

nnoremap <leader>f :LeaderfFile ~<cr>
noremap <F2> :LeaderfFunction!<cr>
let g:Lf_WildIgnore = {
 'dir': ['.svn','.git','.hg','.vscode','.wine','.deepinwine','.oh-my-zsh'],
 'file': ['*.sw?','~$*','*.bak','*.exe','*.o','*.so','*.py[co]']
}
" 按Esc键退出函数列表
let g:Lf_NormalMap = {
 "File":
[["<ESC>", ':exec g:Lf_py "fileExplManager.quit()"<CR>']],
 "Buffer": [["<ESC>", ':exec g:Lf_py "bufExplManager.quit()"<CR>']],
 "Mru":
[["<ESC>", ':exec g:Lf_py "mruExplManager.quit()"<CR>']],
 "Tag":
[["<ESC>", ':exec g:Lf_py "tagExplManager.quit()"<CR>']],
 "Function":
[["<ESC>", ':exec g:Lf_py "functionExplManager.quit()"<CR>']],
 "Colorscheme":
[["<ESC>", ':exec g:Lf_py "colorschemeExplManager.quit()"<CR>']],
 }
" let g:Lf_UseCache = 0

2、安装搜索工具rg:

18.10版本之后的ubuntu系统可以用apt-get 安装:sudo apt-get install ripgrep

修改 ~/.vimrc,添加触发命令:

noremap <Leader>F :<C-U><C-R>=printf("Leaderf! rg -e %s", expand("<cword>"))<CR>
noremap go :<C-U>Leaderf! rg --recall<CR>

 

18.10版本之前的ubuntu系统需要这样安装:

curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep_0.10.0_amd64.deb
sudo dpkg -i ripgrep_0.10.0_amd64.deb

" ack
if executable('rg')
let g:ackprg = 'rg --vimgrep'
endif
nnoremap <leader>F :Ack!<space>
let g:ackhighlight = 1
let g:ack_autoclose = 1

 

最后

以上就是眯眯眼皮皮虾最近收集整理的关于vim插件Leaderf的功能补充的全部内容,更多相关vim插件Leaderf内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(131)

评论列表共有 0 条评论

立即
投稿
返回
顶部