feat(config): update and add new plugins

This commit is contained in:
2024-11-16 23:02:57 +03:00
parent 84f952b665
commit 32e5b77be0
15 changed files with 233 additions and 256 deletions

View File

@@ -0,0 +1,8 @@
return {
{
"tpope/vim-surround",
},
{
"machakann/vim-swap",
},
}

7
lua/plugins/disabled.lua Normal file
View File

@@ -0,0 +1,7 @@
return {
-- {
-- "echasnovski/mini.pairs",
-- enabled = false,
-- },
{ "folke/flash.nvim", enabled = false },
}

18
lua/plugins/laravel.lua Normal file
View File

@@ -0,0 +1,18 @@
return {
"adalessa/laravel.nvim",
dependencies = {
"tpope/vim-dotenv",
"nvim-telescope/telescope.nvim",
"MunifTanjim/nui.nvim",
"kevinhwang91/promise-async",
},
cmd = { "Laravel" },
keys = {
-- { "<leader>la", ":Laravel artisan<cr>" },
{ "<leader>lr", ":Laravel routes<cr>" },
{ "<leader>lm", ":Laravel related<cr>" },
},
event = { "VeryLazy" },
opts = {},
config = true,
}

20
lua/plugins/lazy_git.lua Normal file
View File

@@ -0,0 +1,20 @@
return {
"kdheepak/lazygit.nvim",
lazy = true,
cmd = {
"LazyGit",
"LazyGitConfig",
"LazyGitCurrentFile",
"LazyGitFilter",
"LazyGitFilterCurrentFile",
},
-- optional for floating window border decoration
dependencies = {
"nvim-lua/plenary.nvim",
},
-- setting the keybinding for LazyGit with 'keys' is recommended in
-- order to load the plugin when the command is run for the first time
keys = {
{ "<leader>lg", "<cmd>LazyGit<cr>", desc = "LazyGit" }
}
}

View File

@@ -1,47 +0,0 @@
return {
"jay-babu/mason-nvim-dap.nvim",
dependencies = "mason.nvim",
cmd = { "DapInstall", "DapUninstall" },
opts = {
-- Makes a best effort to setup the various debuggers with
-- reasonable debug configurations
automatic_setup = true,
-- You can provide additional configuration to the handlers,
-- see mason-nvim-dap README for more information
handlers = {
function(config)
-- all sources with no handler get passed here
-- Keep original functionality
require("mason-nvim-dap").default_setup(config)
end,
php = function(config)
config.configurations = {
{
type = "php",
request = "launch",
name = "Listen for Xdebug",
port = 9003,
pathMappings = {
-- For some reason xdebug sometimes fails for me, depending on me
-- using herd or docker. To get it to work, change the order of the mappings.
-- The first mapping should be the one that you are actively using.
-- This only started recently, so I don't know what changed.
["${workspaceFolder}"] = "${workspaceFolder}",
["/var/www/html"] = "${workspaceFolder}",
},
},
}
require("mason-nvim-dap").default_setup(config) -- don't forget this!
end,
},
-- You'll need to check that you have the required things installed
-- online, please don't ask me how to install them :)
ensure_installed = {
-- Update this to ensure that you have the debuggers for the langs you want
"php",
"bash",
-- "python",
},
},
}

60
lua/plugins/php-tools.lua Normal file
View File

@@ -0,0 +1,60 @@
return {
"ccaglak/phptools.nvim",
keys = {
{ "<leader>lm", "<cmd>PhpTools Method<cr>" },
{ "<leader>lc", "<cmd>PhpTools Class<cr>" },
{ "<leader>ls", "<cmd>PhpTools Scripts<cr>" },
{ "<leader>ln", "<cmd>PhpTools Namespace<cr>" },
{ "<leader>lg", "<cmd>PhpTools GetSet<cr>" },
{ "<leader>lf", "<cmd>PhpTools Create<cr>" },
{ "<leader>ld", "<cmd>PhpTools DrupalAutoLoader<cr>" },
{ mode = "v", "<leader>lr", "<cmd>PhpTools Refactor<cr>" },
},
dependencies = {
"ccaglak/namespace.nvim", -- optional - php namespace resolver
"ccaglak/larago.nvim", -- optional -- laravel goto blade/components
-- "ccaglak/snippets.nvim", -- optional -- native snippet expander
},
config = function()
require("phptools").setup({
ui = {
enable = true, -- default:true; false only if you have a UI enhancement plugin
fzf = false, -- default:false; requires fzf used only in tests module otherwise there might long list of tests
},
create = false, -- default:false autorun PhpTools Create when creating a new php file
drupal_autoloader = { -- delete if you dont use it
scan_paths = { "/web/modules/contrib/" }, -- Paths to scan for modules
root_markers = { ".git" }, -- Project root markers
autoload_file = "/vendor/composer/autoload_psr4.php", -- Autoload file path
},
custom_toggles = {
-- { "foo", "bar", "baz" }, -- Add more custom toggle groups here
},
})
local map = vim.keymap.set
-- local ide_helper = require("phptools.ide_helper")
-- -- Laravel IDE Helper keymaps
-- map("n", "<leader>lha", ide_helper.generate_all, { desc = "Generate all IDE helpers" })
-- map("n", "<leader>lhm", ide_helper.generate_models, { desc = "Generate model helpers" })
-- map("n", "<leader>lhf", ide_helper.generate_facades, { desc = "Generate facade helpers" })
-- map("n", "<leader>lht", ide_helper.generate_meta, { desc = "Generate meta helper" })
-- map("n", "<leader>lhi", ide_helper.install, { desc = "Install IDE Helper package" })
--
-- local tests = require("phptools.tests")
-- map("n", "<Leader>ta", tests.test.all, { desc = "Run all tests" })
-- map("n", "<Leader>tf", tests.test.file, { desc = "Run current file tests" })
-- map("n", "<Leader>tl", tests.test.line, { desc = "Run test at cursor" })
-- map("n", "<Leader>ts", tests.test.filter, { desc = "Search and run test" })
-- map("n", "<Leader>tp", tests.test.parallel, { desc = "Run tests in parallel" })
-- map("n", "<Leader>tr", tests.test.rerun, { desc = "Rerun last test" })
-- map("n", "<Leader>ti", tests.test.selected, { desc = "Run selected test file" })
--
-- local fn = require("phptools.fn")
-- map("n", "<leader>llf", fn.toggle_function, { desc = "Toggle PHP function style" })
-- map("n", "<leader>lli", fn.toggle_if_ternary, { desc = "Toggle if/ternary" })
-- map("n", "<leader>llm", fn.toggle_if_match, { desc = "Toggle if/match" })
-- map("n", "<leader>llm", fn.toggle_quotes, { desc = "Toggle qoutes" })
end,
}

View File

@@ -1,97 +1,96 @@
return { -- lazy
{
"ccaglak/namespace.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
},
{
"adalessa/composer.nvim",
lazy = true,
},
"ccaglak/namespace.nvim",
dependencies = {
"ccaglak/phptools.nvim", -- optional
"ccaglak/larago.nvim", -- optional
},
{
"adalessa/composer.nvim",
lazy = true,
},
{
"ludovicchabant/vim-gutentags",
config = function()
vim.g.gutentags_ctags_exclude = {
"*.git",
"*.svg",
"*.hg",
"*/tests/*",
"build",
"dist",
"*sites/*/files/*",
"bin",
"node_modules",
"bower_components",
"cache",
"compiled",
"docs",
"example",
"bundle",
-- "vendor",
"*.md",
"*-lock.json",
"*.lock",
"*bundle*.js",
"*build*.js",
".*rc*",
"*.json",
"*.min.*",
"*.map",
"*.bak",
"*.zip",
"*.pyc",
"*.class",
"*.sln",
"*.Master",
"*.csproj",
"*.tmp",
"*.csproj.user",
"*.cache",
"*.pdb",
"tags*",
"cscope.*",
-- '*.css',
-- '*.less',
-- '*.scss',
"*.exe",
"*.dll",
"*.mp3",
"*.ogg",
"*.flac",
"*.swp",
"*.swo",
"*.bmp",
"*.gif",
"*.ico",
"*.jpg",
"*.png",
"*.rar",
"*.zip",
"*.tar",
"*.tar.gz",
"*.tar.xz",
"*.tar.bz2",
"*.pdf",
"*.doc",
"*.docx",
"*.ppt",
"*.pptx",
}
vim.g.gutentags_add_default_project_roots = false
vim.g.gutentags_project_root = { "package.json", ".git" }
vim.g.gutentags_cache_dir = vim.fn.stdpath("data") .. "/ctags"
vim.g.gutentags_generate_on_new = true
vim.g.gutentags_generate_on_missing = true
vim.g.gutentags_generate_on_write = true
vim.g.gutentags_generate_on_empty_buffer = true
vim.g.gutentags_modules = true
vim.cmd([[command! -nargs=0 GutentagsClearCache call system('rm ' . g:gutentags_cache_dir . '/*')]])
vim.g.gutentags_ctags_extra_args = { "--tag-relative=yes", "--fields=+ailmnS" }
-- custom
vim.g.gutentags_modules = { "ctags" }
end,
},
-- {
-- "ludovicchabant/vim-gutentags",
-- config = function()
-- vim.g.gutentags_ctags_exclude = {
-- "*.git",
-- "*.svg",
-- "*.hg",
-- "*/tests/*",
-- "build",
-- "dist",
-- "*sites/*/files/*",
-- "bin",
-- "node_modules",
-- "bower_components",
-- "cache",
-- "compiled",
-- "docs",
-- "example",
-- "bundle",
-- "vendor",
-- "*.md",
-- "*-lock.json",
-- "*.lock",
-- "*bundle*.js",
-- "*build*.js",
-- ".*rc*",
-- "*.json",
-- "*.min.*",
-- "*.map",
-- "*.bak",
-- "*.zip",
-- "*.pyc",
-- "*.class",
-- "*.sln",
-- "*.Master",
-- "*.csproj",
-- "*.tmp",
-- "*.csproj.user",
-- "*.cache",
-- "*.pdb",
-- "tags*",
-- "cscope.*",
-- -- '*.css',
-- -- '*.less',
-- -- '*.scss',
-- "*.exe",
-- "*.dll",
-- "*.mp3",
-- "*.ogg",
-- "*.flac",
-- "*.swp",
-- "*.swo",
-- "*.bmp",
-- "*.gif",
-- "*.ico",
-- "*.jpg",
-- "*.png",
-- "*.rar",
-- "*.zip",
-- "*.tar",
-- "*.tar.gz",
-- "*.tar.xz",
-- "*.tar.bz2",
-- "*.pdf",
-- "*.doc",
-- "*.docx",
-- "*.ppt",
-- "*.pptx",
-- }
--
-- vim.g.gutentags_add_default_project_roots = false
-- vim.g.gutentags_project_root = { "package.json", ".git" }
-- vim.g.gutentags_cache_dir = vim.fn.stdpath("data") .. "/ctags"
-- vim.g.gutentags_generate_on_new = true
-- vim.g.gutentags_generate_on_missing = true
-- vim.g.gutentags_generate_on_write = true
-- vim.g.gutentags_generate_on_empty_buffer = true
-- vim.g.gutentags_modules = true
-- vim.cmd([[command! -nargs=0 GutentagsClearCache call system('rm ' . g:gutentags_cache_dir . '/*')]])
-- vim.g.gutentags_ctags_extra_args = { "--tag-relative=yes", "--fields=+ailmnS" }
--
-- -- custom
-- vim.g.gutentags_modules = { "ctags" }
-- end,
-- },
}

View File

@@ -1,50 +0,0 @@
-- add more treesitter parsers
return {
"nvim-treesitter/nvim-treesitter",
build = function()
require("nvim-treesitter.install").update({ with_sync = true })
end,
dependencies = {
{
"JoosepAlviste/nvim-ts-context-commentstring",
opts = {
custom_calculation = function(_, language_tree)
if vim.bo.filetype == "blade" and language_tree._lang ~= "javascript" and language_tree._lang ~= "php" then
return "{{-- %s --}}"
end
end,
},
},
"nvim-treesitter/nvim-treesitter-textobjects",
},
opts = {
ensure_installed = "all",
-- auto_install = true,
highlight = {
enable = true,
},
-- Needed because treesitter highlight turns off autoindent for php files
indent = {
enable = true,
},
},
config = function(_, opts)
---@class ParserInfo[]
local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
parser_config.blade = {
install_info = {
url = "https://github.com/EmranMR/tree-sitter-blade",
files = {
"src/parser.c",
-- "src/scanner.cc",
},
branch = "main",
-- generate_requires_npm = true,
-- requires_generate_from_grammar = true,
},
filetype = "blade",
}
require("nvim-treesitter.configs").setup(opts)
end,
}

5
lua/plugins/twilight.lua Normal file
View File

@@ -0,0 +1,5 @@
return {
"folke/twilight.nvim",
cmd = { "Twilight" },
config = true,
}