-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
126 lines (98 loc) · 2.55 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
set nocompatible
silent !mkdir -p $HOME/.tmp/vim/
set directory=$HOME/.tmp/vim//
set nobackup
set nowritebackup
set history=50
set ruler
set showcmd
set incsearch
set laststatus=2
syntax on
set number
set numberwidth=5
set tabstop=2
set shiftwidth=2
set expandtab
"set smarttab
set scrolloff=5
"show a line at column 80
set colorcolumn=80
set splitbelow
set splitright
if filereadable(expand("~/.vimrc.plugins"))
source ~/.vimrc.plugins
endif
" colorscheme stuff
set background=dark
let g:solarized_termcolors=256
" colorscheme solarized
let g:gruvbox_contrast_light='hard'
colorscheme gruvbox
" Language-specific settings
if filereadable(expand("~/.vimrc.languages"))
source ~/.vimrc.languages
endif
filetype plugin on
"AirlineTheme simple
" DetectIndent settings
let g:detectindent_preferred_expandtab=1
let g:detectindent_preferred_indent=2
augroup DetectIndent
autocmd!
autocmd BufReadPost * DetectIndent
augroup END
" js settings
let g:jsx_ext_required = 0
" ctrlp settings
let g:ctrlp_custom_ignore = {
\ 'dir': 'node_modules$',
\ }
let g:ctrlp_show_hidden = 1
" fzf settings
map <C-p> :FZF <CR>
" Fix trailing whitespace on save
let g:better_whitespace_enabled = 1
let g:strip_whitespace_on_save = 1
let g:strip_whitespae_confirm=0
" Disable python-mode's space errors since vim-better-whitespace does it
" better
let g:pymode_syntax_space_errors = 0
let g:pymode_lint_on_write = 0 " Wow this is annoying
" Format python code
if exists("g:load_black")
autocmd BufWritePre *.py execute ':Black'
endif
" Black uses 88 character lines rather than 80
autocmd BufNewFile,BufRead *.py set colorcolumn=89
autocmd BufNewFile,BufRead *.py set textwidth=88
" Use 100 char lines in golang
autocmd BufNewFile,BufRead *.go set colorcolumn=101
autocmd BufNewFile,BufRead *.go set textwidth=100
" Break bad habits
nnoremap <Left> :echoe "Use h"<CR>
nnoremap <Right> :echoe "Use l"<CR>
nnoremap <Up> :echoe "Use k"<CR>
nnoremap <Down> :echoe "Use j"<CR>
" Quicker window movement
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" vimwiki
let g:vimwiki_global_ext = 0
let g:vimwiki_list = [
\ {
\ 'path': '~/vimwiki/',
\ 'syntax': 'markdown',
\ 'ext': '.md',
\ 'path_html': '~/vimwiki/site_html',
\ 'custom_wiki2html': 'vimwiki_markdown',
\ 'template_path': '~/vimwiki/_build/templates',
\ },
\ ]
" Include any machine/loality-specific things, try to keep this .vimrc
" standard across everything
if filereadable(expand("~/.vimrc.local"))
source ~/.vimrc.local
endif