Re:Sublime Text 2.0 Released
by fragmede on Tuesday June 26, 2012 @02:59PM
(#4163588)
I'll bet you don't spend any time editing multiple languages with conflicting notions of whitespace. I split my time between C and Python, and tabs in C (per Linux kernel coding style) and spaces for Python (per PEP-8), and having that be correct is important for my sanity (as well as for the other people I work with - especially those who aren't multi-linugual).
[ Parent
| on HN ]
Re:Sublime Text 2.0 Released
by daviddaviddavid on Tuesday June 26, 2012 @03:31PM
(#4163722)
My .vimrc has the following two lines which expand tabs to spaces by default but make an exception for makefiles:
set expandtab
au FileType make setlocal noexpandtabVim has the ftplugin (filetype plugin), which makes this easy as pie,
and extremely configurable, too.
You simply
set filetype plugin on
then put configuration files for a filetype into ~/.vim/ftplugin/$filetype.vim
(for example, python.vim, text.vim or even gitcommit.vim).Within those, you can do things like setting expandtab or the tab/shift width - they are full local subconfigurations which override your global configuration. They are usually not very large (5 lines on average for me), but it sure helps keep things organized and easy to find and change.