mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 19:30:01 +02:00
touched the nvim, alot.
This commit is contained in:
parent
4c1b128c96
commit
13e4207ef5
28 changed files with 288 additions and 145 deletions
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"}},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue