mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 11:24:55 +02:00
some nvim touching
This commit is contained in:
parent
6dd8f632ad
commit
f910f44191
29 changed files with 467 additions and 233 deletions
24
nvim/lua/plugins/core/autotag.lua
Normal file
24
nvim/lua/plugins/core/autotag.lua
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
return {
|
||||
"windwp/nvim-ts-autotag",
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter'
|
||||
},
|
||||
opts = {
|
||||
filetypes = {
|
||||
'html',
|
||||
'javascript',
|
||||
'typescript',
|
||||
'javascriptreact',
|
||||
'typescriptreact',
|
||||
'svelte',
|
||||
'vue',
|
||||
'tsx',
|
||||
'jsx',
|
||||
'rescript',
|
||||
'xml',
|
||||
'php',
|
||||
'blade',
|
||||
'markdown',
|
||||
}
|
||||
}
|
||||
}
|
||||
27
nvim/lua/plugins/core/treesitter.lua
Normal file
27
nvim/lua/plugins/core/treesitter.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = function()
|
||||
require('nvim-treesitter.install').update({ with_sync = true })
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/playground'
|
||||
},
|
||||
opts = require('config.plugins.treesitter'),
|
||||
config = function(_, opts)
|
||||
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
|
||||
|
||||
parser_config.blade = {
|
||||
install_info = {
|
||||
url = 'https://github.com/EmranMR/tree-sitter-blade',
|
||||
branch = "main",
|
||||
files = { 'src/parser.c' },
|
||||
generate_requires_npm = true,
|
||||
requires_generate_from_grammar = true,
|
||||
},
|
||||
filetype = 'blade',
|
||||
}
|
||||
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
@ -1,9 +1,5 @@
|
|||
return {
|
||||
'echasnovski/mini.comment',
|
||||
version = '*',
|
||||
opts = {
|
||||
options = {
|
||||
custom_commentstring = function() return vim.bo.commentstring end
|
||||
}
|
||||
}
|
||||
opts = require('config.plugins.comment')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@ return {
|
|||
results = { 1, 1, 1, 1 },
|
||||
preview = { 1, 1, 1, 1 },
|
||||
},
|
||||
borderchars = {
|
||||
prompt = { "─", "│", "─", "│", "├", "┤", "┴", "└" },
|
||||
results = { "─", "│", " ", "│", "┌", "┬", "│", "│" },
|
||||
preview = { "─", "│", "─", " ", "─", "┐", "┘", "─" },
|
||||
},
|
||||
-- borderchars = {
|
||||
-- prompt = { "─", "│", "─", "│", "├", "┤", "┴", "└" },
|
||||
-- results = { "─", "│", " ", "│", "┌", "┬", "│", "│" },
|
||||
-- preview = { "─", "│", "─", " ", "─", "┐", "┘", "─" },
|
||||
-- },
|
||||
}
|
||||
|
||||
opts.defaults = vim.tbl_deep_extend("force", opts.defaults, override)
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ return {
|
|||
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'
|
||||
-- border = {'┌', '─', '┐', '│', '┘', '─', '└', '│'},
|
||||
winhighlight = 'Normal:NormalFloat,FloatBorder:FloatBorder,CursorLine:PmenuSel,Search:None'
|
||||
})
|
||||
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -38,11 +38,47 @@ return {
|
|||
},
|
||||
keys = {
|
||||
{ "<leader>Dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
{ "<leader>Db", function() require'dap'.toggle_breakpoint() end, desc = "Toggle breakpoint" },
|
||||
},
|
||||
config = function()
|
||||
-- local Config = require("lazyvim.config")
|
||||
vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })
|
||||
|
||||
local dap = require "dap"
|
||||
dap.adapters.delve = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
command = 'dlv',
|
||||
args = {'dap', '-l', '127.0.0.1:${port}'},
|
||||
}
|
||||
}
|
||||
|
||||
dap.configurations.go = {
|
||||
{
|
||||
type = "delve",
|
||||
name = "Debug",
|
||||
request = "launch",
|
||||
program = "${file}"
|
||||
},
|
||||
{
|
||||
type = "delve",
|
||||
name = "Debug test", -- configuration for debugging test files
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "${file}"
|
||||
},
|
||||
-- works with go.mod packages and sub packages
|
||||
{
|
||||
type = "delve",
|
||||
name = "Debug test (go.mod)",
|
||||
request = "launch",
|
||||
mode = "test",
|
||||
program = "./${relativeFileDirname}"
|
||||
}
|
||||
}
|
||||
-- local Config = require("lazyvim.config")
|
||||
|
||||
|
||||
-- for name, sign in pairs(Config.icons.dap) do
|
||||
-- sign = type(sign) == "table" and sign or { sign }
|
||||
-- vim.fn.sign_define(
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
return {
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"nvim-neotest/nvim-nio",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
|
@ -22,7 +23,7 @@ return {
|
|||
{"<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>tq", ":lua require('neotest').output_panel.close()<cr>", desc = "close output window"},
|
||||
{"<leader>te", ":lua require('neotest').summary()<cr>"}
|
||||
{"<leader>te", ":Neotest summary<cr>", desc = "Open test explorer"}
|
||||
},
|
||||
opts = function()
|
||||
local icons = require('config.icons').test
|
||||
|
|
@ -48,6 +49,9 @@ return {
|
|||
skipped = icons.skipped,
|
||||
unknown = icons.unknown,
|
||||
watching = icons.watch
|
||||
},
|
||||
summery = {
|
||||
open = "botleft vsplit"
|
||||
}
|
||||
}
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,83 +0,0 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = function()
|
||||
require('nvim-treesitter.install').update({ with_sync = true })
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/playground'
|
||||
},
|
||||
opts = {
|
||||
-- A list of parser names
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
"cpp",
|
||||
"ninja",
|
||||
"cmake",
|
||||
"dockerfile",
|
||||
"make",
|
||||
"lua",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"query",
|
||||
"php",
|
||||
"phpdoc",
|
||||
"blade",
|
||||
"go",
|
||||
"gomod",
|
||||
"gosum",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"css",
|
||||
"scss",
|
||||
"html",
|
||||
"vue",
|
||||
"json",
|
||||
"jsonc",
|
||||
"yaml",
|
||||
"toml",
|
||||
"xml",
|
||||
"glsl",
|
||||
"hlsl",
|
||||
"markdown"
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = true,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = false,
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
|
||||
indent = {
|
||||
enable = true
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
local parser_config = require('nvim-treesitter.parsers').get_parser_configs()
|
||||
|
||||
parser_config.blade = {
|
||||
install_info = {
|
||||
url = 'https://github.com/EmranMR/tree-sitter-blade',
|
||||
branch = "main",
|
||||
files = { 'src/parser.c' },
|
||||
generate_requires_npm = true,
|
||||
requires_generate_from_grammar = true,
|
||||
},
|
||||
filetype = 'blade',
|
||||
}
|
||||
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
}
|
||||
|
|
@ -19,29 +19,33 @@ local opts = {
|
|||
|
||||
require("lazy").setup({
|
||||
|
||||
-- Core
|
||||
-----------------------------
|
||||
{ import = "plugins.core.treesitter" },
|
||||
{ import = "plugins.core.autopairs" },
|
||||
{ import = "plugins.core.autotag" },
|
||||
{ import = "plugins.core.indent-blankline" },
|
||||
|
||||
-- Editor
|
||||
-----------------------------
|
||||
{ import = "plugins.editor.indent" },
|
||||
{ import = "plugins.editor.autopairs" },
|
||||
{ import = "plugins.editor.mini-comment" },
|
||||
{ import = "plugins.editor.telescope" },
|
||||
|
||||
-- UI
|
||||
-----------------------------
|
||||
{ import = "plugins.ui.dressing" },
|
||||
{ import = "plugins.ui.edgy" },
|
||||
{ import = "plugins.ui.noice" },
|
||||
{ import = "plugins.ui.dashboard" },
|
||||
{ import = "plugins.ui.catppuccin" },
|
||||
{ import = "plugins.ui.neo-tree" },
|
||||
{ import = "plugins.ui.barbar" },
|
||||
{ import = "plugins.ui.barbecue" },
|
||||
{ import = "plugins.ui.bufferline" },
|
||||
{ import = "plugins.ui.lualine" },
|
||||
{ import = "plugins.ui.gitsigns" },
|
||||
{ import = "plugins.ui.which-key" },
|
||||
|
||||
-- IDE
|
||||
-----------------------------
|
||||
{ import = "plugins.ide.treesitter" },
|
||||
{ import = "plugins.ide.conform" },
|
||||
{ import = "plugins.ide.cmp" },
|
||||
{ import = "plugins.ide.lsp" },
|
||||
|
|
@ -51,7 +55,7 @@ require("lazy").setup({
|
|||
-- Language specific
|
||||
-----------------------------
|
||||
{ import = "plugins.lang.laravel" },
|
||||
--{ import = "plugins.lang.go" },
|
||||
{ import = "plugins.lang.go" },
|
||||
|
||||
}, opts)
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ return {
|
|||
maximum_padding = 2,
|
||||
minimum_padding = 1,
|
||||
sidebar_filetypes = {
|
||||
['neo-tree'] = {event = 'BufWipeout'},
|
||||
--['neo-tree'] = {event = 'BufWipeout'},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
return {
|
||||
"utilyre/barbecue.nvim",
|
||||
name = "barbecue",
|
||||
version = "*",
|
||||
dependencies = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
opts = {
|
||||
theme = "catppuccin",
|
||||
}
|
||||
}
|
||||
6
nvim/lua/plugins/ui/bufferline.lua
Normal file
6
nvim/lua/plugins/ui/bufferline.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
version = "*",
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
opts = require('config.plugins.bufferline')
|
||||
}
|
||||
33
nvim/lua/plugins/ui/edgy.lua
Normal file
33
nvim/lua/plugins/ui/edgy.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
return {
|
||||
"folke/edgy.nvim",
|
||||
event = "VeryLazy",
|
||||
keys = {
|
||||
{ "<leader>ue", function() require("edgy").toggle() end, desc = "Edgy Toggle" },
|
||||
-- stylua: ignore
|
||||
{ "<leader>uE", function() require("edgy").select() end, desc = "Edgy Select Window" },
|
||||
},
|
||||
opts = {
|
||||
left = {
|
||||
{
|
||||
title = "Neo-Tree",
|
||||
ft = "neo-tree",
|
||||
filter = function(buf)
|
||||
return vim.b[buf].neo_tree_source == "filesystem"
|
||||
end,
|
||||
size = { height = 0.5 },
|
||||
},
|
||||
{
|
||||
title = "Test",
|
||||
ft = "neotest-summary"
|
||||
},
|
||||
"neo-tree",
|
||||
},
|
||||
options = {
|
||||
left = { size = 40 }
|
||||
},
|
||||
animate = {
|
||||
enabled = false,
|
||||
},
|
||||
exit_when_last = false
|
||||
}
|
||||
}
|
||||
|
|
@ -12,6 +12,7 @@ return {
|
|||
theme = "catppuccin-mocha",
|
||||
component_separators = '',
|
||||
globalstatus = true,
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {
|
||||
statusline = {
|
||||
'dashboard',
|
||||
|
|
@ -22,6 +23,17 @@ return {
|
|||
sections = {
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "branch" },
|
||||
lualine_c = {
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.error .. ' ',
|
||||
warn = icons.diagnostics.warn .. ' ',
|
||||
info = icons.diagnostics.info .. ' ',
|
||||
hint = icons.diagnostics.hint .. ' ',
|
||||
},
|
||||
}
|
||||
},
|
||||
lualine_x = {
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
|
|
@ -36,15 +48,7 @@ return {
|
|||
-- removed = icons.diff.removed .. ' '
|
||||
-- }
|
||||
-- },
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = icons.diagnostics.error .. ' ',
|
||||
warn = icons.diagnostics.warn .. ' ',
|
||||
info = icons.diagnostics.info .. ' ',
|
||||
hint = icons.diagnostics.hint .. ' ',
|
||||
},
|
||||
},
|
||||
'filename'
|
||||
},
|
||||
lualine_y = {
|
||||
'encoding',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
local icons = require('config.icons')
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
cmd = 'Neotree',
|
||||
|
|
@ -11,54 +9,5 @@ return {
|
|||
"nvim-tree/nvim-web-devicons",
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
opts = {
|
||||
close_if_last_window = true,
|
||||
hide_root_node = true,
|
||||
default_component_configs = {
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
padding = 1,
|
||||
-- indent guides
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
},
|
||||
icon = {
|
||||
folder_open = icons.folder.open,
|
||||
folder_close = icons.folder.close,
|
||||
folder_empty = icons.folder.empty,
|
||||
},
|
||||
name = {
|
||||
use_git_status_colors = false,
|
||||
},
|
||||
git_status = {
|
||||
symbols = icons.gitsigns
|
||||
},
|
||||
},
|
||||
event_handlers = {
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function()
|
||||
if vim.bo.filetype == "neo-tree" then
|
||||
vim.cmd("setlocal statuscolumn=")
|
||||
end
|
||||
end,
|
||||
}
|
||||
},
|
||||
filesystem = {
|
||||
filtered_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
|
||||
hide_by_name = {
|
||||
"node_modules",
|
||||
"vendor",
|
||||
},
|
||||
},
|
||||
follow_current_file = {
|
||||
enable = true
|
||||
},
|
||||
},
|
||||
}
|
||||
opts = require('config.plugins.neo-tree')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,33 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
cmdline = {
|
||||
enabled = true,
|
||||
view = "cmdline"
|
||||
},
|
||||
presets = {
|
||||
bottom_search = true,
|
||||
command_palette = true
|
||||
command_palette = false
|
||||
},
|
||||
commands = {
|
||||
history = {
|
||||
view = "cmdline_output",
|
||||
}
|
||||
},
|
||||
views = {
|
||||
mini = {
|
||||
position = {
|
||||
row = -2,
|
||||
},
|
||||
border = {
|
||||
style = 'solid',
|
||||
padding = { 0, 1 },
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,19 +5,11 @@ return {
|
|||
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" },
|
||||
["<leader>d"] = { name = "+diagnostics" }
|
||||
}
|
||||
},
|
||||
opts = require('config.plugins.which-key'),
|
||||
config = function(_, opts)
|
||||
local wk = require("which-key")
|
||||
wk.setup(opts)
|
||||
wk.register(opts.defaults)
|
||||
wk.register(opts.defaults or {})
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue