diff --git a/.vimrc b/.vimrc index 6544271..1413609 100644 --- a/.vimrc +++ b/.vimrc @@ -305,6 +305,67 @@ let g:undotree_DiffCommand = "diff -u" let g:undotree_SplitWidth = 50 let g:undotree_DiffpanelHeight = 20 +" {{{3 Fuzzbox + +let g:fuzzbox_respect_gitignore = 0 +let g:fuzzbox_keymaps = { + \ 'menu_up': ["\", "\"], + \ 'menu_down': ["\", "\"], + \ 'menu_select': ["\"], + \ 'menu_page_up': [], + \ 'menu_page_down': [], + \ 'menu_scroll_up': ["\", "\"], + \ 'menu_scroll_down': ["\", "\"], + \ 'preview_page_up': [], + \ 'preview_page_down': [], + \ 'preview_scroll_up': ["\"], + \ 'preview_scroll_down': ["\"], + \ 'cursor_end': ["\", "\"], + \ 'cursor_begining': ["\", "\"], + \ 'cursor_word_left': ["\"], + \ 'cursor_word_right': ["\"], + \ 'backspace': ["\"], + \ 'delete': ["\"], + \ 'delete_all': ["\"], + \ 'delete_word': ["\"], + \ 'delete_prefix': [], + \ 'exit': ["\", "\", "\"], + \ } +let g:fuzzbox_buffers_keymap = { + \ 'delete_file': "", + \ 'wipe_buffer': "", + \ 'close_buffer': "\", + \ } +let g:fuzzbox_window_layout = { + \ 'files': { + \ 'preview': 0, + \ 'width': 0.3, + \ 'height': 0.5, + \ }, + \ 'grep': { + \ 'preview': 1, + \ 'width': 0.6, + \ 'height': 0.5, + \ 'preview_ratio': 0.5, + \ }, + \ 'buffers': { + \ 'preview': 0, + \ 'width': 0.3, + \ 'height': 0.5, + \ }, + \ 'mru': { + \ 'preview': 0, + \ 'width': 0.3, + \ 'height': 0.5, + \ }, + \ 'highlights': { + \ 'preview': 1, + \ 'width': 0.6, + \ 'height': 0.5, + \ 'preview_ratio': 0.5, + \ }, + \ } + " {{{2 Install let s:plug_file = expand('$HOME/.vim/autoload/plug.vim') @@ -319,8 +380,6 @@ call plug#begin(s:plug_dir) Plug 'joshdick/onedark.vim' Plug 'tpope/vim-commentary' Plug 'tpope/vim-fugitive' -Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } -Plug 'junegunn/fzf.vim' Plug 'airblade/vim-gitgutter' Plug 'markonm/traces.vim' Plug 'rbong/vim-flog' @@ -330,6 +389,7 @@ Plug 'preservim/nerdtree' Plug 'ryanoasis/vim-devicons' Plug 'tiagofumo/vim-nerdtree-syntax-highlight' Plug 'mbbill/undotree' +Plug 'vim-fuzzbox/fuzzbox.vim' " Plug 'prabirshrestha/vim-lsp' " Plug 'dense-analysis/ale' @@ -442,40 +502,12 @@ nmap ga :G commit --amend nmap gp :G push nmap gg :call ToggleGitStatus() -" {{{3 Fzf +" {{{3 Fuzzbox -autocmd! FileType fzf tnoremap -autocmd! FileType fzf tnoremap -autocmd! FileType fzf tnoremap - -" To match exact, prefix word with `'` -command! -bang -nargs=* Rg call fzf#vim#grep( - \ "rg" - \ . " --column" - \ . " --line-number" - \ . " --no-heading" - \ . " --color=always" - \ . " --smart-case" - \ . " --iglob=!.git" - \ . " --hidden" - \ . " --no-ignore-vcs " ., 1, 0) - -command! -bang CwdHistory call fzf#run(fzf#wrap({ - \ 'source': filter( - \ fzf#vim#_recent_files(), - \ 'v:val !~ "^\\~\\?/"' - \ ), - \ 'options': [ - \ '-m', - \ '--header-lines', !empty(expand('%')), - \ '--prompt', 'CwdHist> ' - \ ]}, - \ 0)) - -nmap ff :Files -nmap fr :CwdHistory -nmap fb :Buffers -nmap fg :Rg "" +nmap ff :FuzzyFiles +nmap fr :FuzzyMruCwd +nmap fb :FuzzyBuffers +nmap fg :FuzzyGrep " {{{3 NERDTree