diff --git a/lazy-lock.json b/lazy-lock.json index 56fb893..803b4d2 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,67 +1,69 @@ { "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "ce0a05ab4e2839e1c48d072c5236cce846a387bc" }, - "catppuccin": { "branch": "main", "commit": "10eda02ea4faa7d1f94e77a3410a4ae91c25c5f5" }, + "LuaSnip": { "branch": "master", "commit": "e808bee352d1a6fcf902ca1a71cee76e60e24071" }, + "catppuccin": { "branch": "main", "commit": "63685e1562ef53873c9764b483d7ac5c7a608922" }, "cheatsheet.nvim": { "branch": "master", "commit": "9716f9aaa94dd1fd6ce59b5aae0e5f25e2a463ef" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "conform.nvim": { "branch": "master", "commit": "25d48271e3d4404ba017cb92a37d3a681c1ad149" }, - "copilot.vim": { "branch": "release", "commit": "25f73977033c597d530c7ab0e211d99b60927d2d" }, + "conform.nvim": { "branch": "master", "commit": "1a99fdc1d3aa9ccdf3021e67982a679a8c5c740c" }, + "copilot.vim": { "branch": "release", "commit": "782461159655b259cff10ecff05efa761e3d4764" }, "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, - "dressing.nvim": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, - "flutter-tools.nvim": { "branch": "main", "commit": "5aa227fa083fd740184b55b5220dfabc24a25cc7" }, + "dressing.nvim": { "branch": "master", "commit": "1b7921eecc65af1baf8ac1dc06f0794934cbcfb2" }, + "flutter-tools.nvim": { "branch": "main", "commit": "ea1d398f543a54ba95357c3b8bb9d6f68eaec36c" }, "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, - "fzf": { "branch": "master", "commit": "d9404fcce45be6a95d697fb2229e77e5ac8bb0c4" }, - "git-blame.nvim": { "branch": "master", "commit": "50543e3993f4b996eea01ff5ccc8fe2a354c5388" }, + "fzf": { "branch": "master", "commit": "855f90727af7827d9934b7fa00ea5ed51f5e4e81" }, + "git-blame.nvim": { "branch": "master", "commit": "8c56e864d448e84e0162872c381dd2715824dce2" }, "gitignore.nvim": { "branch": "master", "commit": "2455191ec94da8ed222806a4fe3aa358eac1e558" }, - "gitsigns.nvim": { "branch": "main", "commit": "f074844b60f9e151970fbcdbeb8a2cd52b6ef25a" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, + "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, "incline.nvim": { "branch": "main", "commit": "16fc9c073e3ea4175b66ad94375df6d73fc114c0" }, - "indent-blankline.nvim": { "branch": "master", "commit": "65e20ab94a26d0e14acac5049b8641336819dfc7" }, - "jedi-vim": { "branch": "master", "commit": "130ce7fb7910b99b494b0d7ed665e40bfb6663bd" }, + "indent-blankline.nvim": { "branch": "master", "commit": "18603eb949eba08300799f64027af11ef922283f" }, "keyseer.nvim": { "branch": "main", "commit": "6cb478f9b2be4af4680ceb0308a9b49cd6b6ea73" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lspkind.nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, - "lualine.nvim": { "branch": "master", "commit": "544dd1583f9bb27b393f598475c89809c4d5e86b" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "ba9c2f0b93deb48d0a99ae0e8d8dd36f7cc286d6" }, - "mason-nvim-dap.nvim": { "branch": "main", "commit": "4ba55f9755ebe8297d92c419b90a946123292ae6" }, + "lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.nvim": { "branch": "main", "commit": "19e1584124cda35388d4fdb911eab7124014e541" }, "nightfly": { "branch": "master", "commit": "19efaf31cbe15a429cb3ca6ac9c9fce13275045b" }, + "noice.nvim": { "branch": "main", "commit": "c1ba80ccf6b3bd8c7fc88fe2e61085131d44ad65" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, "nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" }, - "nvim-cmp": { "branch": "main", "commit": "d818fd0624205b34e14888358037fb6f5dc51234" }, - "nvim-dap": { "branch": "master", "commit": "bc03b83c94d0375145ff5ac6a6dcf28c1241e06f" }, - "nvim-dap-python": { "branch": "master", "commit": "d777c2b32ed39f61209c09bede28d7491621a631" }, - "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, - "nvim-highlight-colors": { "branch": "main", "commit": "a8f6952cb1ff7bde864a34c502f1a42c360a6662" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, + "nvim-dap-python": { "branch": "master", "commit": "db72bf6ab9f75fe841e8e11e772ee7fef6f484f1" }, + "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "3497eb39bf413a57ab5b7e7e2e192683e462148c" }, + "nvim-highlight-colors": { "branch": "main", "commit": "a411550ef85cae467b889ba7d1a96bd78332d90e" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "92a673de7ecaa157dd230d0128def10beb56d103" }, - "nvim-lspconfig": { "branch": "master", "commit": "fdc44768a09a65140aa00c92872a5381ad486485" }, + "nvim-lspconfig": { "branch": "master", "commit": "aaec5d049af99e7b975bdf68aca582f1aa91b338" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-silicon": { "branch": "main", "commit": "feb882f04c992b797daa118101a239fb3bedfc04" }, + "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, + "nvim-silicon": { "branch": "main", "commit": "9fe6001dc8cad4d9c53bcfc8649e3dc76ffa169c" }, "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, - "nvim-treesitter": { "branch": "master", "commit": "9f8c99e980f55e72148a95a0fb2e260c95f6341b" }, - "nvim-treesitter-context": { "branch": "master", "commit": "2aba92ceb1479485953007f4d5adf34d0b66917e" }, - "nvim-web-devicons": { "branch": "master", "commit": "5be6c4e685618b99c3210a69375b38a1202369b4" }, + "nvim-treesitter": { "branch": "master", "commit": "2b2ac302324f4cd2194c5dcaa59332b65e1c6403" }, + "nvim-treesitter-context": { "branch": "master", "commit": "7f7eeaa99e5a9beab518f502292871ae5f20de6f" }, + "nvim-web-devicons": { "branch": "master", "commit": "9154484705968658e9aab2b894d1b2a64bf9f83d" }, "nvim_lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "pkl-neovim": { "branch": "main", "commit": "a0ae099c7eb926150ee0a126b1dd78086edbe3fc" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "poet-v": { "branch": "master", "commit": "85a5dd44d89602cc3dccd2489924e9c7caab0044" }, - "rose-pine": { "branch": "main", "commit": "e4b08d74b7272cb21e4e9c71b8b9e0830fd722fe" }, - "tailwind-sorter.nvim": { "branch": "main", "commit": "1b60096635a1a1bef6b36b6c88a61ff437df5a15" }, + "rose-pine": { "branch": "main", "commit": "8b1fd252255a7f2c41b4192a787ab62660b29f72" }, + "tailwind-sorter.nvim": { "branch": "main", "commit": "e03eea3909c28509375993fb77a42454ac8ecbb2" }, "telescope-dap.nvim": { "branch": "master", "commit": "8c88d9716c91eaef1cdea13cb9390d8ef447dbfe" }, - "telescope-file-browser.nvim": { "branch": "master", "commit": "8574946bf6d0d820d7f600f3db808f5900a2ae23" }, - "telescope-themes": { "branch": "main", "commit": "13456106a7ff6ad3f6bfb0e00a4aac3de10ddb47" }, + "telescope-file-browser.nvim": { "branch": "master", "commit": "dd9de68c08b6d678198a99f5ea13e0384a1f04cf" }, + "telescope-themes": { "branch": "main", "commit": "f005622f066cc0cdbaf9bb44c48edbec67985501" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "tmux-status.nvim": { "branch": "main", "commit": "cfa6442ef044c2cfec9228a609ba36bd34809503" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "toggleterm.nvim": { "branch": "main", "commit": "48be57eaba817f038d61bbf64d2c597f578c0827" }, - "tokyonight": { "branch": "main", "commit": "b0e7c7382a7e8f6456f2a95655983993ffda745e" }, - "treesj": { "branch": "main", "commit": "275f83c81a5a1f5ae23c1eac30c4ac28beebbca2" }, + "tokyonight": { "branch": "main", "commit": "817bb6ffff1b9ce72cdd45d9fcfa8c9cd1ad3839" }, + "treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" }, "trouble.nvim": { "branch": "main", "commit": "6efc446226679fda0547c0fd6a7892fd5f5b15d8" }, - "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, + "undotree": { "branch": "master", "commit": "78b5241191852ffa9bb5da5ff2ee033160798c3b" }, "vim-maximizer": { "branch": "master", "commit": "2e54952fe91e140a2e69f35f22131219fcd9c5f1" }, - "vim-tmux-navigator": { "branch": "master", "commit": "5b3c701686fb4e6629c100ed32e827edf8dad01e" } + "vim-tmux-navigator": { "branch": "master", "commit": "a9b52e7d36114d40350099f254b5f299a35df978" } } diff --git a/lua/absolute/after/dap.lua b/lua/absolute/after/dap.lua index 0487757..91b2953 100644 --- a/lua/absolute/after/dap.lua +++ b/lua/absolute/after/dap.lua @@ -1,21 +1,35 @@ local dap = require("dap") local dapui = require("dapui") local dap_python = require("dap-python") +local virtual_text = require("nvim-dap-virtual-text") + +-- Setup Virtual Text +virtual_text.setup({ + prefix = " ", + hl = "Comment", + lines = 3, + enabled = true, +}) + + +local mason_path = vim.fn.glob(vim.fn.stdpath("data") .. "/mason") +local debugpy_path = mason_path .. "/packages/debugpy/venv/bin/python" + +dapui.setup() +dap_python.setup(debugpy_path) dap.listeners.after.event_initialized["dapui_config"] = function() dapui.open() end + dap.listeners.before.event_terminated["dapui_config"] = function() dapui.close() end + dap.listeners.before.event_exited["dapui_config"] = function() dapui.close() end - -local path = "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python" -dap_python.setup(path) - -- Setup Mappings local opts = { noremap = true, silent = true } diff --git a/lua/absolute/after/jedi.lua b/lua/absolute/after/jedi.lua deleted file mode 100644 index 1863d30..0000000 --- a/lua/absolute/after/jedi.lua +++ /dev/null @@ -1,16 +0,0 @@ -vim.g["jedi#popup_on_dot"] = 1 -vim.g["jedi#use_tabs_not_buffers"] = 0 -vim.g["jedi#popup_select_first"] = 0 -vim.g["jedi#show_call_signatures"] = "2" - - --- Keybindings -vim.g["jedi#goto_command"] = "" -- "d" -vim.g["jedi#goto_assignments_command"] = "gD" -vim.g["jedi#goto_stubs_command"] = "" -- "s" -vim.g["jedi#goto_definitions_command"] = "gd" -vim.g["jedi#documentation_command"] = "K" -vim.g["jedi#usages_command"] = "n" -vim.g["jedi#completions_command"] = "" -vim.g["jedi#rename_command"] = "rn" -vim.g["jedi#rename_command_keep_name"] = "" -- "R" diff --git a/lua/absolute/after/lsp-config.lua b/lua/absolute/after/lsp-config.lua index 69d99ea..97de28d 100644 --- a/lua/absolute/after/lsp-config.lua +++ b/lua/absolute/after/lsp-config.lua @@ -2,6 +2,8 @@ local lspconfig = require("lspconfig") local cmp_nvim_lsp = require("cmp_nvim_lsp") +local DPE = require("absolute.utils.detect-python-env") + local opts = { noremap = true, silent = true } local on_attach = function(client, bufnr) opts.buffer = bufnr @@ -73,7 +75,7 @@ lspconfig["html"].setup({ }) -- configure typescript server with plugin -lspconfig["tsserver"].setup({ +lspconfig["ts_ls"].setup({ capabilities = capabilities, on_attach = on_attach, }) @@ -111,8 +113,20 @@ lspconfig["svelte"].setup({ lspconfig["emmet_ls"].setup({ capabilities = capabilities, on_attach = on_attach, - filetypes = { "html", "typescriptreact", "javascriptreact", "css", "sass", "scss", "less", "svelte", "vue" }, + filetypes = { + "html", + "typescriptreact", + "javascriptreact", + "css", + "sass", + "scss", + "less", + "svelte", + "vue", + }, }) + + -- configure python lsp lspconfig["pylsp"].setup({ filetypes = { "python" }, @@ -124,22 +138,29 @@ lspconfig["pylsp"].setup({ rope_autoimport = { enabled = true, completions = { enabled = true }, + rename = { enabled = false }, }, + black = { enabled = true }, + autopep8 = { enabled = false }, + yapf = { enabled = false }, flake8 = { enabled = true }, jedi_completion = { + enabled = true, include_params = true, + fuzzy = true, }, + pylsp_mypy = { + enabled = true, + overrides = DPE.ResolvePythonEnvironment(), + report_progress = true, + live_mode = true, + }, + -- import sorting + pyls_isort = { enabled = true }, }, }, }, }) --- --- -- configure jedi language server --- lspconfig["jedi_language_server"].setup({ --- capabilities = capabilities, --- on_attach = on_attach, --- }) - -- configure docker server lspconfig["dockerls"].setup({ capabilities = capabilities, @@ -226,13 +247,27 @@ lspconfig["astro"].setup({ on_attach = on_attach, }) - -- configure kotlin server lspconfig["kotlin_language_server"].setup({ capabilities = capabilities, on_attach = on_attach, }) + +-- configure clang server + +lspconfig["clangd"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure arduino language server + +lspconfig["arduino_language_server"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + -- configure biome server lspconfig["biome"].setup({ capabilities = capabilities, diff --git a/lua/absolute/after/lualine.lua b/lua/absolute/after/lualine.lua index 647174b..4d3f362 100644 --- a/lua/absolute/after/lualine.lua +++ b/lua/absolute/after/lualine.lua @@ -1,6 +1,6 @@ local lualine = require("lualine") local lazy_status = require("lazy.status") -- to configure lazy pending updates count - +local noice = require("noice") local colors = { blue = "#65D1FF", @@ -94,23 +94,12 @@ lualine.setup({ theme = my_lualine_theme, }, sections = { - -- lualine_c = { - -- -- ...other lualine components - -- { - -- require('tmux-status').tmux_windows, - -- cond = require('tmux-status').show, - -- padding = { left = 3 }, - -- }, - -- }, - -- lualine_z = { - -- -- ...other lualine components - -- { - -- require('tmux-status').tmux_session, - -- cond = require('tmux-status').show, - -- padding = { left = 3 }, - -- }, - -- }, lualine_x = { + { + noice.api.statusline.mode.get, + cond = noice.api.statusline.mode.has, + color = { fg = "#ff9e64" }, + }, { GetFlutterToolsStatusLine, cond = IsFlutterToolsActive, diff --git a/lua/absolute/after/mason.lua b/lua/absolute/after/mason.lua index 918c2ac..e9b933e 100644 --- a/lua/absolute/after/mason.lua +++ b/lua/absolute/after/mason.lua @@ -1,13 +1,15 @@ require("mason").setup() require("mason-lspconfig").setup({ ensure_installed = { - "tsserver", + "ts_ls", "astro", "biome", "rust_analyzer", "html", "emmet_ls", "lua_ls", + 'arduino_language_server', + 'clangd', "tailwindcss", "svelte", "cssls", diff --git a/lua/absolute/after/noice.lua b/lua/absolute/after/noice.lua new file mode 100644 index 0000000..252521d --- /dev/null +++ b/lua/absolute/after/noice.lua @@ -0,0 +1,92 @@ +local noice = require("noice") +local notify = require("notify") + + +notify.setup({ + top_down = false, + animate = false, + stages = "static", +}) + +noice.setup({ + routes = { + { + filter = { + event = "msg_show", + min_height = 20, + }, + view = "cmdline_output", + }, + { + filter = { + event = "lsp", + kind = "progress", + cond = function(message) + local client = vim.tbl_get(message.opts, "progress", "client") + + return client == "lua_ls" + end + }, + opts = { skip = true }, + } + }, + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + cmdline = { + format = { + search_down = { + view = "cmdline", + }, + search_up = { + view = "cmdline", + }, + }, + }, + views = { + cmdline_popup = { + relative = "editor", + position = { + row = 5, + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + border = { + style = { "╭", "─", "╮", "│", "╯", "─", "╰", "│" }, + padding = { 0, 1 }, + }, + filter_options = {}, + win_options = { + winhighlight = { + Normal = "Normal", + } + }, + }, + popupmenu = { + relative = "editor", + position = { + row = 8, + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, +}) diff --git a/lua/absolute/after/none-ls.lua b/lua/absolute/after/none-ls.lua index 45d9048..82d2e5f 100644 --- a/lua/absolute/after/none-ls.lua +++ b/lua/absolute/after/none-ls.lua @@ -1,41 +1,9 @@ local null_ls = require("null-ls") - -function CheckPoetryVirtualEnv() - local poetry = vim.fn.system("poetry env info -p 2>/dev/null") - if poetry == "" then - return nil - end - return poetry -end - -function ResolvePythonEnvironment() - -- Get system global python env - local python = vim.fn.system("which python3") - -- Check of virtual environments exists - local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or CheckPoetryVirtualEnv() - - if virtual == nil then - -- Check if poetry environment exists - - return { - "--python-executable", python - } - end - - return { - "--python-executable", virtual .. "/bin/python3" - } -end - null_ls.setup({ sources = { null_ls.builtins.formatting.stylua, null_ls.builtins.formatting.prettierd, null_ls.builtins.formatting.shfmt, - null_ls.builtins.formatting.black, - null_ls.builtins.diagnostics.mypy.with({ - extra_args = ResolvePythonEnvironment() - }), }, }) diff --git a/lua/absolute/after/nvim-cmp.lua b/lua/absolute/after/nvim-cmp.lua index da842df..cc502ef 100644 --- a/lua/absolute/after/nvim-cmp.lua +++ b/lua/absolute/after/nvim-cmp.lua @@ -1,37 +1,27 @@ local cmp = require("cmp") +local types = require('cmp.types') local luasnip = require("luasnip") local lspkind = require("lspkind") -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) require("luasnip.loaders.from_vscode").lazy_load() -local function border(hl_name) - return { - { "╭", hl_name }, - { "─", hl_name }, - { "╮", hl_name }, - { "│", hl_name }, - { "╯", hl_name }, - { "─", hl_name }, - { "╰", hl_name }, - { "│", hl_name }, - } -end - cmp.setup({ completion = { - completeopt = "menu,menuone,preview,noselect", + completeopt = "menu,menuone,preview,noinsert", + autocomplete = { types.cmp.TriggerEvent.TextChanged }, }, window = { + documentation = { + border = { '┌', '─', '┐', '│', '┘', '─', '└', '│' }, + winhighlight = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None', + }, completion = { side_padding = 1, - winhighlight = "Normal:CmpPmenu,CursorLine:CmpSel,Search:None", + border = { '┌', '─', '┐', '│', '┘', '─', '└', '│' }, + winhighlight = 'Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None', scrollbar = false, }, - documentation = { - border = border "CmpDocBorder", - winhighlight = "Normal:CmpDoc", - }, }, snippet = { -- configure how nvim-cmp interacts with snippet engine expand = function(args) @@ -39,16 +29,17 @@ cmp.setup({ end, }, mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.complete(), -- show completion suggestions + [""] = cmp.mapping.abort(), -- close completion menu [""] = cmp.mapping.confirm({ select = true }), -- accept current selection }), -- sources for autocompletion sources = cmp.config.sources({ - { name = "otter" }, -- custom source for otter completion { name = "nvim_lsp" }, { name = "luasnip" }, -- snippets { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths + { name = "path" }, -- file system paths, + { name = 'nvim_lsp_signature_help' }, }), -- configure lspkind for vs-code like pictograms in completion menu formatting = { diff --git a/lua/absolute/after/otter.lua b/lua/absolute/after/otter.lua deleted file mode 100644 index 057859f..0000000 --- a/lua/absolute/after/otter.lua +++ /dev/null @@ -1,15 +0,0 @@ -local otter = require("otter") - --- table of embedded languages to look for. --- required (no default) -local languages = { "python", "lua" } - --- enable completion/diagnostics --- defaults are true -local completion = true -local diagnostics = true --- treesitter query to look for embedded languages --- uses injections if nil or not set -local tsquery = nil - -otter.activate(languages, completion, diagnostics, tsquery) diff --git a/lua/absolute/after/treesj.lua b/lua/absolute/after/treesj.lua index c80d823..01eeec7 100644 --- a/lua/absolute/after/treesj.lua +++ b/lua/absolute/after/treesj.lua @@ -1,8 +1,12 @@ local tsj = require("treesj") + +local langs = {} + tsj.setup({ use_default_keymaps = false, max_join_length = 1000, + langs = langs, }) local opts = { silent = true, noremap = true } diff --git a/lua/absolute/core/colorscheme.lua b/lua/absolute/core/colorscheme.lua index 91a31bf..cec7318 100644 --- a/lua/absolute/core/colorscheme.lua +++ b/lua/absolute/core/colorscheme.lua @@ -1,11 +1,24 @@ local function SetupWindowPreferences() - vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) - vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) - vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" }) + -- Utility function to get the blend value or set a default + local function get_blend_value(group_name, default_blend) + -- Retrieve highlight settings for the group using the new API + local current_highlight = vim.api.nvim_get_hl(0, { name = group_name }) + return current_highlight.blend or default_blend + end + + -- Set the Normal group with dynamic blend + local normal_blend = get_blend_value("Normal", 50) + vim.api.nvim_set_hl(0, "Normal", { bg = "none", blend = normal_blend }) + + -- Set the NormalFloat group with dynamic blend + local normal_float_blend = get_blend_value("NormalFloat", 50) + vim.api.nvim_set_hl(1, "NormalFloat", { bg = "none", blend = normal_float_blend }) + + -- Set the NormalNC group with dynamic blend + local normal_nc_blend = get_blend_value("NormalNC", 50) + vim.api.nvim_set_hl(0, "NormalNC", { bg = "none", blend = normal_nc_blend }) end - - local colorschemes = { ["tokyonight-day"] = "Tokyo Night Day", ["tokyonight-night"] = "Tokyo Night Night", @@ -35,7 +48,7 @@ local function SyncWezTerm() assert(file) file:write(colorscheme) file:close() - vim.notify("Setting WezTerm color scheme to " .. colorscheme, vim.log.levels.INFO) + -- vim.notify("Setting WezTerm color scheme to " .. colorscheme, vim.log.levels.INFO) end, }) end diff --git a/lua/absolute/core/init.lua b/lua/absolute/core/init.lua index d4f537b..f591e5d 100644 --- a/lua/absolute/core/init.lua +++ b/lua/absolute/core/init.lua @@ -1,3 +1,9 @@ +local lua_utils = require("absolute.utils.detect-lua") + +package.path = package.path .. lua_utils.GetLatestLuaVersion() + + + -- disable nvim intro vim.opt.shortmess:append "sI" @@ -37,6 +43,7 @@ vim.opt.updatetime = 50 vim.opt.colorcolumn = "" +vim.o.completeopt = "menuone" vim.g.mapleader = " " vim.g.maplocalleader = ";" diff --git a/lua/absolute/disabled/nvim-tree.lua b/lua/absolute/disabled/nvim-tree.lua deleted file mode 100644 index 2f835db..0000000 --- a/lua/absolute/disabled/nvim-tree.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "nvim-tree/nvim-tree.lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("absolute.after.nvim-tree"); - end -} diff --git a/lua/absolute/disabled/otter.lua b/lua/absolute/disabled/otter.lua deleted file mode 100644 index e5caa84..0000000 --- a/lua/absolute/disabled/otter.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - "jmbuhr/otter.nvim", - config = function() - require("absolute.after.otter") - end, - ft = { "py", "lua" } -} diff --git a/lua/absolute/init.lua b/lua/absolute/init.lua index ba3a92c..53ceafa 100644 --- a/lua/absolute/init.lua +++ b/lua/absolute/init.lua @@ -1,8 +1,6 @@ -package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?/init.lua;" -package.path = package.path .. ";" .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/5.1/?.lua;" - - require("absolute.core") require("absolute.lazy") require("absolute.helpers") require("absolute.remap") + + diff --git a/lua/absolute/plugins/dap.lua b/lua/absolute/plugins/dap.lua index 08a2225..b0d5d75 100644 --- a/lua/absolute/plugins/dap.lua +++ b/lua/absolute/plugins/dap.lua @@ -1,11 +1,15 @@ return { "mfussenegger/nvim-dap", dependencies = { - -- "theHamsta/nvim-dap-virtual-text", + "theHamsta/nvim-dap-virtual-text", "rcarriga/nvim-dap-ui", "nvim-neotest/nvim-nio", "nvim-telescope/telescope-dap.nvim", - { "mfussenegger/nvim-dap-python", ft = "python", dependencies = { "mfussenegger/nvim-dap" } }, + { + "mfussenegger/nvim-dap-python", + ft = "python", + dependencies = { "mfussenegger/nvim-dap" }, + }, -- "Pocco81/DAPInstall.nvim" }, config = function() diff --git a/lua/absolute/plugins/jedi.lua b/lua/absolute/plugins/jedi.lua deleted file mode 100644 index 55f8899..0000000 --- a/lua/absolute/plugins/jedi.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - "davidhalter/jedi-vim", - config = function() - require("absolute.after.jedi") - end -} diff --git a/lua/absolute/plugins/noice.lua b/lua/absolute/plugins/noice.lua new file mode 100644 index 0000000..8a500f2 --- /dev/null +++ b/lua/absolute/plugins/noice.lua @@ -0,0 +1,15 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + }, + config = function() + require("absolute.after.noice") + end, +} diff --git a/lua/absolute/plugins/nvim-treesitter.lua b/lua/absolute/plugins/nvim-treesitter.lua index 38b8814..f7a28ba 100644 --- a/lua/absolute/plugins/nvim-treesitter.lua +++ b/lua/absolute/plugins/nvim-treesitter.lua @@ -1,7 +1,7 @@ return { "nvim-treesitter/nvim-treesitter", config = function() - vim.cmd([[:TSUpdate]]) + vim.cmd([[:silent !TSUpdate]]) require("absolute.after.nvim-treesitter") end } diff --git a/lua/absolute/plugins/tmux-status.lua b/lua/absolute/plugins/tmux-status.lua deleted file mode 100644 index 0c33928..0000000 --- a/lua/absolute/plugins/tmux-status.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "christopher-francisco/tmux-status.nvim", - lazy = true, - opts = {}, -} diff --git a/lua/absolute/utils/detect-lua.lua b/lua/absolute/utils/detect-lua.lua new file mode 100644 index 0000000..1a1647d --- /dev/null +++ b/lua/absolute/utils/detect-lua.lua @@ -0,0 +1,39 @@ +function GetLuaPath(version) + local path = vim.fn.expand("$HOME") .. "/.luarocks/share/lua/" .. version .. "/?.lua;" + path = path .. vim.fn.expand("$HOME") .. "/.luarocks/share/lua/" .. version .. "/?/init.lua;" + return path +end + +function GetInstalledLuaVersion() + -- List the directory contents of the lua rocks directory + local rocks = vim.fn.glob(vim.fn.expand("$HOME") .. "/.luarocks/share/lua/") + + -- Split the string into a table + + rocks = vim.split(rocks, "\n") + + -- Sort the table highest to lowest + + table.sort(rocks, function(a, b) + return tonumber(a) > tonumber(b) + end) + + return rocks +end + +function GetLatestLuaVersion() + local rocks = GetInstalledLuaVersion() + local preferredVersion = rocks[1] + + local path = GetLuaPath(preferredVersion) + + return path +end + +M = {} + +M.GetLuaPath = GetLuaPath +M.GetInstalledLuaVersion = GetInstalledLuaVersion +M.GetLatestLuaVersion = GetLatestLuaVersion + +return M diff --git a/lua/absolute/utils/detect-python-env.lua b/lua/absolute/utils/detect-python-env.lua new file mode 100644 index 0000000..874b135 --- /dev/null +++ b/lua/absolute/utils/detect-python-env.lua @@ -0,0 +1,33 @@ +function CheckPoetryVirtualEnv() + local poetry = vim.fn.system("poetry env info -p 2>/dev/null") + if poetry == "" then + return nil + end + return poetry +end + +function ResolvePythonEnvironment() + -- Get system global python env + local python = vim.fn.system("which python3") + -- Check of virtual environments exists + local virtual = os.getenv("VIRTUAL_ENV") or os.getenv("CONDA_PREFIX") or CheckPoetryVirtualEnv() + + if virtual == nil then + -- Check if poetry environment exists + + return { + "--python-executable", python + } + end + + return { + "--python-executable", virtual .. "/bin/python" + } +end + +M = {} + +M.ResolvePythonEnvironment = ResolvePythonEnvironment +M.CheckPoetryVirtualEnv = CheckPoetryVirtualEnv + +return M diff --git a/lua/current-theme.lua b/lua/current-theme.lua index 45ddac7..3198fc4 100644 --- a/lua/current-theme.lua +++ b/lua/current-theme.lua @@ -1 +1 @@ -vim.cmd("colorscheme catppuccin-mocha") \ No newline at end of file +vim.cmd("colorscheme catppuccin") \ No newline at end of file