From ea0f4bf8ffade657b1d45152dbc183d4679e75c4 Mon Sep 17 00:00:00 2001 From: Elvis Claros Castro Date: Fri, 12 Jul 2024 11:18:14 -0300 Subject: Feat: PI --- README.md | 16 +- init.lua | 2 +- lazy-lock.json | 21 +- lua/alpha/animations.lua | 50 ----- lua/alpha/completition/init.lua | 205 ------------------- lua/alpha/dap/configs/dart.lua | 32 --- lua/alpha/dap/configs/elixir.lua | 52 ----- lua/alpha/dap/configs/golang.lua | 1 - lua/alpha/dap/configs/javascript.lua | 62 ------ lua/alpha/dap/configs/kotlin.lua | 18 -- lua/alpha/dap/configs/php.lua | 27 --- lua/alpha/dap/configs/rust.lua | 57 ------ lua/alpha/dap/init.lua | 108 ---------- lua/alpha/globals.lua | 23 --- lua/alpha/laravel-tinker.lua | 64 ------ lua/alpha/lsp/attach.lua | 29 --- lua/alpha/lsp/default.lua | 30 --- lua/alpha/lsp/flags.lua | 3 - lua/alpha/lsp/init.lua | 65 ------ lua/alpha/lsp/mason.lua | 23 --- lua/alpha/lsp/null-ls.lua | 53 ----- lua/alpha/lsp/servers/emmet_ls.lua | 12 -- lua/alpha/lsp/servers/html.lua | 14 -- lua/alpha/lsp/servers/jsonls.lua | 14 -- lua/alpha/lsp/servers/kotlin_language_server.lua | 12 -- lua/alpha/lsp/servers/lua_ls.lua | 36 ---- lua/alpha/lsp/servers/phpactor.lua | 80 -------- lua/alpha/lsp/servers/python.lua | 16 -- lua/alpha/lsp/servers/rust_analyzer.lua | 24 --- lua/alpha/lsp/servers/texlab.lua | 16 -- lua/alpha/lsp/servers/tsserver.lua | 33 --- lua/alpha/lsp/servers/vscode_smarty_langserver.lua | 25 --- lua/alpha/lsp/tools.lua | 8 - lua/alpha/packer_install.lua | 27 --- lua/alpha/php/gateway.lua | 137 ------------- lua/alpha/php/lsp.lua | 151 -------------- lua/alpha/php/servers.lua | 38 ---- lua/alpha/select_to_quickfix.lua | 53 ----- lua/alpha/snips/ft/cucumber.lua | 71 ------- lua/alpha/snips/ft/go.lua | 134 ------------ lua/alpha/snips/ft/lua.lua | 69 ------- lua/alpha/snips/ft/php.lua | 163 --------------- lua/alpha/snips/ft/yaml.lua | 225 --------------------- lua/alpha/telescope/init.lua | 186 ----------------- lua/alpha/telescope/mappings.lua | 55 ----- lua/alpha/telescope/my_actions.lua | 170 ---------------- lua/alpha/telescope/setup.lua | 222 -------------------- lua/alpha/test_menu.lua | 50 ----- lua/alpha/test_strategy.lua | 65 ------ lua/alpha/utils.lua | 11 - lua/config/keymaps.lua | 4 +- lua/pi/animations.lua | 50 +++++ lua/pi/completition/init.lua | 205 +++++++++++++++++++ lua/pi/dap/configs/dart.lua | 32 +++ lua/pi/dap/configs/elixir.lua | 52 +++++ lua/pi/dap/configs/golang.lua | 1 + lua/pi/dap/configs/javascript.lua | 62 ++++++ lua/pi/dap/configs/kotlin.lua | 18 ++ lua/pi/dap/configs/php.lua | 27 +++ lua/pi/dap/configs/rust.lua | 57 ++++++ lua/pi/dap/init.lua | 108 ++++++++++ lua/pi/globals.lua | 23 +++ lua/pi/laravel-tinker.lua | 64 ++++++ lua/pi/lsp/attach.lua | 29 +++ lua/pi/lsp/default.lua | 30 +++ lua/pi/lsp/flags.lua | 3 + lua/pi/lsp/init.lua | 65 ++++++ lua/pi/lsp/mason.lua | 23 +++ lua/pi/lsp/null-ls.lua | 53 +++++ lua/pi/lsp/servers/emmet_ls.lua | 12 ++ lua/pi/lsp/servers/html.lua | 14 ++ lua/pi/lsp/servers/jsonls.lua | 14 ++ lua/pi/lsp/servers/kotlin_language_server.lua | 12 ++ lua/pi/lsp/servers/lua_ls.lua | 36 ++++ lua/pi/lsp/servers/phpactor.lua | 80 ++++++++ lua/pi/lsp/servers/python.lua | 16 ++ lua/pi/lsp/servers/rust_analyzer.lua | 24 +++ lua/pi/lsp/servers/texlab.lua | 16 ++ lua/pi/lsp/servers/tsserver.lua | 33 +++ lua/pi/lsp/servers/vscode_smarty_langserver.lua | 25 +++ lua/pi/lsp/tools.lua | 8 + lua/pi/packer_install.lua | 27 +++ lua/pi/php/gateway.lua | 137 +++++++++++++ lua/pi/php/lsp.lua | 151 ++++++++++++++ lua/pi/php/servers.lua | 38 ++++ lua/pi/select_to_quickfix.lua | 53 +++++ lua/pi/snips/ft/cucumber.lua | 71 +++++++ lua/pi/snips/ft/go.lua | 134 ++++++++++++ lua/pi/snips/ft/lua.lua | 69 +++++++ lua/pi/snips/ft/php.lua | 163 +++++++++++++++ lua/pi/snips/ft/yaml.lua | 225 +++++++++++++++++++++ lua/pi/telescope/init.lua | 186 +++++++++++++++++ lua/pi/telescope/mappings.lua | 55 +++++ lua/pi/telescope/my_actions.lua | 170 ++++++++++++++++ lua/pi/telescope/setup.lua | 222 ++++++++++++++++++++ lua/pi/test_menu.lua | 50 +++++ lua/pi/test_strategy.lua | 65 ++++++ lua/pi/utils.lua | 11 + lua/plugins/animation.lua | 2 +- lua/plugins/completition.lua | 2 +- lua/plugins/dap.lua | 2 +- lua/plugins/lsp.lua | 2 +- lua/plugins/lualine.lua | 2 +- lua/plugins/smooth-cursor.lua | 32 +++ lua/plugins/smooth-cursor.lua.n | 32 --- lua/plugins/snippets.lua | 2 +- lua/plugins/telescope.lua | 4 +- lua/plugins/test.lua | 4 +- lua/plugins/vimwiki.lua | 2 +- 109 files changed, 3084 insertions(+), 3083 deletions(-) delete mode 100644 lua/alpha/animations.lua delete mode 100644 lua/alpha/completition/init.lua delete mode 100644 lua/alpha/dap/configs/dart.lua delete mode 100644 lua/alpha/dap/configs/elixir.lua delete mode 100644 lua/alpha/dap/configs/golang.lua delete mode 100644 lua/alpha/dap/configs/javascript.lua delete mode 100644 lua/alpha/dap/configs/kotlin.lua delete mode 100644 lua/alpha/dap/configs/php.lua delete mode 100644 lua/alpha/dap/configs/rust.lua delete mode 100644 lua/alpha/dap/init.lua delete mode 100644 lua/alpha/globals.lua delete mode 100644 lua/alpha/laravel-tinker.lua delete mode 100644 lua/alpha/lsp/attach.lua delete mode 100644 lua/alpha/lsp/default.lua delete mode 100644 lua/alpha/lsp/flags.lua delete mode 100644 lua/alpha/lsp/init.lua delete mode 100644 lua/alpha/lsp/mason.lua delete mode 100644 lua/alpha/lsp/null-ls.lua delete mode 100644 lua/alpha/lsp/servers/emmet_ls.lua delete mode 100644 lua/alpha/lsp/servers/html.lua delete mode 100644 lua/alpha/lsp/servers/jsonls.lua delete mode 100644 lua/alpha/lsp/servers/kotlin_language_server.lua delete mode 100644 lua/alpha/lsp/servers/lua_ls.lua delete mode 100644 lua/alpha/lsp/servers/phpactor.lua delete mode 100644 lua/alpha/lsp/servers/python.lua delete mode 100644 lua/alpha/lsp/servers/rust_analyzer.lua delete mode 100644 lua/alpha/lsp/servers/texlab.lua delete mode 100644 lua/alpha/lsp/servers/tsserver.lua delete mode 100644 lua/alpha/lsp/servers/vscode_smarty_langserver.lua delete mode 100644 lua/alpha/lsp/tools.lua delete mode 100644 lua/alpha/packer_install.lua delete mode 100644 lua/alpha/php/gateway.lua delete mode 100644 lua/alpha/php/lsp.lua delete mode 100644 lua/alpha/php/servers.lua delete mode 100644 lua/alpha/select_to_quickfix.lua delete mode 100644 lua/alpha/snips/ft/cucumber.lua delete mode 100644 lua/alpha/snips/ft/go.lua delete mode 100644 lua/alpha/snips/ft/lua.lua delete mode 100644 lua/alpha/snips/ft/php.lua delete mode 100644 lua/alpha/snips/ft/yaml.lua delete mode 100644 lua/alpha/telescope/init.lua delete mode 100644 lua/alpha/telescope/mappings.lua delete mode 100644 lua/alpha/telescope/my_actions.lua delete mode 100644 lua/alpha/telescope/setup.lua delete mode 100644 lua/alpha/test_menu.lua delete mode 100644 lua/alpha/test_strategy.lua delete mode 100644 lua/alpha/utils.lua create mode 100644 lua/pi/animations.lua create mode 100644 lua/pi/completition/init.lua create mode 100644 lua/pi/dap/configs/dart.lua create mode 100644 lua/pi/dap/configs/elixir.lua create mode 100644 lua/pi/dap/configs/golang.lua create mode 100644 lua/pi/dap/configs/javascript.lua create mode 100644 lua/pi/dap/configs/kotlin.lua create mode 100644 lua/pi/dap/configs/php.lua create mode 100644 lua/pi/dap/configs/rust.lua create mode 100644 lua/pi/dap/init.lua create mode 100644 lua/pi/globals.lua create mode 100644 lua/pi/laravel-tinker.lua create mode 100644 lua/pi/lsp/attach.lua create mode 100644 lua/pi/lsp/default.lua create mode 100644 lua/pi/lsp/flags.lua create mode 100644 lua/pi/lsp/init.lua create mode 100644 lua/pi/lsp/mason.lua create mode 100644 lua/pi/lsp/null-ls.lua create mode 100644 lua/pi/lsp/servers/emmet_ls.lua create mode 100644 lua/pi/lsp/servers/html.lua create mode 100644 lua/pi/lsp/servers/jsonls.lua create mode 100644 lua/pi/lsp/servers/kotlin_language_server.lua create mode 100644 lua/pi/lsp/servers/lua_ls.lua create mode 100644 lua/pi/lsp/servers/phpactor.lua create mode 100644 lua/pi/lsp/servers/python.lua create mode 100644 lua/pi/lsp/servers/rust_analyzer.lua create mode 100644 lua/pi/lsp/servers/texlab.lua create mode 100644 lua/pi/lsp/servers/tsserver.lua create mode 100644 lua/pi/lsp/servers/vscode_smarty_langserver.lua create mode 100644 lua/pi/lsp/tools.lua create mode 100644 lua/pi/packer_install.lua create mode 100644 lua/pi/php/gateway.lua create mode 100644 lua/pi/php/lsp.lua create mode 100644 lua/pi/php/servers.lua create mode 100644 lua/pi/select_to_quickfix.lua create mode 100644 lua/pi/snips/ft/cucumber.lua create mode 100644 lua/pi/snips/ft/go.lua create mode 100644 lua/pi/snips/ft/lua.lua create mode 100644 lua/pi/snips/ft/php.lua create mode 100644 lua/pi/snips/ft/yaml.lua create mode 100644 lua/pi/telescope/init.lua create mode 100644 lua/pi/telescope/mappings.lua create mode 100644 lua/pi/telescope/my_actions.lua create mode 100644 lua/pi/telescope/setup.lua create mode 100644 lua/pi/test_menu.lua create mode 100644 lua/pi/test_strategy.lua create mode 100644 lua/pi/utils.lua create mode 100644 lua/plugins/smooth-cursor.lua delete mode 100644 lua/plugins/smooth-cursor.lua.n diff --git a/README.md b/README.md index 0972b8a..70e3b82 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Para configurar los plugins utilizo la opcion de lazy `config` donde se puede de Utilizando la opcion `opts` no es necesario utilizar el `config` dado que lazy va a ver la opcion y automaticamente hacer el `require("plugin").setup(opts)` con las opcioens definidas Utilizando el valor `true` para `config` donde le indica que tiene que hacer el `require("plugin").setup()` pero sin opciones. Utilizando una funcion como valor para `config` donde directamente configuro lo necesario ahi. -Utilizando una funcion como valor para `config` donde llamo a otro archivo como `./lua/alpha/lsp` donde la configuracion es extensa y entonces no quiero tenerla toda ahi. +Utilizando una funcion como valor para `config` donde llamo a otro archivo como `./lua/pi/lsp` donde la configuracion es extensa y entonces no quiero tenerla toda ahi. ### LazyLoading Dado que utilizamos el package manager llamado lazy no podia dejar de hablar de esto que es una de sus configuraciones mas importantes, como configurar los plugins para que se carguen solo cuando son necesarios. @@ -47,7 +47,7 @@ return { }, keys = {{"db", ':tab DBUI'}}, init = function () - require("alpha.database") + require("pi.database") end } ``` @@ -74,20 +74,20 @@ Neovim en si no sabe nada de los lenguajes que le digamos, neovim simplemente sa Mi configuración esta separada en las siguientes partes - `./lua/plugins/lsp.lua`: Aca es donde tengo definidos los paquetes que utilizo relacionado a lsp -- `./lua/alpha/lsp`: en este directorio esta mi configuracion en relacion a esto -- `./lua/alpha/lsp/init.lua`: es el primer archivo en cargar. en este configuro mason quien se va a encargar de instalarlos servidores de lsp necesarios. +- `./lua/pi/lsp`: en este directorio esta mi configuracion en relacion a esto +- `./lua/pi/lsp/init.lua`: es el primer archivo en cargar. en este configuro mason quien se va a encargar de instalarlos servidores de lsp necesarios. Luego aplico la configuracion particular para cada server. Idealmente este archivo no necesesita ser modificado. -- `./lua/alpha/lsp/attach.lua`: este ya es un archivo más interesante, en donde configuro los mappings relacionados a lsp +- `./lua/pi/lsp/attach.lua`: este ya es un archivo más interesante, en donde configuro los mappings relacionados a lsp estos solamente van a registrarse para buffers que tengan asociado un servidor de lsp. Aca se pueden cambiar los keybindings o registrar nuevas funciones -- `./lua/alpha/lsp/servers.lua`: acá llegamos al más importante donde registramos los servidores con los mismos nombres que *lspconfig* [ref](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md). En este archivo tenemos una lista que la clave es el nombre del server y como valor es la funcion de registro, para la mayoria podemos utilizar el default, pero algunos servidores tienen una configuracion adicional para esto se puede registrar un callback que debera devolver una tabla con los parametros necesarios. +- `./lua/pi/lsp/servers.lua`: acá llegamos al más importante donde registramos los servidores con los mismos nombres que *lspconfig* [ref](https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md). En este archivo tenemos una lista que la clave es el nombre del server y como valor es la funcion de registro, para la mayoria podemos utilizar el default, pero algunos servidores tienen una configuracion adicional para esto se puede registrar un callback que debera devolver una tabla con los parametros necesarios. ## Completition Como motor de completition utilizo `nvim/cmp`. este provee todas las funcionalidas que necesito. -la configuration se puede encontrar en `./lua/alpha/completition/init.lua` donde defino los keymaps y se configura la integracion con las distintas fuentes como lsp, path, luasnip y otros plugins. +la configuration se puede encontrar en `./lua/pi/completition/init.lua` donde defino los keymaps y se configura la integracion con las distintas fuentes como lsp, path, luasnip y otros plugins. ## Snippets Para snippets utilizo *LuaSnip*, el cual la configuración la mantengo en `./lua/plugins/snippets.lua`. -Pero en este archivo no mantengo los snippets en si mismos, en este solamente tengo la configuracion de como interactua, los snippets se encuentran en `./lua/alpha/snips/ft/` cual carpeta contiene un archivo por cada file type y se registran automaticamente cuando agrego un nuevo archivo (recargar con `s`, o reiniciar neovim). +Pero en este archivo no mantengo los snippets en si mismos, en este solamente tengo la configuracion de como interactua, los snippets se encuentran en `./lua/pi/snips/ft/` cual carpeta contiene un archivo por cada file type y se registran automaticamente cuando agrego un nuevo archivo (recargar con `s`, o reiniciar neovim). diff --git a/init.lua b/init.lua index 8ec306c..7f4fc71 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ require "config" -require "alpha.globals" +require "pi.globals" vim.api.nvim_create_autocmd({ "BufReadPost" }, { pattern = { "*" }, callback = function() diff --git a/lazy-lock.json b/lazy-lock.json index a248747..fe06f1c 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -4,10 +4,11 @@ "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, "LuaSnip": { "branch": "master", "commit": "500981ff6cefc7343e3959ef0f939bd0bfd49ba9" }, "NeoColumn.nvim": { "branch": "main", "commit": "db7695c7c70fcacd290712deef659bca464634ee" }, + "SmoothCursor.nvim": { "branch": "main", "commit": "c082e1e943acec28d95aa05325097426e612047f" }, "animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" }, "baleia.nvim": { "branch": "main", "commit": "4d3b27dbec65a44ceecd9306f605a980bcf4e9b1" }, "buffer_manager.nvim": { "branch": "main", "commit": "fd36131b2b3e0f03fd6353ae2ffc88cf920b3bbb" }, - "catppuccin": { "branch": "main", "commit": "47bd419c0cb776cb0a67ebb525891eca44020b59" }, + "catppuccin": { "branch": "main", "commit": "7946d1a195c66fed38b3e34f9fa8e0c5a2da0700" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-dap": { "branch": "master", "commit": "ea92773e84c0ad3288c3bc5e452ac91559669087" }, @@ -30,7 +31,7 @@ "fzf": { "branch": "master", "commit": "9e92b6f11e0f59272de410f56493893334071e6e" }, "fzf.vim": { "branch": "master", "commit": "279e1ec068f526e985ee7e3f62a71f083bbe0196" }, "git-worktree.nvim": { "branch": "master", "commit": "f247308e68dab9f1133759b05d944569ad054546" }, - "gitsigns.nvim": { "branch": "main", "commit": "375c44bdfdde25585466a966f00c2e291db74f2d" }, + "gitsigns.nvim": { "branch": "main", "commit": "e9c4187c3774a46df2d086a66cf3a7e6bea4c432" }, "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, "hydra.nvim": { "branch": "master", "commit": "3ced42c0b6a6c85583ff0f221635a7f4c1ab0dd0" }, "icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" }, @@ -38,7 +39,7 @@ "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, "indent-o-matic": { "branch": "master", "commit": "4d11e98f523d3c4500b1dc33f0d1a248a4f69719" }, "laravel.nvim": { "branch": "main", "commit": "8aaf614b5c8fc045f75ebc2ba69d68e33847b06d" }, - "lazy.nvim": { "branch": "main", "commit": "d1de92dffab5a862332fdd1892889d362369c12f" }, + "lazy.nvim": { "branch": "main", "commit": "1d451b4c2ce957da05e2123ce1a001804fc7ea96" }, "lspkind-nvim": { "branch": "master", "commit": "1735dd5a5054c1fb7feaf8e8658dbab925f4f0cf" }, "lua-utils.nvim": { "branch": "main", "commit": "e565749421f4bbb5d2e85e37c3cef9d56553d8bd" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, @@ -52,12 +53,12 @@ "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, "neogen": { "branch": "main", "commit": "6de0add4805165317ab7d3d36b5cef48b1b865f3" }, "neorg": { "branch": "main", "commit": "db75bb60ba5e565051cf7bb18c8b1a519ed58d3a" }, - "neotest": { "branch": "master", "commit": "26ed90509c377d10dbdebd25b7094a886323b32b" }, + "neotest": { "branch": "master", "commit": "0fe9186afac9b7874ba304fd28d6325d07e5e274" }, "neotest-go": { "branch": "main", "commit": "92950ad7be2ca02a41abca5c6600ff6ffaf5b5d6" }, "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, "neotest-rust": { "branch": "main", "commit": "0418811e1e3499b2501593f2e131d02f5e6823d4" }, "neotest-vim-test": { "branch": "master", "commit": "75c4228882ae4883b11bfce9b8383e637eb44192" }, - "noice.nvim": { "branch": "main", "commit": "04ff1defa257db569a687ec16051a27fbaeb0e2f" }, + "noice.nvim": { "branch": "main", "commit": "622d7e5b676605ce62569cf2bd15d06c825d0043" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "numb.nvim": { "branch": "master", "commit": "3f7d4a74bd456e747a1278ea1672b26116e0824d" }, @@ -67,16 +68,16 @@ "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, "nvim-dap": { "branch": "master", "commit": "6f79b822997f2e8a789c6034e147d42bc6706770" }, "nvim-dap-go": { "branch": "main", "commit": "3999f0744e80d2dba5775189fc7c7a5e9846053e" }, - "nvim-dap-ui": { "branch": "master", "commit": "b7267003ba4dd860350be86f75b9d9ea287cedca" }, + "nvim-dap-ui": { "branch": "master", "commit": "754104da429457bff733444a3048bc8296daf775" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "484995d573c0f0563f6a66ebdd6c67b649489615" }, "nvim-dap-vscode-js": { "branch": "main", "commit": "03bd29672d7fab5e515fc8469b7d07cc5994bbf6" }, - "nvim-lspconfig": { "branch": "master", "commit": "cf97d2485fc3f6d4df1b79a3ea183e24c272215e" }, - "nvim-nio": { "branch": "master", "commit": "7969e0a8ffabdf210edd7978ec954a47a737bbcc" }, + "nvim-lspconfig": { "branch": "master", "commit": "216deb2d1b5fbf24398919228208649bbf5cbadf" }, + "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-python-repl": { "branch": "main", "commit": "3d63e4f298233cb97e0fb2d8360857120235112f" }, "nvim-spectre": { "branch": "master", "commit": "9a28f926d3371b7ef02243cbbb653a0478d06e31" }, "nvim-transparent": { "branch": "main", "commit": "fd35a46f4b7c1b244249266bdcb2da3814f01724" }, - "nvim-treesitter": { "branch": "master", "commit": "4068e1c0966eee10bc8937b54f8cf8f68b76961f" }, + "nvim-treesitter": { "branch": "master", "commit": "972aa544efb56e2f2f53c5f3c2537e43467dd5cb" }, "nvim-treesitter-context": { "branch": "master", "commit": "f56a1430f21334868a86eb980b12e0af55690e98" }, "nvim-treesitter-endwise": { "branch": "master", "commit": "8b34305ffc28bd75a22f5a0a9928ee726a85c9a6" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "34867c69838078df7d6919b130c0541c0b400c47" }, @@ -104,7 +105,7 @@ "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-dadbod": { "branch": "master", "commit": "7888cb7164d69783d3dce4e0283decd26b82538b" }, "vim-dadbod-completion": { "branch": "master", "commit": "8c9051c1cfc73fcf5bfe9a84db7097e4f7c0180d" }, - "vim-dadbod-ui": { "branch": "master", "commit": "acfb660447f41634b6a299039e034abac126653a" }, + "vim-dadbod-ui": { "branch": "master", "commit": "d2ffc1bdae3041105f3b57423e0e81a5d9429267" }, "vim-dispatch": { "branch": "master", "commit": "4c695bc052cad2ae6b980aebbe48d046466e27ae" }, "vim-dotenv": { "branch": "master", "commit": "5c51cfcf8d87280d6414e03cd6b253eb70ecb800" }, "vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, diff --git a/lua/alpha/animations.lua b/lua/alpha/animations.lua deleted file mode 100644 index c0b7a6c..0000000 --- a/lua/alpha/animations.lua +++ /dev/null @@ -1,50 +0,0 @@ -local redraw_buffer = function() - local Animation = require "animation" - local fps = 45 -- frames per second - local easing = require "animation.easing" - - local buffer = 0 - local len = 0 - local place_holder = {} - - local lines = vim.api.nvim_buf_get_lines(buffer, 0, -1, true) - - for _, line in ipairs(lines) do - len = len + string.len(line) - table.insert(place_holder, "") - end - - vim.api.nvim_buf_set_lines(buffer, 0, #lines, true, place_holder) - - local duration = math.ceil(len / fps * 1000) - - local i = 1 - local line_nr = 1 - local insertLine = "" - - local function callback() - if lines[line_nr] == nil then - return true - end - local char = string.sub(lines[line_nr], i, i) - if char == nil then - return true - end - insertLine = insertLine .. char - i = i + 1 - vim.api.nvim_buf_set_lines(buffer, line_nr - 1, line_nr, true, { insertLine }) - - if insertLine == lines[line_nr] then - i = 1 - line_nr = line_nr + 1 - insertLine = "" - end - end - - local animation = Animation(duration, fps, easing.line, callback) - animation:run() -end - -return { - redraw_buffer = redraw_buffer, -} diff --git a/lua/alpha/completition/init.lua b/lua/alpha/completition/init.lua deleted file mode 100644 index 667e30b..0000000 --- a/lua/alpha/completition/init.lua +++ /dev/null @@ -1,205 +0,0 @@ -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.setup { - window = { - completion = { - border = "rounded", - -- winhighlight = 'Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None', - -- winblend = vim.o.pumblend, - -- scrolloff = 0, - -- col_offset = 0, - -- side_padding = 1, - -- scrollbar = true, - }, - documentation = { - -- max_height = math.floor(WIDE_HEIGHT * (WIDE_HEIGHT / vim.o.lines)), - -- max_width = math.floor((WIDE_HEIGHT * 2) * (vim.o.columns / (WIDE_HEIGHT * 2 * 16 / 9))), - border = "rounded", - -- winhighlight = 'FloatBorder:NormalFloat', - -- winblend = vim.o.pumblend, - }, - }, - mapping = { - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = 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" }), - [""] = 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" }), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }, - [""] = cmp.mapping.complete(), - }, - sources = { - { name = "dictionary" }, - { name = "nvim_lua" }, - { name = "nvim_lsp" }, - { name = "path" }, - { name = "luasnip" }, - { name = "copilot" }, - { - name = "buffer", - keyword_length = 4, - option = { - get_bufnrs = function() - local bufs = {} - for _, win in ipairs(vim.api.nvim_list_wins()) do - local bufnr = vim.api.nvim_win_get_buf(win) - if vim.api.nvim_buf_get_option(bufnr, "buftype") ~= "terminal" then - bufs[bufnr] = true - end - end - return vim.tbl_keys(bufs) - end, - }, - }, - }, - - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - formatting = { - format = function (entry, vim_item) - lspkind.cmp_format { - with_text = true, - menu = { - buffer = "[buf]", - nvim_lsp = "[ ]", - nvim_lua = "[api]", - path = "[path]", - luasnip = "[snip]", - copilot = "[ﮧ ]", - ["vim-dadbod-completion"] = "[DB]", - }, - } - local KIND_ICONS = { - Tailwind = '󰹞󰹞󰹞󰹞󰹞󰹞󰹞󰹞', - Color = ' ', - -- Class = 7, - -- Constant = '󰚞', - -- Constructor = 4, - -- Enum = 13, - -- EnumMember = 20, - -- Event = 23, - -- Field = 5, - -- File = 17, - -- Folder = 19, - -- Function = 3, - -- Interface = 8, - -- Keyword = 14, - -- Method = 2, - -- Module = 9, - -- Operator = 24, - -- Property = 10, - -- Reference = 18, - Snippet = " ", - -- Struct = 22, - -- Text = "", - -- TypeParameter = 25, - -- Unit = 11, - -- Value = 12, - -- Variable = 6 - } - if vim_item.kind == 'Color' and entry.completion_item.documentation then - local _, _, r, g, b = - ---@diagnostic disable-next-line: param-type-mismatch - string.find(entry.completion_item.documentation, '^rgb%((%d+), (%d+), (%d+)') - - if r and g and b then - local color = string.format('%02x', r) .. string.format('%02x', g) .. string.format('%02x', b) - local group = 'Tw_' .. color - - if vim.api.nvim_call_function('hlID', { group }) < 1 then - vim.api.nvim_command('highlight' .. ' ' .. group .. ' ' .. 'guifg=#' .. color) - end - - vim_item.kind = KIND_ICONS.Tailwind - vim_item.kind_hl_group = group - - return vim_item - end - end - - vim_item.kind = KIND_ICONS[vim_item.kind] or vim_item.kind - return vim_item - end - }, - - sorting = { - priority_weight = 2, - comparators = { - compare.kind, - compare.sort_text, - }, - }, - - experimental = { - native_menu = false, - - ghost_text = false, - }, -} - -vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" }) - --- 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" }, - }), -}) - --- 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" }, - }, -}) - --- 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" }, - }), -}) - -cmp.setup.filetype({ "sql", "mysql", "plsql" }, { - sources = cmp.config.sources({ - { name = "vim-dadbod-completion" }, - }, { - { name = "buffer" }, - }), -}) diff --git a/lua/alpha/dap/configs/dart.lua b/lua/alpha/dap/configs/dart.lua deleted file mode 100644 index a23c118..0000000 --- a/lua/alpha/dap/configs/dart.lua +++ /dev/null @@ -1,32 +0,0 @@ -local dap = require('dap') - -dap.adapters.dart = { - type = "executable", - -- As of this writing, this functionality is open for review in https://github.com/flutter/flutter/pull/91802 - command = "flutter", - args = {"debug_adapter"} -} -dap.configurations.dart = { - { - name = "Launch Flutter Program Linux", - type = "dart", - request = "launch", - -- The nvim-dap plugin populates this variable with the filename of the current buffer - program = "${file}", - -- The nvim-dap plugin populates this variable with the editor's current working directory - cwd = "${workspaceFolder}", - -- This gets forwarded to the Flutter CLI tool, substitute `linux` for whatever device you wish to launch - toolArgs = {"-d", "linux"} - }, - { - name = "Launch Flutter Program Motorola", - type = "dart", - request = "launch", - -- The nvim-dap plugin populates this variable with the filename of the current buffer - program = "${file}", - -- The nvim-dap plugin populates this variable with the editor's current working directory - cwd = "${workspaceFolder}", - -- This gets forwarded to the Flutter CLI tool, substitute `linux` for whatever device you wish to launch - toolArgs = {"-d", "192.168.0.33:5555"} - } -} diff --git a/lua/alpha/dap/configs/elixir.lua b/lua/alpha/dap/configs/elixir.lua deleted file mode 100644 index bf732ce..0000000 --- a/lua/alpha/dap/configs/elixir.lua +++ /dev/null @@ -1,52 +0,0 @@ -local dap = require('dap') - -dap.adapters.mix_task = { - type = 'executable', - command = 'elixir-ls-debugger', -- El comando 'elixir-ls' está en $PATH - args = {} -} - -dap.configurations.elixir = { - { - type = "mix_task", - name = "mix (Default task)", - request = "launch", - projectDir = "${workspaceRoot}" - }, - { - type = "mix_task", - name = "mix test", - request = "launch", - task = 'test', - env = { - MIX_ENV = "test", - MIX_TARGET = "host", - HEX_UNSAFE_HTTPS = 1 - }, - taskArgs = {"--trace"}, - startApps = true, -- for Phoenix projects - projectDir = "${workspaceFolder}", - requireFiles = { - "test/**/test_helper.exs", - "test/**/*_test.exs" - } - }, - { - type = "mix_task", - name = "phx server", - request = "launch", - stackTraceMode = "all", - task = 'phx.server', - debugAutoInterpretAllModules = true, - noDebug = false, - exitAfterTaskReturns = false, - env = { - MIX_ENV = "dev", - MIX_TARGET = "host", - HEX_UNSAFE_HTTPS = 1 - }, - startApps = false, -- for Phoenix projects - taskArgs = {"--no-halt", "--open"}, - projectDir = "${workspaceFolder}", - }, -} diff --git a/lua/alpha/dap/configs/golang.lua b/lua/alpha/dap/configs/golang.lua deleted file mode 100644 index 1ec449a..0000000 --- a/lua/alpha/dap/configs/golang.lua +++ /dev/null @@ -1 +0,0 @@ -require("dap-go").setup() diff --git a/lua/alpha/dap/configs/javascript.lua b/lua/alpha/dap/configs/javascript.lua deleted file mode 100644 index 03173ba..0000000 --- a/lua/alpha/dap/configs/javascript.lua +++ /dev/null @@ -1,62 +0,0 @@ -local dap = require('dap') -dap.adapters.firefox = { - type = 'executable', - command = 'firefox-debug-adapter', -} - -dap.configurations.typescript = { - { - name = 'Debug with Firefox', - type = 'firefox', - request = 'launch', - reAttach = true, - url = 'http://localhost:3010', - webRoot = '${workspaceFolder}', - firefoxExecutable = '/home/elvis/.local/bin/firefox' - }, -} --- 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}", --- }, --- } --- 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", --- }, --- } --- end diff --git a/lua/alpha/dap/configs/kotlin.lua b/lua/alpha/dap/configs/kotlin.lua deleted file mode 100644 index aa486db..0000000 --- a/lua/alpha/dap/configs/kotlin.lua +++ /dev/null @@ -1,18 +0,0 @@ -local dap = require('dap') - -dap.adapters.kotlin = { - type = 'executable'; - command = "kotlin-debug-adapter"; -} - -dap.configurations.kotlin = { - { - type = 'kotlin', - request = 'launch', - program = "${file}", - name = 'Launch kotlin program', - projectRoot = "${workspaceFolder}/app", - mainClass = "AppKt", - } -} -dap.defaults.kotlin.auto_continue_if_many_stopped = false diff --git a/lua/alpha/dap/configs/php.lua b/lua/alpha/dap/configs/php.lua deleted file mode 100644 index 968bb9d..0000000 --- a/lua/alpha/dap/configs/php.lua +++ /dev/null @@ -1,27 +0,0 @@ -local dap = require("dap") - -dap.adapters.php = { - 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}", - }, - }, -} diff --git a/lua/alpha/dap/configs/rust.lua b/lua/alpha/dap/configs/rust.lua deleted file mode 100644 index 9ca976f..0000000 --- a/lua/alpha/dap/configs/rust.lua +++ /dev/null @@ -1,57 +0,0 @@ -local dap = require("dap") - -local rust_adapter = nil -local rust_adapters = { "lldb-vscode", "codelldb" } -for _, adapter in pairs(rust_adapters) do - if vim.fn.executable(adapter) then - rust_adapter = adapter - end -end - -if rust_adapter ~= nil then - dap.adapters.lldb = { - type = "executable", - command = rust_adapter, - name = "lldb", - } - - dap.configurations.rust = { - { - name = "launch", - type = "lldb", - request = "launch", - program = function() - local dir = vim.fn.getcwd() - return dir .. "/target/debug/" .. vim.fs.basename(dir) - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - args = function() - local resp = vim.fn.input "Arguments: " - if resp == "" then - return {} - end - - return vim.fn.split(resp, " ") - end, - }, - { - name = "custom", - type = "lldb", - request = "launch", - program = function() - return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") - end, - cwd = "${workspaceFolder}", - stopOnEntry = false, - args = function() - local resp = vim.fn.input "Arguments: " - if resp == "" then - return {} - end - - return vim.fn.split(resp, " ") - end, - }, - } -end diff --git a/lua/alpha/dap/init.lua b/lua/alpha/dap/init.lua deleted file mode 100644 index 12ea352..0000000 --- a/lua/alpha/dap/init.lua +++ /dev/null @@ -1,108 +0,0 @@ -local dap, dapui, hydra = require "dap", require "dapui", require "hydra" - -dap.set_log_level('TRACE') - --- Setup Virtual Text -require("nvim-dap-virtual-text").setup {} - -for _, ft_path in ipairs(vim.api.nvim_get_runtime_file("lua/alpha/dap/configs/*.lua", true)) do - loadfile(ft_path)() -end - --- Signs -vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapStopped", { text = "▶", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointRejected", { text = "🚫", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" }) - --- UI structure -dapui.setup { - icons = { expanded = "▾", collapsed = "▸" }, - layouts = { - { - elements = { - "scopes", - "breakpoints", - "stacks", - "watches", - }, - size = 50, - position = "right", - }, - { - elements = { - "repl", - "console", - }, - size = 7, - position = "bottom", - }, - }, -} - --- Events Listeners -dap.listeners.after.event_initialized["dapui_config"] = function() - dapui.open {} -end - -local hint = [[ - Nvim DAP - _d_: Start/Continue _j_: StepOver _k_: StepOut _l_: StepInto ^ - _bp_: Toogle Breakpoint _bc_: Conditional Breakpoint ^ - _?_: log point ^ - _c_: Run To Cursor ^ - _h_: Show information of the variable under the cursor ^ - _x_: Stop Debbuging ^ - ^^ __ -]] - -hydra { - name = "dap", - hint = hint, - mode = "n", - config = { - color = "blue", - invoke_on_body = true, - hint = { - border = "rounded", - position = "bottom", - }, - }, - body = "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, - }, - - { "", nil, { exit = true } }, - }, -} diff --git a/lua/alpha/globals.lua b/lua/alpha/globals.lua deleted file mode 100644 index e445e72..0000000 --- a/lua/alpha/globals.lua +++ /dev/null @@ -1,23 +0,0 @@ ---- Dumps all values into pretty print ----@vararg any ----@return any -dump = function(...) - local args = {...} - - local mapped = {} - for _, v in ipairs(args) do - table.insert(mapped, vim.inspect(v)) - end - print(unpack(mapped)) - - return unpack(args) -end - -Reload = function(...) - return require("plenary.reload").reload_module(...) -end - -R = function(name) - Reload(name) - return require(name) -end diff --git a/lua/alpha/laravel-tinker.lua b/lua/alpha/laravel-tinker.lua deleted file mode 100644 index 214d958..0000000 --- a/lua/alpha/laravel-tinker.lua +++ /dev/null @@ -1,64 +0,0 @@ -local M = {} - -M.runCode = function() - local curBuff = vim.api.nvim_get_current_buf() - - local stats = vim.api.nvim_list_uis()[1] - - local width = stats.width - local height = stats.height - - local bufh = vim.api.nvim_create_buf(false, true) - local winId = vim.api.nvim_open_win(bufh, true, { - relative = "editor", - width = width * 0.75, - height = height * 0.75, - col = 2, - row = 2, - style = "minimal", - border = "rounded", - }) - - -- get the start and end lines of selection - local startLine = vim.api.nvim_buf_get_mark(curBuff, "<")[1] - 1 - local endLine = vim.api.nvim_buf_get_mark(curBuff, ">")[1] - -- print("range: ", startLine, endLine) - - local code = vim.api.nvim_buf_get_lines(curBuff, startLine, endLine, false) - - -- print (vim.inspect(code)) - - local codeText = vim.fn.shellescape(table.concat(code, " ")) - -- print(codeText) - - local result = vim.fn.systemlist("php artisan tinker --execute=" .. codeText) - - vim.api.nvim_buf_set_text(bufh, 0, 0, 0, 0, result) -end - -M.backTerminal = function() - local bufh = vim.api.nvim_create_buf(false, true) - local term = vim.api.nvim_open_term(bufh, {}) - - local winId = vim.api.nvim_open_win(bufh, true, { - relative = "editor", - width = 80, - height = 80, - col = 2, - row = 2, - style = "minimal", - border = "rounded", - }) - - local jobId = vim.fn.jobstart("php artisan tinker", { - on_stdout = function(err, data) - print(err, vim.inspect(data)) - vim.api.nvim_chan_send(term, table.concat(data, "\n")) - end, - }) - - vim.api.nvim_chan_send(jobId, "$ub = UploadBatch::find(1);\n") - vim.api.nvim_chan_send(jobId, "dump($ub);\n") -end - -return M diff --git a/lua/alpha/lsp/attach.lua b/lua/alpha/lsp/attach.lua deleted file mode 100644 index 7c7413c..0000000 --- a/lua/alpha/lsp/attach.lua +++ /dev/null @@ -1,29 +0,0 @@ -local telescope_mapper = require "alpha.telescope.mappings" - -return function(client, bufnr) - -- keymaps for lsp - vim.keymap.set("n", "K", vim.lsp.buf.hover, { buffer = 0, desc = "LSP Help information of symbol under the cursor" }) - vim.keymap.set("n", "vrn", vim.lsp.buf.rename, { buffer = 0, desc = "LSP Rename symbol under cursor" }) - vim.keymap.set("i", "", vim.lsp.buf.signature_help, { buffer = 0, desc = "LSP Signature help" }) - vim.keymap.set("n", "vo", ":LspRestart", { noremap = true, desc = "LSP Restart Server" }) - vim.keymap.set({ "n", "v" }, "vca", vim.lsp.buf.code_action, { buffer = 0, desc = "LSP Code actions" }) - vim.keymap.set("n", "vf", function() - return vim.lsp.buf.format { - async = true, - filter = function(cli) - return cli.name ~= "lua_ls" - end, - } - end, { buffer = 0, desc = "LSP format file" }) - - telescope_mapper("gr", "lsp_references", { buffer = true, desc = "LSP References of symbol on cursor" }) - telescope_mapper("pv", "find_symbol", { buffer = true, desc = "LSP find symbol on the project" }) - telescope_mapper("pd", "lsp_document_symbols", { buffer = true, desc = "LSP document symbols" }) - telescope_mapper("gd", "lsp_definitions", { buffer = true, desc = "LSP go to definition" }) - - vim.bo.omnifunc = "v:lua.vim.lsp.omnifunc" - - if client.server_capabilities.inlayHintProvider then - vim.lsp.inlay_hint.enable(bufnr) - end -end diff --git a/lua/alpha/lsp/default.lua b/lua/alpha/lsp/default.lua deleted file mode 100644 index 61e1b28..0000000 --- a/lua/alpha/lsp/default.lua +++ /dev/null @@ -1,30 +0,0 @@ -return { - mason = { - enable = true, - auto_install = false, - }, - servers = { - emmet_ls = { enable = true }, - gopls = { enable = true }, - html = { enable = true }, - jsonls = { enable = true }, - lua_ls = { enable = true, neodev = true }, - nil_ls = { enable = true }, - phpactor = {enable = true }, - rust_analyzer = { enable = true }, - svelte = { enable = true }, - tailwindcss = { enable = true, filetypes = {"blade", "html", "svelte"} }, - tsserver = { enable = true }, - volar = { enable = true }, - texlab = { enable = true, filetypes = {"tex", "bib"} }, - pyright = { enable = true, filetypes = {"python"} }, - kotlin_language_server = { enable = true, filetypes = {"kotlin"}, root_dir = require("lspconfig.util").root_pattern("build.gradle.kts", "pom.xml", ".git") }, - smarty_ls = { enable = true, filetypes = {"smarty"}, root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") }, - }, - default_options = function (options) - return vim.tbl_deep_extend("force", { - on_attach = require"alpha.lsp.attach", - flags = require "alpha.lsp.flags", - }, options) - end, -} diff --git a/lua/alpha/lsp/flags.lua b/lua/alpha/lsp/flags.lua deleted file mode 100644 index f70b467..0000000 --- a/lua/alpha/lsp/flags.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - debounce_text_changes = 150, -} diff --git a/lua/alpha/lsp/init.lua b/lua/alpha/lsp/init.lua deleted file mode 100644 index 0d69f07..0000000 --- a/lua/alpha/lsp/init.lua +++ /dev/null @@ -1,65 +0,0 @@ -return { - setup = function(ops) - ops = vim.tbl_deep_extend("force", require "alpha.lsp.default", ops) - - local lspconfig = require "lspconfig" - - local mason_servers = {} - for server, options in pairs(ops.servers) do - if options.enable == true then - local ok, definition = pcall(require, "alpha.lsp.servers." .. server) - local server_options - if not ok then - server_options = ops.default_options(options) - else - server_options = definition(options) - end - lspconfig[server].setup(server_options) - table.insert(mason_servers, server) - end - end - - -- Mason - if ops.mason.enable then - local mason_ops = {} - if ops.mason.auto_install == true then - mason_ops.ensure_installed = mason_servers - end - local mason_lspconfig = require "mason-lspconfig" - mason_lspconfig.setup(mason_ops) - end - - -- TODO: implement null ls with options - require "alpha.lsp.null-ls" - - local servers = {} - for server, options in pairs(ops.servers) do - table.insert(servers, string.format("%s <%s>", server, options.enable)) - end - - -- TODO: create an auto command that on write of the configuration, calls again the setup and restart the server if it's up. - -- can get the client by name of the file - - vim.api.nvim_create_user_command("AlphaLSP", function() - vim.ui.select(servers, { prompt = "LSP Servers" }, function(server) - if server == nil then - return - end - - server = string.match(server, "^(.+) <") - local path = string.format("%s/lua/alpha/lsp/servers/%s.lua", vim.fn.stdpath "config", server) - if vim.fn.filereadable(path) == 0 then - local create = vim.fn.confirm("Server Does Not exist. Create new server?", "&Yes\n&No\n&Cancel") - if create ~= 1 then - return - end - end - - local uri = vim.uri_from_fname(path) - local buffer = vim.uri_to_bufnr(uri) - - vim.api.nvim_win_set_buf(0, buffer) - end) - end, {}) - end, -} diff --git a/lua/alpha/lsp/mason.lua b/lua/alpha/lsp/mason.lua deleted file mode 100644 index a8c6ce7..0000000 --- a/lua/alpha/lsp/mason.lua +++ /dev/null @@ -1,23 +0,0 @@ -local mason_lspconfig = require "mason-lspconfig" -local servers = require "alpha.lsp.servers" -local lspconfig = require "lspconfig" - -local mason_servers = {} - -for server, _ in pairs(servers) do - local cmd = lspconfig[server].cmd[1] - if vim.fn.executable(cmd) == 0 then - table.insert(mason_servers, server) - end -end - -mason_lspconfig.setup { - -- ensure_installed = mason_servers, -} - --- filter the list for the ones not globally installed --- require("mason-tool-installer").setup { --- ensure_installed = vim.tbl_filter(function (tool) --- return vim.fn.executable(tool) == 0 --- end, require "alpha.lsp.tools"), --- } diff --git a/lua/alpha/lsp/null-ls.lua b/lua/alpha/lsp/null-ls.lua deleted file mode 100644 index b329ba6..0000000 --- a/lua/alpha/lsp/null-ls.lua +++ /dev/null @@ -1,53 +0,0 @@ -local null_ls = require "null-ls" --- local php_actions = require "php-code-actions" --- local laravel_actions = require("laravel.code-actions") - -null_ls.setup { - sources = { - -- null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.formatting.jq, - null_ls.builtins.code_actions.refactoring, - null_ls.builtins.formatting.alejandra, - null_ls.builtins.diagnostics.luacheck, - null_ls.builtins.formatting.stylua, - - null_ls.builtins.diagnostics.yamllint, - - -- php_actions.getter_setter, - -- php_actions.file_creator, - - -- null_ls.builtins.diagnostics.phpstan.with { - -- to_temp_file = false, - -- method = null_ls.methods.DIAGNOSTICS_ON_SAVE, - -- -- command = "./bin/phpstan", - -- -- condition = function () - -- -- return vim.fn.findfile("bin/phpstan") ~= "" - -- -- end - -- }, - null_ls.builtins.diagnostics.phpcs.with { - method = null_ls.methods.DIAGNOSTICS_ON_SAVE, - condition = function(utils) - return utils.root_has_file "phpcs.xml" - end, - }, - null_ls.builtins.formatting.pint, - }, -} - -vim.keymap.set({ "n", "v" }, "vca", vim.lsp.buf.code_action, {desc = "LSP (null ls) Code actions"}) -vim.keymap.set("n", "vf", function() - return vim.lsp.buf.format { async = true } -end, {desc = "LSP (null ls) Format file"}) - --- function to toogle and possible restart it -vim.api.nvim_create_user_command("NullLsToggle", function() - local sources = vim.tbl_map(function(el) - return el.name - end, null_ls.get_sources()) - vim.ui.select(sources, {}, function(selected) - if not selected then - return - end - null_ls.toggle(selected) - end) -end, {}) diff --git a/lua/alpha/lsp/servers/emmet_ls.lua b/lua/alpha/lsp/servers/emmet_ls.lua deleted file mode 100644 index c4f1cb6..0000000 --- a/lua/alpha/lsp/servers/emmet_ls.lua +++ /dev/null @@ -1,12 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - capabilities = capabilities, - filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "blade", "vue" }, - }, ops) -end diff --git a/lua/alpha/lsp/servers/html.lua b/lua/alpha/lsp/servers/html.lua deleted file mode 100644 index 7b8ef54..0000000 --- a/lua/alpha/lsp/servers/html.lua +++ /dev/null @@ -1,14 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - local config = { - on_attach = lsp_attach, - flags = lsp_flags, - } - if vim.fn.executable "html-languageserver" == 1 then - config.cmd = { "html-languageserver", "--stdio" } - end - - return vim.tbl_extend("force", config, ops) -end diff --git a/lua/alpha/lsp/servers/jsonls.lua b/lua/alpha/lsp/servers/jsonls.lua deleted file mode 100644 index 9c731ab..0000000 --- a/lua/alpha/lsp/servers/jsonls.lua +++ /dev/null @@ -1,14 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - local config = { - on_attach = lsp_attach, - flags = lsp_flags, - } - if vim.fn.executable "json-languageserver" == 1 then - config.cmd = { "json-languageserver", "--stdio" } - end - - return vim.tbl_extend("force", config, ops) -end diff --git a/lua/alpha/lsp/servers/kotlin_language_server.lua b/lua/alpha/lsp/servers/kotlin_language_server.lua deleted file mode 100644 index 2a02f7d..0000000 --- a/lua/alpha/lsp/servers/kotlin_language_server.lua +++ /dev/null @@ -1,12 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" -return function(ops) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - ["kotlin-language-server"] = { - } - } - }, ops) -end diff --git a/lua/alpha/lsp/servers/lua_ls.lua b/lua/alpha/lsp/servers/lua_ls.lua deleted file mode 100644 index c5f72bf..0000000 --- a/lua/alpha/lsp/servers/lua_ls.lua +++ /dev/null @@ -1,36 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - if ops.neodev == true then - require("neodev").setup() - end - - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - Lua = { - runtime = { - version = "LuaJIT", - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - checkThirdParty = false, - }, - telemetry = { - enable = false, - }, - hint = { - enable = true, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }, ops) -end diff --git a/lua/alpha/lsp/servers/phpactor.lua b/lua/alpha/lsp/servers/phpactor.lua deleted file mode 100644 index ab5d21d..0000000 --- a/lua/alpha/lsp/servers/phpactor.lua +++ /dev/null @@ -1,80 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -local function phpactor_attach(_, bufnr) - vim.api.nvim_buf_create_user_command(bufnr, "LspPhpactorReindex", function() - vim.lsp.buf_notify(bufnr, "phpactor/index/reindex", {}) - end, {}) - - vim.api.nvim_buf_create_user_command(bufnr, "LspPhpactorStatus", function() - local results, _ = vim.lsp.buf_request_sync(bufnr, "phpactor/status", { ["return"] = true }) - - local content = "" - - for _, res in pairs(results or {}) do - if res ~= nil and res["result"] ~= nil then - content = content .. res["result"] - end - end - - local Popup = require "nui.popup" - local event = require("nui.utils.autocmd").event - - local popup = Popup { - enter = true, - focusable = true, - border = { - style = "rounded", - }, - position = "50%", - size = { - width = "80%", - height = "60%", - }, - } - - -- mount/open the component - popup:mount() - - -- unmount component when cursor leaves buffer - popup:on(event.BufLeave, function() - popup:unmount() - end) - local out = {} - for match in string.gmatch(content, "[^\n]+") do - table.insert(out, match) - end - - -- vim.api.nvim_buf_set_option(popup.bufnr, "filetype", "markdown") - vim.api.nvim_buf_set_lines(popup.bufnr, 0, 1, false, out) - end, {}) -end - -return function(ops) - return vim.tbl_extend("force", { - on_attach = function(client, bufnr) - lsp_attach(client, bufnr) - phpactor_attach(client, bufnr) - end, - flags = lsp_flags, - filetypes = { "php", "blade" }, - init_options = { - ["language_server_worse_reflection.inlay_hints.enable"] = true, - ["language_server_worse_reflection.inlay_hints.params"] = true, - ["language_server_worse_reflection.inlay_hints.types"] = true, - ["language_server_configuration.auto_config"] = false, - ["code_transform.import_globals"] = true, - ["language_server_phpstan.enabled"] = true, - ["language_server_phpstan.level"] = 7, - ["language_server_phpstan.bin"] = "phpstan", - }, - handlers = { - ["textDocument/inlayHint"] = function(err, result, ...) - for _, res in ipairs(result) do - res.label = res.label .. ": " - end - vim.lsp.handlers["textDocument/inlayHint"](err, result, ...) - end, - }, - }, ops) -end diff --git a/lua/alpha/lsp/servers/python.lua b/lua/alpha/lsp/servers/python.lua deleted file mode 100644 index 6cdbf9e..0000000 --- a/lua/alpha/lsp/servers/python.lua +++ /dev/null @@ -1,16 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" -return function (ops) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - ["pyright"] = { - disableOrganizeImports = false, - disableDiagnostics = false, - disableLanguageServices = false, - typeCheckingMode = "strict", - } - } - }, ops) -end diff --git a/lua/alpha/lsp/servers/rust_analyzer.lua b/lua/alpha/lsp/servers/rust_analyzer.lua deleted file mode 100644 index c0db321..0000000 --- a/lua/alpha/lsp/servers/rust_analyzer.lua +++ /dev/null @@ -1,24 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - ["rust-analyzer"] = { - checkOnSave = { - allFeatures = true, - overrideCommand = { - "cargo", - "clippy", - "--workspace", - "--message-format=json", - "--all-targets", - "--all-features", - }, - }, - }, - }, - }, ops) -end diff --git a/lua/alpha/lsp/servers/texlab.lua b/lua/alpha/lsp/servers/texlab.lua deleted file mode 100644 index d749db9..0000000 --- a/lua/alpha/lsp/servers/texlab.lua +++ /dev/null @@ -1,16 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" -return function(ops) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - ["texlab"] = { - latexFormatter = "latexindent", - latexindent = { - modifyLineBreaks = false - } - } - } - }, ops) -end diff --git a/lua/alpha/lsp/servers/tsserver.lua b/lua/alpha/lsp/servers/tsserver.lua deleted file mode 100644 index e27d94a..0000000 --- a/lua/alpha/lsp/servers/tsserver.lua +++ /dev/null @@ -1,33 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - typescript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - }, - }, - javascript = { - inlayHints = { - includeInlayParameterNameHints = "all", - includeInlayParameterNameHintsWhenArgumentMatchesName = false, - includeInlayFunctionParameterTypeHints = true, - includeInlayVariableTypeHints = true, - includeInlayPropertyDeclarationTypeHints = true, - includeInlayFunctionLikeReturnTypeHints = true, - includeInlayEnumMemberValueHints = true, - }, - }, - }, - }, ops) -end diff --git a/lua/alpha/lsp/servers/vscode_smarty_langserver.lua b/lua/alpha/lsp/servers/vscode_smarty_langserver.lua deleted file mode 100644 index e404698..0000000 --- a/lua/alpha/lsp/servers/vscode_smarty_langserver.lua +++ /dev/null @@ -1,25 +0,0 @@ -local lsp_attach = require "alpha.lsp.attach" -local lsp_flags = require "alpha.lsp.flags" - -return function(ops) - return vim.tbl_extend("force", { - on_attach = lsp_attach, - flags = lsp_flags, - settings = { - css = { - validate = true - }, - smarty = { - pluginDirs = {} - }, - ["smarty_ls"] = { - checkOnSave = { - overrideCommand = { - "smarty-language-server", - "--stdio", - }, - }, - }, - }, - }, ops) -end diff --git a/lua/alpha/lsp/tools.lua b/lua/alpha/lsp/tools.lua deleted file mode 100644 index 7919521..0000000 --- a/lua/alpha/lsp/tools.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - "codelldb", - "go-debug-adapter", - "js-debug-adapter", - "php-debug-adapter", - "phpcs", - "phpstan", -} diff --git a/lua/alpha/packer_install.lua b/lua/alpha/packer_install.lua deleted file mode 100644 index 9ef6658..0000000 --- a/lua/alpha/packer_install.lua +++ /dev/null @@ -1,27 +0,0 @@ -local download_packer = function() - if vim.fn.input "Download Packer? (y for yes)" ~= "y" then - return - end - - local directory = string.format("%s/site/pack/packer/start/", vim.fn.stdpath "data") - - vim.fn.mkdir(directory, "p") - - local out = vim.fn.system( - string.format("git clone %s %s", "https://github.com/wbthomason/packer.nvim", directory .. "/packer.nvim") - ) - - print(out) - print "Downloading packer.nvim..." - print "( You'll need to restart now )" -end - -return function() - if not pcall(require, "packer") then - download_packer() - - return true - end - - return false -end diff --git a/lua/alpha/php/gateway.lua b/lua/alpha/php/gateway.lua deleted file mode 100644 index 5f8ddae..0000000 --- a/lua/alpha/php/gateway.lua +++ /dev/null @@ -1,137 +0,0 @@ -local pickers = require "telescope.pickers" -local finders = require "telescope.finders" -local conf = require("telescope.config").values -local action_state = require "telescope.actions.state" -local action_set = require "telescope.actions.set" -local actions = require "telescope.actions" -local get_node_text = vim.treesitter.get_node_text - -local gateway = {} - -local get_definition_buffer = function(type) - local uri = vim.uri_from_fname(vim.fn.getcwd() .. "/config/graphql/_" .. type .. ".yaml") - local bu