From 55ca57247d34d48e2b8b3d6056982dcdbba993ef Mon Sep 17 00:00:00 2001 From: bretello Date: Thu, 30 Sep 2021 12:41:07 +0200 Subject: [PATCH] vim: replace CTRLP with fzf.vim - add fzf.vim - Remove ack plugin (use :Rg instead) --- vim/plugins_config.vim | 16 ++-------------- vim/plugs.vim | 17 +++++------------ vim/shortcuts.vim | 20 ++++++++++++-------- 3 files changed, 19 insertions(+), 34 deletions(-) diff --git a/vim/plugins_config.vim b/vim/plugins_config.vim index b3c932b..4625a08 100644 --- a/vim/plugins_config.vim +++ b/vim/plugins_config.vim @@ -1,6 +1,4 @@ """" PLUGINS CONFIGURATION -let g:ack_default_options = " --cc --cpp --shell --python --html --js --vue --rust --yaml" - " ALE configuration let g:ale_set_balloons = 1 " enable tooltips let g:ale_fixers = { @@ -145,13 +143,6 @@ let g:indent_guides_start_level = 2 let g:indent_guides_guide_size = 1 -" let g:ctrlp_custom_ignore = { -" \ 'dir': '\v(target|build|dist|.venv)$', -" \ 'file': '\v\.(exe|so|dll)$', -" \ 'link': 'some_bad_symbolic_links', -" \ } -let g:ctrlp_user_command = ['.git', 'cd %s && git ls-files -co --exclude-standard'] - "" Gutentags" let g:gutentags_cache_dir = expand('~/.vim/ctags_cache/') @@ -161,8 +152,9 @@ let g:gutentags_file_list_command = { \ '.hg': 'hg files', \ }, \ } +let g:gutentags_generate_on_empty_buffer = 1 let g:gutentags_ctags_exclude = ['build', 'dist', '*css', '*json', '*yaml', '*md'] - +let g:gutentags_ctags_extra_args = ['--tag-relative=always', ] "" nerdtree let NERDTreeIgnore=['__pycache__'] @@ -174,10 +166,6 @@ let g:snipMate.description_in_completion = 1 let g:ackprg = 'rg --vimgrep --no-heading' -"" Quickpeek -" Automatically open the quickpeek window -let g:quickpeek_auto = v:true - "" Fzf let g:fzf_layout = { 'down': '~40%' }" diff --git a/vim/plugs.vim b/vim/plugs.vim index 1e51ca7..852e72a 100644 --- a/vim/plugs.vim +++ b/vim/plugs.vim @@ -15,10 +15,6 @@ Plug 'https://github.com/morhetz/gruvbox' Plug 'https://github.com/chrisbra/csv.vim' " Asynchronous Linting Engine Plug 'https://github.com/dense-analysis/ale' -" Open files/recent files/tags quickly -Plug 'https://github.com/ctrlpvim/ctrlp.vim' -" Ctrlp requires gutentags -Plug 'https://github.com/ludovicchabant/vim-gutentags.git' " Git Plug 'https://github.com/tpope/vim-fugitive' " Comment shit easily @@ -33,8 +29,6 @@ Plug 'https://github.com/jiangmiao/auto-pairs' Plug 'https://github.com/amix/open_file_under_cursor.vim' " Multi cursor Plug 'https://github.com/mg979/vim-visual-multi' -" Search -Plug 'https://github.com/mileszs/ack.vim' " Yank history Plug 'https://github.com/maxbrunsfeld/vim-yankstack' " Mark indentation level @@ -43,12 +37,11 @@ Plug 'https://github.com/nathanaelkane/vim-indent-guides' " Meson + Ninja Plug 'https://github.com/igankevich/mesonic' -if g:uname == "Darwin" - " mac - Plug '/usr/local/opt/fzf' -elseif g:uname == "Linux" - Plug '/usr/bin/fzf' -end +" fzf +Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } +Plug 'junegunn/fzf.vim' +" Open tags with fzf's :Tags +Plug 'https://github.com/ludovicchabant/vim-gutentags.git' " snipmate Plug 'https://github.com/MarcWeber/vim-addon-mw-utils' diff --git a/vim/shortcuts.vim b/vim/shortcuts.vim index ad534d2..041bd86 100644 --- a/vim/shortcuts.vim +++ b/vim/shortcuts.vim @@ -53,7 +53,7 @@ nnoremap wz :call WinZoomToggle() nnoremap C :close nnoremap B :Bclose -nnoremap k :LAck +nnoremap k :Rg "" Fugitive nnoremap / :0Git @@ -86,19 +86,23 @@ nmap n :ALEFindReferences -relative nmap h :ALEHover nmap r :ALERename nmap ` :ALELint +nmap F :ALEFix map nn :NERDTreeToggle -"" CtrlP +"" fzf.vim " Quickly find and open a recently opened file -map o :CtrlPBuffer -map j :call fzf#run({'sink': 'edit', 'options': '--preview="BAT_STYLE=header,changes bat --color=always {}"', 'down': '40%'}) +map o :Buffers +map j :GFiles +map J :Files -map f :CtrlPMRUFiles -map T :CtrlPBufTag -map t :CtrlPTag -map l :CtrlPLine +map f :History +map T :BTags +map t :Tags +map l :Lines map c :CtrlPQuickfix +map s :Snippets +map ; :Commands "" CSV " highlight current column