From 323c5af1847ce92b225364338376134e17331d8a Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 25 Jun 2022 17:33:51 +0200 Subject: Update to nvim 0.7 and use self-plugin for colorscheme --- .config/nvim/init.vim | 18 ++---------------- .config/nvim/lua/lsp_conf.lua | 37 +++++++++++++++++++------------------ 2 files changed, 21 insertions(+), 34 deletions(-) (limited to '.config/nvim') diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 9f4ec23..25fe8d6 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -1,6 +1,7 @@ autocmd! bufwritepost .vimrc source % call plug#begin('~/.vim/plugged') + Plug 'cespare/vim-toml', { 'branch': 'main' } Plug 'rust-lang/rust.vim' Plug 'nvim-lua/plenary.nvim' @@ -25,7 +26,7 @@ Plug 'togglebyte/togglerust' " Debug Rust projects if has('nvim') Plug 'rktjmp/lush.nvim' - Plug 'ellisonleao/gruvbox.nvim' + Plug 'dcariotti/gruvbox.nvim' Plug 'nvim-telescope/telescope.nvim' Plug 'neovim/nvim-lspconfig' @@ -115,10 +116,6 @@ set background=dark if has('nvim') colorscheme gruvbox - " highlight CursorLineNr guibg=NONE guifg=#cc241d - " highlight Visual guibg=RED guifg=#ecf0f1 - " highlight TabLine guibg=#ffffff guifg=#2c3e50 - lua require('git') let g:coq_settings = { 'auto_start': v:true } lua require('lsp_conf') @@ -143,17 +140,6 @@ else colorscheme gruvbox endif -highlight Normal guibg=#080808 -highlight CursorLine guibg=NONE -highlight CursorLineNr guibg=NONE guifg=ORANGE -highlight Pmenu guibg=#222f3d guifg=#ecf0f1 -highlight PmenuSel guibg=#000000 guifg=#f1c40f -highlight StatusLine guibg=#ecf0f1 guifg=#080808 -highlight StatusLineNC guibg=#2c3e50 guifg=#080808 -highlight Visual guibg=#fbf1c7 guifg=#d65d0e -highlight ColorColumn guibg=#111111 - - " Figure out the system Python for Neovim. if exists("$VIRTUAL_ENV") let g:python3_host_prog=substitute(system("which -a python3 | head -n2 | tail -n1"), "\n", '', 'g') diff --git a/.config/nvim/lua/lsp_conf.lua b/.config/nvim/lua/lsp_conf.lua index e339a5c..35f88eb 100644 --- a/.config/nvim/lua/lsp_conf.lua +++ b/.config/nvim/lua/lsp_conf.lua @@ -11,10 +11,10 @@ for type, icon in pairs(signs) do vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = '' }) end -local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end +--local function vim.keymap.set(...) vim.api.nvim_vim.keymap.set(bufnr, ...) end local opts = { noremap=true, silent=true } -null_ls.config({ +null_ls.setup({ debug = false, save_after_format = false, sources = { @@ -48,11 +48,11 @@ for _, lsp in ipairs(servers) do local opts = { noremap=true, silent=true } -- See `:help vim.lsp.*` for documentation on any of the below functions - buf_set_keymap('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) - buf_set_keymap('n', 'gd', 'lua vim.lsp.buf.definition()', opts) - buf_set_keymap('n', 'K', 'lua vim.lsp.buf.hover()', opts) - buf_set_keymap('n', 'gr', 'lua vim.lsp.buf.references()', opts) - buf_set_keymap('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) + vim.keymap.set('n', 'gD', 'lua vim.lsp.buf.declaration()', opts) + vim.keymap.set('n', 'gd', 'lua vim.lsp.buf.definition()', opts) + vim.keymap.set('n', 'K', 'lua vim.lsp.buf.hover()', opts) + vim.keymap.set('n', 'gr', 'lua vim.lsp.buf.references()', opts) + vim.keymap.set('n', 'e', 'lua vim.lsp.diagnostic.show_line_diagnostics()', opts) end, flags = { debounce_text_changes = 150, @@ -60,18 +60,19 @@ for _, lsp in ipairs(servers) do } end -nvim_lsp["null-ls"].setup({ - on_attach = function(client) - if client.resolved_capabilities.document_formatting then - buf_set_keymap('n', '', 'lua vim.lsp.buf.formatting_sync()', opts) - vim.cmd "autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync()" - end - end -}) - +-- nvim_lsp["null-ls"].setup({ +-- on_attach = function(client) +-- if client.resolved_capabilities.document_formatting then +-- vim.keymap.set('n', '', 'lua vim.lsp.buf.formatting_sync()', opts) +-- vim.cmd "autocmd BufWritePre lua vim.lsp.buf.formatting_seq_sync()" +-- end +-- end +-- }) +-- +-- trouble.setup({ - use_lsp_diagnostic_signs = true, + use_diagnostic_signs = true, auto_close = true, - auto_open = true + auto_open = false }) -- cgit v1.2.3-18-g5258