A couple .vimrc questions
Is there a way to link to a file containing the syntax highlighting style, (/blahblah/kholer for example), in the .vimrc file.
And is there a way to put an if statement in the .vimrc so it can change the tab width etc depending on the filetype.
For expample
if $openedfile is javascript
tabwsidth = 3
fi
About this post
- Posted
- Archived
- Score
- 8 · 100% up
- Kind
- Text
- ID
- 25ibde
7 comments
You can either use the
ftpluginfolder convention (vim has a couple other of those as well, like put your highlighting color files in~/.vim/colors/), or do like this:Thanks.
Yes, its very simple: http://vim.wikia.com/wiki/Keep_your_vimrc_file_clean
Make a file called
.vim/ftplugin/javascript.vimor.vim/ftplugin/js.vimor whatever vim calls javascript, and place all the code you want to be executed for that filetype there.The javascript filetype is "
javascript".Thanks.
Yes there are. However you don't need if statements, you can use auto commands.
Please check the builtin docs for this, I'm sure. Someone in the comments has put a n example too.
However I suggest you post such questions to /r/vim which is a little better suited for these questions. The subreddit is active and very helpful, from newbies to masters.
Edit: checkout this Vimcasts episode.
Honestly did not think there was a vim subreddit. Thanks