From f0a70fc32b940e9eae25cbc5f02258907aedff6b Mon Sep 17 00:00:00 2001 From: elkowar <5300871+elkowar@users.noreply.github.com> Date: Tue, 16 Feb 2021 19:00:01 +0100 Subject: [PATCH] asdf --- .netrwhist | 6 ++--- init.vim | 58 ++++++++++++++++++++++++++++++++++++++++++---- plugins.vim | 19 ++++++++++++--- whichkeyConfig.vim | 19 +++++++++------ 4 files changed, 85 insertions(+), 17 deletions(-) diff --git a/.netrwhist b/.netrwhist index cb7e08f..1e13bf1 100644 --- a/.netrwhist +++ b/.netrwhist @@ -1,5 +1,7 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhistcnt =2 +let g:netrw_dirhistcnt =4 +let g:netrw_dirhist_4='/home/leon/a-box-of-gruv/styles' +let g:netrw_dirhist_3='/home/leon/tmp/pythonshit' let g:netrw_dirhist_2='/home/leon/dotfiles/.vim' let g:netrw_dirhist_1='/home/leon/.config/discord' let g:netrw_dirhist_0='/home/leon/coding/projects/eww/src' @@ -8,5 +10,3 @@ let g:netrw_dirhist_8='/home/leon/coding/plover-plugins/plover_retro_surround' let g:netrw_dirhist_7='/home/leon/coding/plover-plugins/plover_retro_surround/plover_retro_surround.egg-info' let g:netrw_dirhist_6='/home/leon/.config/coc/extensions' let g:netrw_dirhist_5='/home/leon/.config/elkowar_phocus' -let g:netrw_dirhist_4='/home/leon/coding/projects/eww/docs' -let g:netrw_dirhist_3='/home/leon/tmp/test/content' diff --git a/init.vim b/init.vim index dbd0727..64bdc02 100644 --- a/init.vim +++ b/init.vim @@ -3,6 +3,9 @@ " \ V /| | | | | | | | | (__ " \_/ |_|_| |_| |_|_| \___| + +set runtimepath^=~/coding/tmp/coc.nvim/ + let g:vim_config_root = expand(':p:h') let $VIM_ROOT = g:vim_config_root @@ -64,6 +67,8 @@ hi LineNr ctermbg=NONE guibg=NONE hi Comment cterm=italic let &t_ut='' + + " hide empty line ~'s highlight EndOfBuffer ctermfg=black ctermbg=black guibg=NONE guifg='#282828' @@ -122,6 +127,20 @@ augroup END +" autoclose empty unedited buffers +function! CleanNoNameEmptyBuffers() + let buffers = filter(range(1, bufnr('$')), 'buflisted(v:val) && empty(bufname(v:val)) && bufwinnr(v:val) < 0 && (getbufline(v:val, 1, "$") == [""])') + if !empty(buffers) + exe 'bd '.join(buffers, ' ') + else + echo 'No buffer deleted' + endif +endfunction + +autocmd BufCreate * execute 'call CleanNoNameEmptyBuffers()' + + + " =============== " Basic remapping " =============== @@ -134,8 +153,8 @@ nnoremap set splitbelow splitright " Buffer switching -noremap l :bnext -noremap h :bprevious +"noremap l :bnext +"noremap h :bprevious " Disable default K mapping (would open man page of hovered word) nnoremap K @@ -154,6 +173,8 @@ let g:detectindent_preferred_indent = 2 autocmd BufReadPost *.hs :set shiftwidth=2 +let g:vim_parinfer_filetypes = ['carp'] + let g:sneak#label = 1 nmap Sneak_s @@ -186,7 +207,7 @@ au Syntax * RainbowParenthesesLoadSquare au Syntax * RainbowParenthesesLoadBraces -nnoremap :Files +nnoremap :Files "map f (easymotion-bd-f) "map s (easymotion-overwin-f2) @@ -196,7 +217,7 @@ let g:signify_sign_add = '▍' let g:signify_sign_delete = '▍' let g:signify_sign_delete_first_line = '▍' let g:signify_sign_change = '▍' -let g:signify_sign_show_text = 1 +let g:signify_sign_show_text = 0 hi SignifySignDelete cterm=NONE gui=NONE guifg='#fb4934' hi SignifySignChange cterm=NONE gui=NONE guifg='#83a598' @@ -250,6 +271,35 @@ autocmd User AirlineAfterTheme call s:update_highlights() " }}} +" Barbar --------------------------------------------------------------------------- {{{ + +if has('nvim') + let bufferline = get(g:, 'bufferline', {}) + let bufferline.auto_hide = v:false + let bufferline.animation = v:true + let bufferline.icons = v:false + + let bufferline.icon_separator_active = ' ' + let bufferline.icon_separator_active = ' ' + "let bufferline.icon_separator_inactive = '▎' + "let bufferline.icon_separator_inactive = '▎' + let bufferline.icon_close_tab = '◆' + let bufferline.icon_close_tab_modified = '●' + let bufferline.maximum_padding = 1 + + hi! BufferVisible guibg='#282828' guifg='#282828' + hi! BufferCurrent guibg='#689d6a' guifg='#282828' + hi! BufferInactive guibg='#3c3836' guifg='#282828' + hi! BufferTabpageFill guibg='#282828' guifg='#282828' + hi! BufferCurrentSign guibg='#689d6a' guifg='#689d6a' + + hi! BufferVisibleMod guibg='#282828' guifg='#8ec07c' + hi! BufferCurrentMod guibg='#282828' guifg='#8ec07c' + hi! BufferInactiveMod guibg='#3c3836' guifg='#8ec07c' +endif + + +" }}} " }}} diff --git a/plugins.vim b/plugins.vim index adcf014..e1c1a7a 100644 --- a/plugins.vim +++ b/plugins.vim @@ -6,7 +6,6 @@ endif call plug#begin('~/.vim/plugged') - Plug 'tpope/vim-repeat' Plug 'junegunn/goyo.vim', {'on': 'Goyo'} @@ -27,6 +26,11 @@ call plug#begin('~/.vim/plugged') Plug 'vim-airline/vim-airline-themes' Plug 'vim-airline/vim-airline' + " buffer line + if has('nvim') + Plug 'romgrk/barbar.nvim' + endif + "Plug 'morhetz/gruvbox' Plug 'gruvbox-community/gruvbox' @@ -71,15 +75,21 @@ call plug#begin('~/.vim/plugged') Plug 'tommcdo/vim-exchange' - Plug 'puremourning/vimspector' + if !has('nvim') + Plug 'puremourning/vimspector' + endif Plug 'svermeulen/vim-yoink' Plug 'Shougo/echodoc.vim' Plug 'kien/rainbow_parentheses.vim' + Plug 'bhurlow/vim-parinfer' + " Language Plugins ----------------------------------------------------- {{{ + Plug 'ziglang/zig.vim' + Plug 'bduggan/vim-raku' Plug 'LnL7/vim-nix' Plug 'kevinoid/vim-jsonc' @@ -107,7 +117,10 @@ call plug#begin('~/.vim/plugged') Plug 'mattn/webapi-vim' - Plug 'neoclide/coc.nvim', {'branch': 'release'} + "Plug 'neoclide/coc.nvim', {'branch': 'release'} + Plug 'thyrgle/vim-dyon' + + "Plug 'mxw/vim-prolog' " }}} call plug#end() diff --git a/whichkeyConfig.vim b/whichkeyConfig.vim index ee53ac1..6d0c22a 100644 --- a/whichkeyConfig.vim +++ b/whichkeyConfig.vim @@ -7,13 +7,16 @@ call which_key#register('', "g:which_key_map") + "\ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore' , + "\ 'h' : ':bprevious', 'l' : ':bnext' , let g:which_key_map = { - \ 'h' : 'which_key_ignore', 'l' : 'which_key_ignore', - "\ 'f' : 'which_key_ignore', 's': 'which_key_ignore' , + \ 'h' : [':BufferPrevious', 'prev buffer'], 'l' : [':BufferNext', 'next buffer'] , + \ 'f' : 'which_key_ignore', 's': 'which_key_ignore' , \ 'c' : { 'name': '+comment_out' }, \ 'e' : { 'name': '+emmet' }, \ '[' : ['(YoinkPostPasteSwapBack)', 'Swap last paste backwards' ], \ ']' : ['(YoinkPostPasteSwapForward)', 'Swap last paste backwards' ], + \ ':' : [':Commands' , 'Search command with fzf' ], \ 'z' : { 'name': '+folds', 'c': ['foldclose', 'close fold'], \ 'o': ['foldopen', 'open fold'] , \ } @@ -35,7 +38,8 @@ let g:which_key_map['m'] = { \ 'n' : [ '(coc-rename)' , 'rename' ] , \ 'F' : [ '(coc-format-selected)' , 'format selection' ] , \ 'f' : [ '(coc-format)' , 'format file' ] , - \ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] , + "\ 'v' : [ ':CocCommand actions.open' , 'apply codeaction' ] , + \ 'v' : [ '(coc-codeaction)' , 'apply codeaction' ] , \ 'V' : [ '(coc-codeaction)' , 'codeaction current buffer' ] , \ 'e' : [ ':CocList diagnostics' , 'list all errors' ] , \ 'L' : [ '(coc-diagnostic-next)' , 'go to next error' ] , @@ -72,11 +76,12 @@ let g:which_key_map['v'] = { \ 'i' : [':IndentGuidesToggle' , 'toggle indent guides' ] , \ } + " :bwipeout! bdelete! let g:which_key_map['b'] = { - \ 'name': '+buffers' , - \ 'b' : ['Buffers' , 'select open buffer' ] , - \ 'c' : [':bdelete!' , 'close open buffer' ] , - \ 'w' : [':bwipeout!' , 'wipeout open buffer' ] , + \ 'name': '+buffers', + \ 'b' : ['BufferPick' , 'select open buffer' ] , + \ 'c' : ['BufferClose', 'close open buffer' ] , + \ 'w' : ['BufferWipeout', 'wipeout open buffer' ] , \ } let g:which_key_map['x'] = {