diff --git a/.config/nvim/UltiSnips/lean3.snippets b/.config/nvim/UltiSnips/lean3.snippets deleted file mode 100644 index 4b8106e..0000000 --- a/.config/nvim/UltiSnips/lean3.snippets +++ /dev/null @@ -1,23 +0,0 @@ -snippet \and "and" A -∧ -endsnippet - -snippet \or "and" A -∨ -endsnippet - -snippet \neg "not" A -¬ -endsnippet - -snippet \to "\to ->" A -→ -endsnippet - -snippet \iff "\iff <->" A -↔ -endsnippet - -snippet \forall "forrall" A -∀ -endsnippet diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index fae03cb..a55a963 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -5,6 +5,7 @@ if empty(glob(data_dir . '/autoload/plug.vim')) endif call plug#begin() +" CSS-Color Plug 'ap/vim-css-color' "Surround @@ -16,17 +17,19 @@ Plug 'lervag/vimtex' " For snippets Plug 'SirVer/ultisnips' -"LEAN REQUIRES NVIM if has("nvim") -Plug 'Julian/lean.nvim' +" LSP Plug 'neovim/nvim-lspconfig' -Plug 'nvim-lua/plenary.nvim' +Plug 'hrsh7th/cmp-nvim-lsp' +Plug 'hrsh7th/nvim-cmp' " For LSP completion -Plug 'hrsh7th/nvim-compe' " For LSP completion +"Lean requires nvim +Plug 'Julian/lean.nvim' +Plug 'nvim-lua/plenary.nvim' Plug 'andrewradev/switch.vim' " For Lean switch support end -call plug#end() +call plug#end() " Conceal options hi clear Conceal @@ -40,29 +43,26 @@ let g:UltiSnipsJumpBackwardTrigger="" set encoding=utf-8 +set completeopt=menu,menuone,noselect + " Tab AutoComplete function! InsertTabWrapper() - let col = col('.') - 1 - if !col || getline('.')[col - 1] !~ '\k' - return "\" - else - return "\" - endif + let col = col('.') - 1 + if !col || getline('.')[col - 1] !~ '\k' + return "\" + else + return "\" + endif endfunction + inoremap InsertTabWrapper() inoremap " Make set makeprg=make\ --silent\ 2>&1\ \\\|\ grep\ -E\ \"^([^:\\S]+):\\S+:.+\" -" Vim5 and later versions support syntax highlighting. Uncommenting the next -" line enables syntax highlighting by default. syntax on -" If using a dark background within the editing area and syntax highlighting -" turn on this option as well -"set background=dark - " Uncomment the following to have Vim jump to the last position when " reopening a file au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif @@ -123,18 +123,47 @@ end " Source a global configuration file if available if filereadable("/etc/vim/vimrc.local") - source /etc/vim/vimrc.local + source /etc/vim/vimrc.local endif " LSP Setup if has("nvim") lua <'] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.close(), + [''] = cmp.mapping.confirm({ select = true }), + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + -- { name = 'vsnip' }, -- For vsnip users. + -- { name = 'luasnip' }, -- For luasnip users. + { name = 'ultisnips' }, -- For ultisnips users. + -- { name = 'snippy' }, -- For snippy users. + }, { + { name = 'buffer' }, + }) + }) + + -- Setup lspconfig. + local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) + require('lspconfig')['texlab'].setup { capabilities = capabilities } + local function on_attach(client, bufnr) local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end @@ -158,43 +187,43 @@ lua <