diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index f7002aa..c53ccda 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -29,60 +29,58 @@ autocmd VimEnter * " defines plugin directory " Install plugins from vim with :PlugInstall silent! if plug#begin('~/.local/share/nvim/plugged') + " base +Plug 'christoomey/vim-tmux-navigator' " allow seamless navigation between vim buffers and tmux splits +Plug 'jeffkreeftmeijer/vim-numbertoggle' " toggles numbers to absolute for all buffers but the current which is relative +Plug 'justinmk/vim-sneak' " jump between letters with improved fFtT quicksearch +Plug 'RRethy/vim-illuminate' " highlight other occurences of the word under cursor -" base -Plug 'christoomey/vim-tmux-navigator' -Plug 'jeffkreeftmeijer/vim-numbertoggle' -Plug 'justinmk/vim-sneak' -Plug 'RRethy/vim-illuminate' + " filedrawer +Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show a directory listing within vim +Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show git status in nerdtree for files and dirs -Plug 'scrooloose/nerdtree', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show a directory listing within vim -Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': ['NERDTreeToggle', 'NERDTreeFind'] } " show git status in nerdtree for files and dirs + " editing +Plug 'tpope/vim-commentary' " easily toggle comments for lines, paragraphs etc with gc +Plug 'tpope/vim-surround' " lets you change surrounding things with cs (or ds to del, ys to add) +Plug 'tommcdo/vim-exchange' " adds exchange operator with cx. common use: cxiw . on 2 words to switch +Plug 'jiangmiao/auto-pairs' " Auto close brackets and '' +Plug 'junegunn/vim-easy-align' " Align tables and other alignable things +Plug 'junegunn/vim-peekaboo' " Show the contents of regiseters on pasting from '', @, -" editing -Plug 'tpope/vim-commentary' " easily toggle comments for lines, paragraphs etc with gc -Plug 'tpope/vim-surround' " lets you change surrounding things with cs (or ds to del, ys to add) -Plug 'tommcdo/vim-exchange' " adds exchange operator with cx. common use: cxiw . on 2 words to switch -Plug 'jiangmiao/auto-pairs' " Auto close brackets and '' -Plug 'junegunn/vim-easy-align' " Align tables and other alignable things -Plug 'junegunn/vim-peekaboo' " Show the contents of regiseters on pasting from '', @, - -" Fuzzy matching + " Fuzzy matching Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --bin' } Plug 'junegunn/fzf.vim' -" ultimately the only thing left here should be a -Plug 'Shougo/deoplete.nvim' " automatic suggestions, can also perhaps be changed for newer plugs -Plug 'deoplete-plugins/deoplete-go', { 'do': 'make'} -Plug 'deoplete-plugins/deoplete-jedi' -Plug 'Shougo/echodoc.vim', {} -Plug 'desmap/ale-sensible' | Plug 'w0rp/ale' " asynchronous linting - might be superseded by lsp or coc.nvim at some point -" statusline +Plug 'neovim/nvim-lspconfig' " some commong language server configurations +Plug 'nvim-lua/completion-nvim' " simple completion engine built specifically for nvim and lsp +Plug 'desmap/ale-sensible' | Plug 'w0rp/ale' " asynchronous linting - might be superseded by lsp or coc.nvim at some point + " statusline Plug 'vim-airline/vim-airline' Plug 'vim-airline/vim-airline-themes' Plug 'edkolev/tmuxline.vim' -" Colorschemes + " Colorschemes Plug 'chriskempson/base16-vim' Plug 'reedes/vim-colors-pencil' -" RMarkdown & LaTeX workflow + " RMarkdown & LaTeX workflow Plug 'vim-pandoc/vim-pandoc-syntax' Plug 'vim-pandoc/vim-pandoc' -" Notes and Wiki -Plug 'dyng/ctrlsf.vim' -Plug 'lervag/wiki.vim' -Plug 'alok/notational-fzf-vim' -" Prose Workflow -Plug 'micarmst/vim-spellsync' " personal dict improvements for git sync -Plug 'ron89/thesaurus_query.vim' " find thesaurus backed synonyms for word under cursor -Plug 'kana/vim-textobj-user' " dependency for most other textobj plugins -Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detection -" and allows you to jump to the *end* of this or last sentence. -Plug 'reedes/vim-pencil', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide md convenience functions like hard/softwrap -Plug 'junegunn/goyo.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide distraction free writing + " Notes and Wiki +Plug 'dyng/ctrlsf.vim' " search-and-edit of many wiki files at once +Plug 'lervag/wiki.vim' " foundational wiki system, allowing links between plaintext files +Plug 'alok/notational-fzf-vim' " quickly search through the wiki + " Prose Workflow +Plug 'micarmst/vim-spellsync' " personal dict improvements for git sync +Plug 'ron89/thesaurus_query.vim' " find thesaurus backed synonyms for word under cursor +Plug 'kana/vim-textobj-user' " dependency for most other textobj plugins +Plug 'reedes/vim-textobj-sentence' " extends the capabilities of sentence detection + " and allows you to jump to the *end* of this or last sentence. + +Plug 'reedes/vim-pencil', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide md convenience functions like hard/softwrap +Plug 'junegunn/goyo.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide distraction free writing Plug 'junegunn/limelight.vim', { 'for': ['pandoc', 'markdown', 'txt'], 'on': 'Goyo' } " provide even distraction free-er writing (lowlight paragraphs) -" Language Integration -Plug 'sheerun/vim-polyglot' " syntax plugins for almost every language + " Language Integration +Plug 'sheerun/vim-polyglot' " syntax plugins for almost every language Plug 'stephpy/vim-yaml' Plug 'mhartington/nvim-typescript', {'for': 'typescript','do': './install.sh'} diff --git a/nvim/.config/nvim/lua/pandoc_complete.lua b/nvim/.config/nvim/lua/pandoc_complete.lua new file mode 100644 index 0000000..77b96ac --- /dev/null +++ b/nvim/.config/nvim/lua/pandoc_complete.lua @@ -0,0 +1,13 @@ +local M = {} + +function M.getCompletionItems(prefix) + -- define your total completion items + local items = vim.api.nvim_call_function('pandoc#completion#Complete',{0, prefix}) + return items +end + +M.complete_item = { + item = M.getCompletionItems +} + +return M diff --git a/nvim/.config/nvim/plugin/completion-nvim.vim b/nvim/.config/nvim/plugin/completion-nvim.vim new file mode 100644 index 0000000..79938d3 --- /dev/null +++ b/nvim/.config/nvim/plugin/completion-nvim.vim @@ -0,0 +1,59 @@ +" use completion-nvim for all buffers (not just lsp) +autocmd BufEnter * lua require'completion'.on_attach() + +"map to manually trigger completion +imap (completion_trigger) +imap (completion_trigger) + +" Add and to navigate through popup menu +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" + + +" Set completeopt to have a better completion experience +set completeopt=menuone,noinsert,noselect + +" Avoid showing message extra message when using completion +set shortmess+=c + +" set loop of strategies in descending order +let g:completion_matching_strategy_list = ['exact', 'substring', 'fuzzy'] + +" even when backtracking enable completion +let g:completion_trigger_on_delete = 1 + +" register new completion engines +" (set in rtp/lua/*_complete.lua) +" +" pandoc citation key completion +lua require'completion'.addCompletionSource('bibcite', require'pandoc_complete'.complete_item) + +" only call for specified shortcut, or with completion keys +augroup pandocCompletion + autocmd! + autocmd BufEnter * call SetupPandocCompletion() +augroup end +fun! SetupPandocCompletion() + if &ft =~ 'pandoc' + let g:completion_enable_auto_popup = 0 + let g:completion_trigger_character = ['@\w*'] + return + endif + let g:completion_enable_auto_popup = 1 + let g:completion_trigger_character = ['.'] +endfun + +" the completion chains for different filetypes +" see https://github.com/nvim-lua/completion-nvim/wiki/chain-complete-support +let g:completion_chain_complete_list = { + \ 'pandoc': [ + \ {'complete_items': ['bibcite', 'lsp', 'snippet']}, + \ {'mode': ''}, + \ {'mode': ''} + \], + \ 'default': [ + \ {'complete_items': ['lsp', 'snippet']}, + \ {'mode': ''}, + \ {'mode': ''} + \] +\} diff --git a/nvim/.config/nvim/plugin/deoplete.vim b/nvim/.config/nvim/plugin/deoplete.vim deleted file mode 100644 index c7fc5ce..0000000 --- a/nvim/.config/nvim/plugin/deoplete.vim +++ /dev/null @@ -1,20 +0,0 @@ -" PLUGIN: DEOPLETE -" For async completion -" enable deoplete at startup -let g:deoplete#enable_at_startup =1 - -call deoplete#custom#option( { - \ 'camel_case': v:true, - \ 'smart_case': v:true, - \ 'ignore_case': v:true, - \ 'refresh_always': v:true, - \ 'max_abbr_width': 0, - \ 'max_menu_width': 0 - \} ) - -call deoplete#custom#var('omni', 'input_patterns', { - \'pandoc': '@\w*', - \}) -call deoplete#custom#var('omni', 'functions', { - \'pandoc': 'pandoc#completion#Complete', - \}) diff --git a/nvim/.config/nvim/plugin/echodoc.vim b/nvim/.config/nvim/plugin/echodoc.vim deleted file mode 100644 index df1a2ac..0000000 --- a/nvim/.config/nvim/plugin/echodoc.vim +++ /dev/null @@ -1,7 +0,0 @@ -" PLUGIN: ECHODOC -let g:echodoc#type="virtual" -let g:echodoc_enable_at_startup=1 -set splitbelow -set completeopt+=menu,menuone,noinsert,noselect -set completeopt-=preview -autocmd CompleteDone * pclose diff --git a/nvim/.config/nvim/plugin/nvim-lspconfig.vim b/nvim/.config/nvim/plugin/nvim-lspconfig.vim new file mode 100644 index 0000000..9561622 --- /dev/null +++ b/nvim/.config/nvim/plugin/nvim-lspconfig.vim @@ -0,0 +1,4 @@ + +" enable python language servers +lua require'nvim_lsp'.pyls.setup{} +lua require'nvim_lsp'.vimls.setup{} diff --git a/nvim/.config/nvim/plugin/vim-polyglot.vim b/nvim/.config/nvim/plugin/vim-polyglot.vim index a73abef..75ba9c0 100644 --- a/nvim/.config/nvim/plugin/vim-polyglot.vim +++ b/nvim/.config/nvim/plugin/vim-polyglot.vim @@ -1,7 +1,7 @@ " PLUGIN: vim-polyglot " " we disable markdown so that every markdown file can be given pandoc type -let g:polyglot_disabled = ['markdown'] +" let g:polyglot_disabled = ['markdown'] au BufNewFile,BufRead *.{md,mdown,mkd,mkdn,markdown,mdwn} set ft=pandoc au BufNewFile,BufRead *.{md,mdown,mkd,mkdn,markdown,mdwn}.{des3,des,bf,bfa,aes,idea,cast,rc2,rc4,rc5,desx} set ft=pandoc