-
Notifications
You must be signed in to change notification settings - Fork 1
/
vimrc
171 lines (142 loc) · 2.98 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
"load plugins with pathogen
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
if has ('gui_running')
"colors
set t_Co=256
set background=dark
colorscheme solarized
"window size
set lines=100
set columns=90
"font
set guifont=Source\ Code\ Pro\ Semi-Bold\ 11
else
set t_Co=256
set background=dark
colorscheme molokai
endif
syntax on
"Tabstops
set tabstop=4
set shiftwidth=4
set smarttab
set expandtab
"Shell
set shell=/bin/bash
"GUI
set guioptions-=m "no menu
set guioptions-=T "no toolbar
set guioptions-=r "no right
set guioptions-=R
set guioptions-=l "no left
set guioptions-=L
"general usability
set nocompatible
set modelines=0
set encoding=utf-8
set scrolloff=3
set autoindent
set showmode
set showcmd
set hidden
set visualbell
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
set relativenumber
set number
set undofile
set autoread
"wildmenu
set wildmenu
set wildmode=list:longest
set wildignore+=.hg,.git,.svn
set wildignore+=*.jpg,*.bmp,*.png,*.jpeg
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.elf
set wildignore+=*.sw?
set wildignore+=*.pyc
"backups
set undodir=~/.vim/tmp/undo//
set backupdir=~/.vim/tmp/backup//
set directory=~/.vim/tmp/swap//
set backup
set noswapfile
"leader
let mapleader=","
let maplocalleader="\\"
"folds
set foldmethod=syntax
nnoremap <silent><Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
nnoremap <silent><S-Space> @=(foldlevel('.')?'zA':"\<Space>")<CR>
vnoremap <Space> zf
"open all folds shortcut
nnoremap <leader>z gg<S-v><S-g>z<S-o>``
"fix search, map ,<space> to clear hl
nnoremap / /\v
vnoremap / /\v
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
nnoremap <leader><space> :noh<cr>
nnoremap <tab> %
vnoremap <tab> %
"set line length
set wrap
set textwidth=79
set formatoptions=qrn1
set colorcolumn=85
"stop hitting F1
inoremap <F1> <ESC>
nnoremap <F1> <ESC>
vnoremap <F1> <ESC>
"nnoremap ; :
au FocusLost * :wa
"easier escape
inoremap jj <ESC>
"window splits:
nnoremap <leader>w <C-w>v<C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
"line indents
nmap <Left> <<
nmap <Right> >>
nmap <Up> [e
nmap <Down> ]e
vmap <Left> <gv
vmap <Right> >gv
vmap <Up> [egv
vmap <Down> ]egv
"NERDtree
nnoremap <F2> :NERDTreeToggle<cr>
inoremap <F2> <esc>:NERDTreeToggle<cr>
"Tagbar
nnoremap <F4> :TagbarToggle<cr>
inoremap <F4> <esc>:TagbarToggle<cr>
let NERDTreeHighlightCursorline=1
let NERDTreeIgnore=['.vim$', '\~$', '.*\.pyc$']
"let NERDTreeMinimalUI=1
let NERDTreeDirArrows=1
"YankRing
nnoremap <silent> <F3> :YRShow<cr>
inoremap <silent> <F3> <ESC>:YRShow<cr>
"Gundo
nnoremap <F5> :GundoToggle<cr>
"ctrl-p open in buffer mode
nnoremap <C-b> :CtrlPBuffer<cr>
"ultisnips"
let g:UltiSnipsExpandTrigger = "<c-j>"
let g:UltiSnipsJumpForwardTrigger = "<c-j>"
let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
"spell"
nnoremap <leader>s :setlocal spell spelllang=en_us<cr>
"configure haskell"
let g:haddock_browser="/usr/bin/google-chrome"