1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00

Update nvim

This commit is contained in:
Henrik Hautakoski 2024-03-17 15:45:46 +01:00
parent 5286b45f9d
commit 4c1b128c96
15 changed files with 223 additions and 72 deletions

View file

@ -1,40 +1,44 @@
{
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
"LuaSnip": { "branch": "master", "commit": "a7a4b4682c4b3e2ba82b82a4e6e5f5a0e79dec32" },
"barbar.nvim": { "branch": "master", "commit": "1d6b1386abe97d1d8cba47eb9afa8a9f2d1bbe66" },
"barbar.nvim": { "branch": "master", "commit": "3c48b5edf61dda21ad41c514e53448fee366a824" },
"barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"dashboard": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"laravel.nvim": { "branch": "main", "commit": "5ef5296f9c943e88850591b5e21f17db62e874ee" },
"dressing.nvim": { "branch": "master", "commit": "18e5beb3845f085b6a33c24112b37988f3f93c06" },
"fd": { "branch": "master", "commit": "68fe31da3f5da5d8d5b997d8919dc97e6eafead5" },
"gitsigns.nvim": { "branch": "main", "commit": "4e348641b8206c3b8d23080999e3ddbe4ca90efc" },
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
"laravel.nvim": { "branch": "main", "commit": "ef57e6a138270374412553e769a3d38538d43abc" },
"lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
"lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" },
"lualine.nvim": { "branch": "master", "commit": "26dac2fcadb6e622790ab08e36d0dba3d3765398" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "55716a879568a498fa236593c8119789054a3b8e" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
"neo-tree.nvim": { "branch": "main", "commit": "230e9383c664061bdf3517c998ed1bf6ed409c59" },
"neo-tree.nvim": { "branch": "main", "commit": "742db4e60c74e5fbcc596aaf9e7575e1342dfd09" },
"neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" },
"neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" },
"neotest-phpunit": { "branch": "main", "commit": "2f01e83eedbcf6f0257934b32b5d4fda404a9f11" },
"neotest-phpunit": { "branch": "main", "commit": "d5e920ab861d175080524b9a3caa5ab8c372def0" },
"noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"none-ls.nvim": { "branch": "main", "commit": "ff3819c52ca04232fb70fbd6c1639de9abcbe122" },
"nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" },
"none-ls.nvim": { "branch": "main", "commit": "e25d2fcb24364b9cdb1e6b24a2399dfda5dbdf0c" },
"nui.nvim": { "branch": "main", "commit": "3dc46d725f7b94bee5117c0a699b57b1902b5d65" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" },
"nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" },
"nvim-lspconfig": { "branch": "master", "commit": "99330586c6e1912c890fc39d19d97571fde660cd" },
"nvim-treesitter": { "branch": "master", "commit": "488bec03254207b1dd071be8cb1fb78434b6e777" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" },
"nvim-lspconfig": { "branch": "master", "commit": "4bdd3800b4148f670c6cf55ef65f490148eeb550" },
"nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" },
"nvim-treesitter": { "branch": "master", "commit": "3ae78f376c2e721ce4feb23e9a5e8bc6062a2657" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "d2a4ffc22d9d38d44edb73da007b3cf43451e9b4" },
"nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
"telescope.nvim": { "branch": "master", "commit": "67c598fdd4fca113224281c85721c4d8a6df055e" },
"vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

View file

@ -0,0 +1,65 @@
return {
flavour = "mocha",
color_overrides = {
mocha = {
base = '#0E1019',
mantle = '#131521',
text = '#ECEEF4',
}
},
highlight_overrides = {
mocha = function(colors)
return {
CursorLine = { bg = colors.mantle },
-- indent lines
IblScope = { fg = colors.overlay2 },
BufferCurrent = { fg = colors.text, bg = colors.base },
-- BufferInactive = { bg=colors.base},
-- BufferOffset = { bg = colors.mantle },
-- BufferTabpageFill = {bg=colors.base},
-- Bufferbar
-- Syntax
Operator = { link = "@text" },
Function = { link = "@text" },
Delimiter = { link = "@text" },
Include = { fg = colors.yellow },
Keyword = { fg = colors.yellow },
Repeat = { link = "Keyword" },
Conditional = { link = "Keyword" },
Type = { fg = colors.blue },
String = { fg = colors.lavender },
["@constructor"] = { link = "Function" },
["@variable"] = { fg = colors.green },
["@variable.builtin"] = { link = "@variable" },
["@variable.parameter"] = { link = "@variable" },
["@variable.member"] = { link = "@variable" },
["@keyword.function"] = { link = "Keyword" },
["@keyword.return"] = { link = "Keyword" },
["@property"] = { link = "@variable" },
["@tag"] = { link = "Keyword" },
["@tag.delimiter"] = { link = "@text" },
["@punctuation"] = { link = "@text" },
["@punctuation.bracket"] = { link = "@punctuation" },
["@lsp.type.property"] = { link = "@variable" },
["@class_name.php"] = { link = "@text" },
["@extend_name.php"] = { link = "@text" },
["@implements_name.php"] = { link = "@text" },
["@namespace_name.php"] = { link = "@text" },
["@namespace_alias.php"] = { link = "@text" },
}
end
},
integrations = {
cmp = true,
treesitter = true,
barbar = true,
neotree = true,
noice = true,
telescope = {
enabled = true,
}
}
}

View file

@ -27,6 +27,7 @@ map("v", "<S-d>", ":m '>+1<CR>gv=gv", { silent = true, desc = "move current sele
-- copy/paste
map("x", "<leader>p", [["_dP]], { silent = true, desc = "Paste over selected text without losing content in \"-register" })
map({"n", "v"}, "<leader>y", [["+y]], { desc = "Yank to system clipboard register" })
map("n", "<leader>p", [["+p]], { desc = "Paste from system clipboard register" })
-- File operations
map("n", "<leader>fx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Set execute flag on current file" })
@ -50,3 +51,8 @@ map("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {
})
map("n", "Q", "<nop>")
-- diagnostics
map("n", "<leader>DD", vim.diagnostic.open_float, { desc = "Open"})
map("n", "<leader>Dn", vim.diagnostic.get_next, { desc = "Open"})
map("n", "<leader>Dp", vim.diagnostic.get_prev, { desc = "Open"})

View file

@ -22,7 +22,12 @@ set.cursorline = true
set.number = true
set.relativenumber = true
set.numberwidth = 5
set.statuscolumn = '%=%{v:relnum?v:relnum:v:lnum} %s '
-- sign column to the right.
--set.statuscolumn = '%=%{v:relnum?v:relnum:v:lnum} %s '
-- sign column to the left
set.statuscolumn = '%s %=%{v:relnum?v:relnum:v:lnum} '
-- indent
set.tabstop = 4
@ -38,10 +43,20 @@ vim.filetype.add({
},
})
-- Sign configuration
--
-- Diagnostics
--
local icons = require('config.icons').diagnostics
vim.fn.sign_define('DiagnosticSignError', { text = icons.error, texthl = 'DiagnosticSignError' })
vim.fn.sign_define('DiagnosticSignWarn', { text = icons.warn, texthl = 'DiagnosticSignWarn' })
vim.fn.sign_define('DiagnosticSignInfo', { text = icons.info, texthl = 'DiagnosticSignInfo' })
vim.fn.sign_define('DiagnosticSignHint', { text = icons.hint, texthl = 'DiagnosticSignHint' })
vim.diagnostic.config({
virtual_text = true,
severity_sort = true,
float = {
border = 'single',
source = 'always',
},
})

View file

@ -2,11 +2,11 @@ local icons = require('config.icons')
return {
'nvim-telescope/telescope.nvim',
tag = '0.1.4',
main = 'telescope',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons',
'sharkdp/fd',
{
"folke/which-key.nvim",
-- optional = true,

View file

@ -45,8 +45,7 @@ return {
["<S-Tab>"] = selectPrev,
["<Down>"] = selectNext,
["<Tab>"] = selectNext,
-- ["<esc>"] = close without removeing typed text,
["<S-space>"] = cmp.mapping.complete(),
["<esc>"] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
snippet = {
@ -54,24 +53,24 @@ return {
require('luasnip').lsp_expand(args.body)
end,
},
-- formatting = {
-- fields = { "abbr", "menu", "kind" },
-- format = function(entry, vim_item)
-- if vim.tbl_contains({ 'path' }, entry.source.name) then
-- local icon, hl_group = require('nvim-web-devicons').get_icon(entry:get_completion_item().label)
-- if icon then
-- vim_item.kind = icon
-- vim_item.kind_hl_group = hl_group
-- return vim_item
-- end
-- end
--
-- local opts = {
-- mode = 'symbol',
-- }
-- return require('lspkind').cmp_format(opts)(entry, vim_item)
-- end
-- },
formatting = {
fields = { "abbr", "menu", "kind" },
format = function(entry, vim_item)
if vim.tbl_contains({ 'path' }, entry.source.name) then
local icon, hl_group = require('nvim-web-devicons').get_icon(entry:get_completion_item().label)
if icon then
vim_item.kind = icon
vim_item.kind_hl_group = hl_group
return vim_item
end
end
local opts = {
mode = 'symbol',
}
return require('lspkind').cmp_format(opts)(entry, vim_item)
end
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'buffer' },

View file

@ -8,7 +8,10 @@ return {
opts = {
mappings = {
["<leader>rs"] = { vim.lsp.buf.rename, { desc = "Rename symbol" }},
gd = { vim.lsp.buf.definition, { desc = "Goto definition" }}
["<leader>ca"] = { vim.lsp.buf.code_action, { desc = "Code action" }},
gd = { vim.lsp.buf.definition, { desc = "Goto definition" }},
gi = { vim.lsp.buf.implementation, { desc = "Goto implementation"}},
gr = { vim.lsp.buf.references, { desc = "Goto references"}},
},
servers = {
phpactor = {
@ -19,7 +22,19 @@ return {
}
}
},
gopls = {},
gopls = {
format_on_save = true,
settings = {
gopls = {
analyses = {
unusedvariable = true,
unusedwrite = true,
useany = true
},
gofumpt = true,
},
},
},
lua_ls = {
settings = {
Lua = {
@ -41,6 +56,7 @@ return {
-- Setup Mason to automatically install LSP servers
require('mason').setup()
require('mason-lspconfig').setup({ automatic_installation = true })
local augroup = vim.api.nvim_create_augroup("Lsp", {})
local lspconfig = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false
@ -56,19 +72,49 @@ return {
border = "single",
})
local on_attach = function(ev)
for bind, settings in pairs(opts.mappings) do
vim.keymap.set('n', bind, settings[1], vim.tbl_deep_extend("force", settings[2], { buffer = ev.buf }))
end
end
for name, server_opt in pairs(opts.servers) do
local on_attach = function(client, bufnr)
for bind, settings in pairs(opts.mappings) do
vim.keymap.set('n', bind, settings[1], vim.tbl_deep_extend("force", settings[2], { buffer = bufnr }))
end
local settings = vim.tbl_deep_extend("force", server_opt.settings or {}, {
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
-- Add format on save if configured and client supports it.
if server_opt.format_on_save and client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
group = augroup,
buffer = bufnr,
callback = function()
vim.lsp.buf.format()
end,
})
end
vim.api.nvim_create_autocmd("CursorHold", {
group = augroup,
buffer = bufnr,
callback = function() vim.lsp.buf.document_highlight() end
})
vim.api.nvim_create_autocmd("CursorHoldI", {
group = augroup,
buffer = bufnr,
callback = function() vim.lsp.buf.document_highlight() end
})
vim.api.nvim_create_autocmd("CursorMoved", {
group = augroup,
buffer = bufnr,
callback = function() vim.lsp.buf.clear_references() end
})
end
lspconfig[name].setup({
settings = server_opt.settings or {},
capabilities = capabilities,
on_attach = on_attach
})
lspconfig[name].setup(settings)
end
end
}

View file

@ -15,6 +15,7 @@ return {
"cpp",
"ninja",
"cmake",
"dockerfile",
"make",
"lua",
"vim",
@ -24,6 +25,8 @@ return {
"phpdoc",
"blade",
"go",
"gomod",
"gosum",
"javascript",
"typescript",
"css",

View file

@ -31,9 +31,10 @@ require("lazy").setup({
{ import = "plugins.ui.dressing" },
{ import = "plugins.ui.noice" },
{ import = "plugins.ui.dashboard" },
{ import = "plugins.ui.colorscheme" },
{ import = "plugins.ui.catppuccin" },
{ import = "plugins.ui.neo-tree" },
{ import = "plugins.ui.barbar" },
{ import = "plugins.ui.barbecue" },
{ import = "plugins.ui.lualine" },
{ import = "plugins.ui.gitsigns" },
{ import = "plugins.ui.which-key" },
@ -45,9 +46,9 @@ require("lazy").setup({
{ import = "plugins.ide.lsp" },
{ import = "plugins.ide.dap" },
{ import = "plugins.ide.neotest" },
{ import = "plugins.ide.laravel" }
{ import = "plugins.ide.laravel" },
-- { import = "plugins.nvim-test" },
-- { import = "plugins.go" },
--{ import = "plugins.go" },
}, opts)

View file

@ -1,7 +0,0 @@
return {
"pnx/kodex.nvim",
dev = true,
config = function()
require('kodex').load()
end
}

View file

@ -16,7 +16,7 @@ return {
icons = {
separator = {left = '', right = ''},
separator_at_end = false,
inactive = { button = '' },
inactive = { button = '', separator = { left = '', right = ''} },
modified = {button = icons.filetree.git.modified },
pinned = {button = '', filename = true},
},

View file

@ -0,0 +1,12 @@
return {
"utilyre/barbecue.nvim",
name = "barbecue",
version = "*",
dependencies = {
"SmiteshP/nvim-navic",
"nvim-tree/nvim-web-devicons",
},
opts = {
theme = "catppuccin",
}
}

View file

@ -0,0 +1,10 @@
return {
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
opts = require('config.catppuccin'),
config = function (_, opts)
require("catppuccin").setup(opts)
vim.cmd.colorscheme("catppuccin")
end
}

View file

@ -12,30 +12,27 @@ return {
variables = 'none'
},
colors = {
fg = '#ffffff',
bg0 = '#282a33',
fg = '#b3b1b1',
bg0 = '#171b26',
bg1 = '#30323b',
bg2 = '#24262f',
bg3 = '#383a43',
bg_d = "#1f2129",
bg_blue = "#ff00ff",
bg_yellow = "#f0d197",
red = '#cc817f',
green = '#7ccfaf',
yellow = '#ffcc99',
orange = '#ffcc99',
blue = '#8ac6f2',
cyan = '#8abeb7',
purple = '#9999cc',
red = '#cc4a33',
green = '#51cc7f',
yellow = '#ccaf33',
orange = '#ccab1f',
blue = '#3390cc',
cyan = '#33ccb7',
purple = '#9233cc',
dark_cyan = "#8abeb7",
dark_red = "#cc817f",
dark_yellow = "#ffcc99",
dark_purple = "#9999cc",
},
highlights = {
-- ColorColumn = { bg = "$bg2"},
-- SignColumn = { bg = "$bg2"},
-- LineNr = { fg = "$light_grey", bg = "$bg2" }
LineNr = { fg = "$light_grey" },
CursorLineNr = { fg = "$blue" },
@ -55,7 +52,7 @@ return {
["@constant"] = { fg = "$green" },
["@tag"] = { fg = "$yellow" },
["@tag.delimiter"] = { fg = "$yellow" },
["@tag.attribute"] = { fg = "$cyan" },
["@tag.attribute"] = { fg = "$yellow" },
["@type"] = { fg = "$blue" },
["@type.qualifier"] = { fg = "$yellow" },
["@type.definition"] = { fg = "$blue" },
@ -91,6 +88,5 @@ return {
vim.cmd(string.format("highlight GitSignsAdd guifg='%s'", opts.colors.green))
vim.cmd(string.format("highlight GitSignsChange guifg='%s'", opts.colors.yellow))
vim.cmd(string.format("highlight GitSignsDelete guifg='%s'", opts.colors.red))
end
}

View file

@ -9,6 +9,7 @@ return {
},
opts = {
options = {
theme = "catppuccin-mocha",
component_separators = '',
globalstatus = true,
disabled_filetypes = {