summaryrefslogtreecommitdiffstats
path: root/vimrc
blob: c1e2cf369d283ef81c7c1912b27f9552870e17e4 (plain)
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
set vb t_vb=
set backspace=indent,eol,start
set incsearch
set smartcase
set ignorecase
set hlsearch
set nowrap
set scrolloff=5
set sidescroll=1
set sidescrolloff=10
set tabstop=4
set shiftwidth=4
set wildmode=longest:list
set background=dark
set spelllang=en_us
set foldminlines=2
set foldlevelstart=1
set foldnestmax=2
set modeline
set keywordprg=man\ -s
set mouse=
set linebreak
set formatoptions-=o
set nojoinspaces
set fileformats=unix,dos,mac
set t_Co=256

set tags=tags;
set backupdir=$HOME/.vim_swap//,/tmp
set directory=$HOME/.vim_swap//,/tmp

map <ESC>u :nohlsearch<CR>
map j gj
map k gk
map Q ZQ
map H za
map \l :w<CR>:make<CR>
map - $
map _ ct_
map <C-n> gt
map <C-p> gT
map <C-h> :AS<CR>
nmap <Tab> :set expandtab!<CR>:set expandtab?<CR>
vmap P "_dP
inoremap <C-d> <C-t>
inoremap <C-a> <C-d>
nnoremap U :GundoToggle<CR>

let g:pyflakes_autostart = 0
map <F11> :PyflakesToggle<cr>
let g:csv_strict_columns = 1
let g:csv_autocmd_arrange = 1

filetype plugin indent on
syntax on
highlight Folded ctermbg=black
highlight Todo ctermbg=none ctermfg=lightcyan
highlight diffRemoved ctermfg=red cterm=bold
highlight diffAdded ctermfg=green cterm=bold
highlight CSVColumnOdd ctermbg=16
highlight CSVColumnEven ctermbg=17
highlight CSVColumnHeaderOdd ctermbg=59
highlight CSVColumnHeaderEven ctermbg=19

au BufNewFile,BufRead *.frag,*.vert,*.fp,*.vp,*.glsl setf glsl
au BufNewFile,BufRead *.jinja2 set ft=htmldjango
au BufNewFile,BufRead *.ccss set ft=clevercss

autocmd FileType c,cpp,perl,php,java,glsl set cindent foldmethod=syntax
autocmd FileType python set autoindent foldmethod=indent
autocmd FileType sh set autoindent foldmethod=syntax
autocmd FileType javascript,less,html set foldnestmax=3 formatoptions-=o
autocmd FileType javascript,less set foldmethod=indent
autocmd FileType tex,latex set wrap showbreak=+ spell makeprg=pdflatex\ -interaction=nonstopmode\ %
autocmd FileType html,htmldjango,sml set autoindent
autocmd FileType man set nomod nolist readonly
autocmd FileType man map q :q<CR>
autocmd FileType diff map H zA
autocmd FileType diff map L za

autocmd InsertEnter * if !exists('w:last_fdm') | let w:last_fdm=&foldmethod | setlocal foldmethod=manual | endif
autocmd InsertLeave,WinLeave * if exists('w:last_fdm') | let &l:foldmethod=w:last_fdm | unlet w:last_fdm | endif