1
0
Fork 0
This commit is contained in:
Vladimír Dudr 2022-11-11 20:03:55 +01:00
parent bebc7edbbc
commit 626f17e517
6 changed files with 107 additions and 14 deletions

View file

@ -124,11 +124,62 @@ local function normalizeTerminal() -- {{{
vim.g.terminal_color_15 = 15 vim.g.terminal_color_15 = 15
end -- }}} end -- }}}
local function normalizeCmpKindHighlight() -- {{{
vim.api.nvim_set_hl(0, 'CmpItemKindClass', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindConstant', { link = 'Constant' })
vim.api.nvim_set_hl(0, 'CmpItemKindConstructor', { link = 'Special' })
vim.api.nvim_set_hl(0, 'CmpItemKindEnum', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindEnumMember', { link = 'String' })
vim.api.nvim_set_hl(0, 'CmpItemKindField', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindFile', { link = 'File' })
vim.api.nvim_set_hl(0, 'CmpItemKindFolder', { link = 'Directory' })
vim.api.nvim_set_hl(0, 'CmpItemKindFunction', { link = 'Function' })
vim.api.nvim_set_hl(0, 'CmpItemKindInterface', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindKeyword', { link = 'Keyword' })
vim.api.nvim_set_hl(0, 'CmpItemKindMethod', { link = 'Function' })
vim.api.nvim_set_hl(0, 'CmpItemKindModule', { link = 'Include' })
vim.api.nvim_set_hl(0, 'CmpItemKindProperty', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindSnippet', { link = 'Special' })
vim.api.nvim_set_hl(0, 'CmpItemKindStruct', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindText', { link = 'String' })
vim.api.nvim_set_hl(0, 'CmpItemKindTypeParameter', { link = 'Identifier' })
vim.api.nvim_set_hl(0, 'CmpItemKindValue', { link = 'String' })
vim.api.nvim_set_hl(0, 'CmpItemKindVariable', { link = 'Identifier' })
end -- }}}
local function copyFg(to, from, opts)
local cterm = vim.api.nvim_get_hl_by_name(from, false)
local gui = vim.api.nvim_get_hl_by_name(from, true)
local o = vim.tbl_extend('force', { ctermfg = cterm.foreground, fg = gui.foreground }, opts or {})
vim.api.nvim_set_hl(0, to, o)
end
local function clear(hl)
vim.api.nvim_set_hl(0, hl, {})
end
local function link(hl, to)
vim.api.nvim_set_hl(0, hl, { link = to })
end
local function normalizeTroubleHighlight() -- {{{
clear('TroubleText')
copyFg('TroubleFoldIcon', 'CursorLineNr')
copyFg('TroubleLocation', 'LineNr')
copyFg('TroubleIndent', 'LineNr')
copyFg('TroubleSignInformation', 'DiagnosticSignInfo')
-- TroubleCount xxx links to TabLineSel
-- copyFg('TroubleError', 'DiagnosticError')
link('TroubleSignError', 'DiagnosticError')
link('TroubleSignWarning', 'DiagnosticSignWarn')
link('TroubleSignHint', 'DiagnosticHint')
vim.api.nvim_set_hl(0, 'TroubleNormal', {})
end -- }}}
local function customLinks() local function customLinks()
local cterm = vim.api.nvim_get_hl_by_name('Normal', false) copyFg('Function', 'Normal')
local gui = vim.api.nvim_get_hl_by_name('Normal', true) copyFg('Operator', 'Normal')
vim.api.nvim_set_hl(0, 'Function', { ctermfg = cterm.foreground, fg = gui.foreground })
vim.api.nvim_set_hl(0, 'Operator', { ctermfg = cterm.foreground, fg = gui.foreground })
end end
local augr = vim.api.nvim_create_augroup('config_colorscheme', {}); local augr = vim.api.nvim_create_augroup('config_colorscheme', {});
@ -139,6 +190,25 @@ vim.api.nvim_create_autocmd('Colorscheme', {
normalizeTSHighlight() normalizeTSHighlight()
customLinks() customLinks()
normalizeTerminal() normalizeTerminal()
normalizeCmpKindHighlight()
normalizeTroubleHighlight()
local bla
end
})
local troublegr = vim.api.nvim_create_augroup('TroubleCursorline', { clear = true })
vim.api.nvim_create_autocmd('WinEnter', {
group = troublegr,
pattern = '*Trouble',
callback = function()
vim.wo.cursorline = true
end
})
vim.api.nvim_create_autocmd('WinLeave', {
group = troublegr,
pattern = '*Trouble',
callback = function()
vim.wo.cursorline = false
end end
}) })
@ -153,6 +223,21 @@ vim.api.nvim_create_autocmd('Colorscheme', {
vim.api.nvim_set_hl(0, 'NeoTreeGitAdded', { link = 'GruvboxGreen' }) vim.api.nvim_set_hl(0, 'NeoTreeGitAdded', { link = 'GruvboxGreen' })
vim.api.nvim_set_hl(0, 'NeoTreeGitDeleted', { link = 'GruvboxRed' }) vim.api.nvim_set_hl(0, 'NeoTreeGitDeleted', { link = 'GruvboxRed' })
vim.api.nvim_set_hl(0, 'NeoTreeGitModified', { link = 'GruvboxOrange' }) vim.api.nvim_set_hl(0, 'NeoTreeGitModified', { link = 'GruvboxOrange' })
vim.api.nvim_set_hl(0, 'CmpItemAbbrMatch', { link = 'GruvboxAquaBold' })
vim.api.nvim_set_hl(0, 'CmpItemAbbrMatchFuzzy', { link = 'GruvboxAquaBold' })
local tbg = vim.api.nvim_get_hl_by_name('GruvboxBg0', false)
local bg = vim.api.nvim_get_hl_by_name('GruvboxBg0', true)
local tfg = vim.api.nvim_get_hl_by_name('GruvboxGray', false)
local fg = vim.api.nvim_get_hl_by_name('GruvboxGray', true)
vim.api.nvim_set_hl(0, 'LineNr',
{ fg = fg.foreground,
bg = bg.foreground,
ctermfg = tfg.foreground,
ctermbg = tbg.foreground,
underdotted = true
})
end end
}) })

View file

@ -16,11 +16,15 @@ end
local function on_attach(args) local function on_attach(args)
-- require "lsp_signature".on_attach() -- require "lsp_signature".on_attach()
-- require'completion'.on_attach() -- require'completion'.on_attach()
local bufnr = args.buf local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id) local client = vim.lsp.get_client_by_id(args.data.client_id)
if (client.server_capabilities.documentSymbolProvider) then
require('nvim-navic').attach(client, bufnr)
end
-- Mappings. -- Mappings.
local opts = { noremap = true, silent = true, buffer = args.buf } local opts = { noremap = true, silent = true, buffer = args.buf }

View file

@ -1,6 +1,7 @@
local M = {} local M = {}
function M.setup() function M.setup()
local navic = require('nvim-navic')
require 'lualine'.setup { require 'lualine'.setup {
options = { options = {
icons_enabled = true, icons_enabled = true,
@ -26,7 +27,9 @@ function M.setup()
lualine_z = {} lualine_z = {}
}, },
tabline = {}, tabline = {},
winbar = {}, winbar = {
lualine_c = { { navic.get_location, cond = navic.is_available } },
},
inactive_winbar = {}, inactive_winbar = {},
extensions = { 'neo-tree' } extensions = { 'neo-tree' }
} }

View file

@ -55,9 +55,9 @@ function M.setup()
git_status = { git_status = {
symbols = { symbols = {
-- Change type -- Change type
added = '', -- or "✚", but this is redundant info if you use git_status_colors on the name added = '', -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = '', -- or "", but this is redundant info if you use git_status_colors on the name modified = '', -- or "", but this is redundant info if you use git_status_colors on the name
deleted = '', -- this can only be used in the git_status source deleted = '', -- this can only be used in the git_status source
renamed = '', -- this can only be used in the git_status source renamed = '', -- this can only be used in the git_status source
-- Status type -- Status type
untracked = '', untracked = '',
@ -127,7 +127,7 @@ function M.setup()
nesting_rules = {}, nesting_rules = {},
filesystem = { filesystem = {
filtered_items = { filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items visible = true, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true, hide_dotfiles = true,
hide_gitignored = true, hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories hide_hidden = true, -- only works on Windows for hidden files/directories

View file

@ -5,6 +5,7 @@ function M.setup()
nls.setup({ nls.setup({
debug = false, debug = false,
temp_dir = vim.env.XDG_RUNTIME_DIR or '/tmp',
sources = { sources = {
nls.builtins.formatting.xmllint, nls.builtins.formatting.xmllint,
nls.builtins.formatting.jq, nls.builtins.formatting.jq,

View file

@ -48,6 +48,9 @@ function M.setup()
]], false) ]], false)
end } end }
use { "SmiteshP/nvim-navic", requires = "neovim/nvim-lspconfig"
}
use { 'rafamadriz/friendly-snippets' } use { 'rafamadriz/friendly-snippets' }
use 'hrsh7th/cmp-nvim-lsp-signature-help' use 'hrsh7th/cmp-nvim-lsp-signature-help'
@ -149,10 +152,7 @@ function M.setup()
requires = 'kyazdani42/nvim-web-devicons', requires = 'kyazdani42/nvim-web-devicons',
cmd = 'TroubleToggle', cmd = 'TroubleToggle',
keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>' }, keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>' },
config = function() require('trouble').setup({ config = function() require('configs.trouble').setup() end
mode = 'document_diagnostics'
})
end
} }
use { 'ziglang/zig.vim', ft = 'zig' } use { 'ziglang/zig.vim', ft = 'zig' }