-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
100 lines (88 loc) · 2.44 KB
/
.vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
if &term == "rxvt-unicode"
set term=rxvt
endif
"set t_Co=256
set nocompatible
set expandtab
set backspace=2
set shiftwidth=2
set softtabstop=2
" Visuals
set showtabline=2
set scrolloff=2
set listchars=tab:>-,trail:.
set number
set showcmd
set showmatch
set incsearch
set ruler
set updatetime=100
syntax on
filetype plugin on
if has("autocmd")
filetype plugin indent on
else
set autoindent
endif
" Keybindings
imap jj <ESC>
nmap ; :
nnoremap ; :
nnoremap <silent> k gk
nnoremap <silent> j gj
nmap <F2> :set list!<CR>
nmap <F3> :registers<CR>
nmap <F4> :set invhls<CR>
nmap <F10> :set mouse=a<CR>
nmap <F12> :set number!<CR>
map - <C-w>-
map + <C-w>+
" Deal With term
if &term =~ "^screen" || &term =~ "^putty" || &term =~ "^rxvt-unicode"
set t_Co=256
set background=dark
elseif &term =~ "^vt100"
set background=light
else
set background=dark
endif
" statusline
set laststatus=2
set statusline=
set statusline+=%1*\ %B\ %* "hex value of char under cursor
set statusline+=%2*%y%* "file type
set statusline+=%3*\ %<%F%* "full path
set statusline+=%2*%m%* "modified flag
set statusline+=%=%{fugitive#statusline()} "active register
set statusline+=\ %{v:register} "git branch
set statusline+=%1*%5l%* "current line
set statusline+=%2*/%L%* "total lines
set statusline+=%1*%4c\ %* "column number
set statusline+=%P "percent through file
"Remove trailing whitespace
autocmd FileType python,ruby autocmd BufWritePre * :%s/\s\+$//e
" Protect large files from sourcing and other overhead.
" Files become read only
if !exists("my_auto_commands_loaded")
let my_auto_commands_loaded = 1
" Large files are > 10M
" Set options:
" eventignore+=FileType (no syntax highlighting etc
" assumes FileType always on)
" noswapfile (save copy of file)
" bufhidden=unload (save memory when other file is viewed)
" buftype=nowritefile (is read-only)
" undolevels=-1 (no undo possible)
let g:LargeFile = 1024 * 1024 * 10
augroup LargeFile
autocmd BufReadPre * let f=expand("<afile>") | if getfsize(f) > g:LargeFile | set eventignore+=FileType | setlocal noswapfile bufhidden=unload buftype=nowrite undolevels=-1 | else | set eventignore-=FileType | endif
augroup END
endif
call pathogen#infect()
call pathogen#helptags()
" Gvim settings
highlight Normal guifg=green guibg=black
" Plugin options
let g:puppet_align_hashes = 0
" use bash as vim shell for RVM compatibility
set shell=bash