aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-01-31 09:44:13 +0100
committerAriel D'Alessandro <dalessandro.ariel@gmail.com>2023-01-31 09:44:13 +0100
commit669561e21073e6efafddda25ba3ace69fb43819e (patch)
treef94ebd60ad4cab480b5cbcb7e65dd2060696c339
parent5044c70e9f62cdd06ee91e754423b07c1c18c12d (diff)
downloadnvim-conf-669561e21073e6efafddda25ba3ace69fb43819e.tar.gz
nvim-conf-669561e21073e6efafddda25ba3ace69fb43819e.zip
feat: apply stylua
-rw-r--r--.luacheckrc24
-rw-r--r--after/ftplugin/lua.lua6
-rw-r--r--after/ftplugin/lua.vim1
-rw-r--r--init.lua4
-rw-r--r--lazy-lock.json2
-rw-r--r--lua/alpha/completition/init.lua210
-rw-r--r--lua/alpha/dap.lua272
-rw-r--r--lua/alpha/database.lua66
-rw-r--r--lua/alpha/globals.lua16
-rw-r--r--lua/alpha/harpoon.lua51
-rw-r--r--lua/alpha/laravel-tinker.lua99
-rw-r--r--lua/alpha/lsp/attach.lua49
-rw-r--r--lua/alpha/lsp/init.lua18
-rw-r--r--lua/alpha/lsp/mason.lua16
-rw-r--r--lua/alpha/lsp/null-ls.lua55
-rw-r--r--lua/alpha/lsp/servers.lua22
-rw-r--r--lua/alpha/lsp/setups.lua134
-rw-r--r--lua/alpha/lsp/tools.lua4
-rw-r--r--lua/alpha/php/gateway.lua198
-rw-r--r--lua/alpha/php/lsp.lua197
-rw-r--r--lua/alpha/php/servers.lua42
-rw-r--r--lua/alpha/scratchs/behat-test.lua111
-rw-r--r--lua/alpha/scratchs/laravel.lua2
-rw-r--r--lua/alpha/scratchs/sample.lua36
-rw-r--r--lua/alpha/snips/ft/cucumber.lua7
-rw-r--r--lua/alpha/snips/ft/go.lua190
-rw-r--r--lua/alpha/snips/ft/lua.lua82
-rw-r--r--lua/alpha/snips/ft/php.lua198
-rw-r--r--lua/alpha/snips/ft/yaml.lua258
-rw-r--r--lua/alpha/telescope/actions.lua230
-rw-r--r--lua/alpha/telescope/init.lua210
-rw-r--r--lua/alpha/telescope/mappings.lua24
-rw-r--r--lua/alpha/telescope/setup.lua320
-rw-r--r--lua/alpha/utils.lua30
-rw-r--r--lua/config/autocmds.lua10
-rw-r--r--lua/config/diagnostic.lua10
-rw-r--r--lua/config/init.lua18
-rw-r--r--lua/config/keymaps.lua2
-rw-r--r--lua/config/lazy.lua66
-rw-r--r--lua/config/options.lua4
-rw-r--r--lua/plugins/autopairs.lua6
-rw-r--r--lua/plugins/colorscheme.lua18
-rw-r--r--lua/plugins/comment.lua6
-rw-r--r--lua/plugins/completition.lua36
-rw-r--r--lua/plugins/composer.lua4
-rw-r--r--lua/plugins/dap.lua54
-rw-r--r--lua/plugins/database.lua20
-rw-r--r--lua/plugins/dressing.lua310
-rw-r--r--lua/plugins/easy-align.lua4
-rw-r--r--lua/plugins/fugitive.lua18
-rw-r--r--lua/plugins/gitsigns.lua38
-rw-r--r--lua/plugins/harpoon.lua18
-rw-r--r--lua/plugins/icon-picker.lua14
-rw-r--r--lua/plugins/indent-blankline.lua4
-rw-r--r--lua/plugins/init.lua20
-rw-r--r--lua/plugins/laravel.lua28
-rw-r--r--lua/plugins/lazygit.lua4
-rw-r--r--lua/plugins/lsp.lua48
-rw-r--r--lua/plugins/lualine.lua89
-rw-r--r--lua/plugins/mind.lua26
-rw-r--r--lua/plugins/neogen.lua12
-rw-r--r--lua/plugins/neotest.lua110
-rw-r--r--lua/plugins/notify.lua16
-rw-r--r--lua/plugins/project-config.lua4
-rw-r--r--lua/plugins/refactoring.lua28
-rw-r--r--lua/plugins/rest.lua77
-rw-r--r--lua/plugins/snippets.lua233
-rw-r--r--lua/plugins/telescope.lua50
-rw-r--r--lua/plugins/test.lua68
-rw-r--r--lua/plugins/todo-comments.lua38
-rw-r--r--lua/plugins/transparent.lua34
-rw-r--r--lua/plugins/treesitter.lua152
-rw-r--r--lua/plugins/trouble.lua8
-rw-r--r--lua/plugins/worktree.lua26
-rw-r--r--stylua.toml6
75 files changed, 2492 insertions, 2429 deletions
diff --git a/.luacheckrc b/.luacheckrc
new file mode 100644
index 0000000..f88df1f
--- /dev/null
+++ b/.luacheckrc
@@ -0,0 +1,24 @@
+-- Rerun tests only if their modification time changed.
+cache = true
+
+std = luajit
+codes = true
+
+self = false
+
+-- Glorious list of warnings: https://luacheck.readthedocs.io/en/stable/warnings.html
+ignore = {
+ "212", -- Unused argument, In the case of callback function, _arg_name is easier to understand than _, so this option is set to off.
+ "122", -- Indirectly setting a readonly global
+}
+
+globals = {
+ "P",
+ "R",
+ "Reload",
+}
+
+-- Global objects defined by the C code
+read_globals = {
+ "vim",
+}
diff --git a/after/ftplugin/lua.lua b/after/ftplugin/lua.lua
new file mode 100644
index 0000000..c49ec18
--- /dev/null
+++ b/after/ftplugin/lua.lua
@@ -0,0 +1,6 @@
+local set = vim.bo
+
+set.tabstop = 2
+set.softtabstop = 2
+set.expandtab = true
+set.shiftwidth = 2
diff --git a/after/ftplugin/lua.vim b/after/ftplugin/lua.vim
deleted file mode 100644
index 52ba3ad..0000000
--- a/after/ftplugin/lua.vim
+++ /dev/null
@@ -1 +0,0 @@
-set listchars=tab:\ \ ,trail:-
diff --git a/init.lua b/init.lua
index f1e3c91..7255d55 100644
--- a/init.lua
+++ b/init.lua
@@ -1,2 +1,2 @@
-require("config")
-require("alpha.globals")
+require "config"
+require "alpha.globals"
diff --git a/lazy-lock.json b/lazy-lock.json
index 72a4b94..b00440d 100644
--- a/lazy-lock.json
+++ b/lazy-lock.json
@@ -10,7 +10,6 @@
"cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
- "composer.nvim": { "branch": "main", "commit": "e62eaaef7c978d96a2abfeb2ca570650a4f21528" },
"dressing.nvim": { "branch": "master", "commit": "4436d6f41e2f6b8ada57588acd1a9f8b3d21453c" },
"fidget.nvim": { "branch": "main", "commit": "44585a0c0085765195e6961c15529ba6c5a2a13b" },
"fzf.vim": { "branch": "master", "commit": "dc71692255b62d1f67dc55c8e51ab1aa467b1d46" },
@@ -45,7 +44,6 @@
"nvim-treesitter-refactor": { "branch": "master", "commit": "75f5895cc662d61eb919da8050b7a0124400d589" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "9011d333aa411ae71ca8762ca3a277ce6b9e6527" },
"nvim-web-devicons": { "branch": "master", "commit": "a421d183ef37dfa13f51a5805bed2381aebf9080" },
- "php-code-actions.nvim": { "branch": "main", "commit": "a85a695c58f9c5e8033d824ffae366e9797e0b28" },
"playground": { "branch": "master", "commit": "c19bcfd6a3681bc876e1b861f6685bfc04972d0d" },
"plenary.nvim": { "branch": "master", "commit": "9a0d3bf7b832818c042aaf30f692b081ddd58bd9" },
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
diff --git a/lua/alpha/completition/init.lua b/lua/alpha/completition/init.lua
index 2951608..9955d4e 100644
--- a/lua/alpha/completition/init.lua
+++ b/lua/alpha/completition/init.lua
@@ -1,127 +1,127 @@
-local cmp = require("cmp")
-local lspkind = require("lspkind")
-local luasnip = require("luasnip")
-local cmp_autopairs = require("nvim-autopairs.completion.cmp")
-local compare = require('cmp.config.compare')
+local cmp = require "cmp"
+local lspkind = require "lspkind"
+local luasnip = require "luasnip"
+local cmp_autopairs = require "nvim-autopairs.completion.cmp"
+local compare = require "cmp.config.compare"
-cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } }))
+cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done { map_char = { tex = "" } })
-cmp.setup({
- mapping = {
- ["<C-d>"] = cmp.mapping.scroll_docs(-4),
- ["<C-f>"] = cmp.mapping.scroll_docs(4),
- ["<C-e>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.close()
- elseif luasnip.expand_or_jumpable() then
- luasnip.expand_or_jump()
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<C-n>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.choice_active() then
- luasnip.change_choice(1)
- else
- fallback()
- end
- end, { "i", "s" }),
- ["<C-p>"] = cmp.mapping.select_prev_item(),
- ["<C-y>"] = cmp.mapping.confirm({
- behavior = cmp.ConfirmBehavior.Insert,
- select = true,
- }),
- ["<c-space>"] = cmp.mapping.complete(),
- },
- sources = {
- { name = "nvim_lua" },
- { name = "nvim_lsp" },
- { name = "path" },
- { name = "luasnip" },
- { name = 'nvim_lsp_signature_help' },
- {
- name = "buffer",
- keyword_length = 4,
- option = {
- get_bufnrs = function()
- local bufs = {}
- for _, win in ipairs(vim.api.nvim_list_wins()) do
- bufs[vim.api.nvim_win_get_buf(win)] = true
- end
- return vim.tbl_keys(bufs)
- end,
- },
- },
- },
+cmp.setup {
+ mapping = {
+ ["<C-d>"] = cmp.mapping.scroll_docs(-4),
+ ["<C-f>"] = cmp.mapping.scroll_docs(4),
+ ["<C-e>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.close()
+ elseif luasnip.expand_or_jumpable() then
+ luasnip.expand_or_jump()
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ ["<C-n>"] = cmp.mapping(function(fallback)
+ if cmp.visible() then
+ cmp.select_next_item()
+ elseif luasnip.choice_active() then
+ luasnip.change_choice(1)
+ else
+ fallback()
+ end
+ end, { "i", "s" }),
+ ["<C-p>"] = cmp.mapping.select_prev_item(),
+ ["<C-y>"] = cmp.mapping.confirm {
+ behavior = cmp.ConfirmBehavior.Insert,
+ select = true,
+ },
+ ["<c-space>"] = cmp.mapping.complete(),
+ },
+ sources = {
+ { name = "nvim_lua" },
+ { name = "nvim_lsp" },
+ { name = "path" },
+ { name = "luasnip" },
+ { name = "nvim_lsp_signature_help" },
+ {
+ name = "buffer",
+ keyword_length = 4,
+ option = {
+ get_bufnrs = function()
+ local bufs = {}
+ for _, win in ipairs(vim.api.nvim_list_wins()) do
+ bufs[vim.api.nvim_win_get_buf(win)] = true
+ end
+ return vim.tbl_keys(bufs)
+ end,
+ },
+ },
+ },
- snippet = {
- expand = function(args)
- require("luasnip").lsp_expand(args.body)
- end,
- },
+ snippet = {
+ expand = function(args)
+ require("luasnip").lsp_expand(args.body)
+ end,
+ },
- formatting = {
- format = lspkind.cmp_format({
- with_text = true,
- menu = {
- buffer = "[buf]",
- nvim_lsp = "[LSP]",
- nvim_lua = "[api]",
- path = "[path]",
- luasnip = "[snip]",
- ["vim-dadbod-completion"] = "[DB]",
- },
- }),
- },
+ formatting = {
+ format = lspkind.cmp_format {
+ with_text = true,
+ menu = {
+ buffer = "[buf]",
+ nvim_lsp = "[LSP]",
+ nvim_lua = "[api]",
+ path = "[path]",
+ luasnip = "[snip]",
+ ["vim-dadbod-completion"] = "[DB]",
+ },
+ },
+ },
- sorting = {
- priority_weight = 2,
- comparators = {
- compare.kind,
- compare.sort_text,
- }
- },
+ sorting = {
+ priority_weight = 2,
+ comparators = {
+ compare.kind,
+ compare.sort_text,
+ },
+ },
- experimental = {
- native_menu = false,
+ experimental = {
+ native_menu = false,
- ghost_text = true,
- },
-})
+ ghost_text = true,
+ },
+}
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
- sources = cmp.config.sources({
- { name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it.
- }, {
- { name = "buffer" },
- }),
+ sources = cmp.config.sources({
+ { name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it.
+ }, {
+ { name = "buffer" },
+ }),
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline("/", {
- mapping = cmp.mapping.preset.cmdline(),
- sources = {
- { name = "buffer" },
- },
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = {
+ { name = "buffer" },
+ },
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", {
- mapping = cmp.mapping.preset.cmdline(),
- sources = cmp.config.sources({
- { name = "path" },
- }, {
- { name = "cmdline" },
- }),
+ mapping = cmp.mapping.preset.cmdline(),
+ sources = cmp.config.sources({
+ { name = "path" },
+ }, {
+ { name = "cmdline" },
+ }),
})
cmp.setup.filetype({ "sql", "mysql", "plsql" }, {
- sources = cmp.config.sources({
- { name = "vim-dadbod-completion" },
- }, {
- { name = "buffer" },
- }),
+ sources = cmp.config.sources({
+ { name = "vim-dadbod-completion" },
+ }, {
+ { name = "buffer" },
+ }),
})
diff --git a/lua/alpha/dap.lua b/lua/alpha/dap.lua
index ee53443..a89d72e 100644
--- a/lua/alpha/dap.lua
+++ b/lua/alpha/dap.lua
@@ -1,33 +1,33 @@
-local dap, dapui, dap_go = require("dap"), require("dapui"), require("dap-go")
+local dap, dapui, dap_go = require "dap", require "dapui", require "dap-go"
-require("nvim-dap-virtual-text").setup({})
+require("nvim-dap-virtual-text").setup {}
-- dap.set_log_level('TRACE')
dap_go.setup()
-dapui.setup({
- icons = { expanded = "▾", collapsed = "▸" },
- layouts = {
- {
- elements = {
- "scopes",
- "breakpoints",
- "stacks",
- "watches",
- },
- size = 80,
- position = "left",
- },
- {
- elements = {
- "repl",
- "console",
- },
- size = 10,
- position = "bottom",
- },
- },
-})
+dapui.setup {
+ icons = { expanded = "▾", collapsed = "▸" },
+ layouts = {
+ {
+ elements = {
+ "scopes",
+ "breakpoints",
+ "stacks",
+ "watches",
+ },
+ size = 80,
+ position = "left",
+ },
+ {
+ elements = {
+ "repl",
+ "console",
+ },
+ size = 10,
+ position = "bottom",
+ },
+ },
+}
vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" })
vim.fn.sign_define("DapStopped", { text = "▶", texthl = "", linehl = "", numhl = "" })
@@ -36,83 +36,83 @@ vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl
vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" })
dap.adapters.php = {
- type = "executable",
- command = "php-debug-adapter",
+ type = "executable",
+ command = "php-debug-adapter",
}
dap.configurations.php = {
- {
- type = "php",
- request = "launch",
- name = "Laravel",
- port = 9003,
- pathMappings = {
- ["/var/www/html"] = "${workspaceFolder}",
- },
- },
- {
- type = "php",
- request = "launch",
- name = "Symfony",
- port = 9003,
- pathMappings = {
- ["/app"] = "${workspaceFolder}",
- },
- },
+ {
+ type = "php",
+ request = "launch",
+ name = "Laravel",
+ port = 9003,
+ pathMappings = {
+ ["/var/www/html"] = "${workspaceFolder}",
+ },
+ },
+ {
+ type = "php",
+ request = "launch",
+ name = "Symfony",
+ port = 9003,
+ pathMappings = {
+ ["/app"] = "${workspaceFolder}",
+ },
+ },
}
-require("dap-vscode-js").setup({
- debugger_cmd = { "js-debug-adapter" },
- adapters = { "pwa-node", "pwa-chrome", "node-terminal" },
-})
+require("dap-vscode-js").setup {
+ debugger_cmd = { "js-debug-adapter" },
+ adapters = { "pwa-node", "pwa-chrome", "node-terminal" },
+}
-for _, language in ipairs({ "typescript", "javascript" }) do
- require("dap").configurations[language] = {
- {
- type = "pwa-node",
- request = "launch",
- name = "Launch file",
- program = "${file}",
- cwd = "${workspaceFolder}",
- },
- {
- type = "pwa-node",
- request = "attach",
- name = "Attach",
- processId = require("dap.utils").pick_process,
- cwd = "${workspaceFolder}",
- },
- }
+for _, language in ipairs { "typescript", "javascript" } do
+ require("dap").configurations[language] = {
+ {
+ type = "pwa-node",
+ request = "launch",
+ name = "Launch file",
+ program = "${file}",
+ cwd = "${workspaceFolder}",
+ },
+ {
+ type = "pwa-node",
+ request = "attach",
+ name = "Attach",
+ processId = require("dap.utils").pick_process,
+ cwd = "${workspaceFolder}",
+ },
+ }
end
-for _, language in ipairs({ "typescriptreact", "javascriptreact" }) do
- require("dap").configurations[language] = {
- {
- type = "pwa-chrome",
- name = "Attach - Remote Debugging",
- request = "attach",
- program = "${file}",
- cwd = vim.fn.getcwd(),
- sourceMaps = true,
- protocol = "inspector",
- port = 9222,
- webRoot = "${workspaceFolder}",
- },
- {
- type = "pwa-chrome",
- name = "Launch Chrome",
- request = "launch",
- url = "http://localhost:3000",
- },
- }
+for _, language in ipairs { "typescriptreact", "javascriptreact" } do
+ require("dap").configurations[language] = {
+ {
+ type = "pwa-chrome",
+ name = "Attach - Remote Debugging",
+ request = "attach",
+ program = "${file}",
+ cwd = vim.fn.getcwd(),
+ sourceMaps = true,
+ protocol = "inspector",
+ port = 9222,
+ webRoot = "${workspaceFolder}",
+ },
+ {
+ type = "pwa-chrome",
+ name = "Launch Chrome",
+ request = "launch",
+ url = "http://localhost:3000",
+ },
+ }
end
-- Events Listeners
dap.listeners.after.event_initialized["dapui_config"] = function()
- dapui.open({})
+ dapui.open {}
end
-local hydra = require("hydra")
+local hydra = require "hydra"
local hint = [[
Nvim DAP
_d_: Start/Continue _j_: StepOver _k_: StepOut _l_: StepInto ^
@@ -124,52 +124,52 @@ local hint = [[
^^ _<Esc>_
]]
-hydra({
- name = "dap",
- hint = hint,
- mode = "n",
- config = {
- color = "blue",
- invoke_on_body = true,
- hint = {
- border = "rounded",
- position = "bottom",
- },
- },
- body = "<leader>d",
- heads = {
- { "d", dap.continue },
- { "bp", dap.toggle_breakpoint },
- { "l", dap.step_into },
- { "j", dap.step_over },
- { "k", dap.step_out },
- { "h", dapui.eval },
- { "c", dap.run_to_cursor },
- {
- "bc",
- function()
- vim.ui.input({ prompt = "Condition: " }, function(condition)
- dap.set_breakpoint(condition)
- end)
- end,
- },
- {
- "?",
- function()
- vim.ui.input({ prompt = "Log: " }, function(log)
- dap.set_breakpoint(nil, nil, log)
- end)
- end,
- },
- {
- "x",
- function()
- dap.terminate()
- dapui.close({})
- dap.clear_breakpoints()
- end,
- },
+hydra {
+ name = "dap",
+ hint = hint,
+ mode = "n",
+ config = {
+ color = "blue",
+ invoke_on_body = true,
+ hint = {
+ border = "rounded",
+ position = "bottom",
+ },
+ },
+ body