-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
206 lines (169 loc) · 5.68 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
if &compatible
set nocompatible " be iMproved, required
endif
" Add the dein installation directory into runtimepath
set runtimepath+=~/.cache/dein/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.cache/dein')
call dein#begin('~/.cache/dein')
call dein#add('~/.cache/dein')
call dein#add('bling/vim-airline')
call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('elixir-lang/vim-elixir')
call dein#add('godlygeek/tabular')
call dein#add('JuliaEditorSupport/julia-vim')
call dein#add('mileszs/ack.vim')
call dein#add('qpkorr/vim-renamer')
call dein#add('rhysd/vim-crystal')
call dein#add('romainl/flattened')
call dein#add('scrooloose/nerdtree')
call dein#add('slim-template/vim-slim')
call dein#add('tomtom/tcomment_vim')
call dein#add('tpope/vim-fugitive') " Git integration
call dein#add('tpope/vim-surround')
call dein#add('vim-ruby/vim-ruby')
" call dein#add('ap/vim-css-color') " Highlight CSS Colors
" call dein#add('morhetz/gruvbox') " Color scheme
" call dein#add('altercation/vim-colors-solarized') " does not work (yet?) with neovim
" call dein#add('benmills/vimux') " Tmux integration
" call dein#add('derekwyatt/vim-scala')
" call dein#add('digitaltoad/vim-jade')
" call dein#add('ekalinin/Dockerfile.vim')
" call dein#add('fatih/vim-go')
" call dein#add('gregsexton/gitv')
" call dein#add('honza/vim-snippets')
" call dein#add('kchmck/vim-coffee-script')
" call dein#add('mattn/gist-vim')
" call dein#add('mattn/webapi-vim')
" call dein#add('othree/coffee-check.vim')
" call dein#add('rking/ag.vim')
" call dein#add('scrooloose/syntastic')
" call dein#add('Shougo/deoplete.nvim')
" call dein#add('tpope/vim-abolish')
" call dein#add('tpope/vim-dispatch')
" call dein#add('tpope/vim-endwise')
" call dein#add('tpope/vim-markdown')
" call dein#add('tpope/vim-rails')
" call dein#add('tpope/vim-sensible') " General settings
" call dein#add('vim-scripts/Gundo')
" call dein#add('xolox/vim-lua-ftplugin')
" call dein#add('xolox/vim-misc')
if !has('nvim')
"call dein#add('roxma/nvim-yarp')
"call dein#add('roxma/vim-hug-neovim-rpc')
endif
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" Install not installed plugins on startup
if dein#check_install()
call dein#install()
endif
let mapleader = ","
" Settings
"
set history=1000
set nobackup
set nowritebackup
set number
set ruler
set scrolloff=3
set textwidth=0
set wrapmargin=0
set visualbell
set noswapfile
set exrc
set nowrap
" Make file/command completion useful
set wildmode=list:longest
" General Ignores
set wildignore+=*.so,*.pyc,*.o,*.out,*.obj,.git,*.rbc,*.rbo,*.class,.svn,*.gem
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/*
set wildignore+=*/tmp/*,*/tmp/cache/assets/*/sprockets/*,*/tmp/cache/assets/*/sass/*
set wildignore+=*.swp,*~,._*
" Search+replace
set ignorecase
set incsearch
set smartcase
set hlsearch
" Tab settings
set tabstop=2
set backspace=2
set softtabstop=2
set shiftwidth=2
set smarttab
set expandtab
" Jump to the last know position in a file after opening it
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
" Clear the search buffer when hitting return
" :nnoremap <CR> :nohlsearch<cr>
" Colors, fonts
" highlight Pmenu ctermbg=5 guibg=#004e9c
" let g:airline_theme = 'solarized'
" Load matchit (% to bounce from do to end, etc.)
runtime! macros/matchit.vim
" NERD Tree
imap <leader>n <esc>:NERDTreeToggle<CR>
nmap <leader>n :NERDTreeToggle<CR>
" vimux
let g:VimuxPromptString = "=>"
let g:VimuxHeight = "30"
autocmd FileType ruby map <Leader>rr :call VimuxRunCommand("clear; ruby -w " . bufname("%"))<CR>
autocmd FileType javascript map <Leader>rr :call VimuxRunCommand("clear; node " . bufname("%"))<CR>
autocmd FileType go map <Leader>rr :call VimuxRunCommand("clear; go run " . bufname("%"))<CR>
map <Leader>vp :VimuxPromptCommand<CR>
map <Leader>vl :VimuxRunLastCommand<CR>
map <Leader>vi :VimuxInspectRunner<CR>
map <Leader>vq :VimuxCloseRunner<CR>
map <Leader>vx :VimuxInterruptRunner<CR>
map <Leader>vc :VimuxClearRunnerHistory<CR>
map <Leader>vz :VimuxZoomRunner<CR>
" vim-dispatch
" autocmd FileType ruby let b:dispatch = 'ruby -w %'
autocmd FileType ruby let b:dispatch = 'ruby %'
autocmd FileType javascript let b:dispatch = 'node %'
autocmd FileType go let b:dispatch = 'go run %'
nnoremap <leader>r :Dispatch<CR>
nnoremap <leader>v :Copen<CR>
" vim-ruby
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_use_bundler = 1
" vim-go
au FileType go nmap <leader>r <Plug>(go-run)
au FileType go nmap <leader>b <Plug>(go-build)
au FileType go nmap <leader>t <Plug>(go-test)
au FileType go nmap <leader>c <Plug>(go-coverage)
au FileType go nmap <Leader>ds <Plug>(go-def-split)
au FileType go nmap <Leader>dv <Plug>(go-def-vertical)
au FileType go nmap <Leader>dt <Plug>(go-def-tab)
" BINDINGS
" Buffer Navigation
map <leader>c <C-w>c
map <leader>h <C-w>h
map <leader>j <C-w>j
map <leader>k <C-w>k
map <leader>l <C-w>l
map <leader>a :Ack<Space>
:map <leader>b :CtrlPBuffer<CR>
" Removes trailing spaces
function TrimWhiteSpace()
%s/\s*$//
''
:endfunction
autocmd FileWritePre,FileAppendPre,FilterWritePre,BufWritePre * :call TrimWhiteSpace()
" " MacVim
" "
" if has("gui_running")
" set guifont=Monaco:h12
" set guioptions=egmrt
"
" " MacVim now supports swipe!
" nmap <SwipeLeft> :bN<CR>
" nmap <SwipeRight> :bn<CR>
" endif
set secure