Reputation: 1667
I want to create a different lvimrc for my project that will set "args" to my source files.
Currently I do it during runtime by:
:argadd src/*.c inc/*.h
And I want to have that executed at startup. I always start vim from the root of my project.
Upvotes: 1
Views: 160
Reputation: 31060
To execute commands automatically you can use autocommands (:help autocmd
). If you're using an lvimrc, you could do
au VimEnter * argadd src/*.c inc/*.h
EDIT: Changed argsadd to argadd. That is the correct one.
Upvotes: 3
Reputation: 196626
You could create an alias in your ~/.bashrc
or whatever:
alias lvim='vim +argadd\ src/*\ inc/*.h'
or add something like this to your ~/.vimrc
:
if ( getcwd() == '/path/to/project' )
exec( 'argadd src/*.c inc/*.h' )
endif
Upvotes: 5