diff options
| author | jdhao <jdhao@hotmail.com> | 2021-10-20 21:57:35 +0800 |
|---|---|---|
| committer | jdhao <jdhao@hotmail.com> | 2021-10-20 21:57:35 +0800 |
| commit | 976081c453d820c87d2a5c79df5193ba5dcc6183 (patch) | |
| tree | 363335b71949fd716967bcd0bae4d98c4b88d853 | |
| parent | 43944fabdc386ea321cc858012d07c8f995639d5 (diff) | |
update wilder.nvim conf
1. use popup menu instead of statusline
2. use autocmd to activate
| -rw-r--r-- | core/plugins.vim | 74 |
1 files changed, 46 insertions, 28 deletions
diff --git a/core/plugins.vim b/core/plugins.vim index 32ef861..ffefb39 100644 --- a/core/plugins.vim +++ b/core/plugins.vim @@ -479,33 +479,51 @@ endif nnoremap <leader>dp :<C-U>GdbStartPDB python -m pdb %<CR> """"""""""""""""""""""""""""""wilder.nvim settings"""""""""""""""""""""""""""""" -call wilder#enable_cmdline_enter() -set wildcharm=<Tab> -cmap <expr> <Tab> wilder#in_context() ? wilder#next() : "\<Tab>" -cmap <expr> <S-Tab> wilder#in_context() ? wilder#previous() : "\<S-Tab>" - -" only / and ? are enabled by default -call wilder#set_option('modes', ['/', '?', ':']) - -call wilder#set_option('pipeline', [ - \ wilder#branch( - \ wilder#cmdline_pipeline({ - \ 'language': 'python', - \ 'fuzzy': 1, - \ 'sorter': wilder#python_difflib_sorter() - \ }), - \ wilder#python_search_pipeline({ - \ 'pattern': wilder#python_fuzzy_pattern(), - \ 'sorter': wilder#python_difflib_sorter(), - \ 'engine': 're', - \ }), - \ ), - \ ]) - -call wilder#set_option('renderer', wilder#wildmenu_renderer( - \ wilder#wildmenu_airline_theme({ - \ 'highlighter': wilder#basic_highlighter(), - \ 'separator': ' ', - \ }))) +augroup wilder_init + autocmd! + autocmd CmdlineEnter * ++once call s:wilder_init() +augroup END + +function! s:wilder_init() abort + try + call wilder#enable_cmdline_enter() + set wildcharm=<Tab> + cmap <expr> <Tab> wilder#in_context() ? wilder#next() : "\<Tab>" + cmap <expr> <S-Tab> wilder#in_context() ? wilder#previous() : "\<S-Tab>" + + " only / and ? are enabled by default + call wilder#set_option('modes', ['/', '?', ':']) + + call wilder#set_option('pipeline', [ + \ wilder#branch( + \ wilder#cmdline_pipeline({ + \ 'language': 'python', + \ 'fuzzy': 1, + \ 'sorter': wilder#python_difflib_sorter(), + \ 'debounce': 30, + \ }), + \ wilder#python_search_pipeline({ + \ 'pattern': wilder#python_fuzzy_pattern(), + \ 'sorter': wilder#python_difflib_sorter(), + \ 'engine': 're', + \ 'debounce': 30, + \ }), + \ ), + \ ]) + + let l:hl = wilder#make_hl('WilderAccent', 'Pmenu', [{}, {}, {'foreground': '#f4468f'}]) + call wilder#set_option('renderer', wilder#popupmenu_renderer({ + \ 'highlighter': wilder#basic_highlighter(), + \ 'winblend': 5, + \ 'max_height': 15, + \ 'highlights': { + \ 'accent': l:hl, + \ }, + \ 'apply_incsearch_fix': 0, + \ })) + catch /^Vim\%((\a\+)\)\=:E117/ + echohl Error |echomsg "Wilder.nvim missing. Run :PackerInstall to install all plugins."|echohl None + endtry +endfunction "}} "} |
