fff.vim icon indicating copy to clipboard operation
fff.vim copied to clipboard

Custom behaviour: launch when vim is invoked w/o arguments or with a folder

Open mgiugliano opened this issue 5 years ago • 1 comments

I was successful configuring my .vimrc to launch fff if vim is invoked without arguments (copying a similar setting offered for NERD Tree):

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | exe 'F' | endif

However it does not work nicely if invoked with a folder (once more, copied from NERD tree), as it follows:

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'F' argv()[0] | wincmd p | ene | endif

Any suggestion on how to make the last working smoothly?

mgiugliano avatar Mar 10 '19 19:03 mgiugliano

I just played around with it a lil' bit and I figured out if you remove the last | wincmd p | ene it still opens the normal filebrowser in the background but everything else works smoothly

autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'F' argv()[0] | endif

Now the only thing to figure out would be if one can disable the default file manager in vim

MoonPadUSer avatar Nov 09 '20 20:11 MoonPadUSer