aboutsummaryrefslogtreecommitdiff
path: root/.vimrc
blob: 1abc9ea666a3831b2436afe26e37a8012a88bc9c (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
set number
set relativenumber
syntax on
set cindent

" Disable autocomment
autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o

" Enable your mouse
set mouse=a

" xsel needed for shared clipboard?
set clipboard=unnamedplus  " Copy paste between vim and everything else

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

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

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

" Using jk and kj instead of Esc
inoremap jk <Esc>
inoremap kj <Esc>

" Saving changes even if not root
cmap w!! w !sudo tee %