aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/alpha/completition/init.lua8
-rw-r--r--lua/alpha/database.lua6
-rw-r--r--lua/alpha/harpoon.lua8
-rw-r--r--lua/alpha/laravel.lua10
-rw-r--r--lua/alpha/lsp/null-ls.lua4
-rw-r--r--lua/alpha/lsp/setups.lua1
-rw-r--r--lua/alpha/plugins/comment.lua7
-rw-r--r--lua/alpha/plugins/completition.lua1
-rw-r--r--lua/alpha/plugins/dap.lua17
-rw-r--r--lua/alpha/plugins/database.lua3
-rw-r--r--lua/alpha/plugins/fugitive.lua12
-rw-r--r--lua/alpha/plugins/gitsigns.lua1
-rw-r--r--lua/alpha/plugins/harpoon.lua1
-rw-r--r--lua/alpha/plugins/init.lua30
-rw-r--r--lua/alpha/plugins/laravel.lua25
-rw-r--r--lua/alpha/plugins/lsp.lua7
-rw-r--r--lua/alpha/plugins/mind.lua16
-rw-r--r--lua/alpha/plugins/neotest.lua1
-rw-r--r--lua/alpha/plugins/refactoring.lua4
-rw-r--r--lua/alpha/plugins/rest.lua1
-rw-r--r--lua/alpha/plugins/telescope.lua1
-rw-r--r--lua/alpha/plugins/test.lua49
-rw-r--r--lua/alpha/plugins/trouble.lua8
-rw-r--r--lua/alpha/plugins/worktree.lua11
-rw-r--r--lua/alpha/telescope/mappings.lua5
-rw-r--r--lua/alpha/telescope/setup.lua9
26 files changed, 168 insertions, 78 deletions
diff --git a/lua/alpha/completition/init.lua b/lua/alpha/completition/init.lua
index 6ac3333..dc3d73b 100644
--- a/lua/alpha/completition/init.lua
+++ b/lua/alpha/completition/init.lua
@@ -128,11 +128,3 @@ cmp.setup.filetype({ "sql", "mysql", "plsql" }, {
{ name = "buffer" },
}),
})
-
-cmp.setup.filetype({ "dap-repl", "dapui_watches" }, {
- sources = cmp.config.sources({
- { name = "dap" },
- }, {
- { name = "buffer" },
- }),
-})
diff --git a/lua/alpha/database.lua b/lua/alpha/database.lua
index 7715875..32121eb 100644
--- a/lua/alpha/database.lua
+++ b/lua/alpha/database.lua
@@ -41,9 +41,3 @@ vim.g.db_ui_icons = {
connection_ok = '✓',
connection_error = '✕',
}
-
--- opening it in a new tab
-vim.keymap.set('n', '<leader><leader>db', ':tab DBUI<cr>', {})
-
--- just close the tab, but context related of the keybinding
-vim.keymap.set('n', '<leader><leader>tq', ':tabclose<cr>')
diff --git a/lua/alpha/harpoon.lua b/lua/alpha/harpoon.lua
index 677a527..108737e 100644
--- a/lua/alpha/harpoon.lua
+++ b/lua/alpha/harpoon.lua
@@ -5,16 +5,16 @@ local terms = vim.g.harpoon_terms or 3
local quick_binds = vim.g.harpoon_quick_binds or 5
M.keymaps = {
- "<leader>ss",
- "<leader>sa",
+ {"<leader>ss"},
+ {"<leader>sa"},
}
for i = 1, terms do
- table.insert(M.keymaps, string.format("<leader><leader>%s", i))
+ table.insert(M.keymaps, {string.format("<leader><leader>%s", i)})
end
for i = 1, quick_binds do
- table.insert(M.keymaps, string.format("<leader>%s", i))
+ table.insert(M.keymaps, {string.format("<leader>%s", i)})
end
M.setup = function()
diff --git a/lua/alpha/laravel.lua b/lua/alpha/laravel.lua
deleted file mode 100644
index 99ba41c..0000000
--- a/lua/alpha/laravel.lua
+++ /dev/null
@@ -1,10 +0,0 @@
-local laravel = require("laravel")
-local artisan = require("laravel.artisan")
-local notify = require("notify")
-
-laravel.setup()
-
-vim.keymap.set("n", "<leader>ac", function()
- artisan.clean_cmd_list_cache()
- notify.notify("Artisan cmd list cache clean", "info", { title = "Laravel.nvim" })
-end, { noremap = true })
diff --git a/lua/alpha/lsp/null-ls.lua b/lua/alpha/lsp/null-ls.lua
index f7f925c..5700fcf 100644
--- a/lua/alpha/lsp/null-ls.lua
+++ b/lua/alpha/lsp/null-ls.lua
@@ -1,7 +1,7 @@
local null_ls = require("null-ls")
local composer = require("composer")
local php_actions = require("php-code-actions")
-local laravel_actions = require("laravel.code-actions")
+-- local laravel_actions = require("laravel.code-actions")
local sources = {
null_ls.builtins.code_actions.gitsigns,
@@ -23,7 +23,7 @@ if composer.query({ "require", "symfony/framework-bundle" }) ~= nil then
}))
elseif composer.query({ "require", "laravel/framework" }) ~= nil then
table.insert(sources, null_ls.builtins.formatting.pint)
- table.insert(sources, laravel_actions.relationships)
+ -- table.insert(sources, laravel_actions.relationships)
end
null_ls.setup({
diff --git a/lua/alpha/lsp/setups.lua b/lua/alpha/lsp/setups.lua
index 646eec1..8744e67 100644
--- a/lua/alpha/lsp/setups.lua
+++ b/lua/alpha/lsp/setups.lua
@@ -45,6 +45,7 @@ return setmetatable({
},
workspace = {
library = vim.api.nvim_get_runtime_file("", true),
+ checkThirdParty = false,
},
telemetry = {
enable = false,
diff --git a/lua/alpha/plugins/comment.lua b/lua/alpha/plugins/comment.lua
new file mode 100644
index 0000000..5d1831f
--- /dev/null
+++ b/lua/alpha/plugins/comment.lua
@@ -0,0 +1,7 @@
+return {
+ "numToStr/Comment.nvim",
+ keys = { { "gcc" }, { "gbc" }, { "gc", mode = "v" }, { "gb", mode = "v" } },
+ config = function()
+ require("Comment").setup()
+ end,
+}
diff --git a/lua/alpha/plugins/completition.lua b/lua/alpha/plugins/completition.lua
index 0ab9b89..cf1a37d 100644
--- a/lua/alpha/plugins/completition.lua
+++ b/lua/alpha/plugins/completition.lua
@@ -7,7 +7,6 @@ return {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-cmdline",
"hrsh7th/cmp-git",
- "rcarriga/cmp-dap",
"saadparwaiz1/cmp_luasnip",
"onsails/lspkind-nvim",
{ "L3MON4D3/LuaSnip", version = "v1.*" },
diff --git a/lua/alpha/plugins/dap.lua b/lua/alpha/plugins/dap.lua
index 6f33484..f8a7b17 100644
--- a/lua/alpha/plugins/dap.lua
+++ b/lua/alpha/plugins/dap.lua
@@ -6,9 +6,26 @@ return {
"leoluz/nvim-dap-go",
"mxsdev/nvim-dap-vscode-js",
"anuvyklack/hydra.nvim",
+ "nvim-telescope/telescope-dap.nvim",
+ "rcarriga/cmp-dap",
},
keys = { { "<leader>d" } },
config = function()
require("alpha.dap")
+ local ok_telescope, telescope = pcall(require, "telescope")
+ if ok_telescope then
+ telescope.load_extension("dap")
+ end
+
+ local ok_cmp, cmp = pcall(require, "cmp")
+ if ok_cmp then
+ cmp.setup.filetype({ "dap-repl", "dapui_watches" }, {
+ sources = cmp.config.sources({
+ { name = "dap" },
+ }, {
+ { name = "buffer" },
+ }),
+ })
+ end
end
}
diff --git a/lua/alpha/plugins/database.lua b/lua/alpha/plugins/database.lua
index 39e42a5..fceb506 100644
--- a/lua/alpha/plugins/database.lua
+++ b/lua/alpha/plugins/database.lua
@@ -5,7 +5,8 @@ return {
"kristijanhusak/vim-dadbod-completion",
"tpope/vim-dotenv",
},
- config = function ()
+ keys = {{"<leader><leader>db", ':tab DBUI<cr>'}},
+ init = function ()
require("alpha.database")
end
}
diff --git a/lua/alpha/plugins/fugitive.lua b/lua/alpha/plugins/fugitive.lua
new file mode 100644
index 0000000..bcf7ea8
--- /dev/null
+++ b/lua/alpha/plugins/fugitive.lua
@@ -0,0 +1,12 @@
+return {
+ "tpope/vim-fugitive",
+ keys = {
+ {"<leader>ga", ":Git fetch --all -p<cr>"},
+ {"<leader>gl", ":Git pull<cr>"},
+ },
+ cmd = { "G", "Git" },
+ config = function ()
+ vim.keymap.set("n", "<leader>gdh", ":diffget //2<cr>", nil)
+ vim.keymap.set("n", "<leader>gdl", ":diffget //3<cr>", nil)
+ end
+}
diff --git a/lua/alpha/plugins/gitsigns.lua b/lua/alpha/plugins/gitsigns.lua
index 12a1840..524da78 100644
--- a/lua/alpha/plugins/gitsigns.lua
+++ b/lua/alpha/plugins/gitsigns.lua
@@ -6,6 +6,7 @@ return {
config = function()
local gitsigns = require("gitsigns")
gitsigns.setup({
+ trouble = false,
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>hs', gitsigns.stage_hunk, { buffer = bufnr })
vim.keymap.set('n', '<leader>hu', gitsigns.undo_stage_hunk, { buffer = bufnr })
diff --git a/lua/alpha/plugins/harpoon.lua b/lua/alpha/plugins/harpoon.lua
index 8a4ecc6..b410c8e 100644
--- a/lua/alpha/plugins/harpoon.lua
+++ b/lua/alpha/plugins/harpoon.lua
@@ -4,6 +4,7 @@ return {
"nvim-lua/plenary.nvim",
"nvim-lua/popup.nvim",
},
+ keys = require('alpha.harpoon').keymaps,
config = function ()
require("alpha.harpoon").setup()
end
diff --git a/lua/alpha/plugins/init.lua b/lua/alpha/plugins/init.lua
index 334cb01..5fb4f25 100644
--- a/lua/alpha/plugins/init.lua
+++ b/lua/alpha/plugins/init.lua
@@ -13,42 +13,12 @@ return {
require("nvim-projectconfig").setup()
end,
},
- {
- "ThePrimeagen/git-worktree.nvim",
- config = function()
- require("git-worktree").setup({})
- end,
- },
- {
- "folke/trouble.nvim",
- dependencies = "kyazdani42/nvim-web-devicons",
- },
- "vim-test/vim-test",
"rcarriga/nvim-notify",
-
"Raimondi/delimitMate",
"lukas-reineke/indent-blankline.nvim",
-
"tpope/vim-surround",
"tpope/vim-repeat",
- "tpope/vim-fugitive",
"tpope/vim-rhubarb",
"tpope/vim-dotenv",
"tpope/vim-eunuch",
- {
- "numToStr/Comment.nvim",
- config = function()
- require("Comment").setup()
- end,
- },
- {
- "phaazon/mind.nvim",
- branch = "v2.2",
- dependencies = { "nvim-lua/plenary.nvim" },
- },
-
- { "adalessa/laravel.nvim", dev = false },
-
- "adalessa/composer.nvim",
- "adalessa/php-code-actions.nvim",
}
diff --git a/lua/alpha/plugins/laravel.lua b/lua/alpha/plugins/laravel.lua
new file mode 100644
index 0000000..0082653
--- /dev/null
+++ b/lua/alpha/plugins/laravel.lua
@@ -0,0 +1,25 @@
+return {
+ "adalessa/laravel.nvim",
+ dependencies = {
+ "rcarriga/nvim-notify",
+ "adalessa/composer.nvim",
+ },
+ cmd = {"Sali", "Artisan", "Composer"},
+ keys = {{"<leader>pa", function ()
+ require("telescope").extensions.laravel.laravel()
+ end}},
+ config = function()
+ local laravel = require("laravel")
+ local artisan = require("laravel.artisan")
+ local notify = require("notify")
+
+ laravel.setup()
+
+ vim.keymap.set("n", "<leader>ac", function()
+ artisan.clean_cmd_list_cache()
+ notify.notify("Artisan cmd list cache clean", "info", { title = "Laravel.nvim" })
+ end, { noremap = true })
+
+ require("telescope").load_extension("laravel")
+ end
+}
diff --git a/lua/alpha/plugins/lsp.lua b/lua/alpha/plugins/lsp.lua
index ac07faf..c7da38a 100644
--- a/lua/alpha/plugins/lsp.lua
+++ b/lua/alpha/plugins/lsp.lua
@@ -2,7 +2,12 @@ return {
"neovim/nvim-lspconfig",
dependencies = {
"hrsh7th/cmp-nvim-lsp-signature-help",
- "jose-elias-alvarez/null-ls.nvim",
+ {
+ "jose-elias-alvarez/null-ls.nvim",
+ dependencies = {
+ "adalessa/php-code-actions.nvim",
+ }
+ },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"WhoIsSethDaniel/mason-tool-installer.nvim",
diff --git a/lua/alpha/plugins/mind.lua b/lua/alpha/plugins/mind.lua
new file mode 100644
index 0000000..70c0e23
--- /dev/null
+++ b/lua/alpha/plugins/mind.lua
@@ -0,0 +1,16 @@
+return {
+ "phaazon/mind.nvim",
+ branch = "v2.2",
+ dependencies = { "nvim-lua/plenary.nvim" },
+ cmd = { "MindOpenMain", "MindOpenProject" },
+ config = function()
+ local dirs = {}
+ if vim.fn.isdirectory("/mnt/nas/alpha/mind/data") == 1 then
+ dirs = {
+ state_path = "/mnt/nas/alpha/mind/mind.json",
+ data_dir = "/mnt/nas/alpha/mind/data",
+ }
+ end
+ require('mind').setup({ persistence = dirs })
+ end
+}
diff --git a/lua/alpha/plugins/neotest.lua b/lua/alpha/plugins/neotest.lua
index 2cecb60..5a332be 100644
--- a/lua/alpha/plugins/neotest.lua
+++ b/lua/alpha/plugins/neotest.lua
@@ -1,5 +1,6 @@
return {
"nvim-neotest/neotest",
+ enabled = false,
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-treesitter/nvim-treesitter",
diff --git a/lua/alpha/plugins/refactoring.lua b/lua/alpha/plugins/refactoring.lua
index c8bf7fc..349cc63 100644
--- a/lua/alpha/plugins/refactoring.lua
+++ b/lua/alpha/plugins/refactoring.lua
@@ -4,7 +4,11 @@ return {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
+ keys = { { "<leader>rr", function()
+ require("telescope").extensions.refactoring.refactors()
+ end, mode = { "n", "v" } } },
config = function()
require("refactoring").setup({})
+ require("telescope").load_extension("refactoring")
end
}
diff --git a/lua/alpha/plugins/rest.lua b/lua/alpha/plugins/rest.lua
index a0ec729..7b60a9d 100644
--- a/lua/alpha/plugins/rest.lua
+++ b/lua/alpha/plugins/rest.lua
@@ -1,6 +1,7 @@
return {
"NTBBloodbath/rest.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
+ ft = "http",
config = function()
local rest_nvim = require("rest-nvim")
diff --git a/lua/alpha/plugins/telescope.lua b/lua/alpha/plugins/telescope.lua
index ba6ae58..52d7b8b 100644
--- a/lua/alpha/plugins/telescope.lua
+++ b/lua/alpha/plugins/telescope.lua
@@ -6,7 +6,6 @@ return {
{ "nvim-telescope/telescope-fzy-native.nvim" },
{ "kyazdani42/nvim-web-devicons" },
{ "nvim-telescope/telescope-file-browser.nvim" },
- { "nvim-telescope/telescope-dap.nvim" },
{ "nvim-telescope/telescope-ui-select.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
},
diff --git a/lua/alpha/plugins/test.lua b/lua/alpha/plugins/test.lua
new file mode 100644
index 0000000..7fcabc9
--- /dev/null
+++ b/lua/alpha/plugins/test.lua
@@ -0,0 +1,49 @@
+return {
+ "vim-test/vim-test",
+ keys = {{"<leader>t"}},
+ dependencies = {
+ "anuvyklack/hydra.nvim",
+ },
+ config = function()
+ local hydra = require("hydra")
+
+ vim.g["test#preserve_screen"] = 1
+
+ vim.cmd([[
+ let test#php#pest#executable = './vendor/bin/sail test'
+ let test#strategy = 'neovim'
+ let test#neovim#term_position = 'vert'
+ let g:test#preserve_screen = 1
+]] )
+
+ local hint = [[
+ Vim Tests
+ _n_: Near test _f_: Current file _s_: Test Suit ^
+ _l_: Test Last _g_: Visit
+ ^ ^ _<Esc>_ ^
+]]
+
+ hydra({
+ name = "vimtest",
+ hint = hint,
+ mode = "n",
+ config = {
+ color = "teal",
+ invoke_on_body = true,
+ hint = {
+ border = "rounded",
+ position = "bottom",
+ }
+ },
+ body = "<leader>t",
+ heads = {
+ { "n", ":TestNearest<CR>" },
+ { "f", ":TestFile<CR>" },
+ { "s", ":TestSuit<CR>" },
+ { "l", ":TestLast<CR>" },
+ { "g", ":TestVisit<CR>" },
+ { '<Esc>', nil, { exit = true } }
+ }
+ })
+ end
+}
diff --git a/lua/alpha/plugins/trouble.lua b/lua/alpha/plugins/trouble.lua
new file mode 100644
index 0000000..b3ed1c9
--- /dev/null
+++ b/lua/alpha/plugins/trouble.lua
@@ -0,0 +1,8 @@
+return {
+ "folke/trouble.nvim",
+ dependencies = "kyazdani42/nvim-web-devicons",
+ keys = { { "<leader>oo", "<cmd>TroubleToggle<cr>" } },
+ config = function()
+ require("trouble").setup()
+ end
+}
diff --git a/lua/alpha/plugins/worktree.lua b/lua/alpha/plugins/worktree.lua
new file mode 100644
index 0000000..bd7c923
--- /dev/null
+++ b/lua/alpha/plugins/worktree.lua
@@ -0,0 +1,11 @@
+return {
+ "ThePrimeagen/git-worktree.nvim",
+ keys = {
+ { "<leader>gt", function() require("telescope").extensions.git_worktree.git_worktrees() end },
+ { "<leader>gn", function() require("telescope").extensions.git_worktree.create_git_worktree() end },
+ },
+ config = function()
+ require("git-worktree").setup({})
+ require("telescope").load_extension("git_worktree")
+ end,
+}
diff --git a/lua/alpha/telescope/mappings.lua b/lua/alpha/telescope/mappings.lua
index eab56fd..42d2c4b 100644
--- a/lua/alpha/telescope/mappings.lua
+++ b/lua/alpha/telescope/mappings.lua
@@ -23,8 +23,6 @@ vim.api.nvim_set_keymap("c", "<c-r><c-r>", "<Plug>(TelescopeFuzzyCommandSearch)"
map_tele("<leader>pp", "project_files")
map_tele("<leader>gc", "branches")
-map_tele("<leader>gt", "worktree")
-map_tele("<leader>gn", "worktree_create")
map_tele("<leader>pw", "grep_word")
map_tele("<leader>ps", "grep_string")
map_tele("<leader>pf", "projectionist")
@@ -37,10 +35,7 @@ map_tele("<leader>bp", "file_browser")
map_tele("<leader>gs", "git_status")
map_tele("<leader>ve", "diagnostics")
map_tele("<leader>fp", "my_plugins")
-map_tele("<leader>rr", "refactor", {}, nil, {"n", "v"})
map_tele("<leader>po", "api_specs")
-
-map_tele("<leader>pa", "laravel_commands")
map_tele("<leader>pm", "gateway")
return map_tele
diff --git a/lua/alpha/telescope/setup.lua b/lua/alpha/telescope/setup.lua
index e569db7..627eaed 100644
--- a/lua/alpha/telescope/setup.lua
+++ b/lua/alpha/telescope/setup.lua
@@ -159,16 +159,7 @@ require("telescope").setup({
},
},
})
-_ = require("telescope").load_extension("dap")
_ = require("telescope").load_extension("notify")
_ = require("telescope").load_extension("file_browser")
--- makes the selection like lsp code actions in telescope
_ = require("telescope").load_extension("ui-select")
_ = require("telescope").load_extension("fzf")
-_ = require("telescope").load_extension("git_worktree")
--- _ = require("telescope").load_extension "neoclip"
--- _ = require("telescope").load_extension "frecency"
--- _ = require("telescope").load_extension "smart_history"
--- _ = require("telescope").load_extension("projectionist")
-_ = require("telescope").load_extension("laravel")
-_ = require("telescope").load_extension("refactoring")