diff options
-rw-r--r-- | general/functions.vim | 21 | ||||
-rw-r--r-- | general/settings.vim | 2 | ||||
-rw-r--r-- | init.vim | 9 | ||||
-rw-r--r-- | keys/mappings.vim | 4 | ||||
-rw-r--r-- | keys/which-key.vim | 23 | ||||
-rw-r--r-- | plug-config/coc.vim | 2 | ||||
-rw-r--r-- | plug-config/goyo.vim | 1 | ||||
-rw-r--r-- | plug-config/quickscope.vim | 3 | ||||
-rw-r--r-- | plug-config/start-screen.vim | 8 | ||||
-rw-r--r-- | plug-config/vim-rooter.vim | 1 | ||||
-rw-r--r-- | themes/airline.vim | 3 |
11 files changed, 64 insertions, 13 deletions
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 <silent> n n:call HLCurrent()<cr> +nnoremap <silent> N N:call HLCurrent()<cr> diff --git a/general/settings.vim b/general/settings.vim index 49c5136f..c2f89897 100644 --- a/general/settings.vim +++ b/general/settings.vim @@ -1,8 +1,6 @@ " set leader key "map <Space> <Leader> "nmap <space> <leader> -let mapleader=" " -nnoremap <Space> <Nop> set iskeyword+=- " treat dash separated words as a word text object" if !exists('g:vscode') @@ -1,14 +1,15 @@ -" ____ _ __ _ -" / _/___ (_) /__ __(_)___ ___ +" ____ _ __ _ +" / _/___ (_) /__ __(_)___ ___ " / // __ \/ / __/ | / / / __ `__ \ " _/ // / / / / /__| |/ / / / / / / / -"/___/_/ /_/_/\__(_)___/_/_/ /_/ /_/ +"/___/_/ /_/_/\__(_)___/_/_/ /_/ /_/ " Always source these source $HOME/.config/nvim/vim-plug/plugins.vim source $HOME/.config/nvim/general/settings.vim source $HOME/.config/nvim/keys/mappings.vim +source $HOME/.config/nvim/keys/which-key.vim source $HOME/.config/nvim/general/paths.vim " Source depending on if VSCode is our client @@ -29,6 +30,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/keys/mappings.vim b/keys/mappings.vim index 71776b08..79311e5f 100644 --- a/keys/mappings.vim +++ b/keys/mappings.vim @@ -1,3 +1,7 @@ +" Leader key +let mapleader=" " +let localleader=" " +nnoremap <Space> <Nop> " Better indenting vnoremap < <gv diff --git a/keys/which-key.vim b/keys/which-key.vim new file mode 100644 index 00000000..2cf2e48e --- /dev/null +++ b/keys/which-key.vim @@ -0,0 +1,23 @@ +" map leader to which_key +" call which_key#register('<Space>', "g:which_key_map") + +nnoremap <silent> <leader> :silent WhichKey ' '<CR> + +" Not a fan of floating windows for this +let g:which_key_use_floating_win = 0 + +" highlight default link WhichKey Function +" highlight default link WhichKeySeperator DiffAdded +" highlight default link WhichKeyGroup Keyword +" highlight default link WhichKeyDesc Identifier + +highlight default link WhichKey Operator +highlight default link WhichKeySeperator DiffAdded +highlight default link WhichKeyGroup Identifier +highlight default link WhichKeyDesc Function + +" Hide status line +autocmd! FileType which_key +autocmd FileType which_key set laststatus=0 noshowmode noruler + \| autocmd BufLeave <buffer> set laststatus=2 noshowmode ruler + 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 <silent> <space>e :CocCommand explorer<CR> -nnoremap <leader>e :CocCommand explorer<CR> +nnoremap <silent> <leader>e :CocCommand explorer<CR> nmap <space>f :CocCommand explorer --preset floatingRightside<CR> 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 <silent> <leader>z :Goyo<CR> 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/start-screen.vim b/plug-config/start-screen.vim index eb2d5bd7..8024fa16 100644 --- a/plug-config/start-screen.vim +++ b/plug-config/start-screen.vim @@ -1,9 +1,9 @@ let g:startify_custom_header = [ - \ ' _ __ _ __ ___ __ ___ ', - \ ' / |/ / __(_)_ _ / |/ /__ _____/ / |_ |', - \ ' / / |/ / / ` \ / /|_/ / _ `/ __/ _ \ / __/ ', - \ '/_/|_/|___/_/_/_/_/ /_/ /_/\_,_/\__/_//_/ /____/ ', + \ ' _ __ _ __ ___ __ ___ ', + \ ' / |/ / __(_)_ _ / |/ /__ _____/ / |_ |', + \ ' / / |/ / / ` \ / /|_/ / _ `/ __/ _ \ / __/ ', + \ ' /_/|_/|___/_/_/_/_/ /_/ /_/\_,_/\__/_//_/ /____/ ', \] let g:startify_session_dir = '~/.config/nvim/session' 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 |