-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
89 lines (69 loc) · 1.85 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
map <C-Insert> <Esc>:tabnew<CR>
"set smartindent " EVIL. Breaks filetype indenting. Don't enable.
set autoindent
set backspace=start,indent,eol
set cmdheight=2 " Annoying 'hit enter' message when using PIDA, get rid of it
set expandtab
set hidden
set history=1000
set ignorecase
set incsearch
set noinsertmode
set nostartofline
set number
set hlsearch
set shiftwidth=4
set softtabstop=4
set showcmd
set wildchar=<TAB>
set wildmenu
set wildmode=list:longest
set nowrap
set viminfo='100,f1
set nolinebreak
set textwidth=0
if exists('+autochdir')
set autochdir
else
autocmd BufEnter * silent! lcd %:p:h:gs/ /\\ /
endif
nmap <F2> :wall<NL> " Save all on F2
im :<CR> :<CR><TAB>
" Buffer navigation
map <Leader>, <C-^>
map <Leader>] :bnext<CR>
map <Leader>[ :bprev<CR>
map <Leader>ls :buffers<CR>
" Alternatives for Esc to exit insert mode.
imap jj <ESC>
" Filetype customizations
syntax on
filetype on
filetype plugin on
"filetype indent on
set list listchars=tab:>\ ,trail:.,extends:$,nbsp:_
set fillchars=fold:-
set dictionary=/usr/share/dict/words
au BufNewFile,BufRead *.mak set ft=mako
au BufNewFile,BufRead *.mako set ft=mako
au FileType html,css,mako,js setlocal expandtab tabstop=4
au FileType python setlocal expandtab shiftwidth=4 tabstop=4
au Filetype html,xml,xsl,mako source ~/.vim/plugin/closetag.vim
augroup mkd
autocmd BufRead *.txt set ai formatoptions=tcroqn2 comments=n:>
augroup END
" Markdown
augroup mkd
autocmd BufRead *.mkd set ai formatoptions=tcroqn2 comments=n:>
augroup END
function! StripWhitespace ()
exec ':%s/\s*$//g'
endfunction
noremap <leader>t :call StripWhitespace ()<CR>
"Fast reloading of the .vimrc
map <leader>s :source ~/.vimrc<cr>
"Fast editing of .vimrc
map <leader>e :e! ~/.vimrc<cr>
"When .vimrc is edited, reload it
autocmd! bufwritepost vimrc source ~/.vimrc
vnoremap <C-r> "hy:%s/<C-r>h//gc<left><left><left>