commit ac1ab2357c0dfa28b95244d5ecd8d427f8870aab
parent f46a48005f4f2d4aa179c6a958ef4fcbfedd8814
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Wed, 8 May 2019 11:58:21 +0200
vim: nerdtree to netrw
Former-commit-id: ad89488a7723b585c07ddfa2f769d4975fc7208d
Diffstat:
5 files changed, 29 insertions(+), 5 deletions(-)
diff --git a/vim/autocmd.vimrc b/vim/autocmd.vimrc
@@ -34,3 +34,8 @@ augroup makeprgs
autocmd FileType markdown setlocal makeprg=pandoc\ %\ -o\ %<.pdf
autocmd FileType sh setlocal makeprg=shellcheck\ -f\ gcc\ %
augroup END
+
+augroup netrw
+ autocmd!
+ autocmd FileType netrw set buftype=nofile nolist
+augroup END
diff --git a/vim/commands.vimrc b/vim/commands.vimrc
@@ -44,6 +44,22 @@ function! DeleteHiddenBuffers() " Vim with the 'hidden' option
endfor
endfunction
+let g:NetrwIsOpen=0
+function! ToggleNetrw()
+ if g:NetrwIsOpen
+ let i = bufnr("$")
+ while (i >= 1)
+ if (getbufvar(i, "&filetype") == "netrw")
+ silent exe "bwipeout " . i
+ endif
+ let i-=1
+ endwhile
+ let g:NetrwIsOpen=0
+ else
+ let g:NetrwIsOpen=1
+ silent Lexplore
+ endif
+endfunction
" Custom session management (should be plugin) {{{
function! SaveSession() abort
let seshdir = $HOME.'/.vim/sessions/'
diff --git a/vim/general.vimrc b/vim/general.vimrc
@@ -34,8 +34,12 @@ set fileencoding=utf-8
set fileencodings=utf-8
set fileformats=unix,dos,mac
-" Hide the annoying banner in netrw explorer
+" netrw
+let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+' " hide dotfiles
let g:netrw_banner = 0
+let g:netrw_liststyle = 3
+let g:netrw_browse_split = 4
+let g:netrw_winsize = 25
" Send more characters at a given time
set ttyfast
diff --git a/vim/map.vimrc b/vim/map.vimrc
@@ -106,3 +106,5 @@ nnoremap <leader>ss :call SaveSession()<CR>
nnoremap <leader>sl :call LoadSession()<CR>
nnoremap <leader>sd :call DeleteSession()<CR>
nnoremap <leader>sq :call CloseSession()<CR>
+
+nnoremap <leader>f :call ToggleNetrw()<CR>
diff --git a/vim/plugins.vimrc b/vim/plugins.vimrc
@@ -10,10 +10,7 @@ call plug#begin('~/.vim/plugged')
" A color table with xterm color codes
Plug 'guns/xterm-color-table.vim'
-" NERDTree - file browser
-Plug 'scrooloose/nerdtree'
-Plug 'jistr/vim-nerdtree-tabs'
-nnoremap <leader>f :NERDTreeTabsToggle<CR>
+Plug 'tpope/vim-vinegar'
" NERD Commenter - simple comment toggling {{{
Plug 'scrooloose/nerdcommenter'