mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 11:24:55 +02:00
touched the nvim, alot.
This commit is contained in:
parent
4c1b128c96
commit
13e4207ef5
28 changed files with 288 additions and 145 deletions
|
|
@ -1,5 +1,5 @@
|
|||
return {
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {} -- this is equalent to setup({}) function
|
||||
config = true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
return{
|
||||
return {
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
main = "ibl",
|
||||
opts = {
|
||||
debounce = 10,
|
||||
indent = {
|
||||
char = '▏',
|
||||
},
|
||||
scope = {
|
||||
enabled = true,
|
||||
show_start = false,
|
||||
|
|
@ -13,5 +17,13 @@ return{
|
|||
'dashboard'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
config = function (_, opts)
|
||||
|
||||
require 'ibl'.setup(opts)
|
||||
|
||||
local hooks = require 'ibl.hooks'
|
||||
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_tab_indent_level)
|
||||
hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
local icons = require('config.icons')
|
||||
local config = require('config.plugins.telescope')
|
||||
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
|
|
@ -9,49 +9,30 @@ return {
|
|||
'sharkdp/fd',
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
-- optional = true,
|
||||
optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>s"] = { name = "+search" },
|
||||
},
|
||||
defaults = config.key_groups or {},
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = require('config.telescope'),
|
||||
opts = function()
|
||||
local actions = require("telescope.actions")
|
||||
return {
|
||||
defaults = {
|
||||
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 .. ' ',
|
||||
selection_caret = icons.current .. ' ',
|
||||
multi_icon = icons.selected .. ' ',
|
||||
file_ignore_patterns = {
|
||||
".git/",
|
||||
"node_modules/"
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = actions.close
|
||||
}
|
||||
}
|
||||
keys = config.keys or {},
|
||||
opts = config.opts or {},
|
||||
config = function (_, opts)
|
||||
local override = {
|
||||
border = {
|
||||
prompt = { 1, 1, 1, 1 },
|
||||
results = { 1, 1, 1, 1 },
|
||||
preview = { 1, 1, 1, 1 },
|
||||
},
|
||||
borderchars = {
|
||||
prompt = { "─", "│", "─", "│", "├", "┤", "┴", "└" },
|
||||
results = { "─", "│", " ", "│", "┌", "┬", "│", "│" },
|
||||
preview = { "─", "│", "─", " ", "─", "┐", "┘", "─" },
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
|
||||
opts.defaults = vim.tbl_deep_extend("force", opts.defaults, override)
|
||||
|
||||
require('telescope').setup(opts)
|
||||
end
|
||||
}
|
||||
|
|
|
|||
38
nvim/lua/plugins/ide/conform.lua
Normal file
38
nvim/lua/plugins/ide/conform.lua
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
local config = require('config.plugins.conform')
|
||||
|
||||
return {
|
||||
'stevearc/conform.nvim',
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"zapling/mason-conform.nvim"
|
||||
},
|
||||
cmd = { "ConformInfo", "Format" },
|
||||
keys = config.keys or {},
|
||||
opts = config.opts or {},
|
||||
config = function (_, opts)
|
||||
|
||||
-- Create command to format a buffer or range.
|
||||
vim.api.nvim_create_user_command("Format", function(args)
|
||||
local range = nil
|
||||
if args.count ~= -1 then
|
||||
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
|
||||
range = {
|
||||
start = { args.line1, 0 },
|
||||
["end"] = { args.line2, end_line:len() },
|
||||
}
|
||||
end
|
||||
|
||||
local opt = opts.format_options
|
||||
if range ~= nil then
|
||||
opt = vim.tbl_deep_extend("force", opt, { range = range })
|
||||
end
|
||||
|
||||
require("conform").format(opt)
|
||||
end, { range = true })
|
||||
|
||||
require('conform').setup(opts)
|
||||
|
||||
-- setup mason-conform to autmagically install formatters.
|
||||
require('mason-conform').setup()
|
||||
end
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@ return {
|
|||
-- optional = true,
|
||||
opts = {
|
||||
defaults = {
|
||||
["<leader>d"] = { name = "+debug" },
|
||||
["<leader>D"] = { name = "+debug" },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -14,8 +14,8 @@ return {
|
|||
"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"} },
|
||||
{ "<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)
|
||||
|
|
@ -37,7 +37,7 @@ return {
|
|||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
{ "<leader>Dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
|
||||
},
|
||||
config = function()
|
||||
-- local Config = require("lazyvim.config")
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
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,
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ return {
|
|||
mappings = {
|
||||
["<leader>rs"] = { vim.lsp.buf.rename, { desc = "Rename symbol" }},
|
||||
["<leader>ca"] = { vim.lsp.buf.code_action, { desc = "Code action" }},
|
||||
["<leader>ff"] = { vim.lsp.buf.format, { desc = "Format file" }},
|
||||
gd = { vim.lsp.buf.definition, { desc = "Goto definition" }},
|
||||
gi = { vim.lsp.buf.implementation, { desc = "Goto implementation"}},
|
||||
gr = { vim.lsp.buf.references, { desc = "Goto references"}},
|
||||
|
|
|
|||
|
|
@ -20,14 +20,14 @@ local opts = {
|
|||
require("lazy").setup({
|
||||
|
||||
-- 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.noice" },
|
||||
{ import = "plugins.ui.dashboard" },
|
||||
|
|
@ -40,15 +40,18 @@ require("lazy").setup({
|
|||
{ import = "plugins.ui.which-key" },
|
||||
|
||||
-- IDE
|
||||
--------------------
|
||||
-----------------------------
|
||||
{ import = "plugins.ide.treesitter" },
|
||||
{ import = "plugins.ide.conform" },
|
||||
{ import = "plugins.ide.cmp" },
|
||||
{ import = "plugins.ide.lsp" },
|
||||
{ import = "plugins.ide.dap" },
|
||||
{ import = "plugins.ide.neotest" },
|
||||
{ import = "plugins.ide.laravel" },
|
||||
-- { import = "plugins.nvim-test" },
|
||||
|
||||
--{ import = "plugins.go" },
|
||||
-- Language specific
|
||||
-----------------------------
|
||||
{ import = "plugins.lang.laravel" },
|
||||
--{ import = "plugins.lang.go" },
|
||||
|
||||
}, opts)
|
||||
|
||||
|
|
|
|||
26
nvim/lua/plugins/lang/laravel.lua
Normal file
26
nvim/lua/plugins/lang/laravel.lua
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
return {
|
||||
"adalessa/laravel.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
"tpope/vim-dotenv",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvimtools/none-ls.nvim",
|
||||
},
|
||||
ft = "php",
|
||||
cmd = { "Sail", "Artisan", "Composer", "Npm", "Yarn", "Laravel" },
|
||||
config = function (_, _)
|
||||
local opts = require('config.plugins.laravel')
|
||||
|
||||
local haswk, wk = pcall(require, "which-key")
|
||||
|
||||
if haswk then
|
||||
wk.register({l = {name = "laravel" }}, { prefix = "<leader>" })
|
||||
end
|
||||
|
||||
for key, value in pairs(opts.keys) do
|
||||
vim.keymap.set("n", key, value[1], { desc = value[2] or ''})
|
||||
end
|
||||
|
||||
require('laravel').setup(opts)
|
||||
end
|
||||
}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
return {
|
||||
"klen/nvim-test",
|
||||
}
|
||||
|
|
@ -17,8 +17,13 @@ return {
|
|||
separator = {left = '', right = ''},
|
||||
separator_at_end = false,
|
||||
inactive = { button = '', separator = { left = '', right = ''} },
|
||||
modified = {button = icons.filetree.git.modified },
|
||||
pinned = {button = '', filename = true},
|
||||
modified = {button = icons.gitsigns.modified },
|
||||
pinned = {button = icons.pinned, filename = true},
|
||||
gitsigns = {
|
||||
added = { enabled = false },
|
||||
changed = { enabled = false },
|
||||
deleted = { enabled = false },
|
||||
}
|
||||
},
|
||||
maximum_padding = 2,
|
||||
minimum_padding = 1,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ return {
|
|||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 1000,
|
||||
opts = require('config.catppuccin'),
|
||||
opts = require('config.plugins.catppuccin'),
|
||||
config = function (_, opts)
|
||||
require("catppuccin").setup(opts)
|
||||
vim.cmd.colorscheme("catppuccin")
|
||||
|
|
|
|||
|
|
@ -23,12 +23,16 @@ return {
|
|||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
},
|
||||
icon = icons.filetree.basic,
|
||||
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.filetree.git
|
||||
symbols = icons.gitsigns
|
||||
},
|
||||
},
|
||||
event_handlers = {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ return {
|
|||
["<leader>r"] = { name = "+rename" },
|
||||
["<leader>b"] = { name = "+buffers" },
|
||||
["<leader>f"] = { name = "+files" },
|
||||
["<leader>d"] = { name = "+diagnostics" }
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue