summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-10-25 10:17:35 +0300
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-10-25 10:17:35 +0300
commitcd28de4f06cf1c189b08412519b8df0af43a2e3b (patch)
treead8f866c181931f6ef96c3dff5055ce0a46336f8
parent57b7f94031d6fc8089a9ef52a60bfd9a0136e4ee (diff)
downloaddotfiles-cd28de4f06cf1c189b08412519b8df0af43a2e3b.tar
dotfiles-cd28de4f06cf1c189b08412519b8df0af43a2e3b.tar.gz
dotfiles-cd28de4f06cf1c189b08412519b8df0af43a2e3b.zip
Added file and dictionary autocompletion, as well as Pug integration
-rw-r--r--.vimrc56
1 files changed, 39 insertions, 17 deletions
diff --git a/.vimrc b/.vimrc
index cf95864..1fa6e8b 100644
--- a/.vimrc
+++ b/.vimrc
@@ -18,14 +18,20 @@
Plug 'kien/tabman.vim' " Show open buffers
""" Software development
- Plug 'prabirshrestha/vim-lsp' " LSP servers in Vim
- Plug 'prabirshrestha/asyncomplete.vim' " Autocompletion from LSP server
- Plug 'prabirshrestha/asyncomplete-lsp.vim' " Integration with vim-lsp
- Plug 'mattn/vim-lsp-settings' " Automatic LSP server configuration
- Plug 'honza/vim-snippets' " Ready snippets for some languages
- Plug 'editorconfig/editorconfig-vim' " Support for EditorConfig
- Plug 'zivyangll/git-blame.vim' " Show who last edited a line
- Plug 'wakatime/vim-wakatime' " Time tracking via wakatime.com
+ Plug 'prabirshrestha/vim-lsp' " LSP servers in Vim
+ Plug 'prabirshrestha/asyncomplete.vim' " Autocompletion from LSP server
+ Plug 'prabirshrestha/asyncomplete-lsp.vim' " Integration with vim-lsp
+ Plug 'prabirshrestha/asyncomplete-file.vim' " File path autocompletion
+ Plug 'htlsne/asyncomplete-look' " Word (dictionary) autocompletion (via look and words linux packages)
+ Plug 'mattn/vim-lsp-settings' " Automatic LSP server configuration
+ Plug 'honza/vim-snippets' " Ready snippets for some languages
+ Plug 'editorconfig/editorconfig-vim' " Support for EditorConfig
+ Plug 'zivyangll/git-blame.vim' " Show who last edited a line
+ Plug 'wakatime/vim-wakatime' " Time tracking via wakatime.com
+
+ """ Language integration
+ Plug 'dNitro/vim-pug-complete', { 'for': ['jade', 'pug'] } " Pug: Omnicompletion integration
+ Plug 'digitaltoad/vim-pug' " Pug: Filetype detection, identation, syntax highlighting
call plug#end()
" }}}
@@ -335,18 +341,34 @@
" }}}
" asyncomplete {{{
- inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
- inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
- " inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
- imap <c-space> <Plug>(asyncomplete_force_refresh)
+ " General {{{
+ inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
+ inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
+ " inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
+ imap <c-space> <Plug>(asyncomplete_force_refresh)
- " allow modifying the completeopt variable, or it will
- " be overridden all the time
- let g:asyncomplete_auto_completeopt = 0
+ " allow modifying the completeopt variable, or it will
+ " be overridden all the time
+ let g:asyncomplete_auto_completeopt = 0
- set completeopt=menuone,noinsert,noselect,preview
+ set completeopt=menuone,noinsert,noselect,preview
- autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
+ autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
+ " }}}
+
+ " Registering {{{
+ au User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#file#get_source_options({
+ \ 'name': 'file',
+ \ 'allowlist': ['*'],
+ \ 'priority': 10,
+ \ 'completor': function('asyncomplete#sources#file#completor')
+ \ }))
+ au User asyncomplete_setup call asyncomplete#register_source({
+ \ 'name': 'look',
+ \ 'allowlist': ['text', 'markdown'],
+ \ 'completor': function('asyncomplete#sources#look#completor'),
+ \ })
+ " }}}
" }}}
" vim-lsp {{{