Indenting in VIM with all the files in Folder

Much simpler than scripting vim from the bash command line is to use vimscript from inside of vim (or perhaps a much simpler one-liner for scripting vim from the command line). I personally prefer using the arg list for all multi-file manipulation. For example: :args ~/src/myproject/**/*.ttl | argdo execute “normal gg=G” | update args sets … Read more

Vim auto-generate ctags

au BufWritePost *.c,*.cpp,*.h silent! !ctags -R & The downside is that you won’t have a useful tags file until it completes. As long as you’re on a *nix system it should be ok to do multiple writes before the previous ctags has completed, but you should test that. On a Windows system it won’t put … Read more

Mapping in vimrc causes bizarre arrow behaviour

The mapping nnoremap <esc> :noh<return><esc> will conflict with so called “grey keys” and I believe that it should be used either in GVim only or in terminal Vim by someone who does not use special keys like arrows. From what I know (and guess) how Vim processes keys, I would say that it’s impossible to … Read more

Why does vim not obey my expandtab in python files?

The problem is that your settings are being overridden by a filetype plugin that’s part of Vim. The issue is in ftplugin/python.vim: ” As suggested by PEP8. setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 The python plugin attempts to setup your source code to be PEP8 compliant by default, so it’s adjusting the tabstop. You’ll want some … Read more