Last active
July 7, 2017 23:33
-
-
Save hergaiety/abf5dac5fa12eb3824af60c134e747e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let DirProjectHome = getcwd() | |
function! ExploreToggle(bang) | |
if &ft ==# "netrw" | |
:exe "lcd " . g:DirProjectHome | |
:bd | |
else | |
if a:bang | |
:lcd %:p:h | |
:enew | |
:Explore | |
else | |
:exe "lcd " . g:DirProjectHome | |
:enew | |
:Explore | |
endif | |
endif | |
endfunction | |
command! -bang ET call ExploreToggle(<bang>0) | |
" --- Commands --- | |
" :ET toggles file explorer from project home | |
" :ET! toggles file explorer from current open file's directory | |
" --- Suggested Mappings --- | |
" map ` :ET<CR> | |
" map ~ :ET!<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment