From 32d652a93fc2b4e2b015ade87a9e44dc3b96c912 Mon Sep 17 00:00:00 2001 From: David Ibia Date: Mon, 21 Jul 2025 17:01:26 +0100 Subject: [PATCH] feat(lua): add configuration files for catppuccino theme, cheatsheet, comment, conform, dap, flutter-tools, gitignore, gitsigns, highlight-colors, image, incline, and indent-blank-line plugins. feat(lsp-config.lua): Add configurations for various language servers and setup custom key mappings and settings for improved development experience. feat(lualine.lua, mason.lua, mini-diff.lua, mini.lua, notify.lua, nvim-bqf.lua, nvim-cmp.lua, nvim-silicon.lua, nvim-surround.lua): Add new Lua files and configurations for lualine theme, mason setup, mini-diff, mini map integrations, notify setup, nvim-bqf, nvim-cmp autocompletion, nvim-silicon screenshot, and nvim-surround setup. feat(nvim-tree.lua): add custom configurations for Nvim Tree plugin feat(nvim-treesitter-context.lua): implement Treesitter Context plugin setup feat(nvim-treesitter.lua): configure Nvim Treesitter with specific parsers and features feat(poet-v.lua): set up Poet-V plugin with custom settings feat(smear-cursor.lua): integrate Smear Cursor plugin with defined options feat(tailwind-sorter.lua): initialize Tailwind Sorter plugin with save patterns and settings feat(telescope.lua): add custom settings and extensions to improve Telescope functionality feat(venv-selector.lua): add venv-selector setup and key mappings for VenvSelector and VenvSelectCached to enhance venv management. --- lua/absolute/after/catppuccin.lua | 11 + lua/absolute/after/cheatsheet.lua | 9 + lua/absolute/after/comment.lua | 3 + lua/absolute/after/conform.lua | 33 ++ lua/absolute/after/dap.lua | 31 ++ lua/absolute/after/flutter-tools.lua | 12 + lua/absolute/after/gitignore.lua | 18 + lua/absolute/after/gitsigns.lua | 3 + lua/absolute/after/highlight-colors.lua | 7 + lua/absolute/after/image.lua | 37 ++ lua/absolute/after/incline.lua | 45 +++ lua/absolute/after/indent-blank-line.lua | 1 + lua/absolute/after/lsp-config.lua | 336 ++++++++++++++++++ lua/absolute/after/lualine.lua | 97 +++++ lua/absolute/after/mason.lua | 20 ++ lua/absolute/after/mini-diff.lua | 6 + lua/absolute/after/mini.lua | 11 + lua/absolute/after/notify.lua | 25 ++ lua/absolute/after/nvim-bqf.lua | 0 lua/absolute/after/nvim-cmp.lua | 72 ++++ lua/absolute/after/nvim-silicon.lua | 57 +++ lua/absolute/after/nvim-surround.lua | 3 + lua/absolute/after/nvim-tree.lua | 49 +++ .../after/nvim-treesitter-context.lua | 24 ++ lua/absolute/after/nvim-treesitter.lua | 71 ++++ lua/absolute/after/poet-v.lua | 20 ++ lua/absolute/after/smear-cursor.lua | 10 + lua/absolute/after/tailwind-sorter.lua | 6 + lua/absolute/after/telescope.lua | 182 ++++++++++ lua/absolute/after/todo-comments.lua | 25 ++ lua/absolute/after/toggleterm.lua | 62 ++++ lua/absolute/after/tokyonight.lua | 7 + lua/absolute/after/treesj.lua | 16 + lua/absolute/after/undotree.lua | 4 + lua/absolute/after/venv-selector.lua | 14 + 35 files changed, 1327 insertions(+) create mode 100644 lua/absolute/after/catppuccin.lua create mode 100644 lua/absolute/after/cheatsheet.lua create mode 100644 lua/absolute/after/comment.lua create mode 100644 lua/absolute/after/conform.lua create mode 100644 lua/absolute/after/dap.lua create mode 100644 lua/absolute/after/flutter-tools.lua create mode 100644 lua/absolute/after/gitignore.lua create mode 100644 lua/absolute/after/gitsigns.lua create mode 100644 lua/absolute/after/highlight-colors.lua create mode 100644 lua/absolute/after/image.lua create mode 100644 lua/absolute/after/incline.lua create mode 100644 lua/absolute/after/indent-blank-line.lua create mode 100644 lua/absolute/after/lsp-config.lua create mode 100644 lua/absolute/after/lualine.lua create mode 100644 lua/absolute/after/mason.lua create mode 100644 lua/absolute/after/mini-diff.lua create mode 100644 lua/absolute/after/mini.lua create mode 100644 lua/absolute/after/notify.lua create mode 100644 lua/absolute/after/nvim-bqf.lua create mode 100644 lua/absolute/after/nvim-cmp.lua create mode 100644 lua/absolute/after/nvim-silicon.lua create mode 100644 lua/absolute/after/nvim-surround.lua create mode 100644 lua/absolute/after/nvim-tree.lua create mode 100644 lua/absolute/after/nvim-treesitter-context.lua create mode 100644 lua/absolute/after/nvim-treesitter.lua create mode 100644 lua/absolute/after/poet-v.lua create mode 100644 lua/absolute/after/smear-cursor.lua create mode 100644 lua/absolute/after/tailwind-sorter.lua create mode 100644 lua/absolute/after/telescope.lua create mode 100644 lua/absolute/after/todo-comments.lua create mode 100644 lua/absolute/after/toggleterm.lua create mode 100644 lua/absolute/after/tokyonight.lua create mode 100644 lua/absolute/after/treesj.lua create mode 100644 lua/absolute/after/undotree.lua create mode 100644 lua/absolute/after/venv-selector.lua diff --git a/lua/absolute/after/catppuccin.lua b/lua/absolute/after/catppuccin.lua new file mode 100644 index 0000000..7856702 --- /dev/null +++ b/lua/absolute/after/catppuccin.lua @@ -0,0 +1,11 @@ +local theme = require("catppuccino") + +theme.setup({ + flavour = "mocha", + transparent_background = true, + dim_inactive = { + enabled = true, + shade = "dark", + percentage = 0.50, + }, +}) diff --git a/lua/absolute/after/cheatsheet.lua b/lua/absolute/after/cheatsheet.lua new file mode 100644 index 0000000..17c6727 --- /dev/null +++ b/lua/absolute/after/cheatsheet.lua @@ -0,0 +1,9 @@ +local cheatsheet = require("cheatsheet") + +cheatsheet.setup({}) + + +local opts = { noremap = true, silent = true } + +opts.desc = "Show Cheatsheet" +vim.keymap.set("n", "\\", "Cheatsheet", opts) -- toggle file explorer diff --git a/lua/absolute/after/comment.lua b/lua/absolute/after/comment.lua new file mode 100644 index 0000000..4d3d732 --- /dev/null +++ b/lua/absolute/after/comment.lua @@ -0,0 +1,3 @@ +local comment = require("Comment") + +comment.setup() diff --git a/lua/absolute/after/conform.lua b/lua/absolute/after/conform.lua new file mode 100644 index 0000000..1663df8 --- /dev/null +++ b/lua/absolute/after/conform.lua @@ -0,0 +1,33 @@ +local conform = require("conform") + +conform.setup({ + format_on_save = function(bufnr) + local disable_filetypes = {} + return { + timeout_ms = 500, + lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + } + end, + formatters_by_ft = { + sh = { "shfmt" }, + lua = { "stylua" }, + -- Conform will run multiple formatters sequentially + python = { + + -- To fix auto-fixable lint errors. + "ruff_fix", + -- To run the Ruff formatter. + "ruff_format", + -- To organize the imports. + "ruff_organize_imports", + }, + -- Use a sub-list to run only the first available formatter + javascript = { "biome" }, + astro = { "prettierd", "prettier", "biome" }, + vue = { "prettierd", "prettier" }, + proto = { "buf" }, + yaml = { "prettierd", "prettier" }, + }, +}) + +-- vim.o.formatexpr = "v:lua.require'conform'.formatexpr()" diff --git a/lua/absolute/after/dap.lua b/lua/absolute/after/dap.lua new file mode 100644 index 0000000..8029e37 --- /dev/null +++ b/lua/absolute/after/dap.lua @@ -0,0 +1,31 @@ +local dap = require("dap") +local dapui = require("dapui") +local virtual_text = require("nvim-dap-virtual-text") + +-- Setup Virtual Text +virtual_text.setup({ + prefix = " ", + hl = "Comment", + lines = 3, + enabled = true, +}) + +dapui.setup() + +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 + +-- Setup Mappings +local opts = { noremap = true, silent = true } + +opts.desc = "Toggle breakpoint" +vim.keymap.set("n", "db", " DapToggleBreakpoint", opts) diff --git a/lua/absolute/after/flutter-tools.lua b/lua/absolute/after/flutter-tools.lua new file mode 100644 index 0000000..83406d9 --- /dev/null +++ b/lua/absolute/after/flutter-tools.lua @@ -0,0 +1,12 @@ +local flutter_tools = require('flutter-tools') + +flutter_tools.setup({ + decorations = { + statusline = { + app_version = true, + device = true, + project_config = true, + } + }, + fvm = true, +}) diff --git a/lua/absolute/after/gitignore.lua b/lua/absolute/after/gitignore.lua new file mode 100644 index 0000000..74afccd --- /dev/null +++ b/lua/absolute/after/gitignore.lua @@ -0,0 +1,18 @@ +local gitignore = require("gitignore") +local GetProjectRoot = require("absolute.utils.get-git-root") + +-- Keymaps + +local opts = { noremap = true, silent = true } + +opts.desc = "GitIgnore: Generate .gitignore" + +vim.keymap.set("n", "gi", function() + local path = GetProjectRoot() + + gitignore.generate(path) +end, opts) + +-- Global Settings + +vim.g.gitignore_nvim_overwrite = true diff --git a/lua/absolute/after/gitsigns.lua b/lua/absolute/after/gitsigns.lua new file mode 100644 index 0000000..a238e52 --- /dev/null +++ b/lua/absolute/after/gitsigns.lua @@ -0,0 +1,3 @@ +local gitsigns = require("gitsigns") + +gitsigns.setup() diff --git a/lua/absolute/after/highlight-colors.lua b/lua/absolute/after/highlight-colors.lua new file mode 100644 index 0000000..31db234 --- /dev/null +++ b/lua/absolute/after/highlight-colors.lua @@ -0,0 +1,7 @@ +local highlight = require("nvim-highlight-colors") + +highlight.setup({ + enable_tailwind = true, +}) + +highlight.turnOn() diff --git a/lua/absolute/after/image.lua b/lua/absolute/after/image.lua new file mode 100644 index 0000000..76b0c42 --- /dev/null +++ b/lua/absolute/after/image.lua @@ -0,0 +1,37 @@ +require("image").setup({ + backend = "kitty", + processor = "magick_rock", -- or "magick_cli" + integrations = { + markdown = { + enabled = true, + clear_in_insert_mode = false, + download_remote_images = true, + only_render_image_at_cursor = false, + floating_windows = true, -- if true, images will be rendered in floating markdown windows + filetypes = { "markdown", "vimwiki" }, -- markdown extensions (ie. quarto) can go here + }, + neorg = { + enabled = true, + filetypes = { "norg" }, + }, + typst = { + enabled = true, + filetypes = { "typst" }, + }, + html = { + enabled = false, + }, + css = { + enabled = false, + }, + }, + max_width = nil, + max_height = nil, + max_width_window_percentage = nil, + max_height_window_percentage = 50, + window_overlap_clear_enabled = true, -- toggles images when windows are overlapped + window_overlap_clear_ft_ignore = { "cmp_menu", "cmp_docs", "snacks_notif", "scrollview", "scrollview_sign" }, + editor_only_render_when_focused = true, -- auto show/hide images when the editor gains/looses focus + tmux_show_only_in_active_window = true, -- auto show/hide images in the correct Tmux window (needs visual-activity off) + hijack_file_patterns = { "*.png", "*.jpg", "*.jpeg", "*.gif", "*.webp", "*.avif", "*.svg" }, -- render image files as images when opened +}) diff --git a/lua/absolute/after/incline.lua b/lua/absolute/after/incline.lua new file mode 100644 index 0000000..3b34b46 --- /dev/null +++ b/lua/absolute/after/incline.lua @@ -0,0 +1,45 @@ +local incline = require("incline") +local helpers = require("incline.helpers") +local devicons = require("nvim-web-devicons") + +local function shortenPath(str, max) + if #str > max then + local start = #str - max + 1 + return "..." .. string.sub(str, start) + end + + return str +end + +incline.setup({ + hide = { + cursorline = true, + }, + window = { + padding = 0, + margin = { horizontal = 0 }, + placement = { + horizontal = "right", + }, + }, + render = function(props) + local filename = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":t") + local filepath = vim.fn.fnamemodify(vim.api.nvim_buf_get_name(props.buf), ":p") + local ft_icon, ft_color = devicons.get_icon_color(filename) + local modified = vim.bo[props.buf].modified + + local path = vim.fn.fnamemodify(filepath, ":~:.") -- Get relative path + path = shortenPath(path, 30) + + -- Shorten path from the left if the entire line is longer than 100 characters + + -- + return { + ft_icon and { " ", ft_icon, " ", guibg = ft_color, guifg = helpers.contrast_color(ft_color) } or "", + " ", + { path, gui = modified and "bold,italic" or "bold" }, + " ", + guibg = "#44406e", + } + end, +}) diff --git a/lua/absolute/after/indent-blank-line.lua b/lua/absolute/after/indent-blank-line.lua new file mode 100644 index 0000000..be401dd --- /dev/null +++ b/lua/absolute/after/indent-blank-line.lua @@ -0,0 +1 @@ +require("ibl").setup() diff --git a/lua/absolute/after/lsp-config.lua b/lua/absolute/after/lsp-config.lua new file mode 100644 index 0000000..0fe7d63 --- /dev/null +++ b/lua/absolute/after/lsp-config.lua @@ -0,0 +1,336 @@ +-- Setup language servers. +local conform = require("conform") +local lspconfig = require("lspconfig") +local cmp_nvim_lsp = require("cmp_nvim_lsp") + +local opts = { noremap = true, silent = true } + +local global_node_modules = vim.fn.system("npm root -g") + +-- client, buffer +local on_attach = function(client, bufnr) + opts.buffer = bufnr + + -- Enable completion triggered by + vim.bo[opts.buffer].omnifunc = "v:lua.vim.lsp.omnifunc" + + opts.desc = "Go to declaration" + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + + opts.desc = "Go to definitions" + vim.keymap.set("n", "gd", "Telescope lsp_definitions", opts) + + opts.desc = "Show documentation for what is under cursor" + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + + opts.desc = "Show LSP Implementation" + vim.keymap.set("n", "gi", "Telescope lsp_implementations", opts) + + opts.desc = "Get Help" + vim.keymap.set("n", "gh", vim.lsp.buf.signature_help, opts) + + -- vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + -- vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + -- vim.keymap.set('n', 'wl', function() + -- print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + -- end, opts) + + opts.desc = "Show LSP type definitions" + vim.keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) + + opts.desc = "Smart rename" + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + + opts.desc = "See available code actions" + vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) + + opts.desc = "Show LSP references" + vim.keymap.set("n", "cr", "Telescope lsp_references", opts) + + opts.desc = "Format File" + vim.keymap.set({ "n", "v" }, "f", function() + -- vim.lsp.buf.format({ async = true }) + conform.format({ + bufnr = opts.buffer, + async = true, + lsp_fallback = true, + }) + end, opts) + + opts.desc = "Restart LSP" + vim.keymap.set("n", "rs", "LspRestart", opts) + + -- LSP Only Settings + -- Ruff & Pyright behaviour + if client.name == "ruff" then + -- Disable hover in favor of Pyright + client.server_capabilities.hoverProvider = false + end +end + +local capabilities = cmp_nvim_lsp.default_capabilities() + +-- Change the Diagnostic symbols in the sign column (gutter) +local signs = { + Error = " ", + Warn = " ", + Hint = "󰠠 ", + Info = " ", +} + +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" }) +end + +-- configure html server +lspconfig["html"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure typescript server with plugin +lspconfig["ts_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + init_options = { + plugins = { + { + name = "@vue/typescript-plugin", + location = global_node_modules .. "@vue/typescript-plugin", + languages = { "vue" }, + }, + }, + }, + filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" }, +}) + +-- configure css server +lspconfig["cssls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure tailwindcss server +lspconfig["tailwindcss"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "html", "svelte", "vue", "astro" }, +}) + +-- configure svelte server +lspconfig["svelte"].setup({ + capabilities = capabilities, + on_attach = function(client, bufnr) + on_attach(client, bufnr) + + vim.api.nvim_create_autocmd("BufWritePost", { + pattern = { "*.js", "*.ts" }, + callback = function(ctx) + if client.name == "svelte" then + client.notify("$/onDidChangeTsOrJsFile", { uri = ctx.file }) + end + end, + }) + end, +}) + +-- configure emmet language server +lspconfig["emmet_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { + "html", + "typescriptreact", + "javascriptreact", + "astro", + "css", + "sass", + "scss", + "less", + "svelte", + "vue", + }, +}) + +-- configure ruff server +lspconfig["ruff"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure pyright server +lspconfig["pyright"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "python" }, + settings = { + python = { + analysis = { + autoSearchPaths = true, + useLibraryCodeForTypes = true, + diagnosticMode = "workspace", + }, + }, + }, +}) + +-- configure docker server +lspconfig["dockerls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure json server +lspconfig["jsonls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure vue server +lspconfig["volar"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "vue" }, + init_options = { + vue = { + hybridMode = false, + }, + }, + settings = { + typescript = { + inlayHints = { + enumMemberValues = { + enabled = true, + }, + functionLikeReturnTypes = { + enabled = true, + }, + propertyDeclarationTypes = { + enabled = true, + }, + parameterTypes = { + enabled = true, + suppressWhenArgumentMatchesName = true, + }, + variableTypes = { + enabled = true, + }, + }, + }, + }, +}) + +-- configure rust server +lspconfig.rust_analyzer.setup({ + -- Server-specific settings. See `:help lspconfig-setup` + on_attach = on_attach, + capabilities = capabilities, + settings = { + ["rust-analyzer"] = {}, + }, +}) + +-- configure lua server (with special settings) +lspconfig["lua_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { -- custom settings for lua + Lua = { + -- make the language server recognize "vim" global + diagnostics = { + globals = { "vim" }, + }, + workspace = { + -- make language server aware of runtime files + library = { + [vim.fn.expand("$VIMRUNTIME/lua")] = true, + [vim.fn.stdpath("config") .. "/lua"] = true, + }, + }, + }, + }, +}) + +-- configure css server +lspconfig["cssls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +--configure docker file server +lspconfig["dockerls"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure docker compose server +lspconfig["docker_compose_language_service"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure eslint server +lspconfig["eslint"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure astro server +lspconfig["astro"].setup({ + capabilities = capabilities, + on_attach = on_attach, + -- init_options = { + -- typescript = { + -- tsdk = ResolveTypescriptServer(), + -- }, + -- }, +}) + +-- configure kotlin server +lspconfig["kotlin_language_server"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure clang server + +lspconfig["clangd"].setup({ + cmd = { "clangd", "--compile-commands-dir=./", "--background-index=false" }, + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "c", "cpp", "objc", "objcpp" }, +}) + +-- configure bufls server + +lspconfig["buf_ls"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { "proto" }, +}) + +-- configure arduino language server + +lspconfig["arduino_language_server"].setup({ + capabilities = capabilities, + on_attach = on_attach, +}) + +-- configure biome server +lspconfig["biome"].setup({ + capabilities = capabilities, + on_attach = on_attach, + filetypes = { + "javascript", + "javascriptreact", + "json", + "jsonc", + "typescript", + "typescript.tsx", + "typescriptreact", + "astro", + "svelte", + "vue", + }, +}) diff --git a/lua/absolute/after/lualine.lua b/lua/absolute/after/lualine.lua new file mode 100644 index 0000000..2f055c8 --- /dev/null +++ b/lua/absolute/after/lualine.lua @@ -0,0 +1,97 @@ +local lualine = require("lualine") +local lazy_status = require("lazy.status") -- to configure lazy pending updates count + +local colors = { + blue = "#65D1FF", + green = "#3EFFDC", + violet = "#FF61EF", + yellow = "#FFDA7B", + red = "#FF4A4A", + fg = "#c3ccdc", + bg = "#112638", + inactive_bg = "#2c3043", +} + +local my_lualine_theme = { + normal = { + a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + insert = { + a = { bg = colors.green, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + visual = { + a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + command = { + a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + replace = { + a = { bg = colors.red, fg = colors.bg, gui = "bold" }, + b = { bg = colors.bg, fg = colors.fg }, + c = { bg = colors.bg, fg = colors.fg }, + }, + inactive = { + a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, + b = { bg = colors.inactive_bg, fg = colors.semilightgray }, + c = { bg = colors.inactive_bg, fg = colors.semilightgray }, + }, +} + +function GetPoetvStatusLine() + -- Get the poetv statusline + -- If poetv is not active, return empty string + + if IsPoetvActive() then + local poetv_name = vim.g.poetv_name + local poetv_statusline_symbol = vim.g.poetv_statusline_symbol + + local result = string.sub(poetv_name, 1, 20) .. " " .. poetv_statusline_symbol + + return result + else + return "" + end +end + +function IsPoetvActive() + -- Check if vim.g.poetv_name exists + -- If it does, then poetv is active + + if vim.g.poetv_name ~= nil then + return true + else + return false + end +end + +-- configure lualine with modified theme +lualine.setup({ + options = { + theme = my_lualine_theme, + }, + sections = { + lualine_x = { + { + GetPoetvStatusLine, + cond = IsPoetvActive, + color = { fg = "#ff9e64" }, + }, + { + lazy_status.updates, + cond = lazy_status.has_updates, + color = { fg = "#ff9e64" }, + }, + { "encoding" }, + { "fileformat" }, + { "filetype" }, + }, + }, +}) diff --git a/lua/absolute/after/mason.lua b/lua/absolute/after/mason.lua new file mode 100644 index 0000000..46d3ec1 --- /dev/null +++ b/lua/absolute/after/mason.lua @@ -0,0 +1,20 @@ +require("mason").setup() +require("mason-lspconfig").setup({ + ensure_installed = { + "ts_ls", + "astro", + "biome", + "rust_analyzer", + "html", + "emmet_ls", + "lua_ls", + "arduino_language_server", + "clangd", + "tailwindcss", + "svelte", + "cssls", + "jedi_language_server", + "kotlin_language_server", + }, + automatic_enable = false, +}) diff --git a/lua/absolute/after/mini-diff.lua b/lua/absolute/after/mini-diff.lua new file mode 100644 index 0000000..6e2471d --- /dev/null +++ b/lua/absolute/after/mini-diff.lua @@ -0,0 +1,6 @@ +local diff = require("mini.diff") + +diff.setup({ + -- Disabled by default + source = diff.gen_source.none(), +}) diff --git a/lua/absolute/after/mini.lua b/lua/absolute/after/mini.lua new file mode 100644 index 0000000..a3a789c --- /dev/null +++ b/lua/absolute/after/mini.lua @@ -0,0 +1,11 @@ +local map = require("mini.map") +require("mini.map").setup({ + integrations = { + map.gen_integration.builtin_search(), + map.gen_integration.gitsigns(), + map.gen_integration.diagnostic() + }, +}) + +vim.keymap.set("n", "mc", map.close) +vim.keymap.set("n", "mo", map.open) diff --git a/lua/absolute/after/notify.lua b/lua/absolute/after/notify.lua new file mode 100644 index 0000000..2180d18 --- /dev/null +++ b/lua/absolute/after/notify.lua @@ -0,0 +1,25 @@ +local notify = require("notify") + +notify.setup({ + background_colour = "#000000", + fps = 15, + icons = { + DEBUG = "", + ERROR = "", + INFO = "", + TRACE = "✎", + WARN = "", + }, + level = 2, + minimum_width = 50, + render = "default", + stages = "static", + time_formats = { + notification = "%T", + notification_history = "%FT%T", + }, + timeout = 3000, + top_down = true, +}) + +vim.notify = notify diff --git a/lua/absolute/after/nvim-bqf.lua b/lua/absolute/after/nvim-bqf.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/absolute/after/nvim-cmp.lua b/lua/absolute/after/nvim-cmp.lua new file mode 100644 index 0000000..afa8650 --- /dev/null +++ b/lua/absolute/after/nvim-cmp.lua @@ -0,0 +1,72 @@ +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() + +cmp.setup({ + completion = { + completeopt = "menu,menuone,preview,noinsert,noselect", + autocomplete = { types.cmp.TriggerEvent.TextChanged }, + }, + window = { + documentation = { + border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" }, + winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None", + }, + completion = { + side_padding = 1, + border = { "┌", "─", "┐", "│", "┘", "─", "└", "│" }, + winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenuBorder,CursorLine:PmenuSel,Search:None", + scrollbar = false, + }, + }, + snippet = { -- configure how nvim-cmp interacts with snippet engine + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.complete(), -- show completion suggestions + ["C-"] = cmp.mapping.abort(), -- close completion menu + [""] = cmp.mapping.confirm({ select = true }), -- accept current selection + }), + + -- sources for autocompletion + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "codecompanion" }, -- code companion for AI-assisted coding + { name = "luasnip" }, -- snippets + { name = "buffer" }, -- text within current buffer + { name = "path" }, -- file system paths, + { name = "nvim_lsp_signature_help" }, + }), + -- configure lspkind for vs-code like pictograms in completion menu + formatting = { + format = lspkind.cmp_format({ + maxwidth = 50, + ellipsis_char = "...", + }), + }, +}) + +-- Use buffer source for `/` and `?` (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" }, + }), + matching = { disallow_symbol_nonprefix_matching = false }, +}) diff --git a/lua/absolute/after/nvim-silicon.lua b/lua/absolute/after/nvim-silicon.lua new file mode 100644 index 0000000..bb19165 --- /dev/null +++ b/lua/absolute/after/nvim-silicon.lua @@ -0,0 +1,57 @@ +local silicon = require("silicon") +local current_os = require("absolute.utils.detect-os") +local get_git_root = require("absolute.utils.get-git-root") + +local os_name = current_os.detect() +local supported_os = current_os.supported + +local function generate_file_name() + -- Generate a file name + local file_name = os.date("!%Y-%m-%dT%H-%M-%S") .. "_code.png" + + -- Project root + local project_root = get_git_root() + + -- Create screenshots directory if it doesn't exist in the local directory + local screenshot_dir = project_root .. "/Screenshots" + if vim.fn.isdirectory(screenshot_dir) == 0 then + vim.fn.mkdir(screenshot_dir, "p") + end + + -- Return the full path to the file + return screenshot_dir .. "/" .. file_name +end + +function Open_local_screenshot_folder() + local project_root = get_git_root() + local screenshot_dir = project_root .. "/Screenshots" + + if os_name == supported_os.MACOS then + vim.fn.jobstart("open " .. screenshot_dir, { detach = true }) + return + end + + if os_name == supported_os.UNIX then + vim.fn.jobstart("xdg-open " .. screenshot_dir, { detach = true }) + return + end + + if os_name == supported_os.WINDOWS then + vim.fn.jobstart("explorer " .. screenshot_dir, { detach = true }) + return + end +end + +-- Keymaps +local opts = { noremap = true, silent = true } + +opts.desc = "Silicon: Create screenshot of highlighted code" +vim.api.nvim_set_keymap("v", "sc", ":'<,'>Silicon", opts) + +opts.desc = "Silicon: Open screenshots directory" +vim.api.nvim_set_keymap("n", "so", "lua Open_local_screenshot_folder()", opts) + +silicon.setup({ + font = "JetBrains Mono=34;Noto Emoji", + output = generate_file_name, +}) diff --git a/lua/absolute/after/nvim-surround.lua b/lua/absolute/after/nvim-surround.lua new file mode 100644 index 0000000..d714190 --- /dev/null +++ b/lua/absolute/after/nvim-surround.lua @@ -0,0 +1,3 @@ +local surround = require("nvim-surround") + +surround.setup({}) diff --git a/lua/absolute/after/nvim-tree.lua b/lua/absolute/after/nvim-tree.lua new file mode 100644 index 0000000..8bf51ed --- /dev/null +++ b/lua/absolute/after/nvim-tree.lua @@ -0,0 +1,49 @@ +local nvimtree = require("absolute.disabled.nvim-tree") + +vim.g.loaded_netrw = 1 +vim.g.loaded_netrwPlugin = 1 + +vim.cmd([[ highlight NvimTreeIndentMarker guifg=#3FC5FF ]]) + +vim.cmd([[ highlight NvimTreeFolderArrowClosed guifg=#3FC5FF ]]) +vim.cmd([[ highlight NvimTreeFolderArrowOpen guifg=#3FC5FF ]]) + +nvimtree.setup({ + view = { + width = 45, + relativenumber = true, + }, + update_focused_file = { + enable = true, + }, + renderer = { + indent_markers = { + enable = true, + }, + icons = { + glyphs = { + + folder = { + arrow_closed = "", -- arrow when folder is closed + arrow_open = "", -- arrow when folder is open + }, + }, + }, + }, + -- disable window_picker for + -- explorer to work well with + -- window splits + actions = { + open_file = { + window_picker = { + enable = false, + }, + }, + }, + filters = { + custom = { ".DS_Store" }, + }, + git = { + ignore = false, + }, +}) diff --git a/lua/absolute/after/nvim-treesitter-context.lua b/lua/absolute/after/nvim-treesitter-context.lua new file mode 100644 index 0000000..9fbd545 --- /dev/null +++ b/lua/absolute/after/nvim-treesitter-context.lua @@ -0,0 +1,24 @@ +local treesittercontext = require("treesitter-context") + +treesittercontext.setup({ + enable = true, -- Enable this plugin (Can be enabled/disabled later via commands) + max_lines = 5, -- How many lines the window should span. Values <= 0 mean no limit. + min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit. + line_numbers = true, + multiline_threshold = 20, -- Maximum number of lines to show for a single context + trim_scope = "outer", -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer' + mode = "cursor", -- Line used to calculate context. Choices: 'cursor', 'topline' + -- Separator between context and content. Should be a single character string, like '-'. + -- When separator is set, the context will only show up when there are at least 2 lines above cursorline. + separator = nil, + zindex = 20, -- The Z-index of the context window + on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching +}) + +local opts = { silent = true } + +opts.desc = "Treesitter Context: Go to Previous Context" + +vim.keymap.set("n", "[c", function() + treesittercontext.go_to_context(vim.v.count1) +end, opts) diff --git a/lua/absolute/after/nvim-treesitter.lua b/lua/absolute/after/nvim-treesitter.lua new file mode 100644 index 0000000..c7cb351 --- /dev/null +++ b/lua/absolute/after/nvim-treesitter.lua @@ -0,0 +1,71 @@ +require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { + "rust", + "javascript", + "typescript", + "python", + "proto", + "c", + "lua", + "vim", + "vimdoc", + "query", + "markdown_inline", + "markdown", + }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + + highlight = { + enable = true, + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + disable = { "php" }, + }, + textobjects = { + move = { + enable = true, + set_jumps = false, -- you can change this if you want. + goto_next_start = { + --- ... other keymaps + ["]b"] = { query = "@code_cell.inner", desc = "next code block" }, + }, + goto_previous_start = { + --- ... other keymaps + ["[b"] = { query = "@code_cell.inner", desc = "previous code block" }, + }, + }, + select = { + enable = true, + lookahead = true, -- you can change this if you want + keymaps = { + --- ... other keymaps + ["ib"] = { query = "@code_cell.inner", desc = "in block" }, + ["ab"] = { query = "@code_cell.outer", desc = "around block" }, + }, + }, + swap = { -- Swap only works with code blocks that are under the same + -- markdown header + enable = true, + swap_next = { + --- ... other keymap + ["sbl"] = "@code_cell.outer", + }, + swap_previous = { + --- ... other keymap + ["sbh"] = "@code_cell.outer", + }, + }, + }, +}) diff --git a/lua/absolute/after/poet-v.lua b/lua/absolute/after/poet-v.lua new file mode 100644 index 0000000..e8c0187 --- /dev/null +++ b/lua/absolute/after/poet-v.lua @@ -0,0 +1,20 @@ +vim.g.poetv_executables = { "poetry" } +vim.g.poetv_auto_activate = 0 +vim.g.poetv_set_environment = 1 +vim.g.poetv_statusline_symbol = "🐍" + +-- Setup Autocommands + +vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { + pattern = { "*/.venv/*", "*.py" }, + callback = function() + -- check if poetv is activated + + if vim.g.poetv_name ~= nil then + return + else + vim.cmd([[ PoetvActivate ]]) + vim.cmd([[ LspRestart ]]) + end + end, +}) diff --git a/lua/absolute/after/smear-cursor.lua b/lua/absolute/after/smear-cursor.lua new file mode 100644 index 0000000..70435e4 --- /dev/null +++ b/lua/absolute/after/smear-cursor.lua @@ -0,0 +1,10 @@ +local smear_cursor = require("smear_cursor") + +smear_cursor.setup({ + stiffness = 0.5, + trailing_stiffness = 0.49, + never_draw_over_target = false, + smear_insert_mode = false, + smear_between_buffers = true, + cursor_color = "#7DF9FF", +}) diff --git a/lua/absolute/after/tailwind-sorter.lua b/lua/absolute/after/tailwind-sorter.lua new file mode 100644 index 0000000..c2ef2ee --- /dev/null +++ b/lua/absolute/after/tailwind-sorter.lua @@ -0,0 +1,6 @@ +local tws = require("tailwind-sorter") + +tws.setup({ + on_save_enabled = true, + on_save_pattern = { "*.html", "*.js", "*.jsx", "*.tsx", "*.twig", "*.hbs", "*.php", "*.heex", "*.astro", "*.vue" }, -- T +}) diff --git a/lua/absolute/after/telescope.lua b/lua/absolute/after/telescope.lua new file mode 100644 index 0000000..ad0a4a0 --- /dev/null +++ b/lua/absolute/after/telescope.lua @@ -0,0 +1,182 @@ +local telescope = require("telescope") +local builtin = require("telescope.builtin") +local actions = require("telescope.actions") +local trouble = require("trouble.sources.telescope") +local file_browser_actions = require("telescope._extensions.file_browser.actions") +local live_grep_shortcuts = require("telescope-live-grep-args.shortcuts") +local live_grep_actions = require("telescope-live-grep-args.actions") + +local image_preview = require("absolute.utils.telescope_image_preview") + +-- local function chafa_previewer_mime_hook(filepath, bufnr, opts) +-- local is_image = function(current_filepath) +-- local image_extensions = { "png", "jpg", "jpeg", "gif" } -- Supported image formats +-- local split_path = vim.split(current_filepath:lower(), ".", { plain = true }) +-- local extension = split_path[#split_path] +-- return vim.tbl_contains(image_extensions, extension) +-- end +-- if is_image(filepath) then +-- local term = vim.api.nvim_open_term(bufnr, {}) +-- local function send_output(_, data, _) +-- for _, d in ipairs(data) do +-- vim.api.nvim_chan_send(term, d .. "\r\n") +-- end +-- end +-- vim.fn.jobstart("chafa --passthrough tmux --exact-size off --format=symbols " .. filepath, { +-- on_stdout = send_output, +-- stdout_buffered = true, +-- }) +-- else +-- require("telescope.previewers.utils").set_preview_message(bufnr, opts.winid, "Binary cannot be previewed") +-- end +-- end + +telescope.setup({ + defaults = { + file_previewer = image_preview.file_previewer, + buffer_previewer_maker = image_preview.buffer_previewer_maker, + + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--follow", + "--hidden", + "--glob=!.git/", + }, + mappings = { + i = { + [""] = trouble.open, + [""] = actions.send_to_qflist, + }, + n = { + [""] = trouble.open, + [""] = actions.send_to_qflist, + }, + }, + }, + extensions = { + media_files = { + filetypes = { "png", "webp", "jpg", "jpeg", "svg" }, + find_cmd = "rg", + }, + live_grep_args = { + auto_quoting = false, + mappings = { + i = { + ["C-space"] = live_grep_actions.to_fuzzy_refine, + }, + }, + }, + + file_browser = { + hijack_netrw = true, + hide_parent_dir = true, + depth = 1, + respect_gitignore = vim.fn.executable("fd") == 1, + hidden = { file_browser = true, folder_browser = false }, + auto_depth = false, + browse_files = require("telescope._extensions.file_browser.finders").browse_files, + display_stat = { + date = true, + size = true, + mode = false, + }, + use_fd = true, + git_status = true, + mappings = { + ["i"] = { + [""] = file_browser_actions.create, + [""] = file_browser_actions.create_from_prompt, + [""] = file_browser_actions.rename, + [""] = file_browser_actions.move, + [""] = file_browser_actions.copy, + [""] = file_browser_actions.remove, + [""] = file_browser_actions.open, + [""] = file_browser_actions.goto_parent_dir, + [""] = file_browser_actions.goto_home_dir, + [""] = file_browser_actions.goto_cwd, + [""] = file_browser_actions.change_cwd, + [""] = file_browser_actions.toggle_browser, + [""] = file_browser_actions.toggle_hidden, + [""] = file_browser_actions.toggle_all, + [""] = file_browser_actions.backspace, + }, + ["n"] = { + ["c"] = file_browser_actions.create, + ["r"] = file_browser_actions.rename, + ["m"] = file_browser_actions.move, + ["y"] = file_browser_actions.copy, + ["d"] = file_browser_actions.remove, + ["o"] = file_browser_actions.open, + ["g"] = file_browser_actions.goto_parent_dir, + ["e"] = file_browser_actions.goto_home_dir, + ["w"] = file_browser_actions.goto_cwd, + ["t"] = file_browser_actions.change_cwd, + ["f"] = file_browser_actions.toggle_browser, + ["h"] = file_browser_actions.toggle_hidden, + ["s"] = file_browser_actions.toggle_all, + }, + }, + }, + }, +}) + +telescope.load_extension("live_grep_args") +telescope.load_extension("file_browser") +telescope.load_extension("media_files") +telescope.load_extension("themes") +telescope.load_extension("dap") + +local find_files = function() + builtin.find_files({ + find_command = { "rg", "--files", "--hidden", "--glob", "!.git" }, + }) +end + +local default_grep_files = function() + local input = vim.fn.input("[Global Search]: ") + local trimmed_input = vim.fn.trim(input) + + -- Check the length of the input + + local live_grep_args = telescope.extensions.live_grep_args + -- If the input is empty open the search prompt + + if trimmed_input == "" then + live_grep_args.live_grep_args() + return + end + + builtin.grep_string({ search = trimmed_input }) +end + +-- Function to get the visually selected text + +-- Pipe the visual selection into Telescope find_files +local opts = { noremap = true, silent = true } + +opts.desc = "Open file browser (cwd)" +vim.keymap.set("n", "pf", "Telescope file_browser", opts) + +opts.desc = "Open file browser (current file)" +vim.keymap.set("n", "cf", "Telescope file_browser path=%:p:h select_buffer=true", opts) + +opts.desc = "Fuzzy find files (cwd)" +vim.keymap.set("n", "", find_files, opts) + +opts.desc = "Fuzzy find recent files" +vim.keymap.set("n", "pr", builtin.oldfiles, opts) + +opts.desc = "Fuzzy find files in git in cwd" +vim.keymap.set("n", "gf", builtin.git_files, opts) + +opts.desc = "Fuzzy find files in cwd" +vim.keymap.set("n", "ps", default_grep_files, opts) + +opts.desc = "Fuzzy find word under cursor in cwd" +vim.keymap.set("n", "sb", live_grep_shortcuts.grep_word_under_cursor, opts) diff --git a/lua/absolute/after/todo-comments.lua b/lua/absolute/after/todo-comments.lua new file mode 100644 index 0000000..2cd25a3 --- /dev/null +++ b/lua/absolute/after/todo-comments.lua @@ -0,0 +1,25 @@ +local todo_comments = require("todo-comments") + +todo_comments.setup({}) + +local opts = { noremap = true, silent = true } + +opts.desc = "Jump to previous comment" +vim.keymap.set("n", "[t", function() + todo_comments.jump_prev() +end, opts) + +opts.desc = "Jump to next todo comment" +vim.keymap.set("n", "]t", function() + todo_comments.jump_next() +end, opts) + +opts.desc = "Open Comments in Telescope" +vim.keymap.set("n", "pt", function() + vim.cmd([[TodoTelescope]]) +end, opts) + +opts.desc = "Open Comments in Trouble" +vim.keymap.set("n", "tt", function() + vim.cmd([[TodoTrouble]]) +end, opts) diff --git a/lua/absolute/after/toggleterm.lua b/lua/absolute/after/toggleterm.lua new file mode 100644 index 0000000..1229514 --- /dev/null +++ b/lua/absolute/after/toggleterm.lua @@ -0,0 +1,62 @@ +local toggle_term = require("toggleterm") +local Terminal = require("toggleterm.terminal").Terminal + +toggle_term.setup({ + direction = "float", +}) + +local opts = { noremap = true, silent = true } + +local lazygit = Terminal:new({ + cmd = "lazygit", + dir = "git_dir", + direction = "float", + float_opts = { + border = "double", + }, + -- function to run on opening the terminal + on_open = function(term) + vim.cmd("startinsert!") + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", opts) + end, + -- function to run on closing the terminal + on_close = function(term) + vim.cmd("startinsert!") + end, +}) + +function _LAZYGIT_TOGGLE() + lazygit:toggle() +end + +-- Todo prompt model to run +local ollama = Terminal:new({ + cmd = "ollama run llama3", + dir = "git_dir", + direction = "float", + float_opts = { + border = "double", + }, + -- function to run on opening the terminal + on_open = function(term) + vim.cmd("startinsert!") + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", opts) + end, + -- function to run on closing the terminal + on_close = function(term) + vim.cmd("startinsert!") + end, +}) + +function _OLLAMA_TOGGLE() + ollama:toggle() +end + +opts.desc = "Open lazygit" +vim.api.nvim_set_keymap("n", "gs", "lua _LAZYGIT_TOGGLE()", opts) + +opts.desc = "Open ollama" +vim.api.nvim_set_keymap("n", "ol", "lua _OLLAMA_TOGGLE()", opts) + +-- opts.desc = "Open a terminal" +-- vim.api.nvim_set_keymap("n", "", "ToggleTerm", opts) diff --git a/lua/absolute/after/tokyonight.lua b/lua/absolute/after/tokyonight.lua new file mode 100644 index 0000000..c4462bd --- /dev/null +++ b/lua/absolute/after/tokyonight.lua @@ -0,0 +1,7 @@ +local theme = require("tokyonight") + +theme.setup({ + style = "night", + transparent = true, + dim_inactive = true, +}) diff --git a/lua/absolute/after/treesj.lua b/lua/absolute/after/treesj.lua new file mode 100644 index 0000000..01eeec7 --- /dev/null +++ b/lua/absolute/after/treesj.lua @@ -0,0 +1,16 @@ +local tsj = require("treesj") + + +local langs = {} + +tsj.setup({ + use_default_keymaps = false, + max_join_length = 1000, + langs = langs, +}) + +local opts = { silent = true, noremap = true } + +opts.desc = "Toggle Treesitter Join" + +vim.keymap.set("n", "m", "TSJToggle", opts) diff --git a/lua/absolute/after/undotree.lua b/lua/absolute/after/undotree.lua new file mode 100644 index 0000000..e63a278 --- /dev/null +++ b/lua/absolute/after/undotree.lua @@ -0,0 +1,4 @@ +vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" +vim.opt.undofile = true + +vim.keymap.set("n", "u", vim.cmd.UndotreeToggle) diff --git a/lua/absolute/after/venv-selector.lua b/lua/absolute/after/venv-selector.lua new file mode 100644 index 0000000..27cbe2a --- /dev/null +++ b/lua/absolute/after/venv-selector.lua @@ -0,0 +1,14 @@ +local venvSelector = require("venv-selector") + +venvSelector.setup({ + -- name = "venv", + auto_refresh = false, +}) + +local opts = { noremap = true, silent = true } + +opts.desc = "Open VenvSelector to pick a venv." +vim.api.nvim_set_keymap("n", "vs", "VenvSelect", opts) + +opts.desc = "Retrieve the venv from a cache." +vim.api.nvim_set_keymap("n", "vc", "VenvSelectCached", opts)