add vim-vinegar, configure some shortcuts

This commit is contained in:
Nicole Tietz-Sokolskaya 2024-05-20 17:31:03 -04:00
parent 0fbbc616de
commit 1af043aaa9
3 changed files with 18 additions and 0 deletions

View File

@ -18,6 +18,7 @@ map <C-n> :NERDTreeToggle<CR>
map <C-f> :Files<CR> map <C-f> :Files<CR>
map <C-g> :Rg<CR> map <C-g> :Rg<CR>
map <C-l> :noh<CR> map <C-l> :noh<CR>
let NERDTreeHijackNetrw = 0
" Keep context visible " Keep context visible
set scrolloff=10 set scrolloff=10
@ -60,6 +61,22 @@ fun! ToggleSpell()
endif endif
endf endf
" Close buffers that I'm not using
" source: https://stackoverflow.com/a/30101152
function! DeleteHiddenBuffers()
let tpbl=[]
let closed = 0
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
if getbufvar(buf, '&mod') == 0
silent execute 'bwipeout' buf
let closed += 1
endif
endfor
echo "Closed ".closed." hidden buffers"
endfunction
nn <silent> <leader>b :call DeleteHiddenBuffers()<CR>
" Always show the signcolumn, otherwise it would shift the text each time " Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved. " diagnostics appear/become resolved.
if has("nvim-0.5.0") || has("patch-8.1.1564") if has("nvim-0.5.0") || has("patch-8.1.1564")

View File

@ -4,6 +4,7 @@ call plug#begin('~/.local/.shared/nvim/plugged')
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
let g:NERDTreeMinimalMenu=1 let g:NERDTreeMinimalMenu=1
let g:NERDTreeNodeDelimiter="\u00a0" let g:NERDTreeNodeDelimiter="\u00a0"
Plug 'tpope/vim-vinegar'
" Fuzzy file finding is great " Fuzzy file finding is great
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } } Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }