diff --git a/.vimrc.bundles b/.vimrc.bundles index b55184a..5d91387 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -607,22 +607,28 @@ if HasPlug("fzf") && HasPlug("fzf.vim") let g:fzf_preview_window = ['right:50%'] end - let g:fzf_colors = { - \ 'gutter': ['bg', 'Normal'], - \ } + hi! fzfborderhi term=bold cterm=bold ctermbg=236 gui=bold guibg=#272c42 + hi! fzfqueryhi term=underline cterm=underline gui=underline + let g:fzf_force_termguicolors = 1 + + let g:fzf_colors = { 'gutter': ['bg', 'Normal'], 'bg+': ['bg', 'Normal'], 'bg': ['bg', 'Normal'], 'fg+': ['fg', 'WarningMsg'] } + + let g:fzf_files_options = ['--border-label', 'Files', '--border-label-pos', '9', '--no-scrollbar', '--no-hscroll', '--no-separator'] " check if ripgrep is installed - if ! executable('rg') - command! -bang -nargs=* Rg - \ call fzf#vim#grep( - \ 'grep -R --line-number --exclude-dir=".git;.svn" --color=always -- '.shellescape(), 1, - \ fzf#vim#with_preview(), 0) - endif + function! FzfRg() + if ! executable('rg') + let cmd = 'grep -R --line-number --exclude-dir=".git;.svn" --color=always -- '.shellescape('') + else + let cmd = "rg --column --line-number --no-heading --color=always --smart-case -- ".shellescape('') + endif - command! -bang -nargs=* CFile - \ call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case --vimgrep -- " - \ .shellescape(). " ".expand('%'), - \ 1, fzf#vim#with_preview(), 0) + let RgOptions = ['--border-label', 'Grep', '--border-label-pos', '9', '--no-scrollbar', + \ '--no-hscroll', '--no-separator'] + let with_preview = fzf#vim#with_preview() + let with_preview.options = RgOptions + with_preview.options + call fzf#vim#grep(cmd, 1, with_preview, 0) + endfunction function! FzfColorSelect(color_name) execute("colorscheme " . a:color_name) @@ -636,13 +642,18 @@ if HasPlug("fzf") && HasPlug("fzf.vim") function! FzfAirlineColorSelect(color_name) call SetStatusLineTheme(&background, a:color_name) endfunction - let g:FzfColorComfirmCb = function('FzfColorSelect') - let g:FzfAirlineComfirmCb = function('FzfAirlineColorSelect') - noremap fr :Rg + + noremap fr :call FzfRg() noremap ff :Files - noremap ft :CFile - noremap fa :AirlinePreview - noremap fc :ColorsPreview + + if HasPlug('fzf-color-preview') + let g:FzfColorComfirmCb = function('FzfColorSelect') + let g:FzfAirlineComfirmCb = function('FzfAirlineColorSelect') + noremap fa :AirlinePreview + noremap fc :ColorsPreview + else + noremap fc :Colors + endif endif if HasPlug("coc.nvim") && executable('node') diff --git a/.vimrc.lua b/.vimrc.lua index f60a556..178576e 100644 --- a/.vimrc.lua +++ b/.vimrc.lua @@ -221,7 +221,6 @@ local function telescope_config() [""] = function(bufnr) local selection = action_state.get_selected_entry() actions.select_default() - vim.fn.Theme_persistent(selection.value) end, }, },