-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
executable file
·189 lines (160 loc) · 4.65 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
set nocompatible " be iMproved
filetype off " required!
runtime macros/matchit.vim
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Plugin 'mxw/vim-jsx'
Plugin 'pangloss/vim-javascript'
Plugin 'bluz71/vim-moonfly-colors'
Plugin 'kudabux/vim-srcery-drk'
Plugin 'Zabanaa/neuromancer.vim'
Plugin 'gkjgh/cobalt'
Plugin 'janko-m/vim-test'
Plugin 'mustache/vim-mustache-handlebars'
Plugin 'stephpy/vim-yaml'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'ryanmorillo/excel.vim'
Plugin 'gmarik/vundle'
Plugin 'lambdatoast/elm.vim'
Plugin 'scrooloose/nerdcommenter'
Plugin 'vim-ruby/vim-ruby'
Plugin 'elixir-lang/vim-elixir'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'scrooloose/nerdtree'
Plugin 'https://github.com/freeo/vim-kalisi'
Plugin 'kien/ctrlp.vim'
Plugin 'gioele/vim-autoswap'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-rails'
Plugin 'aklt/vim-substitute'
Plugin 'tpope/vim-fugitive'
Plugin 'godlygeek/tabular'
Plugin 'slim-template/vim-slim'
Plugin 'kchmck/vim-coffee-script'
Plugin 'shime/vim-livedown'
Plugin 'rking/ag.vim'
set dir=~/.vim/tmp
set shortmess=a
call vundle#end()
filetype plugin indent on
"airline stuff
let g:airline_inactive_collapse=1
let g:airline_section_b = '%f'
let g:airline_section_c = '%t'
set tabstop=2 shiftwidth=2 expandtab
set relativenumber
set number
syntax on
set t_Co=256
" in case t_Co alone doesn't work, add this as well:
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
" remove unwanted whitespace with f5
:nnoremap <silent> <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar>:nohl<CR>
let g:mapleader=","
"ctrlp stuff
" let g:ctrlp_by_filename=1
let g:ctrlp_root_markers = ['.git']
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git\|vendor\|tmp'
let g:ctrlp_show_hidden = 1
"nerdtree
map <leader>d :NERDTree<cr>
set background=dark
colorscheme moonfly
"colorscheme cobalt
"colorscheme calmar256-dark
"colorscheme kalisi
" colorscheme sonoma
" colorscheme railscasts
"colorscheme liquidcarbon
"colorscheme blacklight
" colorscheme neuromancer
" colorscheme wombat
" colorscheme gruvbox
"colorscheme srcery-drk
" text search stuff
set incsearch
set hlsearch
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
cnoremap <leader>w <C-F>
" shows when you break the 80 column rule
highlight OverLength ctermbg=black ctermfg=white guibg=#592929
match OverLength /\%121v.\+/"
" removes escape lag
set nottimeout
" enable per-project .vimrc files
set exrc
" Only execute safe per-project vimrc commands
set secure
" open new window below instead of above
set splitbelow
" window management
function! WinMove(key)
let t:curwin = winnr()
exec "wincmd ".a:key
if (t:curwin == winnr()) "we havent moved
if (match(a:key,'[jk]')) "were we going up/down
wincmd v
else
wincmd s
endif
exec "wincmd ".a:key
endif
endfunction
" Zoom / Restore window.
function! s:ZoomToggle() abort
if exists('t:zoomed') && t:zoomed
execute t:zoom_winrestcmd
let t:zoomed = 0
else
let t:zoom_winrestcmd = winrestcmd()
resize
vertical resize
let t:zoomed = 1
endif
endfunction
command! ZoomToggle call s:ZoomToggle()
nnoremap <silent> <C-I> :ZoomToggle<CR>
map <leader>h :call WinMove('h')<cr>
map <leader>k :call WinMove('k')<cr>
map <leader>l :call WinMove('l')<cr>
map <leader>j :call WinMove('j')<cr>
map <leader>wc :wincmd q<cr>
map <leader>wr <C-W>r
map <leader>H :wincmd H<cr>
map <leader>K :wincmd K<cr>
map <leader>L :wincmd L<cr>
map <leader>J :wincmd J<cr>
nmap <leader><left> :3wincmd <<cr>
nmap <leader><right> :3wincmd ><cr>
nmap <leader><up> :3wincmd +<cr>
nmap <leader><down> :3wincmd -<cr>
" move by visual lines, not by wrapped lines
noremap <buffer> <silent> k gk
noremap <buffer> <silent> j gj
noremap <buffer> <silent> 0 g0
noremap <buffer> <silent> $ g$
" silver searcher options
let g:ag_highlight=1
let g:ag_mapping_message=0
" This allows buffers to be hidden if you've modified a buffer.
" This is almost a must if you wish to use buffers in this way.
set hidden
" copy file path into buffer
:nmap cp :let @* = expand("%:p")
autocmd BufNewFile,BufRead *.ratchet set syntax=html
autocmd BufNewFile,BufRead *.tex set syntax=html
" vim test
"nmap <silent> <leader>t :TestNearest<CR>
nmap <silent> <leader>t :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
"nmap <silent> <leader>l :TestLast<CR>
"nmap <silent> <leader>g :TestVisit<CR>
"
" cp full path
noremap <silent> <F4> :let @+=expand("%:p")<CR>
" javascript jsx
let g:jsx_ext_required = 0