-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc.plugins
170 lines (148 loc) · 4.75 KB
/
vimrc.plugins
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
runtime macros/matchit.vim
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'KeitaNakamura/neodark.vim'
Plug 'airblade/vim-gitgutter'
Plug 'airblade/vim-localorie'
Plug 'andrewradev/splitjoin.vim'
Plug 'andrewradev/switch.vim'
Plug 'benmills/vimux'
Plug 'blueyed/vim-diminactive'
Plug 'camspiers/animate.vim'
Plug 'camspiers/lens.vim'
Plug 'christoomey/vim-sort-motion'
Plug 'christoomey/vim-tmux-navigator'
Plug 'despo/vim-ruby-refactoring'
Plug 'elzr/vim-json'
Plug 'exu/pgsql.vim'
Plug 'janko-m/vim-test'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/gv.vim'
Plug 'junegunn/indentLine'
Plug 'junegunn/vim-easy-align'
Plug 'kana/vim-textobj-lastpat'
Plug 'kana/vim-textobj-user'
" Plug 'ludovicchabant/vim-gutentags'
Plug 'luochen1990/rainbow'
Plug 'maralla/completor.vim'
Plug 'matze/vim-move'
Plug 'mcasper/vim-infer-debugger'
Plug 'miyase256/vim-ripgrep', {'branch': 'fix/remove-complete-from-RgRoot'}
Plug 'morhetz/gruvbox'
Plug 'mustache/vim-mustache-handlebars'
Plug 'nelstrom/vim-visual-star-search'
Plug 'ngmy/vim-rubocop'
Plug 'ntpeters/vim-better-whitespace'
Plug 'SirVer/ultisnips'
Plug 'shime/vim-livedown'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-bundler'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-unimpaired'
Plug 'unblevable/quick-scope'
Plug 'vim-airline/vim-airline'
Plug 'vim-scripts/Align'
Plug 'vim-scripts/SQLUtilities'
Plug 'w0rp/ale'
call plug#end()
nnoremap gz yi':!xdg-open https://www.github.com/<C-R>"<CR><CR>
" Airline
let g:airline#extensions#tabline#enabled = 1
" Ale
let g:ale_open_list = 0
let g:ale_set_loclist = 0
let g:ale_ruby_rubocop_executable = 'bundle'
let g:ale_eruby_erblint_executable = 'bundle'
let g:ale_linters = {
\ 'ruby': ['rails_best_practices', 'reek', 'rubocop', 'ruby'],
\}
let g:ale_set_signs = 0
" EasyAlign
" Motion/Text Object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" Visual Mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" FZF
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden'
let g:fzf_files_options = '--preview "bat" --bind alt-j:preview-down,alt-k:preview-up,ctrl-d:preview-page-down,ctrl-u:preview-page-up'
map <c-f>f :Files<CR>
map <c-f>h :History<CR>
map <c-f>l :Lines<CR>
map <c-f>b :Buffer<CR>
map <c-f>m :Marks<CR>
nmap <c-f><tab> <plug>(fzf-maps-n)
xmap <c-f><tab> <plug>(fzf-maps-x)
omap <c-f><tab> <plug>(fzf-maps-o)
imap <c-f><tab> <plug>(fzf-maps-i)
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-j> <plug>(fzf-complete-file-rg)
imap <c-x><c-l> <plug>(fzf-complete-line)
" Infer Debugger
nmap <Leader>P :call AddDebugger("O")<cr>
nmap <Leader>p :call AddDebugger("o")<cr>
nmap <Leader>d :call RemoveAllDebuggers()<cr>
" Livedown
nmap gm :LivedownToggle<cr>
" Localorie
nnoremap <silent> <leader>lt :call localorie#translate()<CR>
nnoremap <silent> <leader>le :call localorie#expand_key()<CR>
" Rainbow Parens
let g:rainbow_active = 1
" Rubocop
nmap <Leader>ra :RuboCop -a<CR>
" Sql Utilities
vmap <silent>sf <Plug>SQLU_Formatter<CR>
nmap <silent>scl <Plug>SQLU_CreateColumnList<CR>
nmap <silent>scd <Plug>SQLU_GetColumnDef<CR>
nmap <silent>scdt <Plug>SQLU_GetColumnDataType<CR>
nmap <silent>scp <Plug>SQLU_CreateProcedure<CR>
" Surround
let g:surround_45 = "<% \r %>"
let g:surround_62 = "<%= \r %>"
" Switch
let g:switch_mapping = "<leader>sw"
" UltiSnips
let g:UltiSnipsExpandTrigger = "<nop>"
let g:ulti_expand_or_jump_res = 0
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
let g:UltiSnipsEditSplit="vertical"
function ExpandSnippetOrCarriageReturn()
let snippet = UltiSnips#ExpandSnippetOrJump()
if g:ulti_expand_or_jump_res > 0
return snippet
else
return "\<CR>"
endif
endfunction
inoremap <expr> <CR> pumvisible() ? "<C-R>=ExpandSnippetOrCarriageReturn()<CR>" : "\<CR>"
nmap <leader>sp :Snippets<CR>a
nmap <leader>sn :UltiSnipsEdit<CR>
" Vim Fugitive
nmap <silent> <leader>b :Git blame<CR>
nmap <silent> <leader>s :Gstatus<CR>
nmap <silent> <leader>pu :Gpush -u origin HEAD<CR>
" Vim Rhubarb
nnoremap <Leader>gh :.GBrowse<CR>
xnoremap <Leader>gh :'<'>GBrowse<CR>
" Vim Test
let g:test#echo_command = 0
let g:test#preserve_screen = 1
let test#strategy = "vimux"
let test#ruby#use_binstubs = 0
nmap <silent> <leader>T :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
nmap <silent> <leader>g :TestVisit<CR>
nmap <silent> <leader>l :TestLast<CR>
nmap <silent> <leader>o :TestSuite --only-failures<CR>
nmap <silent> <leader>t :TestNearest<CR>