nvim
This commit is contained in:
parent
bebc7edbbc
commit
626f17e517
6 changed files with 107 additions and 14 deletions
|
@ -124,11 +124,62 @@ local function normalizeTerminal() -- {{{
|
|||
vim.g.terminal_color_15 = 15
|
||||
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 cterm = vim.api.nvim_get_hl_by_name('Normal', false)
|
||||
local gui = vim.api.nvim_get_hl_by_name('Normal', true)
|
||||
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 })
|
||||
copyFg('Function', 'Normal')
|
||||
copyFg('Operator', 'Normal')
|
||||
end
|
||||
|
||||
local augr = vim.api.nvim_create_augroup('config_colorscheme', {});
|
||||
|
@ -139,6 +190,25 @@ vim.api.nvim_create_autocmd('Colorscheme', {
|
|||
normalizeTSHighlight()
|
||||
customLinks()
|
||||
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
|
||||
})
|
||||
|
||||
|
@ -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, 'NeoTreeGitDeleted', { link = 'GruvboxRed' })
|
||||
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
|
||||
})
|
||||
|
||||
|
|
|
@ -16,11 +16,15 @@ end
|
|||
local function on_attach(args)
|
||||
-- require "lsp_signature".on_attach()
|
||||
-- require'completion'.on_attach()
|
||||
|
||||
local bufnr = args.buf
|
||||
|
||||
|
||||
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.
|
||||
local opts = { noremap = true, silent = true, buffer = args.buf }
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
local M = {}
|
||||
|
||||
function M.setup()
|
||||
local navic = require('nvim-navic')
|
||||
require 'lualine'.setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
|
@ -26,7 +27,9 @@ function M.setup()
|
|||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
winbar = {
|
||||
lualine_c = { { navic.get_location, cond = navic.is_available } },
|
||||
},
|
||||
inactive_winbar = {},
|
||||
extensions = { 'neo-tree' }
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ function M.setup()
|
|||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
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
|
||||
deleted = '✖', -- this can only be used in the git_status source
|
||||
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
|
||||
deleted = '', -- this can only be used in the git_status source
|
||||
renamed = '', -- this can only be used in the git_status source
|
||||
-- Status type
|
||||
untracked = '',
|
||||
|
@ -127,7 +127,7 @@ function M.setup()
|
|||
nesting_rules = {},
|
||||
filesystem = {
|
||||
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_gitignored = true,
|
||||
hide_hidden = true, -- only works on Windows for hidden files/directories
|
||||
|
|
|
@ -5,6 +5,7 @@ function M.setup()
|
|||
|
||||
nls.setup({
|
||||
debug = false,
|
||||
temp_dir = vim.env.XDG_RUNTIME_DIR or '/tmp',
|
||||
sources = {
|
||||
nls.builtins.formatting.xmllint,
|
||||
nls.builtins.formatting.jq,
|
||||
|
|
|
@ -48,6 +48,9 @@ function M.setup()
|
|||
]], false)
|
||||
end }
|
||||
|
||||
use { "SmiteshP/nvim-navic", requires = "neovim/nvim-lspconfig"
|
||||
}
|
||||
|
||||
use { 'rafamadriz/friendly-snippets' }
|
||||
|
||||
use 'hrsh7th/cmp-nvim-lsp-signature-help'
|
||||
|
@ -149,10 +152,7 @@ function M.setup()
|
|||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
cmd = 'TroubleToggle',
|
||||
keys = { 'n', '<space>t <Cmd>TroubleToggle<CR>' },
|
||||
config = function() require('trouble').setup({
|
||||
mode = 'document_diagnostics'
|
||||
})
|
||||
end
|
||||
config = function() require('configs.trouble').setup() end
|
||||
}
|
||||
|
||||
use { 'ziglang/zig.vim', ft = 'zig' }
|
||||
|
|
Loading…
Add table
Reference in a new issue