jalanb
  • Member for 6 years, 11 months
  • Last seen more than a month ago
How do you fold functions automatically?
12 votes

Given that your example is in Python, which relies on correct indentation of code blocks it is enough to base folding on that: :set foldmethod=indent For more information on the varieties of folding ...

View answer
Python debugging
10 votes

There are alternatives. Plain ol' pdb can be integrated into vim with vimpdb vebugger, etc (My own favourite) pudb can be integrated with pudb.vim vim-pudb And the popular ipdb can be integrated ...

View answer
Treat string literals as a different language
Accepted answer
8 votes

You will need to use contains keyword in a syntax file (see :help contains) As an example of usage, see how the pythonDocTest syntax region is defined and used within a Python syntax file.

View answer
How do I break a file into two?
4 votes

Use line ranges with the :w command. vim provides simple abbreviations in such ranges for places like first line 1, current line ., and last line $. Ranges can also accept calculated values, so e.g. $...

View answer
Prevent Vim from clearing the terminal after exit
3 votes

As you are using an xterm you could use its main and alternate screen buffers for screen swapping, as in this section from my .vimrc if &term == "linux" set t_ti=^[[?1049h set t_te=^[[?...

View answer
Adding 80-column wide comment header block with centered text
3 votes

I would use a vimscript function for that. function Header(width, word) let a:inserted_word = ' ' . a:word . ' ' let a:word_width = strlen(a:inserted_word) let a:length_before = (a:width -...

View answer
Get name of nearest tag to the cursor
Accepted answer
2 votes

Tags in help files are enclosed within * characters. So to find the closest one above the current position I would search with ?\*[^*]\+\* As there can be a number of such tags after the main/...

View answer
vim python syntax not working (Partly)
Accepted answer
0 votes

I have extended the standard Python syntax file to cover your mentioned use cases: Function calls Attributes As well as variables (as distinct from object instances) doctests self string ...

View answer