neovim: diagnostics: only show under cursor and

use custom signcolumn icons using new lua
vim.diagnostic.config options

fix fzf pop-up colors

get sonokai, suda-vim from nixpkgs vimPlugins

bump vim-workspace

add apprentice, hybrid and airline colorschemes
This commit is contained in:
teutat3s 2022-04-09 16:47:28 +02:00
parent 11ea007899
commit 030bf9e808
Signed by: teutat3s
GPG key ID: 4FA1D3FA524F22C1
3 changed files with 53 additions and 34 deletions

View file

@ -15,33 +15,16 @@ let
}; };
}; };
sonokai = pkgs.vimUtils.buildVimPlugin {
name = "sonokai";
src = pkgs.fetchFromGitHub {
owner = "sainnhe";
repo = "sonokai";
rev = "51e7ee8b13f9c2e4eae33f8d745eaa1f320b0ae6";
sha256 = "0svqr6dnpk2p5qhb6j0rllns8f0f4886wxpx69wgazjx84bx728i";
};
};
suda = pkgs.vimUtils.buildVimPlugin {
name = "suda";
src = pkgs.fetchFromGitHub {
owner = "lambdalisue";
repo = "suda.vim";
rev = "fbb138f5090c3db4dabeba15326397a09df6b73b";
sha256 = "ztZ5UPd2y4Mkore/QLfMCwjM0Qy4eWCOw535NzDSfgY=";
};
};
workspace = pkgs.vimUtils.buildVimPlugin { workspace = pkgs.vimUtils.buildVimPlugin {
name = "vim-workspace"; name = "vim-workspace";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "thaerkh"; owner = "thaerkh";
repo = "vim-workspace"; repo = "vim-workspace";
rev = "faa835406990171bbbeff9254303dad49bad17cb"; rev = "c26b473f9b073f24bacecd38477f44c5cd1f5a62";
sha256 = "w6CcFcIplwUVcvx54rbTwThBxus1k7yHot2TpdNQ61M="; sha256 = "sha256-XV7opLyfkHIDO0+JJaO/x0za0gsHuklrzapTGdLHJmI=";
}; };
}; };
beautify = pkgs.vimUtils.buildVimPlugin { beautify = pkgs.vimUtils.buildVimPlugin {
name = "vim-beautify"; name = "vim-beautify";
src = pkgs.fetchFromGitHub { src = pkgs.fetchFromGitHub {
@ -51,6 +34,16 @@ let
sha256 = "QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ="; sha256 = "QPTCl6KaGcAjTS5yVDov9yxmv0fDaFoPLMsrtVIG6GQ=";
}; };
}; };
apprentice = pkgs.vimUtils.buildVimPlugin {
name = "vim-apprentice";
src = pkgs.fetchFromGitHub {
owner = "romainl";
repo = "Apprentice";
rev = "ecd41698037f15a58125b349be76dbd2595bfb6d";
sha256 = "sha256-9s7Yzn3IEJBjcyUq9NBIQ9wb45Xr7jOkEIoWf0lAYYg=";
};
};
in in
{ {
enable = true; enable = true;
@ -103,13 +96,16 @@ in
editorconfig-vim editorconfig-vim
nnn-vim nnn-vim
quick-scope quick-scope
suda suda-vim
syntastic syntastic
vim-gutentags vim-gutentags
vim-vinegar vim-vinegar
workspace workspace
sonokai sonokai
vim-hybrid-material
vim-airline-themes
apprentice
fugitive fugitive
vim-gitgutter vim-gitgutter

View file

@ -8,9 +8,10 @@ set completeopt=menuone,noinsert,noselect
" Avoid showing extra messages when using completion " Avoid showing extra messages when using completion
set shortmess+=c set shortmess+=c
" Configure neovim 5 experimental LSPs " Configure neovim 0.6+ experimental LSPs
" https://github.com/neovim/nvim-lspconfig " https://github.com/neovim/nvim-lspconfig
" https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md " https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
" https://github.com/neovim/nvim-lspconfig/wiki/UI-Customization
" https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/_config/plugin/nvim_lsp.lua " https://gitlab.com/Iron_E/dotfiles/-/blob/master/.config/nvim/lua/_config/plugin/nvim_lsp.lua
lua <<EOF lua <<EOF
local nvim_lsp = require('lspconfig') local nvim_lsp = require('lspconfig')
@ -175,21 +176,27 @@ lua <<EOF
{ name = 'luasnip' }, { name = 'luasnip' },
}, },
} }
EOF
" Visualize diagnostics -- Configure diagnostics
let g:diagnostic_enable_virtual_text = 1 vim.diagnostic.config({
let g:diagnostic_trimmed_virtual_text = '40' virtual_text = false,
" Don't show diagnostics while in insert mode signs = true,
let g:diagnostic_insert_delay = 1 underline = true,
update_in_insert = false,
severity_sort = false,
})
-- Change diagnostic symbols in the sign column (gutter)
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
EOF
" Show diagnostic popup on cursor hold " Show diagnostic popup on cursor hold
autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, { focus = false, scope = "cursor" }) autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, { focus = false, scope = "cursor" })
" Goto previous/next diagnostic warning/error
" nnoremap <silent> g[ <cmd>PrevDiagnosticCycle<cr>
" nnoremap <silent> g] <cmd>NextDiagnosticCycle<cr>
" have a fixed column for the diagnostics to appear in " have a fixed column for the diagnostics to appear in
" this removes the jitter when warnings/errors flow in " this removes the jitter when warnings/errors flow in
set signcolumn=yes set signcolumn=yes:2

View file

@ -14,3 +14,19 @@ let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
let g:airline_powerline_fonts = 1 " Use powerline fonts let g:airline_powerline_fonts = 1 " Use powerline fonts
let g:airline_theme = 'sonokai' let g:airline_theme = 'sonokai'
" Customize fzf colors to match your color scheme
" - fzf#wrap translates this to a set of `--color` options
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }