-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvimrc.after
More file actions
127 lines (104 loc) · 4 KB
/
vimrc.after
File metadata and controls
127 lines (104 loc) · 4 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
" reduce vi compatibility for more usefult stuff
set nocompatible
set nohlsearch
set ttyfast
set t_Co=256
set synmaxcol=250
set magic
set nowrap
set modelines=0
set enc=utf-8
set foldlevel=99
set expandtab
set textwidth=0 wrapmargin=0
set complete-=i
set noeb vb t_vb=
set complete-=i
" I want a slighly bigger preview window.
set previewheight=25
set foldmethod=syntax
" Set Color Theme
colors zenburn
set guifont=Monaco:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
let mapleader=","
" remove pipes in vertical split
set fillchars=vert:\
" Gdiff
set diffopt+=vertical
" Map :W to :w since i always accidentally press wrong
" command W w
" Tab between buffers
noremap <tab> <c-w><c-w>
" Use space for :
noremap <space> :
" Switch between last two buffers
nnoremap <leader><leader> <C-^>
" easer fold/unfold with just a keypress
nnoremap f za
nnoremap F zR
" extra fugitive
noremap <F4> :Gblame<CR>
au BufRead,BufNewFile *.html set filetype=mustache
" Autofix extra whitespace on write for the following filetypes
autocmd BufWritePre *.js :%s/\s\+$//e
autocmd BufWritePre *.vue :%s/\s\+$//e
autocmd BufWritePre *.jsx :%s/\s\+$//e
autocmd BufWritePre *.rb :%s/\s\+$//e
autocmd BufWritePre *.scss :%s/\s\+$//e
autocmd BufWritePre *.less :%s/\s\+$//e
autocmd BufWritePre *.php :%s/\s\+$//e
autocmd BufWritePre *.html :%s/\s\+$//e
autocmd BufWritePre *.mustache :%s/\s\+$//e
let g:Powerline_symbols = 'fancy'
" NERDTree
function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
endfunction
call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#3f3f3f')
call NERDTreeHighlightFile('md', 'blue', 'none', '#dca3a3', '#3f3f3f')
call NERDTreeHighlightFile('yml', 'yellow', 'none', '#dca3a3', '#3f3f3f')
call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#3f3f3f')
call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#3f3f3f')
call NERDTreeHighlightFile('json', 'yellow', 'none', '#ffd1b3', '#3f3f3f')
call NERDTreeHighlightFile('cson', 'yellow', 'none', '#ffd1b3', '#3f3f3f')
call NERDTreeHighlightFile('html', 'yellow', 'none', '#7f9f7f', '#3f3f3f')
call NERDTreeHighlightFile('jade', 'yellow', 'none', '#7f9f7f', '#3f3f3f')
call NERDTreeHighlightFile('haml', 'yellow', 'none', '#7f9f7f', '#3f3f3f')
call NERDTreeHighlightFile('mustache', 'yellow', 'none', '#7f9f7f', '#3f3f3f')
call NERDTreeHighlightFile('styl', 'cyan', 'none', '#efdcbc', '#3f3f3f')
call NERDTreeHighlightFile('css', 'cyan', 'none', '#efdcbc', '#3f3f3f')
call NERDTreeHighlightFile('scss', 'cyan', 'none', '#efdcbc', '#3f3f3f')
call NERDTreeHighlightFile('less', 'cyan', 'none', '#efdcbc', '#3f3f3f')
call NERDTreeHighlightFile('coffee', 'Red', 'none', '#ffb380', '#3f3f3f')
call NERDTreeHighlightFile('js', 'Red', 'none', '#ffb380', '#3f3f3f')
call NERDTreeHighlightFile('jsx', 'Red', 'none', '#ffb380', '#3f3f3f')
call NERDTreeHighlightFile('vue', 'Red', 'none', '#ffb380', '#3f3f3f')
call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#3f3f3f')
let NERDTreeShowLineNumbers=1
let NERDTreeIgnore=['^node_modules$']
let NERDTreeMinimalUI=1
" CtrlP
nnoremap <silent> t :CtrlP<cr>
nnoremap <silent><leader>t :CtrlP<cr>
nnoremap <silent><leader>r :CtrlPMRUFiles<cr>
nnoremap <silent><leader>b :CtrlPBuffer<cr>
" shorthand to split
nnoremap <silent><leader>s :vsp<cr>
" tabularize
nnoremap <silent><leader>o :Tabularize /=<cr>
" JSON formatting
nnoremap <silent><leader>q :%!python -m json.tool<cr>
let g:ctrlp_match_window_bottom = 0
let g:ctrlp_match_window_reversed = 0
let g:ctrlp_working_path_mode = 2
let g:ctrlp_by_filename = 0
let g:ctrlp_max_files = 1000
let g:ctrlp_max_depth = 6
let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist)|(\.(swp|ico|git|svn))$'
" fzf
set rtp+=/usr/local/opt/fzf
let g:vue_disable_pre_processors=1