aboutsummaryrefslogtreecommitdiffstats
path: root/vim/vimrc
blob: 51f06729b983843edb741aa5c2fb485bc2e6c651 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
set nocompatible               " be iMproved
set shortmess+=I

" Respect XDG
set directory=$XDG_CACHE_HOME/vim,~/,/tmp
set backupdir=$XDG_CACHE_HOME/vim,~/,/tmp
set viminfo+=n$XDG_CACHE_HOME/vim/viminfo
set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME,/usr/share/vim/vimfiles
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"

" Make backspace behave in a sane manner.
set backspace=indent,eol,start

" NeoBndle stuff
set runtimepath+=~/.config/vim/bundle/neobundle.vim/
call neobundle#rc('/home/kyrias/.config/vim/bundle')
NeoBundleFetch 'Shougo/neobundle.vim'

NeoBundle 'Shougo/vimproc', {
 \ 'build' : {
 \     'unix' : 'make -f make_unix.mak',
 \    },
 \ }
NeoBundle 'Shougo/unite.vim'

" Colorscheme❤
NeoBundle "daylerees/colour-schemes", { "rtp": "vim-themes/" }
colorscheme Darkcustomside
"colorscheme mustang

" Smart Tabs (http://www.emacswiki.org/emacs/SmartTabs)
NeoBundle 'gustavo-hms/vim-smart-tabs'

syntax on
filetype plugin indent on
set autoindent    " always set autoindenting on
set copyindent    " copy the previous indentation on autoindenting
set number        " always show line numbers
set showmatch     " set show matching parenthesis
set smartcase     " ignore case if search pattern is all lowercase,
                  "    case-sensitive otherwise
set hlsearch      " highlight search terms
set incsearch     " show search matches as you type
set history=1000         " remember more commands and search history
set undolevels=1000      " use many muchos levels of undo
set wildignore=*.swp,*.bak,*.pyc,*.class
set title                " change the terminal's title
set visualbell           " don't beep
set noerrorbells         " don't beep
set nobackup
set noswapfile

set mouse=a
nnoremap ; :

map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>

nmap <silent> <Leader>/ :nohlsearch<CR>

cmap w!! w !sudo tee % >/dev/null

" Tabs are 4 spaces wide
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab

" voodoo magic
set hidden

" Make the cursor be on the left side in normal mode if line starts with tab
set list lcs=tab:\ \ 
" Note the extra space after the second \

" Append modeline after last line in buffer.
function! AppendModeline()
	let l:modeline = printf("vim: set ts=%d sts=%d sw=%d %set:",
				\ &tabstop, &softtabstop, &shiftwidth, &expandtab ? '' : 'no')
	let l:modeline = substitute(&commentstring, "%s", l:modeline, "")
	call append(line("$"), l:modeline)
endfunction
nnoremap <silent> <Leader>ml Go<ESC>``:call AppendModeline()<CR>

" Paste mode when pressing Insert, disables autoformating
set pastetoggle=<Insert>

" Installation check.
NeoBundleCheck

set listchars=tab:»·,trail:·
set list

highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()