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

big nvim update. maybe broke something

This commit is contained in:
Henrik Hautakoski 2024-03-10 10:36:20 +01:00
parent 1e68462bc1
commit 8a39a1b88a
32 changed files with 531 additions and 195 deletions

View file

@ -4,35 +4,38 @@
"barbar.nvim": { "branch": "master", "commit": "1d6b1386abe97d1d8cba47eb9afa8a9f2d1bbe66" }, "barbar.nvim": { "branch": "master", "commit": "1d6b1386abe97d1d8cba47eb9afa8a9f2d1bbe66" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"dashboard": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" }, "dashboard": { "branch": "master", "commit": "413442b12d85315fc626c44a0ce4929b213ef604" },
"dressing.nvim": { "branch": "master", "commit": "6f212262061a2120e42da0d1e87326e8a41c0478" },
"gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" }, "gitsigns.nvim": { "branch": "main", "commit": "2c2463dbd82eddd7dbab881c3a62cfbfbe3c67ae" },
"go.nvim": { "branch": "master", "commit": "43850d00feb887bc0195fe3331ff6fb76837f8e9" },
"guihua.lua": { "branch": "master", "commit": "9fb6795474918b492d9ab01b1ebaf85e8bf6fe0b" },
"indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" }, "indent-blankline.nvim": { "branch": "master", "commit": "821a7acd88587d966f7e464b0b3031dfe7f5680c" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" }, "laravel.nvim": { "branch": "main", "commit": "5ef5296f9c943e88850591b5e21f17db62e874ee" },
"lazy.nvim": { "branch": "main", "commit": "83493db50a434a4c5c648faf41e2ead80f96e478" },
"lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" },
"lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" }, "lualine.nvim": { "branch": "master", "commit": "8b56462bfb746760465264de41b4907310f113ec" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" },
"mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" },
"mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" }, "mini.comment": { "branch": "main", "commit": "a4b7e46deb9ad2feb8902cc5dbf087eced112ee5" },
"neo-tree.nvim": { "branch": "main", "commit": "459c60317cc1d251f6eb3b6f010d015d5d24b806" }, "neo-tree.nvim": { "branch": "main", "commit": "7f2ebdef3b55374390714ac7c0a7fe6b0dae498a" },
"neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" }, "neotest": { "branch": "master", "commit": "4440cc2227894c2ae9b0673a30e6cc6f1836e8c2" },
"neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" }, "neotest-go": { "branch": "main", "commit": "6a2f996d89fe4631942e035b1c114544ee045043" },
"neotest-phpunit": { "branch": "main", "commit": "2f01e83eedbcf6f0257934b32b5d4fda404a9f11" }, "neotest-phpunit": { "branch": "main", "commit": "2f01e83eedbcf6f0257934b32b5d4fda404a9f11" },
"nui.nvim": { "branch": "main", "commit": "b81333d12f824dbed5eb231c8a4409a290fdd848" }, "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" },
"none-ls.nvim": { "branch": "main", "commit": "ff3819c52ca04232fb70fbd6c1639de9abcbe122" },
"nui.nvim": { "branch": "main", "commit": "756c59f46057cd2d43619cd3a6d4e01b2aa60295" },
"nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-lspconfig": { "branch": "master", "commit": "c932a56bf25167b1e88d2a1ebe35bb774b41019a" }, "nvim-dap": { "branch": "master", "commit": "fc880e82059eb21c0fa896be60146e5f17680648" },
"nvim-test": { "branch": "main", "commit": "e06f3d029ee161f3ead6193cf27354d1eb8723c3" }, "nvim-dap-ui": { "branch": "master", "commit": "9720eb5fa2f41988e8770f973cd11b76dd568a5d" },
"nvim-treesitter": { "branch": "master", "commit": "63ca90eaa3ce1cc668add8828a9e3d6728dbbdf1" }, "nvim-lspconfig": { "branch": "master", "commit": "16295b79410f131c4fa7870c663b4ace6a761fb2" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "95933e762e28f9d38b572d65e7e4da9d2f4d90cb" }, "nvim-treesitter": { "branch": "master", "commit": "7ff51f53b0efb6228df2e8539b51bb2e737b77f3" },
"nvim-web-devicons": { "branch": "master", "commit": "4adea17610d140a99c313e3f79a9dc01825d59ae" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "b7a0bfa3e93697ca5b61b15df633404bf8f45883" },
"nvim-web-devicons": { "branch": "master", "commit": "75df79feb02d5e0ec114e447453775d4d291ea03" },
"onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" },
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, "plenary.nvim": { "branch": "master", "commit": "f7adfc4b3f4f91aab6caebf42b3682945fbc35be" },
"telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
"vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
} }

View file

@ -37,10 +37,13 @@ map("n", "<leader>bb", cmd.bp, { silent = true, desc = "Move to previous buffer"
map("n", "<leader>bd", cmd.bd, { silent = true, desc = "Close current buffer"}) map("n", "<leader>bd", cmd.bd, { silent = true, desc = "Close current buffer"})
-- Indent -- Indent
map('n', "<Tab>", "v=") map('n', "<Tab>", "^=$")
map('x', "<Tab>", "=", { desc = "auto indent selection" }) map('x', "<Tab>", "=", { desc = "auto indent selection" })
map("i", "<S-Tab>", "<C-d>", { desc = "delete indent" }) map("i", "<S-Tab>", "<C-d>", { desc = "delete indent" })
-- fix paste
map('n', "p", "p=$")
-- Crazy search+replace -- Crazy search+replace
map("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], { map("n", "<leader>rw", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]], {
desc = "search+replace word under cursor" desc = "search+replace word under cursor"

View file

@ -10,7 +10,7 @@ set.showmode = false -- disable mode in the command line, because i use lualine
-- --
-- Editor settings -- Editor settings
-- --
set.pumheight = 20
set.hlsearch = false set.hlsearch = false
set.incsearch = true set.incsearch = true
set.laststatus = 3 set.laststatus = 3
@ -38,3 +38,10 @@ vim.filetype.add({
}, },
}) })
-- Sign configuration
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' })

View file

@ -2,12 +2,12 @@ return {
{ '<leader>sf', '<cmd>Telescope find_files<cr>', desc = 'Search files' }, { '<leader>sf', '<cmd>Telescope find_files<cr>', desc = 'Search files' },
{ '<leader>sa', '<cmd>Telescope live_grep<cr>', desc = 'Search in files' }, { '<leader>sa', '<cmd>Telescope live_grep<cr>', desc = 'Search in files' },
{ '<leader>sg', '<cmd>Telescope git_files<cr>', desc = 'Search Git files' }, { '<leader>sg', '<cmd>Telescope git_files<cr>', desc = 'Search Git files' },
{ '<leader>so', '<cmd>Telescope oldfiles<cr>', desc = 'Search Old files' },
{ '<leader>sw', '<cmd>Telescope grep_string<cr>', desc = 'Search for word under cursor' }, { '<leader>sw', '<cmd>Telescope grep_string<cr>', desc = 'Search for word under cursor' },
-- LSP -- LSP
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' }, { '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
{ '<leader>ss', '<cmd>Telescope lsp_document_symbols<cr>', desc = 'Search document symbols' }, { '<leader>ss', '<cmd>Telescope lsp_document_symbols<cr>', desc = 'Search document symbols' },
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' }, { '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
{ '<leader>sr', '<cmd>Telescope lsp_references<cr>', desc = 'Search Reference' },
{ 'gd', '<cmd>Telescope lsp_definitions<cr>', desc = 'Goto definition' }, { 'gd', '<cmd>Telescope lsp_definitions<cr>', desc = 'Goto definition' },
} }

View file

@ -1,27 +0,0 @@
return {
'nvimdev/dashboard-nvim',
name = 'dashboard',
dependencies = {
'nvim-tree/nvim-web-devicons'
},
event = 'VimEnter',
opts = {
config = {
header = {
'::::::::: :::: ::: ::: :::',
':+: :+: :+:+: :+: :+: :+:',
'+:+ +:+ :+:+:+ +:+ +:+ +:+ ',
'+#++:++#+ +#+ +:+ +#+ +#++:+ ',
'+#+ +#+ +#+#+# +#+ +#+ ',
'#+# #+# #+#+# #+# #+#',
'### ### #### ### ###',
'',
},
shortcut = {
{ desc = '󰊳 Update', group = '@property', action = 'Lazy update', key = 'u' }
},
footer = {}
}
}
}

View file

@ -4,7 +4,8 @@ return{
opts = { opts = {
scope = { scope = {
enabled = true, enabled = true,
show_exact_scope = true, show_start = false,
show_end = false
}, },
exclude = { exclude = {
filetypes = { filetypes = {

View file

@ -6,7 +6,16 @@ return {
main = 'telescope', main = 'telescope',
dependencies = { dependencies = {
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons' 'nvim-tree/nvim-web-devicons',
{
"folke/which-key.nvim",
-- optional = true,
opts = {
defaults = {
["<leader>s"] = { name = "+search" },
},
},
},
}, },
keys = require('config.telescope'), keys = require('config.telescope'),
opts = function() opts = function()
@ -14,6 +23,17 @@ return {
return { return {
defaults = { defaults = {
path_display = { truncate = 1 }, path_display = { truncate = 1 },
-- borderchars = { "─", "│", "─", "│", "┌", "┐", "┘", "└" },
border = {
prompt = { 1, 1, 1, 1 },
results = { 1, 1, 1, 1 },
preview = { 1, 1, 1, 1 },
},
borderchars = {
prompt = { "", "", "", "", "", "", "", "" },
results = { "", "", " ", "", "", "", "", "" },
preview = { "", "", "", " ", "", "", "", "" },
},
prompt_prefix = ' ' .. icons.prompt .. ' ', prompt_prefix = ' ' .. icons.prompt .. ' ',
selection_caret = icons.current .. ' ', selection_caret = icons.current .. ' ',
multi_icon = icons.selected .. ' ', multi_icon = icons.selected .. ' ',

View file

@ -0,0 +1,133 @@
return {
'hrsh7th/nvim-cmp',
version = false,
event = "InsertEnter",
dependencies = {
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'onsails/lspkind-nvim',
},
opts = function()
local cmp = require('cmp')
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "NonText", default = true })
local selectPrev = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert })
local selectNext = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert })
local border = cmp.config.window.bordered({
border = {'', '', '', '', '', '', '', ''},
winhighlight = 'Normal:None,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None'
})
return {
completion = {
completeopt = "menu,menuone,noinsert",
},
-- enabled = function()
-- if require"cmp.config.context".in_treesitter_capture("comment")==true or require"cmp.config.context".in_syntax_group("Comment") then
-- return false
-- else
-- return true
-- end
-- end,
-- preselect = false,
view = {
entries = { name = 'custom', selection_order = 'near_cursor' },
},
window = {
documentation = border,
completion = border
},
mapping = {
["<Up>"] = selectPrev,
["<S-Tab>"] = selectPrev,
["<Down>"] = selectNext,
["<Tab>"] = selectNext,
-- ["<esc>"] = close without removeing typed text,
["<S-space>"] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
snippet = {
expand = function(args)
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
-- },
sources = {
{ name = 'nvim_lsp' },
{ name = 'buffer' },
{ name = 'path' },
{ name = 'luasnip' }
},
experimental = {
ghost_text = {
hl_group = "CmpGhostText",
},
},
}
end,
config = function(_, opts)
local cmp = require('cmp')
-- local has_words_before = function()
-- local line, col = unpack(vim.api.nvim_win_get_cursor(0))
-- return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
-- end
-- local moveDown = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_next_item()
-- elseif has_words_before() then
-- cmp.complete()
-- else
-- fallback()
-- end
-- end, { "i", "s" })
--
-- local moveUp = cmp.mapping(function(fallback)
-- if cmp.visible() then
-- cmp.select_prev_item()
-- else
-- fallback()
-- end
-- end, { "i", "s" })
cmp.setup(opts)
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(
vim.lsp.handlers.hover,
{border = 'single'}
)
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
focusable = true,
style = "minimal",
border = "single",
})
-- insert () on function completion using autopairs
cmp.event:on(
'confirm_done',
require('nvim-autopairs.completion.cmp').on_confirm_done()
)
end
}

View file

@ -0,0 +1,54 @@
return {
"mfussenegger/nvim-dap",
dependencies = {
{
"folke/which-key.nvim",
-- optional = true,
opts = {
defaults = {
["<leader>d"] = { name = "+debug" },
},
},
},
{
"rcarriga/nvim-dap-ui",
-- stylua: ignore
keys = {
{ "<leader>du", function() require("dapui").toggle({ }) end, desc = "Dap UI" },
{ "<leader>de", function() require("dapui").eval() end, desc = "Eval", mode = {"n", "v"} },
},
opts = {},
config = function(_, opts)
-- setup dap config by VsCode launch.json file
-- require("dap.ext.vscode").load_launchjs()
local dap = require("dap")
local dapui = require("dapui")
dapui.setup(opts)
dap.listeners.after.event_initialized["dapui_config"] = function()
dapui.open({})
end
dap.listeners.before.event_terminated["dapui_config"] = function()
dapui.close({})
end
dap.listeners.before.event_exited["dapui_config"] = function()
dapui.close({})
end
end,
},
},
keys = {
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},
config = function()
-- local Config = require("lazyvim.config")
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
-- for name, sign in pairs(Config.icons.dap) do
-- sign = type(sign) == "table" and sign or { sign }
-- vim.fn.sign_define(
-- "Dap" .. name,
-- { text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
-- )
-- end
end,
}

View file

@ -0,0 +1,17 @@
return {
"adalessa/laravel.nvim",
dependencies = {
"nvim-telescope/telescope.nvim",
"tpope/vim-dotenv",
"MunifTanjim/nui.nvim",
"nvimtools/none-ls.nvim",
},
cmd = { "Sail", "Artisan", "Composer", "Npm", "Yarn", "Laravel" },
keys = {
{ "<leader>la", ":Laravel artisan<cr>" },
{ "<leader>lr", ":Laravel routes<cr>" },
{ "<leader>lm", ":Laravel related<cr>" },
},
event = { "VeryLazy" },
config = true,
}

View file

@ -0,0 +1,47 @@
return {
'neovim/nvim-lspconfig',
dependencies = {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'hrsh7th/cmp-nvim-lsp',
},
opts = {
mappings = {
["<leader>rs"] = { vim.lsp.buf.rename, { desc = "Rename symbol" }}
},
servers = {
phpactor = {
init_options = {
["language_server_phpstan.enabled"] = true,
["language_server_psalm.enabled"] = false,
}
},
gopls = {}
},
},
config = function (_, opts)
-- Setup Mason to automatically install LSP servers
require('mason').setup()
require('mason-lspconfig').setup({ automatic_installation = true })
local lspconfig = require('lspconfig')
local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false
local on_attach = function(ev)
for bind, settings in pairs(opts.mappings) do
vim.keymap.set('n', bind, settings[0], vim.tbl_deep_extend("force", settings[1], { buffer = ev.buf }))
end
-- vim.keymap.set('n', '<leader>rs', vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename symbol" })
end
for name, settings in pairs(opts.servers) do
settings = vim.tbl_deep_extend("force", settings, {
capabilities = capabilities,
on_attach = on_attach
})
lspconfig[name].setup(settings)
end
end
}

View file

@ -5,14 +5,24 @@ return {
"antoinemadec/FixCursorHold.nvim", "antoinemadec/FixCursorHold.nvim",
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"nvim-neotest/neotest-go", "nvim-neotest/neotest-go",
"olimorris/neotest-phpunit" "olimorris/neotest-phpunit",
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>t"] = { name = "+test" },
},
},
},
}, },
keys = { keys = {
{"<leader>tn", ":lua require('neotest').run.run()<cr>", desc = "test nearest"}, {"<leader>tn", ":lua require('neotest').run.run()<cr>", desc = "test nearest", silent = true},
{"<leader>tf", ":lua require('neotest').run.run(vim.fn.expand('%'))<cr>", desc = "test file"}, {"<leader>tf", ":lua require('neotest').run.run(vim.fn.expand('%'))<cr>", desc = "test file"},
{"<leader>ta", ":lua require('neotest').output_panel.open()<cr>:lua require('neotest').run.run({suite = true})<cr>", desc = "test all"}, {"<leader>ta", ":lua require('neotest').output_panel.open()<cr>:lua require('neotest').run.run({suite = true})<cr>", desc = "test all"},
{"<leader>ts", ":lua require('neotest').run.stop()<cr>", desc = "stop test"}, {"<leader>ts", ":lua require('neotest').run.stop()<cr>", desc = "stop test"},
{"<leader>tq", ":lua require('neotest').output_panel.close()<cr>", desc = "close output window"}, {"<leader>tq", ":lua require('neotest').output_panel.close()<cr>", desc = "close output window"},
{"<leader>te", ":lua require('neotest').summary()<cr>"}
}, },
opts = function() opts = function()
local icons = require('config.icons').test local icons = require('config.icons').test
@ -28,10 +38,10 @@ return {
child_indent = "", child_indent = "",
child_prefix = "", child_prefix = "",
collapsed = "", collapsed = "",
expanded = "", expanded = "",
failed = icons.failed, failed = icons.failed,
final_child_indent = " ", final_child_indent = " ",
final_child_prefix = "", final_child_prefix = "",
non_collapsible = "", non_collapsible = "",
passed = icons.ok, passed = icons.ok,
running = icons.running, running = icons.running,

View file

@ -21,6 +21,7 @@ return {
"vimdoc", "vimdoc",
"query", "query",
"php", "php",
"phpdoc",
"blade", "blade",
"go", "go",
"javascript", "javascript",

View file

@ -11,44 +11,43 @@ if not vim.loop.fs_stat(lazypath) then
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
local opts = {
dev = {
path = "~/code/nvim_plugins",
}
}
require("lazy").setup({ require("lazy").setup({
{ import = "plugins.dashboard" }, -- Editor
--------------------
{ import = "plugins.editor.indent" },
{ import = "plugins.editor.autopairs" },
{ import = "plugins.editor.mini-comment" },
{ import = "plugins.editor.telescope" },
-- Highlight -- UI
{ import = "plugins.colorscheme" }, --------------------
{ import = "plugins.ui.dressing" },
{ import = "plugins.ui.noice" },
{ import = "plugins.ui.dashboard" },
{ import = "plugins.ui.colorscheme" },
{ import = "plugins.ui.neo-tree" },
{ import = "plugins.ui.barbar" },
{ import = "plugins.ui.lualine" },
{ import = "plugins.ui.gitsigns" },
{ import = "plugins.ui.which-key" },
{ import = "plugins.indent" }, -- IDE
{ import = "plugins.nvim-autopairs" }, --------------------
{ import = "plugins.mini-comment" }, { import = "plugins.ide.treesitter" },
{ import = "plugins.barbar" }, { import = "plugins.ide.cmp" },
{ import = "plugins.ide.lsp" },
{ import = "plugins.ide.dap" },
{ import = "plugins.ide.neotest" },
{ import = "plugins.ide.laravel" }
-- { import = "plugins.nvim-test" },
-- Filetree -- { import = "plugins.go" },
{ import = "plugins.neo-tree" }, }, opts)
-- Status line
{ import = "plugins.lualine" },
-- Fuzzy finder
{ import = "plugins.telescope" },
-- Keybind helper
{ import = "plugins.which-key" },
-- Treesitter
{ import = "plugins.treesitter" },
{ import = "plugins.neotest" },
-- LSP
{ import = "plugins.lsp" },
{ import = "plugins.nvim-cmp" },
{ import = "plugins.go" },
{ import = "plugins.nvim-test" },
-- Git changes in gutter
{ import = "plugins.gitsigns" },
})

View file

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

View file

@ -73,12 +73,5 @@ return {
capabilities = capabilities capabilities = capabilities
}) })
-- Config
-- Sign configuration
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' })
end end
} }

View file

@ -1,70 +0,0 @@
return {
'hrsh7th/nvim-cmp',
dependencies = {
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'L3MON4D3/LuaSnip',
'onsails/lspkind-nvim',
},
config = function()
local cmp = require('cmp')
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local moveDown = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" })
local moveUp = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
fallback()
end
end, { "i", "s" })
cmp.setup({
preselect = false,
view = {
entries = { name = 'custom', selection_order = 'near_cursor' },
},
mapping = {
["<Tab>"] = moveDown,
["<Down>"] = moveDown,
["<S-Tab>"] = moveUp,
["<Up>"] = moveUp,
['<CR>'] = cmp.mapping.confirm({ select = true }),
},
formatting = {
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
return require('lspkind').cmp_format({ with_text = true })(entry, vim_item)
end
},
sources = {
{ name = 'nvim_lsp', max_item_count = 10 },
{ name = 'nvim_lsp_signature_help' },
{ name = 'buffer' },
{ name = 'path' },
},
})
end
}

View file

@ -16,16 +16,34 @@ return {
bg0 = '#282a33', bg0 = '#282a33',
bg1 = '#30323b', bg1 = '#30323b',
bg2 = '#24262f', bg2 = '#24262f',
bg3 = '#383a43',
bg_d = "#1f2129", bg_d = "#1f2129",
bg_blue = "#ff00ff",
bg_yellow = "#f0d197",
red = '#cc817f', red = '#cc817f',
green = '#7ccfaf', green = '#7ccfaf',
yellow = '#ffcc99', yellow = '#ffcc99',
orange = '#ffcc99', orange = '#ffcc99',
blue = '#8ac6f2', blue = '#8ac6f2',
cyan = '#8abeb7', cyan = '#8abeb7',
purple = '#9999cc' purple = '#9999cc',
dark_cyan = "#8abeb7",
dark_red = "#cc817f",
dark_yellow = "#ffcc99",
dark_purple = "#9999cc",
}, },
highlights = { highlights = {
-- ColorColumn = { bg = "$bg2"},
-- SignColumn = { bg = "$bg2"},
-- LineNr = { fg = "$light_grey", bg = "$bg2" }
LineNr = { fg = "$light_grey" },
CursorLineNr = { fg = "$blue" },
Pmenu = { bg = "$bg2"},
PmenuSel = { bg = "$bg_d", fg = "$fg" },
FloatBorder = { fg = "$grey", bg = 'None' },
-- Syntax
["@comment"] = { fg = "$red" },
["@string"] = { fg = "$purple" }, ["@string"] = { fg = "$purple" },
["@function"] = { fg = "$fg" }, ["@function"] = { fg = "$fg" },
["@keyword"] = { fg = "$yellow" }, ["@keyword"] = { fg = "$yellow" },
@ -33,19 +51,36 @@ return {
["@keyword.function"] = { fg = "$yellow" }, ["@keyword.function"] = { fg = "$yellow" },
["@keyword.conditional"] = { fg = "$yellow" }, ["@keyword.conditional"] = { fg = "$yellow" },
["@keyword.operator"] = { fg = "$yellow" }, ["@keyword.operator"] = { fg = "$yellow" },
["@keyword.repeat"] = { fg = "$yellow" },
["@constant"] = { fg = "$green" },
["@tag"] = { fg = "$yellow" },
["@tag.delimiter"] = { fg = "$yellow" },
["@tag.attribute"] = { fg = "$cyan" },
["@type"] = { fg = "$blue" }, ["@type"] = { fg = "$blue" },
["@type.qualifier"] = { fg = "$yellow" }, ["@type.qualifier"] = { fg = "$yellow" },
["@type.definition"] = { fg = "$blue" }, ["@type.definition"] = { fg = "$blue" },
["@type.builtin"] = { fg = "$blue" }, ["@type.builtin"] = { fg = "$blue" },
["@function.method"] = { fg = "$fg" }, ["@function.method"] = { fg = "$fg" },
["@function.call"] = { fg = "$fg" },
["@function.builtin"] = { fg = "$fg" },
["@number"] = { fg = "$red" }, ["@number"] = { fg = "$red" },
["@variable"] = { fg = "$green" }, ["@variable"] = { fg = "$green" },
["@variable.member"] = { fg = "$green" },
["@variable.builtin"] = { fg = "$green" }, ["@variable.builtin"] = { fg = "$green" },
["@variable.parameter"] = { fg = "$fg" }, ["@variable.parameter"] = { fg = "$fg" },
["@property"] = { fg = "$green" }, ["@property"] = { fg = "$orange" },
-- ["@property"] = { fg = "$fg" },
["@punctuation.delimiter"] = { fg = "$fg" }, ["@punctuation.delimiter"] = { fg = "$fg" },
["@punctuation.bracket"] = { fg = "$fg" }, ["@punctuation.bracket"] = { fg = "$fg" },
["@module"] = { fg = "$fg" }, ["@module"] = { fg = "$fg" },
-- php overrides
["@class_name.php"] = { fg = "$fg" },
["@extend_name.php"] = { fg = "$fg" },
["@implements_name.php"] = { fg = "$fg" },
["@namespace_name.php"] = { fg = "$fg" },
["@namespace_alias.php"] = { fg = "$fg" },
} }
}, },
config = function(_, opts) config = function(_, opts)
@ -56,6 +91,6 @@ return {
vim.cmd(string.format("highlight GitSignsAdd guifg='%s'", opts.colors.green)) 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 GitSignsChange guifg='%s'", opts.colors.yellow))
vim.cmd(string.format("highlight GitSignsDelete guifg='%s'", opts.colors.red)) vim.cmd(string.format("highlight GitSignsDelete guifg='%s'", opts.colors.red))
-- vim.api.nvim_command("highlight GitSign"
end end
} }

View file

@ -0,0 +1,42 @@
local logo = [[
::::::::: :::: ::: ::: :::
:+: :+: :+:+: :+: :+: :+:
+:+ +:+ :+:+:+ +:+ +:+ +:+
+#++:++#+ +#+ +:+ +#+ +#++:+
+#+ +#+ +#+#+# +#+ +#+
#+# #+# #+#+# #+# #+#
### ### #### ### ###
]]
logo = string.rep("\n", 8) .. logo .. "\n\n"
return {
'nvimdev/dashboard-nvim',
name = 'dashboard',
dependencies = {
'nvim-tree/nvim-web-devicons'
},
event = 'VimEnter',
opts = {
theme = 'doom',
config = {
header = vim.split(logo, "\n"),
center = {
{ action = function() require('telescope.builtin').find_files() end, desc = " Find file", icon = "", key = "f" },
{ action = "ene | startinsert", desc = " New file", icon = "", key = "n" },
{ action = function() require('telescope.builtin').oldfiles() end, desc = " Recent files", icon = "", key = "r" },
{ action = function() require('telescope.builtin').live_grep() end, desc = " Find text", icon = "", key = "g" },
{ action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" },
{ action = "qa", desc = " Quit", icon = "", key = "q" }
},
footer = function()
local stats = require("lazy").stats()
local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
return { "Loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms" }
end,
}
}
}

View file

@ -0,0 +1,23 @@
return {
'stevearc/dressing.nvim',
opts = {
input = {
title_pos = "center",
border = "single",
relative = "win",
},
select = {
backend = { "telescope", "builtin" },
telescope = require('telescope.themes').get_dropdown({
borderchars = {
prompt = { "", "", "", "", "", "", "", "" },
results = { "", "", "", "", "", "", "", "" },
},
max_height = 5
}),
builtin = {
border = "single",
}
}
},
}

View file

@ -2,6 +2,17 @@ local icons = require('config.icons').diff_gutter
return { return {
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
dependencies = {
{
"folke/which-key.nvim",
optional = true,
opts = {
defaults = {
["<leader>g"] = { name = "+git" },
},
},
},
},
lazy = false, lazy = false,
keys = { keys = {
{ '<leader>gp', '<cmd>Gitsigns preview_hunk<cr>', desc = 'Git preview diff' }, { '<leader>gp', '<cmd>Gitsigns preview_hunk<cr>', desc = 'Git preview diff' },

View file

@ -0,0 +1,16 @@
return {
"folke/noice.nvim",
event = "VeryLazy",
opts = {
cmdline = {
view = "cmdline"
},
presets = {
bottom_search = true,
command_palette = true
}
},
dependencies = {
"MunifTanjim/nui.nvim",
}
}

View file

@ -0,0 +1,22 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {
defaults = {
mode = { "n", "v" },
["<leader>r"] = { name = "+rename" },
["<leader>b"] = { name = "+buffers" },
["<leader>f"] = { name = "+files" },
}
},
config = function(_, opts)
local wk = require("which-key")
wk.setup(opts)
wk.register(opts.defaults)
end
}

View file

@ -1,21 +0,0 @@
return {
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {},
config = function()
local wk = require("which-key")
wk.register({
f = 'file',
b = 'buffers',
t = 'test',
g = 'git',
s = 'search'
}, { prefix = "<leader>" })
end
}

View file

@ -1,5 +1,6 @@
(directive) @keyword
(directive_start) @keyword
(directive_end) @keyword
(comment) @comment (comment) @comment
(keyword) @keyword ((parameter) @string (#set! "priority" 110))
((php_only) @include (#set! "priority" 110))
((bracket_start) @function (#set! "priority" 120))
((bracket_end) @function (#set! "priority" 120))
((keyword) @keyword (#set! "priority" 110))

View file

@ -5,9 +5,9 @@
; Tag names in class definition as regular text. ; Tag names in class definition as regular text.
(class_declaration [ (class_declaration [
name: (name) @text name: (name) @class_name
(base_clause (name) @text) (base_clause (name) @extend_name)
(class_interface_clause (name) @text) (class_interface_clause (name) @implement_name)
]) ])
; tag "use" traits as text ; tag "use" traits as text
@ -16,8 +16,8 @@
; tag namespace classes in "use" as text ; tag namespace classes in "use" as text
(namespace_use_declaration (namespace_use_clause [ (namespace_use_declaration (namespace_use_clause [
(qualified_name [ (qualified_name [
(name) @text (name) @namespace_name
(namespace_name_as_prefix (namespace_name (name) @text)) (namespace_name_as_prefix (namespace_name (name) @namespace_name))
]) ])
(namespace_aliasing_clause (name) @text) (namespace_aliasing_clause (name) @namespace_alias)
])) ]))

View file

@ -0,0 +1,9 @@
; extends
; Fix for phpdoc comments that don't align * properly.
; This is black magic. I came up with it myself but
; i don't know why it works.
(ERROR
"/"
"**"
@indent.align)