This commit is contained in:
Nachuan Tang
2023-03-25 15:33:00 -04:00
parent ff440be571
commit b0c84ce1c5
2 changed files with 30 additions and 20 deletions
+30 -19
View File
@@ -607,22 +607,28 @@ if HasPlug("fzf") && HasPlug("fzf.vim")
let g:fzf_preview_window = ['right:50%'] let g:fzf_preview_window = ['right:50%']
end end
let g:fzf_colors = { hi! fzfborderhi term=bold cterm=bold ctermbg=236 gui=bold guibg=#272c42
\ 'gutter': ['bg', 'Normal'], 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 " check if ripgrep is installed
if ! executable('rg') function! FzfRg()
command! -bang -nargs=* Rg if ! executable('rg')
\ call fzf#vim#grep( let cmd = 'grep -R --line-number --exclude-dir=".git;.svn" --color=always -- '.shellescape('')
\ 'grep -R --line-number --exclude-dir=".git;.svn" --color=always -- '.shellescape(<q-args>), 1, else
\ fzf#vim#with_preview(), <bang>0) let cmd = "rg --column --line-number --no-heading --color=always --smart-case -- ".shellescape('')
endif endif
command! -bang -nargs=* CFile let RgOptions = ['--border-label', 'Grep', '--border-label-pos', '9', '--no-scrollbar',
\ call fzf#vim#grep("rg --column --line-number --no-heading --color=always --smart-case --vimgrep -- " \ '--no-hscroll', '--no-separator']
\ .shellescape(<q-args>). " ".expand('%'), let with_preview = fzf#vim#with_preview()
\ 1, fzf#vim#with_preview(), <bang>0) let with_preview.options = RgOptions + with_preview.options
call fzf#vim#grep(cmd, 1, with_preview, 0)
endfunction
function! FzfColorSelect(color_name) function! FzfColorSelect(color_name)
execute("colorscheme " . a:color_name) execute("colorscheme " . a:color_name)
@@ -636,13 +642,18 @@ if HasPlug("fzf") && HasPlug("fzf.vim")
function! FzfAirlineColorSelect(color_name) function! FzfAirlineColorSelect(color_name)
call SetStatusLineTheme(&background, a:color_name) call SetStatusLineTheme(&background, a:color_name)
endfunction endfunction
let g:FzfColorComfirmCb = function('FzfColorSelect')
let g:FzfAirlineComfirmCb = function('FzfAirlineColorSelect') noremap <leader>fr :call FzfRg()<CR>
noremap <leader>fr :Rg<CR>
noremap <leader>ff :Files<CR> noremap <leader>ff :Files<CR>
noremap <leader>ft :CFile<CR>
noremap <leader>fa :AirlinePreview<CR> if HasPlug('fzf-color-preview')
noremap <leader>fc :ColorsPreview<CR> let g:FzfColorComfirmCb = function('FzfColorSelect')
let g:FzfAirlineComfirmCb = function('FzfAirlineColorSelect')
noremap <leader>fa :AirlinePreview<CR>
noremap <leader>fc :ColorsPreview<CR>
else
noremap <leader>fc :Colors<CR>
endif
endif endif
if HasPlug("coc.nvim") && executable('node') if HasPlug("coc.nvim") && executable('node')
-1
View File
@@ -221,7 +221,6 @@ local function telescope_config()
["<CR>"] = function(bufnr) ["<CR>"] = function(bufnr)
local selection = action_state.get_selected_entry() local selection = action_state.get_selected_entry()
actions.select_default() actions.select_default()
vim.fn.Theme_persistent(selection.value)
end, end,
}, },
}, },