-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
96 lines (73 loc) · 1.83 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
set nocompatible " be iMproved, required
filetype off " required
if has("nvim")
let vimdir = $HOME . "/.config/nvim"
else
let vimdir = $HOME . "/.vim"
endif
" Plugins
let pluginsVim = vimdir . '/plugins.vim'
exec "source " . pluginsVim
" Syntax highlights, colorscheme
syntax on
" Only use colorscheme if it exists!
if isdirectory(vimdir . '/bundle/jellybeans.vim')
colorscheme jellybeans
"colorscheme sol-term
else
colorscheme default
endif
" Line numbering
set number
" Column highlighting
set colorcolumn=80
highlight ColorColumn ctermbg=235 guibg=Grey
" CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
" airline
let g:airline_theme='jellybeans'
let g:airline_powerline_fonts=1
" Always show status bar
set laststatus=2
" Folding
set foldmethod=syntax
set foldlevelstart=20
" Enable filetype detection
filetype plugin indent on
" Always use spaces, 4 space tabstop
set tabstop=4
set shiftwidth=4
set expandtab
" Undo/backup
set undofile
set undodir=~/.undo/
set undoreload=100
set backup
set backupdir=~/.backup/
" Disable mouse
set mouse=
" Set language
autocmd BufRead,BufNewFile *.md,*.tex,*.txt setlocal spell
set spelllang=en_us
" Autowrap md, tex, and txt
autocmd BufRead,BufNewFile *.md,*.tex,*.txt setlocal textwidth=80 wrap
" Prev. buffer mapped to Ctrl-H
nnoremap <silent> <C-h> :tabprevious<CR>
" Next buffer mapped to Ctrl-L
nnoremap <silent> <C-l> :tabnext<CR>
" New buffer tab mapped to Ctrl-B
nnoremap <silent> <C-b> :tabnew<CR>
" NERDTree mapped to Ctrl-N
nnoremap <silent> <C-n> :NERDTree<CR>
" Toggle fold mapped to spacebar
nnoremap <Space> za
if has("multi_byte")
if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8
setglobal fileencoding=utf-8
set fileencodings=ucs-bom,utf-8,latin1
endif
" vim: set ft=vim: