-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
192 lines (155 loc) · 3.79 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
set nocompatible
set title
set mouse=a
set shortmess=I
set visualbell
set colorcolumn=80
set encoding=utf-8
set hidden
set ignorecase
set incsearch
set number
set smartcase
set tabstop=2 shiftwidth=2 expandtab
set undofile
set undodir=~/.cache/undo.vim
set noswapfile
set nobackup
set nowritebackup
autocmd BufWritePre * :%s/\s\+$//e
autocmd BufNewFile,BufRead .envrc set syntax=bash
autocmd BufNewFile,BufRead .env set syntax=bash
""
"" Plugin
""
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips'
Plug 'Yggdroot/indentLine'
Plug 'airblade/vim-gitgutter'
Plug 'aliou/sql-heredoc.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'francoiscabrol/ranger.vim'
Plug 'honza/vim-snippets'
Plug 'itchyny/lightline.vim'
Plug 'liuchengxu/space-vim-dark'
Plug 'mboughaba/i3config.vim'
Plug 'mileszs/ack.vim'
Plug 'rhysd/vim-crystal'
Plug 'scrooloose/nerdcommenter'
Plug 'sheerun/vim-polyglot'
Plug 'thoughtbot/vim-rspec'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-endwise'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-surround'
Plug 'w0rp/ale'
Plug 'zivyangll/git-blame.vim'
call plug#end()
let g:space_vim_dark_background = 234
colorscheme space-vim-dark
hi Comment guifg=#5C6370 ctermfg=59
""
"" Keyboard
""
let mapleader=","
map ; :
cmap w!! w !sudo tee % >/dev/null
nnoremap <silent> <tab> :bnext<CR>
nnoremap <silent> <S-tab> :bprev<CR>
vnoremap <Leader>y "+yy
nnoremap <Leader>p "+p
nnoremap <Leader>' di'
nnoremap <Leader>" di"
nnoremap <Leader>S :%s//g<Left><Left>
nnoremap <Leader>D :%s//d<Left><Left>
inoremap <C-l> <Right>
inoremap <C-h> <Left>
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
nnoremap <silent> <Leader>b :<C-u>call gitblame#echo()<CR>
noremap <F4> :set hlsearch! hlsearch?<CR>
""
"" Plugin configuration
""
" Ack
let g:ack_use_dispatch = 1
let g:ackprg =
\ 'ag --nocolor --nogroup --hidden --skip-vcs-ignores --vimgrep
\ --ignore .git/
\ --ignore .github/
\ --ignore node_modules/
\ --ignore tmp/
\ --ignore bin/
\ --ignore dist/
\ --ignore public/
\ --ignore coverage/
\ --ignore coverage-js/
\ --ignore metrics/
\ --ignore log/
cnoreabbrev Ack Ack!
nnoremap <Leader>a :Ack!<Space>
" CtrlP
let g:ctrlp_use_caching = 1
let g:ctrlp_clear_cache_on_exit = 0
let g:ctrlp_max_files = 0
let g:ctrlp_user_command =
\ 'ag %s -i --nocolor --nogroup --hidden --skip-vcs-ignores
\ --ignore .git/
\ --ignore .github/
\ --ignore node_modules/
\ --ignore tmp/
\ --ignore bin/
\ --ignore dist/
\ --ignore public/
\ --ignore coverage/
\ --ignore coverage-js/
\ --ignore metrics/
\ --ignore log/
\ -g ""'
" LightLine
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'seoul256',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified', 'clock' ] ]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head'
\ },
\ 'component': {
\ 'clock': '%{strftime("%H:%M")}'
\ },
\ }
" GitGutter
let g:gitgutter_enabled = 0
noremap <F3> :GitGutterToggle<CR>
" Nerd Commenter
let g:NERDDefaultAlign = 'left'
let g:NERDSpaceDelims = 1
" PostgreSQL
let g:sql_type_default = 'pgsql'
" Ranger
let g:ranger_replace_netrw = 1
nnoremap <silent> = :Ranger<CR>
" ALE
let g:ale_enabled = 0
let g:ale_fixers = {
\ 'javascript': ['standard'],
\ 'ruby': ['rubocop']
\}
" VueJS
let g:vue_pre_processors = []
" RSpec
let g:rspec_command = "!clear && echo '>> rspec {spec}' && bundle exec rspec {spec}"
" Markdown
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_conceal = 0
let g:vim_markdown_conceal_code_blocks = 0
" UtilSnips
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<c-s>"
let g:UltiSnipsJumpBackwardTrigger="<c-a>"