syntax on " syntax highlighting
set tabstop=4 " PEP-8 uses 4 spaces per indentation level
set shiftwidth=4 " shifting (PEP-8)
set expandtab " spaces instead of tabs (PEP-8, and just bettter in general)
filetype on " file type detection
filetype indent on " special indentation rules for file type
filetype plugin on " auto-completion rules for file type
set hls " highlight search terms (:noh to turn off temporarily)
set ignorecase " ignore case for searches (:set noignorecase to turn off)
set incsearch " search as you type
colorscheme darkblue " slightly nicer colour scheme
set scrolloff=15 " keep 15 lines of context on both sides of cursor when scrolling
http://github.com/paulgb/settings/blob/9ebf793bcf202589c74f3...Ask HN: What's in your .vimrc file?
11–20 of 69 posts
Re: Ask HN: What's in your .vimrc file?
#12 set backupdir=~/.vim/backup
set backup
set directory=~/.vim/tmp
This to see line numbers on the left (i find it a bit more readable instead of watching at the bottom-right) set number
added a simple way to speedup my writing with (I know it's crappy but it works ...until you need to add just one bracket/quote) " autocomplete parenthesis, brackets and braces
inoremap ( ()
inoremap [ []
inoremap { {}
" autocomplete quotes
inoremap ' ':call QuoteInsertionWrapper("'")a
inoremap " ":call QuoteInsertionWrapper('"')a
inoremap ` `:call QuoteInsertionWrapper('`')a
function! QuoteInsertionWrapper (quote)
let col = col('.')
if getline('.')[col-2] !~ '\k' && getline('.')[col] !~ '\k'
normal ax
exe "normal r".a:quote."h"
end
endfunction
and mapped f1/f2 to switch buffer noremap :bprev!
noremap :bnext!
Some of this wall of text was stolen from a nice, but a bit too big, vimrc i found somewhereIf you need something specific try http://vim.wikia.com/
Re: Ask HN: What's in your .vimrc file?
#13 " copy/paste with the system clipboard
map ^P "+gP
map ^C "+y
Also this, for dealing with DOS-style stuff: " map +s to remove ^M from the ends of lines
map ^S :%s\/^M\/\/gRe: Ask HN: What's in your .vimrc file?
#14I specially like:
map /
map ?
And the parenthesis/bracket expanding.Re: Ask HN: What's in your .vimrc file?
#15Re: Ask HN: What's in your .vimrc file?
#16I work on many different systems from time to time. I don't like to get too used to things that aren't universal. I have found out (the hard way) that relying on convenience can bite you in the ass when it's 3AM and you've been up for 67 consecutive hours and you execute some keystrokes from habit and they don't do what you expected.
I'll admit, I probably cripple my productivity overall for working this way, but it's what I'm used to.
Re: Ask HN: What's in your .vimrc file?
#17Nothing. I work on many different systems from time to time. I don't like to get too used to things that aren't universal. I have found out (the hard way) that relying on convenience can bite you in the ass when it's 3AM and you've been up for 67 consecutive hours and you execute some keystrokes from habit and they don't do what you expected. I'll admit, I probably cripple my productivity overall for working this way…
Re: Ask HN: What's in your .vimrc file?
#18 set guifont=Pragmata:h14
set guioptions=egmrLt
set nohlsearch
set number
set ts=3
colors vividchalk
syntax on
Pragmata is a delicious, delicious font.Re: Ask HN: What's in your .vimrc file?
#19Re: Ask HN: What's in your .vimrc file?
#20I do a lot of copying/pasting from my browser (and other random places), so these mappings make my life easier: " copy/paste with the system clipboard map ^P "+gP map ^C "+y Also this, for dealing with DOS-style stuff: " map +s to remove ^M from the ends of lines map ^S :%s\/^M\/\/g
map ^C "+y
Ugh. I couldn't do that. C-c is a shortcut to exit Insert Mode or to stop a command (similar to C-g usage in Emacs or mutt). map ^S :%s\/^M\/\/g
Be careful with that on terminals. C-s is usually mapped in with flow control on terminals.