-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvimrc
176 lines (140 loc) · 3.84 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
call plug#begin('~/.vim/plugged')
Plug 'honza/vim-snippets'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter', { 'on': '<plug>NERDCommenterToggle' }
Plug 'godlygeek/tabular', { 'on': 'Tabularize' }
Plug 'michaeljsmith/vim-indent-object'
Plug 'majutsushi/tagbar'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-fugitive' | Plug 'tpope/vim-rhubarb'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-eunuch'
Plug 'tpope/vim-projectionist'
Plug 'bronson/vim-trailing-whitespace'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
Plug 'w0rp/ale'
Plug 'airblade/vim-gitgutter'
Plug 'sheerun/vim-polyglot'
Plug 'editorconfig/editorconfig-vim'
Plug 'neoclide/coc.nvim', { 'branch': 'release' }
" avante.nvim
Plug 'stevearc/dressing.nvim'
Plug 'nvim-lua/plenary.nvim'
Plug 'MunifTanjim/nui.nvim'
Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make' }
" Add plugins to &runtimepath
call plug#end()
" Setup
set number
set ruler
set nowrap
set tabstop=2
set shiftwidth=2
set expandtab
set list
set backspace=indent,eol,start
set laststatus=2
" Chars
set listchars=""
set listchars=tab:\ \
set listchars+=trail:.
set listchars+=extends:>
set listchars+=precedes:<
" Search
set hlsearch
set incsearch
set ignorecase
set smartcase
" Colors
colorscheme default
if has('nvim')
colorscheme vim
endif
set background=dark
" Backup
set nobackup
" Mouse reporting
set mouse=a
" Fast redraw
set lazyredraw
set ttyfast
" Folding
set foldlevel=0
set foldmethod=manual
" Show break line symbol
" http://www.bestofvim.com/tip/better-line-wraps/
set showbreak=↪
" Split separator character
set fillchars+=vert:│
" Wrap to 80 characters
set textwidth=80
" Avoid word wrapping
set formatoptions-=t
" Use system's clipboard
set clipboard=unnamedplus
" Don't give |ins-completion-menu| messages
set shortmess+=c
" Always show signcolumns
set signcolumn=yes
" Leader key
let mapleader = ","
" Reselect visual block after indent/outdent
" http://vimbits.com/bits/20
vnoremap < <gv
vnoremap > >gv
" Use <Tab> as <Esc>
nnoremap <Tab> <Esc>
vnoremap <Tab> <Esc>gV
onoremap <Tab> <Esc>
" Use jk as <Esc> (INSERT mode)
" http://stevelosh.com/blog/2010/09/coming-home-to-vim/
inoremap jk <Esc>
" Easy switching between tabs
" http://syskall.com/my-biggest-vim-productivity-boost/
map <C-L> :tabn<CR>
map <C-H> :tabp<CR>
" Remap <C-@> as <C-space> to help terminals interpret it correctly
inoremap <C-@> <C-x><C-o>
" NERDTree toggle
map <Leader>n :NERDTreeToggle<CR> :NERDTreeMirror<CR>
" NERDCommenter toggle
map <Leader>/ <plug>NERDCommenterToggle<CR>
" Tagbar toggle
map <Leader>rt :TagbarToggle<CR>
" ALEFix toggle
map <Leader>f :ALEFix<CR>
" Fugitive
nmap <Leader>gb :Git blame<CR>
nmap <Leader>gs :Git status<CR>
nmap <Leader>gd :Git diff<CR>
nmap <Leader>gl :Git log<CR>
nmap <Leader>gc :Git commit<CR>
nmap <Leader>gp :Git push<CR>
" format the entire file
nnoremap <leader>fef :normal! gg=G``<CR>
" Bubble single lines
nmap <C-k> [e
nmap <C-j> ]e
" Bubble multiple lines
vmap <C-k> [egv
vmap <C-j> ]egv
" Open file finder
nnoremap <Leader>p :FZF<CR>
" Open file finder for current buffers
nnoremap <Leader>; :Buffers<CR>
" ALE
" https://github.com/dense-analysis/ale
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '⚠'
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 0
let g:ale_lint_delay = 100
let g:ale_linters = { 'javascript': ['eslint'], 'typescript': ['eslint'], 'typescriptreact': ['eslint'], 'ruby': ['rubocop'], 'elixir': ['elixir-ls'], 'haskell': ['hlint'] }
let g:ale_fixers = { 'javascript': ['prettier'], 'typescript': ['prettier'], 'typescriptreact': ['prettier'], 'ruby': ['rubocop'], 'elixir': ['mix_format'], 'haskell': ['hlint'], 'rust': ['rustfmt'] }
let g:ale_javascript_prettier_use_local_config = 1
let g:ale_ruby_rubocop_executable = 'bin/rubocop'
" NERDTree
" ignore list
let NERDTreeIgnore=['node_modules']