From 86bb86e4f111e4353a1ac14ac3cf2844391ee8b1 Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 8 May 2020 22:12:01 -0400 Subject: [PATCH] updates --- general/functions.vim | 21 +++++++++++++++++++++ init.vim | 8 +++++--- plug-config/coc.vim | 2 +- plug-config/goyo.vim | 1 + plug-config/quickscope.vim | 3 +-- plug-config/vim-rooter.vim | 1 + themes/airline.vim | 3 ++- 7 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 general/functions.vim create mode 100644 plug-config/goyo.vim create mode 100644 plug-config/vim-rooter.vim diff --git a/general/functions.vim b/general/functions.vim new file mode 100644 index 00000000..bec4580b --- /dev/null +++ b/general/functions.vim @@ -0,0 +1,21 @@ +" distinct highlight current, first and last match when searching +function! HLCurrent() abort + if exists("currmatch") + call matchdelete(currmatch) + endif + " only on cursor + let patt = '\c\%#'.@/ + " check prev and next match + let prevmatch = search(@/, 'bWn') + let nextmatch = search(@/, 'Wn') + " if on first or last match + if prevmatch == 0 || nextmatch == 0 + let currmatch = matchadd('EdgeSearch', patt, 101) + else + let currmatch = matchadd('IncSearch', patt, 101) + endif + redraw +endfunction + +nnoremap n n:call HLCurrent() +nnoremap N N:call HLCurrent() diff --git a/init.vim b/init.vim index f1e1e623..bc7fa41f 100644 --- a/init.vim +++ b/init.vim @@ -1,8 +1,8 @@ -" ____ _ __ _ -" / _/___ (_) /__ __(_)___ ___ +" ____ _ __ _ +" / _/___ (_) /__ __(_)___ ___ " / // __ \/ / __/ | / / / __ `__ \ " _/ // / / / / /__| |/ / / / / / / / -"/___/_/ /_/_/\__(_)___/_/_/ /_/ /_/ +"/___/_/ /_/_/\__(_)___/_/_/ /_/ /_/ " Always source these @@ -29,6 +29,8 @@ else source $HOME/.config/nvim/plug-config/coc.vim source $HOME/.config/nvim/plug-config/quickscope.vim source $HOME/.config/nvim/plug-config/sneak.vim + source $HOME/.config/nvim/plug-config/goyo.vim + source $HOME/.config/nvim/plug-config/vim-rooter.vim "source $HOME/.config/nvim/plug-config/easymotion.vim source $HOME/.config/nvim/plug-config/start-screen.vim source $HOME/.config/nvim/plug-config/signify.vim diff --git a/plug-config/coc.vim b/plug-config/coc.vim index c9ae319f..babae7ed 100644 --- a/plug-config/coc.vim +++ b/plug-config/coc.vim @@ -136,6 +136,6 @@ let g:coc_explorer_global_presets = { \ } \ } "nmap e :CocCommand explorer -nnoremap e :CocCommand explorer +nnoremap e :CocCommand explorer nmap f :CocCommand explorer --preset floatingRightside autocmd BufEnter * if (winnr("$") == 1 && &filetype == 'coc-explorer') | q | endif diff --git a/plug-config/goyo.vim b/plug-config/goyo.vim new file mode 100644 index 00000000..1f5b17ac --- /dev/null +++ b/plug-config/goyo.vim @@ -0,0 +1 @@ +nmap z :Goyo diff --git a/plug-config/quickscope.vim b/plug-config/quickscope.vim index 934166b6..7950dc7d 100644 --- a/plug-config/quickscope.vim +++ b/plug-config/quickscope.vim @@ -1,7 +1,6 @@ " Trigger a highlight in the appropriate direction when pressing these keys: -" ; repeat forward , repeat backwards let g:qs_highlight_on_keys = ['f', 'F', 't', 'T'] highlight QuickScopePrimary guifg='#00C7DF' gui=underline ctermfg=155 cterm=underline -highlight QuickScopeSecondary guifg='#afff5f' gui=underline ctermfg=81 cterm=underline +highlight QuickScopeSecondary guifg='#eF5F70' gui=underline ctermfg=81 cterm=underline let g:qs_max_chars=150 diff --git a/plug-config/vim-rooter.vim b/plug-config/vim-rooter.vim new file mode 100644 index 00000000..0fea0770 --- /dev/null +++ b/plug-config/vim-rooter.vim @@ -0,0 +1 @@ +let g:rooter_silent_chdir = 1 diff --git a/themes/airline.vim b/themes/airline.vim index b7b500ad..26f73454 100644 --- a/themes/airline.vim +++ b/themes/airline.vim @@ -6,6 +6,7 @@ let g:airline#extensions#tabline#right_sep = '' let g:airline#extensions#tabline#right_alt_sep = '' let airline#extensions#tabline#show_splits = 0 let airline#extensions#tabline#tabs_label = '' +le " Disable tabline close button let g:airline#extensions#tabline#show_close_button = 0 @@ -39,7 +40,7 @@ set showtabline=2 set noshowmode " Sections -let g:airline_section_c = '' +" let g:airline_section_c = '' let g:airline_section_a = "Mach 2" let g:airline_section_y = '' let g:webdevicons_enable_airline_tabline = 1