-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc-mac
executable file
·206 lines (174 loc) · 5.62 KB
/
vimrc-mac
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
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#begin()
Plugin 'tommcdo/vim-lion'
"Plugin 'posva/vim-vue'
Plugin 'pangloss/vim-javascript'
Plugin 'jparise/vim-graphql'
"Plugin 'xuhdev/vim-latex-live-preview'
Plugin 'w0rp/ale'
Plugin 'sheerun/vim-polyglot'
"Plugin 'moll/vim-node'
Plugin 'The-NERD-tree'
Plugin 'Valloric/YouCompleteMe'
Plugin 'VundleVim/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'jiangmiao/auto-pairs'
"Plugin 'justinmk/vim-sneak'
"Plugin 'kchmck/vim-coffee-script'
"Plugin 'majutsushi/tagbar'
"Plugin 'othree/html5.vim'
"Plugin 'rhysd/vim-grammarous'
"Plugin 'rizzatti/dash.vim'
Plugin 'scrooloose/nerdcommenter'
"Plugin 'suan/vim-instant-markdown'
"Plugin 'tomasr/molokai'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-rails'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'vim-scripts/matchit.zip'
"Plugin 'xolox/vim-easytags'
"Plugin 'xolox/vim-misc'
"Plugin 'zenburn'
"Plugin 'ruby-matchit'
"All of your Plugins must be added before the following line
call vundle#end() "required
filetype plugin indent on "required
"___________________________________________________AFTER VUNDLE___________________________________________________
" ignore python3 errors
silent! py3 pass
"Spacebar folding
nnoremap <space> za
vnoremap <space> zf
"Set default register to system clipboard
set clipboard=unnamed
"<C-P> to :CtrlP
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
"Tagbar key map
nmap <F7> :TagbarToggle<CR>
"<F5> to :buffers
nnoremap <F5> :buffers<CR>:buffer<Space>
"Map Ctrl+N to Nerd Tree
map <C-n> :NERDTreeToggle<CR>
"Keep Airline from disappearing when NERDTree is gone
set laststatus=2
"make backspace work like most other apps
set backspace=2
"For fast navigation
set relativenumber
set number
" Damian Conway's Die Blinkënmatchen: highlight matches
nnoremap <silent> n n:call HLNext(0.1)<cr>
nnoremap <silent> N N:call HLNext(0.1)<cr>
function! HLNext (blinktime)
let target_pat = '\c\%#'.@/
let ring = matchadd('ErrorMsg', target_pat, 101)
redraw
exec 'sleep ' . float2nr(a:blinktime * 1000) . 'm'
call matchdelete(ring)
redraw
endfunction
"Enable syntax highlighting
syntax enable
"Highlight search results
set hlsearch
"Jump to search results as you type
set incsearch
"2-space tabs
set softtabstop=2
set shiftwidth=2
set expandtab
"auto indent
set autoindent
"Highlight line cursor is on
set cursorline
"We can use different key mappings for easy navigation between splits to save a keystroke. So instead of ctrl-w then j, it’s just ctrl-j
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
"Open new split panes to right and bottom, which feels more natural than Vim’s default
set splitbelow
set splitright
"To get rid of annoying .swp files in every directory
set backupdir=./.backup,.,/tmp
set directory=./.backup,.,/tmp
if !has("gui_running")
colorscheme Solarized
set background=dark
let g:airline_theme='solarized'
set t_Co=256
endif
"Toggle background
call togglebg#map("<F6>")
"Persistent undos [MUST run 'mkdir ~/.vim/undodir' for this to work]
if !&diff
set undodir=~/.vim/undodir
set undofile
endif
"----------------YOUCOMPLETEME----------------
let g:ycm_key_list_select_completion = ['<C-J>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-K>', '<Up>']
set completeopt-=preview
"----------------YOUCOMPLETEME----------------
"__________________DOCUMENTS__________________
"Turn on spell check in specific files
autocmd FileType markdown :setlocal spell spelllang=en_us
autocmd FileType text :setlocal spell spelllang=en_us
autocmd FileType tex :setlocal spell spelllang=en_us
"Set textwidth to 80 in specific files
autocmd FileType markdown :setlocal textwidth=80
autocmd FileType text :setlocal textwidth=80
autocmd FileType tex :setlocal textwidth=80
"__________________DOCUMENTS__________________
"_______________vim-grammarous_______________
"let g:grammarous#hooks = {}
"function! g:grammarous#hooks.on_check(errs) abort
"nmap <buffer>gn <Plug>(grammarous-move-to-next-error)<Plug>(grammarous-open-info-window)
"nmap <buffer>gp <Plug>(grammarous-move-to-previous-error)
"nmap <buffer>gr <Plug>(grammarous-remove-error)
"nmap <buffer>gf <Plug>(grammarous-fixit)
"nmap <buffer>gR <Plug>(grammarous-disable-rule)
"endfunction
"function! g:grammarous#hooks.on_reset(errs) abort
"nunmap <buffer>gn
"nunmap <buffer>gp
"nunmap <buffer>gr
"nunmap <buffer>gf
"nunmap <buffer>gR
"endfunction
"let g:grammarous#disabled_rules = {
"\ '*' : ['WHITESPACE_RULE', 'EN_QUOTES'],
"\ 'help' : ['WHITESPACE_RULE', 'EN_QUOTES', 'SENTENCE_WHITESPACE', 'UPPERCASE_SENTENCE_START'],
"\ }
"_______________vim-grammarous_______________
"
"_______________vim-latex-live-preview_______________
let g:livepreview_previewer = 'open -a Skim'
autocmd Filetype tex setl updatetime=1
"_______________vim-latex-live-preview_______________
"------------------vim-lion------------------
let g:lion_squeeze_spaces = 1
"------------------vim-lion------------------
"------------------ale------------------
let g:ale_sign_error = '✘'
let g:ale_sign_warning = '⚠'
highlight ALEErrorSign ctermbg=NONE ctermfg=red
highlight ALEWarningSign ctermbg=NONE ctermfg=yellow
let g:ale_linters = {
\ 'javascript': ['eslint'],
\}
let g:ale_fixers = {
\ 'javascript': ['eslint'],
\}
let g:ale_fix_on_save = 1
let g:ale_lint_on_save = 1
let g:ale_echo_msg_format = '%linter% says %s'
let g:ale_pattern_options = {
\ '.*dist/.*\.js$': {'ale_enabled': 0},
\}
"------------------ale------------------