netrw open close in tab

This commit is contained in:
ManjaroOne666 2019-05-27 00:10:32 +01:00
commit a9b7a0c8e3
3 changed files with 36 additions and 5 deletions

26
vimrc
View file

@ -242,7 +242,7 @@ if has('nvim')
nnoremap <space>ra :call RangerExplorer()<CR>
endif
else
if !exists('*RangerExplorer') "{{{
if !exists('*RangerExplorer')
function RangerExplorer() abort
exec 'silent !ranger --choosefile=/tmp/vim_ranger_current_file ' . expand('%:p:h')
if filereadable('/tmp/vim_ranger_current_file')
@ -464,6 +464,25 @@ command! -nargs=1 -complete=command Redir silent call Redir(<q-args>)
" :Redir hi ............. show the full output of command ':hi' in a scratch window
" :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window
"}}}
function! OpenNetrw() abort "{{{
let g:netrw_opened_in_tab = 1
Texplore
endfunction
"}}}
function! CloseNetrw(keep_buffer) abort "{{{
if a:keep_buffer == 1
let l:current_buffer = bufnr("%")
tabclose
tabprevious
execute "buffer" l:current_buffer
else
tabclose
tabprevious
endif
endfunction
"}}}
"}}} end #functions
"----------------------------------------------------------------------------}}}
"#commands{{{
@ -577,7 +596,6 @@ nnoremap 0 ^
nnoremap <silent><space>cs :let @/=""<cr>
nnoremap : :setlocal norelativenumber<CR>:
nnoremap <silent> <space>rc :so $MYVIMRC<CR>
nnoremap <silent> <space>nn :setlocal invrelativenumber<CR>
nnoremap <silent><expr> <space>nh (&hls && v:hlsearch ? ':nohls' : ':set hls')."\n"
nnoremap <silent> <space>sl :set invlist<CR>
nnoremap <space>aa A<left>
@ -611,6 +629,10 @@ if has('terminal')
tnoremap <Esc> <C-\><C-n>
endif
"}}}
" windows{{{
nnoremap <space><space> :resize<CR>:vertical resize<CR>
" }}}
" git mappings {{{
" also see vim-fugitive plugin section
nnoremap <space>gD :!clear; echo 'git diff'; git diff<CR>