-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
209 lines (178 loc) · 6.12 KB
/
Copy path.vimrc
File metadata and controls
209 lines (178 loc) · 6.12 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
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
207
208
209
colo gruvbox
"colo solarized
set bg=dark
let mapleader = ","
"map <SPACE> <Nop>
"let mapleader = " "
nmap <SPACE> ,
noremap <C-q> :confirm qall<CR>
nnoremap <leader>x :!chmod +x %:p<CR>
nnoremap <leader>s :!%:p
nnoremap <leader>S :!%:p<CR>
nnoremap <leader>R :!rake<CR>
nnoremap <leader>b :Buffers<CR>
nnoremap <leader>f :FZF<CR>
nnoremap <leader>; @:
nnoremap <leader>m :!make<CR>
nnoremap <leader>G :!git add -u && git commit -m "lit update" && git push origin master<CR>
nnoremap <leader>e :!go run %:p<CR>
nnoremap <leader>r :Rg<CR>
nnoremap <Leader>p :bp<CR>
nnoremap <Leader>n :bn<CR>
nnoremap <Leader>w :w<CR>
nnoremap <Leader>/ :!date \| grep --color=always ':' && mpc<CR>
nnoremap <C-l> <C-l>zz
nnoremap <C-p> :Files<CR>
nnoremap <C-n> :Rg<CR>
let g:netrw_banner = 0
" markdown file linewidth rule
augroup filetype_settings
" Clear this autocmd group so that the settings won't get loaded over and
" over again
autocmd!
au BufRead,BufNewFile *.md setlocal textwidth=79 spell spelllang=en_us complete+=kspell
au BufRead,BufNewFile *.mail setlocal spell spelllang=en_us complete+=kspell
autocmd BufNewFile,BufReadPost *.md,README setlocal filetype=markdown
"au BufRead,BufNewFile *.tex setlocal spell spelllang=en_us complete+=kspell
autocmd BufNewFile,BufReadPost aliasrc,ctl* setlocal filetype=sh
autocmd BufNewFile,BufReadPost spec setlocal filetype=yaml
autocmd FileType make setlocal noexpandtab
for filetype in ['tex', 'plaintex', 'mail']
exe 'autocmd FileType ' . filetype . ' setlocal spell'
endfo
for filetype in ['yaml', 'sql', 'ruby', 'html', 'css', 'xml', 'php', 'vim']
exe 'autocmd FileType ' . filetype . ' setlocal sw=2 sts=2 ts=2'
endfor
augroup END
augroup modechange_settings
autocmd!
" Clear search context when entering insert mode, which implicitly stops the
" highlighting of whatever was searched for with hlsearch on. It should also
" not be persisted between sessions.
autocmd InsertEnter * let @/ = ''
autocmd BufReadPre,FileReadPre * let @/ = ''
autocmd InsertLeave * setlocal nopaste
" Jump to last position in file
autocmd BufReadPost *
\ if line("'\"") >= 1 && line("'\"") <= line("$") && &ft !~# 'commit'
\ | exe "normal! g`\""
\ | endif
" Balance splits on window resize
autocmd VimResized * wincmd =
augroup END
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file (restore to previous version)
if has('persistent_undo')
set undofile " keep an undo file (undo changes after closing)
endif
endif
" Add optional packages.
"
" The matchit plugin makes the % command work better, but it is not backwards
" compatible.
" The ! means the package won't be loaded right away but when plugins are
" loaded during initialization.
if has('syntax') && has('eval')
packadd! matchit
endif
filetype plugin indent on
syntax on
set spell
set display=truncate
set showcmd " display incomplete commands
set wildmenu " display completion matches in a status line
set history=200 " keep 200 lines of command line history
set clipboard=unnamed
set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab
set undofile
set splitright
set number
set autoindent
set relativenumber
set incsearch
set ignorecase
set linebreak
set smartcase
set cursorcolumn
set cursorline
set pastetoggle=<F2>
set shortmess=I
set backspace=indent,eol,start
set scrolloff=10 "defaults.vim is 5
set hlsearch
set ttimeout " time out for key codes
set ttimeoutlen=100 " wait up to 100ms after Esc for special key
set textwidth=79
set colorcolumn=+1
"set shellcmdflag=-ic "breaks vim
"augroup numbertoggle
" autocmd!
" autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
" autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
"augroup END
" Easy pane naviation
"map <C-j> <C-W>j
"map <C-k> <C-W>k
"map <C-h> <C-W>h
"map <C-l> <C-W>l
" Quickly move around (and into) command mode
imap jk <Esc>
imap kj <Esc>:
" Give :terminal Esc behavior
tnoremap <Esc> <C-\><C-n>
" minpac
packadd minpac
let s:plugins = exists('*minpac#init')
if !s:plugins "{{{
fun! InstallPlug() " Bootstrap plugin manager on new systems.
exe '!git clone https://github.com/k-takata/minpac.git ~/.vim/pack/minpac/opt/minpac'
" call minpac#update()
endfun
else
call minpac#init({'verbose': 3})
" minpac must have {'type': 'opt'} so that it can be loaded with `packadd`.
call minpac#add('k-takata/minpac', {'type': 'opt'})
" Additional plugins here.
call minpac#add('junegunn/fzf', { 'do': 'yes n \| ./install' })
call minpac#add('junegunn/fzf.vim')
call minpac#add('tpope/vim-surround')
call minpac#add('tpope/vim-endwise')
call minpac#add('tpope/vim-fugitive')
call minpac#add('fatih/vim-go')
call minpac#add('rust-lang/rust.vim')
call minpac#add('prabirshrestha/async.vim')
call minpac#add('prabirshrestha/vim-lsp')
call minpac#add('prabirshrestha/asyncomplete.vim')
call minpac#add('prabirshrestha/asyncomplete-lsp.vim')
call minpac#add('dense-analysis/ale')
call minpac#add('gruvbox-community/gruvbox')
call minpac#add('easymotion/vim-easymotion')
"call minpac#add('michaeljsmith/vim-indent-object')
"call minpac#add('tpope/vim-abolish')
"call minpac#add('michaeljsmith/vim-indent-object')
"call minpac#add('neoclide/coc.nvim', { 'rev': '*', 'do': { -> pack#coc_install() } })
"let g:fzf_command_prefix = 'Fz'
" minpac utility commands
command! PackUpdate call minpac#update()
command! PackClean call minpac#clean()
command! PackStatus call minpac#status()
endif
set backupdir=.backup/,~/.backup/,/tmp//
set directory=.swp/,~/.swp/,/tmp//
set undodir=.undo/,~/.undo/,/tmp//
highlight TrailingWhitespace ctermbg=red
call matchadd('TrailingWhitespace', '\s\+$')
autocmd BufRead *.rs :setlocal tags=./rusty-tags.vi;/,$RUST_SRC_PATH/rusty-tags.vi
let g:LanguageClient_serverCommands = {
\ 'rust': ['~/.cargo/bin/rustup', 'run', 'stable', 'rls'],
\ 'javascript': ['/usr/local/bin/javascript-typescript-stdio'],
\ 'javascript.jsx': ['tcp://127.0.0.1:2089'],
\ 'python': ['/usr/local/bin/pyls'],
\ 'ruby': ['~/.rbenv/shims/solargraph', 'stdio'],
\ }