Merge pull request #6 from LinuxIsCool/hack-slash-vim

Add barbar for vim tabs bar and customize the keys.
This commit is contained in:
Shawn Anderson 2023-06-29 20:26:57 -07:00 committed by GitHub
commit a374a23f39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 86 additions and 4 deletions

View File

@ -21,8 +21,8 @@ noremap <leader>j $
set ignorecase " ignores case of letters on searches
set smartcase " Override the 'ignorecase' option if the search pattern contains upper case characters
map <leader>/ :nohl<CR>
noremap <C-j> jj
noremap <C-k> kk
" noremap <C-j> jj
" noremap <C-k> 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

View File

@ -11,8 +11,8 @@ noremap <leader>j $
map <leader>/ :nohl<CR>
" Faster scrolling with control
noremap <C-j> jj
noremap <C-k> kk
" noremap <C-j> jj
" noremap <C-k> 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.

View File

@ -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 <A-".c.">=\e".c
"exec "imap \e".c." <A-".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 <silent> <M-p> <Cmd>BufferPrevious<CR>
nnoremap <silent> <M-h> <Cmd>BufferPrevious<CR>
nnoremap <silent> <M-j> <Cmd>BufferPrevious<CR>
nnoremap <silent> <C-h> <Cmd>BufferPrevious<CR>
nnoremap <silent> <C-j> <Cmd>BufferPrevious<CR>
nnoremap <silent> <M-n> <Cmd>BufferNext<CR>
nnoremap <silent> <M-l> <Cmd>BufferNext<CR>
nnoremap <silent> <M-k> <Cmd>BufferNext<CR>
nnoremap <silent> <C-l> <Cmd>BufferNext<CR>
nnoremap <silent> <C-k> <Cmd>BufferNext<CR>
" Re-order to previous/next
nnoremap <silent> <M-<> <Cmd>BufferMovePrevious<CR>
nnoremap <silent> <M->> <Cmd>BufferMoveNext<CR>
" Goto buffer in position...
nnoremap <silent> <M-1> <Cmd>BufferGoto 1<CR>
nnoremap <silent> <M-2> <Cmd>BufferGoto 2<CR>
nnoremap <silent> <M-3> <Cmd>BufferGoto 3<CR>
nnoremap <silent> <M-4> <Cmd>BufferGoto 4<CR>
nnoremap <silent> <M-5> <Cmd>BufferGoto 5<CR>
nnoremap <silent> <M-6> <Cmd>BufferGoto 6<CR>
nnoremap <silent> <M-7> <Cmd>BufferGoto 7<CR>
nnoremap <silent> <M-8> <Cmd>BufferGoto 8<CR>
nnoremap <silent> <M-9> <Cmd>BufferGoto 9<CR>
nnoremap <silent> <M-0> <Cmd>BufferLast<CR>
" Pin/unpin buffer
nnoremap <silent> <M-z> <Cmd>BufferPin<CR>
" Close buffer
nnoremap <silent> <M-q> <Cmd>BufferClose<CR>
" Restore buffer
nnoremap <silent> <M-w> <Cmd>BufferRestore<CR>
" Wipeout buffer
" :BufferWipeout
" Close commands
" :BufferCloseAllButCurrent
" :BufferCloseAllButVisible
" :BufferCloseAllButPinned
" :BufferCloseAllButCurrentOrPinned
" :BufferCloseBuffersLeft
" :BufferCloseBuffersRight
" Magic buffer-picking mode
nnoremap <silent> <M-f> <Cmd>BufferPick<CR>
nnoremap <silent> <C-p> <Cmd>BufferPickDelete<CR>
" Sort automatically by...
nnoremap <silent> <Space>bb <Cmd>BufferOrderByBufferNumber<CR>
nnoremap <silent> <Space>bd <Cmd>BufferOrderByDirectory<CR>
nnoremap <silent> <Space>bl <Cmd>BufferOrderByLanguage<CR>
nnoremap <silent> <Space>bw <Cmd>BufferOrderByWindowNumber<CR>
" Other:
" :BarbarEnable - enables barbar (enabled by default)
" :BarbarDisable - very bad command, should never be used

View File

@ -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