Repository navigation
Expand file tree
/
Copy pathvimrc
More file actions
166 lines (129 loc) · 3.45 KB
/
Copy pathvimrc
File metadata and controls
166 lines (129 loc) · 3.45 KB
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
syntax enable
filetype off
" Vundler
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
so ~/.vim/plugins
so ~/.vim/vimrc.local
call vundle#end()
filetype plugin on
:let mapleader = ","
language en_GB
" 256 colors and solarized
set t_Co=256
colorscheme solarized
set background=dark
" Hilight trailing whitespaces
:highlight ExtraWhitespace ctermbg=red guibg=red
:au BufWinEnter * let w:m1=matchadd('ExtraWhitespace', '\s\+$', -1)
:map <Leader>r :let w:m1=matchadd('ExtraWhitespace', '\s\+$', -1)<CR>
set colorcolumn=100
:highlight ColorColumn ctermbg=0
map! <BS>
map! [4~ <End>
map å ^
map gå g^
set hlsearch
set nocompatible
set backspace=indent,eol,start
set ruler
set smartcase
set incsearch
set ts=2
set shiftwidth=2
set rnu
set autoindent
set expandtab
set cursorline
set laststatus=2
set hidden
set autoread
set wildmenu
set ignorecase
set smartcase
set listchars=tab:>-,eol:$
set cinoptions=0
let c_space_errors=1
au BufRead,BufNewFile *.coffee set filetype=coffee
au BufRead,BufNewFile *.arb set filetype=ruby
au BufRead,BufNewFile *.tex set filetype=tex
" Auto close / skip brackets and parenthis
inoremap ( ()<Left>
inoremap (<CR> (<CR>)<Esc>O
inoremap (( (
inoremap () ()
inoremap ( ()<Left>
inoremap <expr> ) strpart(getline('.'), col('.')-1, 1) == ")" ? "\<Right>" : ")"
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
inoremap { {}<Left>
inoremap <expr> } strpart(getline('.'), col('.')-1, 1) == "}" ? "\<Right>" : "}"
" CtlrP mapping
noremap <C-N> :CtrlP<CR>
set wildignore+=node_modules,env
" Easier CTags
map <Leader>e g<C-]>
" Tagbar bindings
map <Leader>s :TagbarToggle<CR>
" NERDTree mappings
map <Leader>d :NERDTreeFind<CR>
set foldmethod=indent
set foldlevelstart=999
" Some leader mappings
set pastetoggle=<Leader>p
map <Leader>t :BufExplorer<CR>
" Open a quick fix window on bottom
map <Leader>f :bo cw<CR>
" Close buffer without closing the window
nmap <silent> <Leader>c :bp\|bd #<CR>
nmap <silent> <Leader>g :GitGutterAll<CR>
" Load custom vimrc from pwd
if filereadable(".vim.custom")
so .vim.custom
endif
set spelllang=en_gb
" Limelight colors
let g:limelight_conceal_ctermfg = 'DarkGray'
let g:goyo_width = 83
autocmd User GoyoEnter Limelight
autocmd User GoyoLeave Limelight!
" NERDTree configuration
let NERDTreeIgnore = ['\.pyc$']
" Flow plugin
let g:flow#autoclose=1
" Solarized theme for airline
let g:airline_theme = 'dark'
" Airline truncate
let g:airline#extensions#default#layout = [
\ [ 'a', 'b', 'c' ],
\ [ 'y', 'z']
\ ]
" Hdevtool bindings
au FileType haskell nnoremap <buffer> <F1> :HdevtoolsType<CR>
au FileType haskell nnoremap <buffer> <silent> <F2> :HdevtoolsClear<CR>
" Flow bindings
au FileType javascript nnoremap <buffer> <F1> :FlowType<CR>
au FileType javascript nnoremap <buffer> <Leader>b :FlowJumpToDef<CR>
" Enable do-end matching for ruby
runtime macros/matchit.vim
" Syntastic settings
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" Tsuquyomi settings
let g:tsuquyomi_disable_default_mappings = 1
let g:tsuquyomi_disable_quickfix = 1
let g:syntastic_typescript_checkers = ['tsuquyomi'] " Make sure tsc is not used
au FileType go let g:ale_fixers = {
\ 'go': [
\ 'gofmt',
\ 'goimports',
\ ],
\}