• Member for 6 years, 11 months
  • Last seen more than a month ago
  • Virginia
How can I use the undofile?
56 votes

The simplest version is: create ~/.vim/undo-dir/ directory and add the following to the .vimrc: set undodir=~/.vim/undo-dir set undofile However, it's not flawless, and it's better to read on. From ...

View answer
Is it possible to split Vim window to view multiple files at once?
32 votes

Yes, there are the :split (split into two windows, top half and bottom half) and :vsplit (left and right) commands. You can then use Ctrl-W direction to switch windows (where direction is one of the ...

View answer
How can I generate a list of sequential numbers, one per line?
20 votes

In addition to Undo's pure-vim :put =range(1,100) (which actually leaves you with a blank line up top), you can, depending on your OS, use one of its commands. E.g., on a Unix/Linux box: %!seq 1 100 ...

View answer
Can I script Vim using Python?
Accepted answer
19 votes

Yes, vim can be built with several different language interpreters available. This is something you (or your distro) picked when compiling vim from source. Available at least are Python (as you ...

View answer
How can I change the default indentation based on filetype?
14 votes

You can do this with autocommands in your .vimrc. For example, I have a function html_like_mode that sets up various things for editing HTML files. In my .vimrc, I have: au BufNewFile,BufRead *.html ...

View answer
Performing certain operations without clearing register
12 votes

x doesn't put things on the clipboard, it puts them into a register. If you don't tell it which register to put it into, it puts it into the unnamed register, which of course overwrites the previous ...

View answer
Is there any way to add to the help system without developing a plugin
Accepted answer
8 votes

Adding a help file is actually fairly easy: as documented in :help add-local-help, you plop it in ~/.vim/doc and then run :helptags ~/.vim/doc. That's (part of) what your plugin manager is doing for ...

View answer
Vim -p: Caught deadly signal SEGV?
6 votes

The SEGV signal, also known as a segfault, is almost always due to a bug in the program you're running—in this case, vim. (Other causes are things like defective hardware, or once in a blue moon, ...

View answer
Vim Windows creating temporary files
2 votes

I think these are the vim backup files. This should turn them off: set nobackup There will still be one while vim is actually writing the file (e.g, during the :w command; use set nowritebackup to ...

View answer