aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
blob: d9a61c02b6d149fc0547a45ff85217063d77d2ad (plain) (blame)
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
set number
syntax on
set cindent
" Disable autocomment
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
set mouse=a                             " Enable your mouse
" xsel needed?
set clipboard=unnamedplus               " Copy paste between vim and everything else

set tabstop=2       " The width of a TAB is set to 4.
                    " Still it is a \t. It is just that
                    " Vim will interpret it to be having
                    " a width of 4.

set shiftwidth=2    " Indents will have a width of 4

set softtabstop=2   " Sets the number of columns for a TAB

set expandtab       " Expand TABs to spaces

" Better tabbing
vnoremap < <gv
vnoremap > >gv

" Better window navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" I hate escape more than anything else
inoremap jk <Esc>
inoremap kj <Esc>

":help ftplugin
"autocmd FileType md nmap <buffer> <F10> !./gen.sh <enter> " doesn't work...
nnoremap <silent> <F10> :!./gen.sh <enter>

" You can't stop me
cmap w!! w !sudo tee %

" autocmd BufWritePost *.md silent !markdown <afile> > plain.html
" autocmd BufWritePost *.md silent !markdown <afile> > <afile>:r.html

" run on current filename
" :autocmd BufWritePost * silent !run_tests.sh <afile>
" list auto commands
" :autocmd BufWritePost *
" remove all current auto commands
" :autocmd! BufWritePost *