Error detected while processing BufRead Auto commands for “*.py”

It’s hard to notice (I had to look twice), but the problem is the spaces between the patterns in the :autocmd definition: The syntax is :au[tocmd] [group] {event} {pat} [nested] {cmd} :help {pat} shows that there must not be whitespace between individual patterns. Example :au BufNewFile,BufRead *.py, *.php, *.rb, *.html, *.js, *.ts, *.md echomsg ‘test’ … Read more

How to set a custom color to folded highlighting in .vimrc (for use with putty)

The cterm in ctermbg is short for “color terminal”. It is used to define the background color when Vim runs in a terminal emulator and can only accept named colors like grey or cyan or color numbers like 7. Hexadecimal values only work in GVim/MacVim and must be used with guibg/guifg like that: hi Folded … Read more

Vim [compile and] run shortcut

Something like this would work. Just create filetype autocmd that map <F4> or whatever you want to save and compile and run the program. It uses exec to build the string and uses shellescape to escape the file name. autocmd filetype python nnoremap <F4> :w <bar> exec ‘!python ‘.shellescape(‘%’)<CR> autocmd filetype c nnoremap <F4> :w … Read more

Is it possible to “extend” IntelliJ such that I can open the current file in VIM

Absolutely! Go to File -> Settings -> External Tools and add a new one. Program and Working Directory fields should be self-explanatory. The parameter field should be $FilePath$. Click the Insert macro button to see more token values that you could use. You can also bind keyboard shortcuts to the external tools you define. See … Read more

Vim Search/Replace, meaning of %s

% is the range over which the :s command (short for :substitute) will be run. % itself is short for the range :1,$, which means Line 1 to the last line in the buffer. The Vim help has a couple topics (user manual – :help 10.3, reference manual – :help cmdline-ranges) describing the forms that … Read more