-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
282 lines (224 loc) · 7.91 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
"Standard {{{
set nocompatible
syntax on
set modelines=1
set encoding=utf-8
" }}}
"Vundle {{{
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'flazz/vim-colorschemes'
Plugin 'mhinz/vim-startify'
Plugin 'tpope/vim-rhubarb'
Plugin 'tpope/vim-fugitive'
Plugin 'airblade/vim-gitgutter'
Plugin 'morhetz/gruvbox'
Plugin 'Valloric/YouCompleteMe'
Plugin 'majutsushi/tagbar'
Plugin 'vim-airline/vim-airline'
Plugin 'junegunn/fzf'
Plugin 'junegunn/fzf.vim'
Plugin 'junegunn/goyo.vim'
Plugin 'junegunn/limelight.vim'
Plugin 'python-mode/python-mode'
Plugin 'vim-pandoc/vim-pandoc'
Plugin 'vim-pandoc/vim-pandoc-syntax'
Plugin 'reedes/vim-pencil'
Plugin 'vimwiki/vimwiki'
Plugin 'michal-h21/vim-zettel'
Plugin 'tbabej/taskwiki'
Plugin 'ervandew/supertab'
Plugin 'mbbill/undotree'
Plugin 'chrisbra/Colorizer'
Plugin 'mboughaba/i3config.vim'
Plugin 'rhysd/vim-grammarous'
Plugin 'dpelle/vim-LanguageTool'
Plugin 'w0rp/ale'
Plugin 'jalvesaq/Nvim-R'
call vundle#end()
filetype plugin indent on
" }}}
"Theme {{{
set termguicolors
" need to get gray relative numbers to work with gruvbox
" colorscheme 256-grayvim
set background=dark
let g:gruvbox_italics=1
let g:gruvbox_guisp_fallback = "bg"
colorscheme gruvbox
highlight Comment cterm=italic
highlight Folded cterm=italic
" highlight SpellBad cterm=underline,bold ctermbg=red
let g:airline_theme='gruvbox'
" }}}
"Basic settings {{{
"set cursorline
set ruler
set ignorecase
set smartcase
set autoread
set shortmess+=I
set showcmd
set showmatch " highlight matching [{()}]
set incsearch
set hlsearch
" and to turn off search highlighting -
nnoremap <leader><space> :nohlsearch<CR>
set nowrap
set backspace=indent,eol,start
set expandtab
set tabstop=4
set shiftwidth=4
set number relativenumber
set wildmenu
set lazyredraw
setlocal cm=blowfish2
set clipboard=unnamedplus
set foldenable
set nrformats= " All numbers treated as decimal
set mouse=a
set fillchars+=vert:│
" save session
nnoremap <leader>s :mksession<CR>
" }}}
"Global key mappings {{{
"Buffer switching
nmap <F8> :bprev<CR>
nmap <F9> :bnext<CR>
"Toggle relative numbering
nnoremap <F4> :set relativenumber!<CR>
" Quicker command by removing need for shift
nnoremap ; :
nnoremap : ;
" Enable folding with the spacebar
nnoremap <space> za
nnoremap <S-Space> zR
" Journal
nnoremap <leader>j :edit ~/Dropbox/personal/journal/2019.md<CR>
" Fix syntax in vimwiki
nnoremap <leader>v :set syntax=vimwiki.markdown<CR>
" Undo
nnoremap <F10> :UndotreeToggle<cr>
" Below don't work as conflict with fullscreen and yuquake
nnoremap <F11> :earlier<cr>
nnoremap <F12> :later<cr>
"}}}
" YouCompleteMe {{{
" Pandoc citekeys
if !exists('g:ycm_semantic_triggers')
let g:ycm_semantic_triggers = {}
endif
let g:ycm_semantic_triggers.pandoc = ['@']
let g:ycm_semantic_triggers.vimwiki = ['@']
let g:ycm_semantic_triggers.tex = ['@']
let g:ycm_filetype_blacklist = {
\ 'tagbar': 1,
\ 'qf': 1,
\ 'notes': 1,
\ 'unite': 1,
\ 'infolog': 1,
\ 'mail': 1,
\ 'gitcommit': 1,
\ 'pandoc': 1,
\ 'markdown': 1,
\ 'vimwiki': 1
\}
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_min_num_of_chars_for_completion = 1
let g:ycm_goto_buffer_command = 'split-or-existing-window'
nnoremap <leader>g :tab YcmCompleter GoTo<cr>
" }}}
"Python {{{
au BufNewFile,BufRead *.py
\ set autoindent fileformat=unix foldlevel=99
"}}}
"R {{{
" }}}
"Pencil & Markdown {{{
let g:pencil#wrapModeDefault = 'soft' " default is 'hard'
augroup pencil
autocmd!
autocmd FileType markdown,mkd call pencil#init()
autocmd FileType text call pencil#init()
augroup END
" Goyo
nnoremap <leader>f :Goyo 120<CR>
" Limelight
let g:limelight_conceal_ctermfg = 239
let g:limelight_conceal_guifg = '#3c3836'
let g:limelight_default_coefficient = 0.7
" }}}
" Pandoc {{{
let g:pandoc#folding#mode = 'syntax'
let g:pandoc#filetypes#handled = ["pandoc", "markdown", "rst"]
let g:pandoc#modules#enabled = ["formatting", "folding", "toc", "command", "menu", "bibliographies", "completion"]
let g:pandoc#folding#fold_yaml=1
let g:pandoc#syntax#conceal#urls=1
let g:pandoc#folding#fold_fenced_codeblocks = 1
let g:pandoc#syntax#codeblocks#embeds#langs = ["python"]
let g:pandoc#biblio#bibs = ["/home/alasdair/zettel/zettel.bib"]
" }}}
"Tagbar {{{
nmap <F7> :TagbarToggle<CR>
" }}}
" VimWiki {{{
" default vimwiki is <leader>ww
" Set VimWiki to use pandoc highlighting
" & set pandoc to recognise python code blocks
" au FileType vimwiki set syntax=vimwiki.markdown
au FileType vimwiki call pandoc#completion#Init()
au FileType vimwiki set syntax=markdown.pandoc | set foldexpr=pandoc#folding#FoldExpr()
let g:vimwiki_folding='expr'
au FileType vimwiki set nospell
au FileType vimwiki set foldlevel=20
let g:vimwiki_global_ext= 0
let g:vimwiki_list = [
\{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md',
\ 'python': 'python', 'markdown': 'markdown'},
\{'path': '~/zettel/',
\ 'syntax': 'markdown', 'ext': '.md'},
\{'path': '~/.disintegration/',
\ 'syntax': 'markdown', 'ext': '.md'},
\]
"Hotkey for zettel
nmap <leader>z 2<leader>ww
nmap <leader>d 3<leader>ww
let g:zettel_options = [
\{},
\ {"front_matter" : {"tags" : ""}, "template" : "~/Dropbox/notes/zettel/.zettel.tpl"},
\{}]
" }}}
" TaskWiki {{{
let g:taskwiki_markup_syntax = "markdown"
" }}}
" Spelling & Grammar {{{
map <F5> :setlocal spell! spelllang=en_gb<CR>
map <F6> :LanguageToolCheck<CR>
let g:languagetool_jar='$HOME/Applications/LanguageTool/languagetool-commandline.jar'
let g:languagetool_lang='en-GB'
let g:languagetool_enable_categories = 'PUNCTUATION,TYPOGRAPHY,CASING,COLLOCATIONS,CONFUSED_WORDS,CREATIVE_WRITING,GRAMMAR,MISC,MISUSED_TERMS_EU_PUBLICATIONS,NONSTANDARD_PHRASES,PLAIN_ENGLISH,TYPOS,REDUNDANCY,SEMANTICS,TEXT_ANALYSIS,STYLE,GENDER_NEUTRALITY'
let g:languagetool_enable_rules = 'AND_ALSO,ARE_ABLE_TO,ARTICLE_MISSING,AS_FAR_AS_X_IS_CONCERNED,BEST_EVER,BLEND_TOGETHER,BRIEF_MOMENT,CAN_NOT,CANT_HELP_BUT,COMMA_WHICH,EG_NO_COMMA,ELLIPSIS,EXACT_SAME,HONEST_TRUTH,HOPEFULLY,IE_NO_COMMA,IN_ORDER_TO,I_VE_A,NEGATE_MEANING,PASSIVE_VOICE,PLAN_ENGLISH,REASON_WHY,SENT_START_NUM,SERIAL_COMMA_OFF,SERIAL_COMMA_ON,SMARTPHONE,THREE_NN,TIRED_INTENSIFIERS,ULESLESS_THAT,WIKIPEDIA,WORLD_AROUND_IT'
let g:grammarous#enabled_categories = {'*' : ['PUNCTUATION', 'TYPOGRAPHY', 'CASING', 'COLLOCATIONS', 'CONFUSED_WORDS', 'CREATIVE_WRITING', 'GRAMMAR', 'MISC', 'PLAIN_ENGLISH', 'TYPOS', 'REDUNDANCY', 'SEMANTICS', 'TEXT_ANALYSIS', 'STYLE', 'GENDER_NEUTRALITY']}
let g:grammarous#enabled_rules = {'*' : ['AND_ALSO', 'ARE_ABLE_TO', 'ARTICLE_MISSING', 'AS_FAR_AS_X_IS_CONCERNED', 'BEST_EVER', 'BLEND_TOGETHER', 'BRIEF_MOMENT', 'CAN_NOT', 'CANT_HELP_BUT', 'COMMA_WHICH', 'EG_NO_COMMA', 'ELLIPSIS', 'EXACT_SAME', 'HONEST_TRUTH', 'HOPEFULLY', 'IE_NO_COMMA', 'IN_ORDER_TO', 'I_VE_A', 'NEGATE_MEANING', 'PASSIVE_VOICE', 'PLAN_ENGLISH', 'REASON_WHY', 'SENT_START_NUM', 'SERIAL_COMMA_OFF', 'SERIAL_COMMA_ON', 'SMARTPHONE', 'THREE_NN', 'TIRED_INTENSIFIERS', 'ULESLESS_THAT', 'WIKIPEDIA', 'WORLD_AROUND_IT']}
" }}}
" Airline {{{
let g:airline#extensions#wordcount#filetypes = ['asciidoc', 'help', 'mail', 'markdown', 'org', 'rst', 'tex', 'text',
\ 'pandoc', 'vimwiki']
let g:airline#extensions#ale#enabled = 1
" }}}
" ALE {{{
let g:ale_python_auto_pipenv = 1
let g:ale_fix_on_save = 1
let g:ale_python_flake8_executable = 'python3'
let g:ale_python_pylint_executable = 'pylint3'
let g:ale_linter_aliases = {'pandoc': ['markdown']}
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
" }}}
" Supertab {{{
" disabled as conflicts with vim-pandoc citations
"let g:SuperTabDefaultCompletionType="<c-x><c-o>"
" }}}
" vim:foldmethod=marker:foldlevel=0