" Treat buffers from stdin (e.g.: echo foo | vim -) as scratch buffers.
au StdinReadPost * :set buftype=nofile
" Use 2 spellfiles to spellcheck sensitive words
set spellfile=~/.vim/dict.utf-8.add,~/vim-local-dict.utf-8.add
bitbucket.org/sjl/dotfiles/s…
" Don't move when you use *
nnoremap <silent> * :let stay_star_view = winsaveview()<cr>*:call winrestview(stay_star_view)<cr>
" Indent/dedent/autoindent what you just pasted
nnoremap >< V`]>
nnoremap <lt>> V`]<
nnoremap =- V`]=
Random .vimrc Lines retweeted
Just flipped the switch. Learn Vimscript the Hard Way is finally published!
$8 ebook
$20 paperback
$40 hardcover
learnvimscriptthehardway.ste…
Random .vimrc Lines retweeted
Fixed my next/last Vim text objects to work across lines. Still a few bugs (feel free to fix...): github.com/sjl/dotfiles/blob…
" Sort lines
" Great for Python imports.
nnoremap <leader>s vip:!sort<cr>
vnoremap <leader>s :!sort<cr>
Oh and in case you've forgotten when mappings you've added, ':map <leader>' will show you all the mappings defined that start with <leader>.
~30% of the suggestions are for "inoremap jk <esc>" or similar. Have y'all seen stevelosh.com/blog/2012/10/a… ? :)
" Only show cursorline in the current window and in normal mode
au WinLeave,InsertEnter * set nocul
au WinEnter,InsertLeave * set cul
I've posted this before, but I use it so often and it's so handy that it's worth reposting.
Next & Last text objects: gist.github.com/3762227
" Set the shell Vim uses for external commands to bash in such a way that it'll source ~/.bash_profile
set shell=/bin/bash\ --login
Random .vimrc Lines retweeted
nnoremap <leader>r :read !curl -s --raw
#vim





