From 288a844e2563d022cc38d755dd0732be0700690d Mon Sep 17 00:00:00 2001 From: zoomiti Date: Tue, 18 Oct 2022 00:44:43 -0400 Subject: [PATCH] Adds `auto_pairs`, `trouble`, and `cmp_spell` plugins to Neovim --- .config/nvim/init.vim | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 11311f6..177ffbd 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -6,6 +6,9 @@ if empty(glob(data_dir . '/autoload/plug.vim')) endif call plug#begin() +" auto pairs +Plug 'LunarWatcher/auto-pairs' + " Lightline Plug 'itchyny/lightline.vim' @@ -58,10 +61,14 @@ Plug 'hrsh7th/cmp-nvim-lsp' Plug 'hrsh7th/cmp-path' Plug 'hrsh7th/cmp-buffer' Plug 'hrsh7th/cmp-nvim-lua' +Plug 'f3fora/cmp-spell' " Plug 'hrsh7th/cmp-copilot' Plug 'onsails/lspkind.nvim' Plug 'quangnguyen30192/cmp-nvim-ultisnips' +" Diagnostics +Plug 'folke/trouble.nvim' + " Telescope Plug 'nvim-telescope/telescope.nvim' Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } @@ -223,15 +230,16 @@ let g:lightline = { function! LightlineFilename() return &filetype ==# 'fugitive' ? fugitive#statusline() : \ &filetype ==# 'qf' ? 'QuickFix' : + \ &filetype ==# 'Trouble' ? 'Trouble' : \ expand('%:t') !=# '' ? expand('%:t') : '[No Name]' endfunction function! LightlineReadonly() - return &readonly && &filetype !~# '\v(help|fugitive)' ? 'RO' : '' + return &readonly && &filetype !~# '\v(help|fugitive|Trouble)' ? 'RO' : '' endfunction function! LightlineBranch() - return &filetype !~# '\v(help|fugitive|qf)' ? FugitiveHead() : '' + return &filetype !~# '\v(help|fugitive|qf|Trouble)' ? FugitiveHead() : '' endfunction " }}} @@ -275,6 +283,12 @@ let g:vim_markdown_frontmatter = 1 " }}} +" Auto-Pairs config {{{ +let g:AutoPairsMapBS = 1 + +" }}} + + " Autocompile dwmblocks {{{ if has("nvim") autocmd BufWritePost ~/desktop/dwmblocks/blocks.h :term cd ~/desktop/dwmblocks/; sudo make install && { killall -q dwmblocks;setsid -f dwmblocks > /dev/null 2> /dev/null ; } @@ -390,6 +404,14 @@ if has("nvim") { name = 'nvim_lsp' }, { name = 'nvim_lua' }, { name = 'ultisnips' }, + { name = 'spell', + option = { + enable_in_context = function() + return true --require('cmp.config.context').in_treesitter_capture('spell') + end, + }, + keyword_length = 3, + }, { name = 'path' }, }, { { name = 'buffer', keyword_length = 5}, @@ -403,6 +425,7 @@ if has("nvim") nvim_lua = "[api]", path = "[path]", ultisnips = "[snip]", + spell = "[spell]", --copilot = "[cop]", }, }, @@ -497,6 +520,12 @@ if has("nvim") }, } -- }}} --]] + + require("trouble").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } EOF endif