Hi,
Recently I learned a way to have vim automatically change settings when I'm editing wine source code:
At the bottom of my ~/.vimrc (create it if it doesn't exist): if !exists("loaded_vimrc_autocmd") let loaded_vimrc_autocmd=1 autocmd BufNewFile,BufRead /data/wine/* set expandtab tabstop=8 softtabstop=4 endif
In my case my wine tree is in /data/wine, so replace this with the first part of the path to your wine tree. Using the same syntax you can also put custom settings for other projects you might work on.
This is helpful for me since I usually like to indent using tabs and a 4 space tab width, but now I can edit most of wine's code without having to worry about fixing my indents all the time.
If anyone is interested, I've also got another Vim tip on the wiki (from last year), to automate the creation of wide character arrays: http://wiki.winehq.org/Character_arrays_in_Vim
If any other vim users have tips that help out with wine coding, I'd love to hear them!
Maybe we can make a page on the wiki for them.
n0dalus.
On Monday 25 September 2006 19:47, n0dalus wrote:
At the bottom of my ~/.vimrc (create it if it doesn't exist): if !exists("loaded_vimrc_autocmd") let loaded_vimrc_autocmd=1 autocmd BufNewFile,BufRead /data/wine/* set expandtab tabstop=8 softtabstop=4 endif
You might want to add "shiftwidth=4" so autoindent works correctly.
On Tuesday 26 September 2006 09:34, Troy Rollo wrote:
On Monday 25 September 2006 19:47, n0dalus wrote:
At the bottom of my ~/.vimrc (create it if it doesn't exist): if !exists("loaded_vimrc_autocmd") let loaded_vimrc_autocmd=1 autocmd BufNewFile,BufRead /data/wine/* set expandtab tabstop=8 softtabstop=4 endif
You might want to add "shiftwidth=4" so autoindent works correctly.
And add "|hi link cCommentL cError" to have C++ comments hilighted as errors, giving:
autocmd BufNewFile,BufRead /data/wine/* set expandtab tabstop=8 softtabstop=4 shiftwidth=4|hi link cCommentL cError
On 9/26/06, Troy Rollo wine@troy.rollo.name wrote:
And add "|hi link cCommentL cError" to have C++ comments hilighted as errors, giving:
autocmd BufNewFile,BufRead /data/wine/* set expandtab tabstop=8 softtabstop=4 shiftwidth=4|hi link cCommentL cError
Thanks! I put that up on the Wiki too.
Feel free to make any changes there if you think of other things.
n0dalus.
On 9/26/06, Troy Rollo wine@troy.rollo.name wrote:
On Monday 25 September 2006 19:47, n0dalus wrote:
At the bottom of my ~/.vimrc (create it if it doesn't exist): if !exists("loaded_vimrc_autocmd") let loaded_vimrc_autocmd=1 autocmd BufNewFile,BufRead /data/wine/* set expandtab tabstop=8 softtabstop=4 endif
You might want to add "shiftwidth=4" so autoindent works correctly.
Thanks, I had that set in /etc/vimrc so I didn't notice that I needed it.
I've now put up a page on the wiki with the tips: http://wiki.winehq.org/VimTips
n0dalus.