From b148d27ff1b53efe3d1eb98f6f15a73bb16f42a7 Mon Sep 17 00:00:00 2001 From: Shawn Anderson Date: Thu, 29 Jun 2023 20:18:05 -0700 Subject: [PATCH] Add barbar for vim tabs bar and customize the keys. --- dotfiles/.config/nvim/init.vim | 4 +- dotfiles/.config/nvim/keys.vim | 4 +- dotfiles/.config/nvim/plugconfig/barbar.vim | 76 +++++++++++++++++++++ dotfiles/.config/nvim/plugins.vim | 6 ++ 4 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 dotfiles/.config/nvim/plugconfig/barbar.vim diff --git a/dotfiles/.config/nvim/init.vim b/dotfiles/.config/nvim/init.vim index 1dc7c15..29c70e3 100644 --- a/dotfiles/.config/nvim/init.vim +++ b/dotfiles/.config/nvim/init.vim @@ -21,8 +21,8 @@ noremap j $ set ignorecase " ignores case of letters on searches set smartcase " Override the 'ignorecase' option if the search pattern contains upper case characters map / :nohl -noremap jj -noremap kk +" noremap jj +" noremap kk " This makes the location of the current open file always the current working " directory of vim. This pairs very nicely with tmux. Added - Sept 15th 2020 diff --git a/dotfiles/.config/nvim/keys.vim b/dotfiles/.config/nvim/keys.vim index ea46e8f..9dc28a6 100644 --- a/dotfiles/.config/nvim/keys.vim +++ b/dotfiles/.config/nvim/keys.vim @@ -11,8 +11,8 @@ noremap j $ map / :nohl " Faster scrolling with control -noremap jj -noremap kk +" noremap jj +" noremap kk " Spookie bug. I think I was hacked and that someone i fucking with me. " Whenever I would pres shift K it would open a new tab in nvim. diff --git a/dotfiles/.config/nvim/plugconfig/barbar.vim b/dotfiles/.config/nvim/plugconfig/barbar.vim new file mode 100644 index 0000000..340b262 --- /dev/null +++ b/dotfiles/.config/nvim/plugconfig/barbar.vim @@ -0,0 +1,76 @@ +" Apparently the following enables alt to work in vim. Source: https://stackoverflow.com/questions/6778961/alt-key-shortcuts-not-working-on-gnome-terminal-with-vim +"let c='a' +"while c <= 'z' + "exec "set =\e".c + "exec "imap \e".c." " + "let c = nr2char(1+char2nr(c)) +"endw +"set timeout ttimeoutlen=50 + +" Initialized 2023-06-29 from https://github.com/romgrk/barbar.nvim +" +" +" +" +" Move to previous/next +nnoremap BufferPrevious +nnoremap BufferPrevious +nnoremap BufferPrevious +nnoremap BufferPrevious +nnoremap BufferPrevious +nnoremap BufferNext +nnoremap BufferNext +nnoremap BufferNext +nnoremap BufferNext +nnoremap BufferNext + +" Re-order to previous/next +nnoremap BufferMovePrevious +nnoremap > BufferMoveNext + +" Goto buffer in position... +nnoremap BufferGoto 1 +nnoremap BufferGoto 2 +nnoremap BufferGoto 3 +nnoremap BufferGoto 4 +nnoremap BufferGoto 5 +nnoremap BufferGoto 6 +nnoremap BufferGoto 7 +nnoremap BufferGoto 8 +nnoremap BufferGoto 9 +nnoremap BufferLast + +" Pin/unpin buffer +nnoremap BufferPin + +" Close buffer +nnoremap BufferClose + +" Restore buffer +nnoremap BufferRestore + +" Wipeout buffer +" :BufferWipeout +" Close commands +" :BufferCloseAllButCurrent +" :BufferCloseAllButVisible +" :BufferCloseAllButPinned +" :BufferCloseAllButCurrentOrPinned +" :BufferCloseBuffersLeft +" :BufferCloseBuffersRight + +" Magic buffer-picking mode +nnoremap BufferPick +nnoremap BufferPickDelete + +" Sort automatically by... +nnoremap bb BufferOrderByBufferNumber +nnoremap bd BufferOrderByDirectory +nnoremap bl BufferOrderByLanguage +nnoremap bw BufferOrderByWindowNumber + +" Other: +" :BarbarEnable - enables barbar (enabled by default) +" :BarbarDisable - very bad command, should never be used + + diff --git a/dotfiles/.config/nvim/plugins.vim b/dotfiles/.config/nvim/plugins.vim index 4d35c22..32707cf 100644 --- a/dotfiles/.config/nvim/plugins.vim +++ b/dotfiles/.config/nvim/plugins.vim @@ -238,6 +238,12 @@ Plug 'mkitt/tabline.vim' Plug 'prisma/vim-prisma' + +Plug 'lewis6991/gitsigns.nvim' " OPTIONAL: for git status +Plug 'nvim-tree/nvim-web-devicons' " OPTIONAL: for file icons +Plug 'romgrk/barbar.nvim' +runtime plugconfig/barbar.vim + "" LSP Support "Plug 'neovim/nvim-lspconfig' " Required "Plug 'williamboman/mason.nvim', {'do': ':MasonUpdate'} " Optional