David Blume commited on 2020-07-08 11:50:00
Showing 1 changed files, with 29 additions and 4 deletions.
... | ... |
@@ -1,4 +1,4 @@ |
1 |
-" Version 2018-10-07.1 - Don't set textwidth. I like to hit Return on my own. |
|
1 |
+" Version 2020-07-08.1 - Use built-in netrw instead of NERDTree |
|
2 | 2 |
set nocompatible " Use Vim defaults, forget compatibility with vi. |
3 | 3 |
set bs=2 " allow backspacing over everything in insert mode |
4 | 4 |
set wildmenu " Allows command-line completion with tab |
... | ... |
@@ -118,7 +118,25 @@ nmap <leader>p :set invpaste paste?<cr> |
118 | 118 |
" Control+p to paste onto next line |
119 | 119 |
nmap <C-p> :pu<cr> |
120 | 120 |
|
121 |
-nmap <leader>e :NERDTreeToggle %:p:h<cr> " install nerdtree (e for Explore) |
|
121 |
+" Make netrw's Lexplore behave like NERDTreeToggle |
|
122 |
+let g:NetrwIsOpen=0 |
|
123 |
+function! ToggleNetrw() |
|
124 |
+ if g:NetrwIsOpen |
|
125 |
+ let i = bufnr("$") |
|
126 |
+ while (i >= 1) |
|
127 |
+ if (getbufvar(i, "&filetype") == "netrw") |
|
128 |
+ silent exe "bwipeout " . i |
|
129 |
+ endif |
|
130 |
+ let i-=1 |
|
131 |
+ endwhile |
|
132 |
+ let g:NetrwIsOpen=0 |
|
133 |
+ else |
|
134 |
+ let g:NetrwIsOpen=1 |
|
135 |
+ silent Lexplore %:p:h |
|
136 |
+ endif |
|
137 |
+endfunction |
|
138 |
+nmap <leader>e :call ToggleNetrw()<cr> |
|
139 |
+ |
|
122 | 140 |
nmap <leader>l :TlistToggle<cr> " install taglist |
123 | 141 |
nmap <leader>bd :Bdelete<cr> " install vim-bbye |
124 | 142 |
|
... | ... |
@@ -295,8 +313,15 @@ endif |
295 | 313 |
" Cygwin64 won't let you choose it. Launch Cygwin64 as follows: |
296 | 314 |
" C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -o Font="Roboto Mono for Powerline" - |
297 | 315 |
|
298 |
-" When using vim-powerline |
|
299 |
-let g:Powerline_symbols = 'fancy' |
|
316 |
+" Settings that make netrw more like NERDTree |
|
317 |
+let g:netrw_banner = 0 |
|
318 |
+let g:netrw_liststyle = 3 |
|
319 |
+let g:netrw_browse_split = 4 |
|
320 |
+let g:netrw_altv = 1 |
|
321 |
+" let g:netrw_winsize = -28 (for absolute width) |
|
322 |
+let g:netrw_winsize = 35 |
|
323 |
+" sort is affecting only: directories on the top, files below |
|
324 |
+let g:netrw_sort_sequence = '[\/]$,*' |
|
300 | 325 |
|
301 | 326 |
" When using vim-airline |
302 | 327 |
let g:airline_powerline_fonts = 1 |
303 | 328 |