aboutsummaryrefslogtreecommitdiff
path: root/core/plugins.vim
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2021-10-20 21:57:35 +0800
committerjdhao <jdhao@hotmail.com>2021-10-20 21:57:35 +0800
commit976081c453d820c87d2a5c79df5193ba5dcc6183 (patch)
tree363335b71949fd716967bcd0bae4d98c4b88d853 /core/plugins.vim
parent43944fabdc386ea321cc858012d07c8f995639d5 (diff)
update wilder.nvim conf
1. use popup menu instead of statusline 2. use autocmd to activate
Diffstat (limited to 'core/plugins.vim')
-rw-r--r--core/plugins.vim74
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
"}}
"}