3 ms·
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 Li
by fragmede 14y ago
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).
- daviddaviddavid 14y agoMy .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 noexpandtab
- slowpoke 14y agoVim 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.