-
Notifications
You must be signed in to change notification settings - Fork 0
/
minimimal-vimrc
121 lines (107 loc) · 4.29 KB
/
minimimal-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
" OS verification
if !exists("g:os")
if has("win64") || has("win32") || has("win16")
let g:os = "Windows"
else
let g:os = substitute(system('uname'), '\n', '', '')
endif
endif
" Current user
let g:current_user = $USER
let g:python3_host_prog = '/home/' . g:current_user . '/.pyenv/versions/neovim3/bin/python'
call plug#begin('~/.vim/plugged')
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'tomasr/molokai'
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
Plug 'lervag/vimtex'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-ultisnips'
Plug 'jalvesaq/Nvim-R'
Plug 'gaalcaras/ncm-R'
Plug 'lervag/vimtex'
Plug 'rafaqz/citation.vim'
Plug 'jalvesaq/zotcite'
Plug 'ncm2/ncm2-markdown-subscope'
Plug 'vim-pandoc/vim-pandoc'
Plug 'vim-pandoc/vim-pandoc-syntax'
Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown'
Plug 'iamcco/mathjax-support-for-mkdp'
Plug 'iamcco/markdown-preview.vim'
"Plug 'lervag/vim-rmarkdown'
Plug 'fgrsnau/ncm2-aspell'
call plug#end()
" https://github.com/neovim/neovim/issues/583
set clipboard=unnamed
" suppress the annoying 'match x of y', 'The only match' and 'Pattern not
" found' messages
set shortmess+=c
" CTRL-C doesn't trigger the InsertLeave autocmd . map to <ESC> instead.
inoremap <c-c> <ESC>
" When the <Enter> key is pressed while the popup menu is visible, it only
" hides the menu. Use this mapping to close the menu and also start a new
" line.
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
" Press enter key to trigger snippet expansion
" The parameters are the same as `:help feedkeys()`
inoremap <silent> <expr> <CR> ncm2_ultisnips#expand_or("\<CR>", 'n')
" c-j c-k for moving in snippet
let g:UltiSnipsExpandTrigger = "<Plug>(ultisnips_expand)"
let g:UltiSnipsJumpForwardTrigger = "<c-j>"
let g:UltiSnipsJumpBackwardTrigger = "<c-k>"
let g:UltiSnipsRemoveSelectModeMappings = 0
" Use <TAB> to select the popup menu:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
autocmd BufRead,BufNewFile *.rmd set filetype=rmarkdown
au BufEnter * call ncm2#enable_for_buffer()
let g:vimtex#re#deoplete = '\\(?:'
\ . '\w*cite\w*(?:\s*\[[^]]*\]){0,2}\s*{[^}]*'
\ . '|(text|block)cquote\*?(?:\s*\[[^]]*\]){0,2}\s*{[^}]*'
\ . '|(for|hy)\w*cquote\*?{[^}]*}(?:\s*\[[^]]*\]){0,2}\s*{[^}]*'
\ . '|\w*ref(?:\s*\{[^}]*|range\s*\{[^,}]*(?:}{)?)'
\ . '|hyperref\s*\[[^]]*'
\ . '|includegraphics\*?(?:\s*\[[^]]*\]){0,2}\s*\{[^}]*'
\ . '|(?:include(?:only)?|input)\s*\{[^}]*'
\ . '|\w*(gls|Gls|GLS)(pl)?\w*(\s*\[[^]]*\]){0,2}\s*\{[^}]*'
\ . '|includepdf(\s*\[[^]]*\])?\s*\{[^}]*'
\ . '|includestandalone(\s*\[[^]]*\])?\s*\{[^}]*'
\ . '|usepackage(\s*\[[^]]*\])?\s*\{[^}]*'
\ . '|documentclass(\s*\[[^]]*\])?\s*\{[^}]*'
\ . '|\w*'
\ .')'
au Filetype tex call ncm2#register_source({
\ 'name' : 'bibtex',
\ 'priority': 8,
\ 'complete_length': -1,
\ 'scope': ['tex', 'rmarkdown'],
\ 'matcher': {'name': 'combine',
\ 'matchers': [
\ {'name': 'prefix', 'key': 'word'},
\ {'name': 'abbrfuzzy', 'key': 'abbr'},
\ {'name': 'abbrfuzzy', 'key': 'menu'},
\ ]},
\ 'word_pattern': '\w+',
\ 'complete_pattern': g:vimtex#re#deoplete,
\ 'on_complete': ['ncm2#on_complete#omni', 'vimtex#complete#omnifunc'],
\ })
au User Ncm2Plugin call ncm2#register_source({
\ 'name' : 'vimtex',
\ 'priority': 1,
\ 'subscope_enable': 1,
\ 'complete_length': 1,
\ 'scope': ['tex', 'rmarkdown'],
\ 'mark': 'tex',
\ 'word_pattern': '\w+',
\ 'complete_pattern': g:vimtex#re#ncm,
\ 'on_complete': ['ncm2#on_complete#omni', 'vimtex#complete#omnifunc'],
\ })
" Auto-closes R
autocmd! VimLeave * if exists("g:SendCmdToR") && string(g:SendCmdToR) != "function('SendCmdToR_fake')" | call RQuit("nosave") | endif
set completeopt=noinsert,menuone,noselect
" https://github.com/neovim/neovim/issues/583
set clipboard=unnamed
colorscheme molokai