Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

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

Open
mgiugliano opened this issue Mar 10, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@mgiugliano
Copy link

mgiugliano commented Mar 10, 2019

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?

@dylanaraps dylanaraps added the enhancement New feature or request label Mar 10, 2019
@MoonPadUSer
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants