fff.vim
fff.vim copied to clipboard
Custom behaviour: launch when vim is invoked w/o arguments or with a folder
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?
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