-
Notifications
You must be signed in to change notification settings - Fork 2
/
vimrc
154 lines (129 loc) · 3.36 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
"breaks compatibility with vi
set nocompatible
"to prevent security exploits
set modelines=0
"tab settings
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
" Set the proper tab / whitespace handling for a given programming language
if has("autocmd")
" enable file type search
filetype plugin on
" use filetype indent
filetype indent on
" Consistent with the Linux Kernel Coding Style Guidelines
autocmd FileType c,cpp,opencl set expandtab tabstop=4 shiftwidth=4 textwidth=80
autocmd FileType python,lua set expandtab tabstop=4 shiftwidth=4 softtabstop=4 textwidth=79
autocmd FileType jade,css,sass,html set expandtab tabstop=2 shiftwidth=2 softtabstop=2 textwidth=79
endif
"general settings
syntax on
set nu
set encoding=utf-8
set scrolloff=3
set showmode
set showcmd
set hidden
set wildmenu
set wildmode=list:longest
set cursorline
set ttyfast
set ruler
set backspace=indent,eol,start
set laststatus=2
"searching and moving settings
set ignorecase
set smartcase
set incsearch
set showmatch
set hlsearch
set wrapscan
set wrap
set textwidth=79
set formatoptions=qrn1
"making j & k behave rationally
nnoremap j gj
nnoremap k gk
au FocusLost * :wa
inoremap jk <ESC>
" Solarized
syntax on
set background=dark
"let g:solarized_termcolors = 256
colorscheme solarized
set autoindent " always set autoindenting on
set smartindent
set cindent
"stop mutt from indenting each paragraph
au FileType mail set noautoindent
au FileType mail set nosmartindent
au FileType mail set nocindent
au FileType mail set indentexpr=
au FileType mail setlocal fo+=aw
"au FileType mail filetype indent off
"window navigation
map <C-H> <C-W><Left>
map <C-L> <C-W><Right>
map <C-J> <C-W><Down>
map <C-K> <C-W><Up>
"spacebar in insert mode inserts a single character
:nmap <Space> i_<Esc>r
set listchars=eol:↓,tab:→\ ,trail:↤,extends:>,precedes:<
set list
execute pathogen#infect()
"nerdtree shortcut
:nmap <c-k><c-b> :NERDTreeToggle<CR>
"to disable folding which is default with plasticboy/vim-markdown
let g:vim_markdown_folding_disabled=1
"ctags-related
set tags=./.tags,.tags,./tags,tags
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
"python
let g:syntastic_python_checkers=['flake8']
"haskell
let g:syntastic_haskell_checkers = ['hlint']
let g:syntastic_hs_checkers=['ghc-mod', 'hlint']
" tagbar
nmap <F8> :TagbarToggle<CR>
let g:tagbar_left=1
let g:tagbar_sort=0
let g:tagbar_width=25
set updatetime=500
let g:tagbar_type_haskell = {
\ 'ctagsbin' : 'hasktags',
\ 'ctagsargs' : '-x -c -o-',
\ 'kinds' : [
\ 'm:modules:0:1',
\ 'd:data: 0:1',
\ 'd_gadt: data gadt:0:1',
\ 't:type names:0:1',
\ 'nt:new types:0:1',
\ 'c:classes:0:1',
\ 'cons:constructors:1:1',
\ 'c_gadt:constructor gadt:1:1',
\ 'c_a:constructor accessors:1:1',
\ 'ft:function types:1:1',
\ 'fi:function implementations:0:1',
\ 'o:others:0:1'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 'm' : 'module',
\ 'c' : 'class',
\ 'd' : 'data',
\ 't' : 'type'
\ },
\ 'scope2kind' : {
\ 'module' : 'm',
\ 'class' : 'c',
\ 'data' : 'd',
\ 'type' : 't'
\ }
\ }
"ctrlp
set runtimepath^=~/.vim/bundle/ctrlp.vim