How I boosted my Vim
nvie.com
How I boosted my Vim
1–10 of 69 posts
Re: How I boosted my Vim
#2set nobackup set noswapfile
backup files are one thing, but turning off swap files is a terrible idea. vim can crash, you can accidentally close the window, your ssh session can die, etc. if you exit vim cleanly then the swap files will be transparent, so i don't see the point in disabling them.
Re: How I boosted my Vim
#3Oh, and man… never ever let Vim write a backup file! They did that in the 70’s. Use modern ways for tracking your changes, for God’s sake. set nobackup set noswapfile backup files are one thing, but turning off swap files is a terrible idea. vim can crash, you can accidentally close the window, your ssh session can die, etc. if you exit vim cleanly then the swap files will be transparent, so i don't see the point in…
What really ends up happening is I try to edit a file and something annoying pops up telling me about something requiring my attention (swap file already exists .. read only mode .. bla bla). In other words, it's just a distraction, most of the time.
Re: How I boosted my Vim
#4Oh, and man… never ever let Vim write a backup file! They did that in the 70’s. Use modern ways for tracking your changes, for God’s sake. set nobackup set noswapfile backup files are one thing, but turning off swap files is a terrible idea. vim can crash, you can accidentally close the window, your ssh session can die, etc. if you exit vim cleanly then the swap files will be transparent, so i don't see the point in…
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp
This way, if you want your backups to be neatly grouped, just create a directory called '.backup' in your working directory. Vim will stash backups there. The 'directory' option controls where swap files go. If your working directory is not writable, Vim will put the swap file in one of the specified places.
(http://vim.wikia.com/wiki/Remove_swap_and_backup_files_from_...)
Re: How I boosted my Vim
#5Oh, and man… never ever let Vim write a backup file! They did that in the 70’s. Use modern ways for tracking your changes, for God’s sake. set nobackup set noswapfile backup files are one thing, but turning off swap files is a terrible idea. vim can crash, you can accidentally close the window, your ssh session can die, etc. if you exit vim cleanly then the swap files will be transparent, so i don't see the point in…
so far, swap files have caused me more headache than anything else. I'm a paranoid maniac and I save every minute or two, so worst case I'll repeat a minute worth of coding. What really ends up happening is I try to edit a file and something annoying pops up telling me about something requiring my attention (swap file already exists .. read only mode .. bla bla). In other words, it's just a distraction, most of the t…
You can configure it to put your swap files in a canonical dir, instead of polluting the directory you're editing files in:
set backupdir=/var/tmp,/tmp
set directory=/var/tmp,/tmp
Now you can just nuke the swap files in one swoop:
rm -rf /var/tmp/*.swp
Re: How I boosted my Vim
#6Re: How I boosted my Vim
#7Oh, and man… never ever let Vim write a backup file! They did that in the 70’s. Use modern ways for tracking your changes, for God’s sake. set nobackup set noswapfile backup files are one thing, but turning off swap files is a terrible idea. vim can crash, you can accidentally close the window, your ssh session can die, etc. if you exit vim cleanly then the swap files will be transparent, so i don't see the point in…
It can?
Re: How I boosted my Vim
#8Oh, and man… never ever let Vim write a backup file! They did that in the 70’s. Use modern ways for tracking your changes, for God’s sake. set nobackup set noswapfile backup files are one thing, but turning off swap files is a terrible idea. vim can crash, you can accidentally close the window, your ssh session can die, etc. if you exit vim cleanly then the swap files will be transparent, so i don't see the point in…
> vim can crash It can?
Vim: Caught deadly signal SEGV
Re: How I boosted my Vim
#9Earlier quoted context omitted.
so far, swap files have caused me more headache than anything else. I'm a paranoid maniac and I save every minute or two, so worst case I'll repeat a minute worth of coding. What really ends up happening is I try to edit a file and something annoying pops up telling me about something requiring my attention (swap file already exists .. read only mode .. bla bla). In other words, it's just a distraction, most of the t…
Until it saves your ass. Which will happen, if you use vim for a few years. You can configure it to put your swap files in a canonical dir, instead of polluting the directory you're editing files in: set backupdir=/var/tmp,/tmp set directory=/var/tmp,/tmp Now you can just nuke the swap files in one swoop: rm -rf /var/tmp/*.swp
Re: How I boosted my Vim
#10One big productivity boost for me was remapping the Escape key to something a little more convenient. I just remapped the ESC key altogether, but this can throw you off if you find yourself working at lots of different computers. If you prefer something less permanent, you can map a key sequence to ESC. I like this one, which maps 'sdf' to ESC if you're in insert mode:
imap sdf
jkjk is also a sequence I've seen used.