summaryrefslogtreecommitdiff
path: root/.config/nvim-old/lua/config
diff options
context:
space:
mode:
authorTom Li Dobnik <tomlidobnik1@gmail.com>2026-03-03 18:46:16 +0100
committerTom Li Dobnik <tomlidobnik1@gmail.com>2026-03-03 18:46:16 +0100
commitf7bbc5e6740f6199d7ed0fe704daaa7efd98c093 (patch)
treed6cd8984dbf2a8a909f16dde865a19a343c31d48 /.config/nvim-old/lua/config
parent1f156148fadab8468a46e598296b18b54f7860ce (diff)
nvim update
Diffstat (limited to '.config/nvim-old/lua/config')
-rw-r--r--.config/nvim-old/lua/config/lazy.lua36
-rw-r--r--.config/nvim-old/lua/config/plugins/blink-cmp.lua125
-rw-r--r--.config/nvim-old/lua/config/plugins/colorscheme.lua14
-rw-r--r--.config/nvim-old/lua/config/plugins/conform.lua40
-rw-r--r--.config/nvim-old/lua/config/plugins/flash.lua18
-rw-r--r--.config/nvim-old/lua/config/plugins/fzflua.lua29
-rw-r--r--.config/nvim-old/lua/config/plugins/gitsigns.lua36
-rw-r--r--.config/nvim-old/lua/config/plugins/leetcode.lua22
-rw-r--r--.config/nvim-old/lua/config/plugins/lsp.lua240
-rw-r--r--.config/nvim-old/lua/config/plugins/lualine.lua218
-rw-r--r--.config/nvim-old/lua/config/plugins/luasnip.lua21
-rw-r--r--.config/nvim-old/lua/config/plugins/markdown.lua220
-rw-r--r--.config/nvim-old/lua/config/plugins/mini.lua27
-rw-r--r--.config/nvim-old/lua/config/plugins/neotree.lua17
-rw-r--r--.config/nvim-old/lua/config/plugins/oil.lua37
-rw-r--r--.config/nvim-old/lua/config/plugins/rustacean.lua29
-rw-r--r--.config/nvim-old/lua/config/plugins/snacks.lua84
-rw-r--r--.config/nvim-old/lua/config/plugins/treesitter.lua43
-rw-r--r--.config/nvim-old/lua/config/plugins/typst.lua9
-rw-r--r--.config/nvim-old/lua/config/plugins/utils.lua58
-rw-r--r--.config/nvim-old/lua/config/plugins/uv.lua7
-rw-r--r--.config/nvim-old/lua/config/plugins/which-key.lua27
-rw-r--r--.config/nvim-old/lua/config/snippets/all.lua10
23 files changed, 1367 insertions, 0 deletions
diff --git a/.config/nvim-old/lua/config/lazy.lua b/.config/nvim-old/lua/config/lazy.lua
new file mode 100644
index 0000000..ba9b8f3
--- /dev/null
+++ b/.config/nvim-old/lua/config/lazy.lua
@@ -0,0 +1,36 @@
+-- Bootstrap lazy.nvim
+local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
+if not (vim.uv or vim.loop).fs_stat(lazypath) then
+ local lazyrepo = "https://github.com/folke/lazy.nvim.git"
+ local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
+ if vim.v.shell_error ~= 0 then
+ vim.api.nvim_echo({
+ { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
+ { out, "WarningMsg" },
+ { "\nPress any key to exit..." },
+ }, true, {})
+ vim.fn.getchar()
+ os.exit(1)
+ end
+end
+
+-- Hey! Put lazy into the runtimepath for neovim!
+vim.opt.runtimepath:prepend(lazypath)
+
+-- Make sure to setup `mapleader` and `maplocalleader` before
+-- loading lazy.nvim so that mappings are correct.
+-- This is also a good place to setup other settings (vim.opt)
+-- Setup lazy.nvim
+require("lazy").setup({
+ spec = {
+ { import = "config.plugins" },
+ },
+ ui = {
+ backdrop = 100,
+ },
+ change_detection = {
+ -- automatically check for config file changes and reload the ui
+ enabled = false,
+ notify = false, -- get a notification when changes are found
+ },
+})
diff --git a/.config/nvim-old/lua/config/plugins/blink-cmp.lua b/.config/nvim-old/lua/config/plugins/blink-cmp.lua
new file mode 100644
index 0000000..9f622c7
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/blink-cmp.lua
@@ -0,0 +1,125 @@
+return {
+ {
+ "saghen/blink.compat",
+ version = "*",
+ lazy = true,
+ opts = {},
+ },
+ {
+ "saghen/blink.cmp",
+ event = "VeryLazy",
+ -- optional: provides snippets for the snippet source
+ dependencies = {
+ "rafamadriz/friendly-snippets",
+ "moyiz/blink-emoji.nvim",
+ "ray-x/cmp-sql",
+ },
+
+ -- use a release tag to download pre-built binaries
+ version = "1.*",
+ -- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
+ -- build = 'cargo build --release',
+ -- If you use nix, you can build from source using latest nightly rust with:
+ -- build = 'nix run .#build-plugin',
+ opts = {
+ snippets = {
+ preset = "luasnip", -- Choose LuaSnip as the snippet engine
+ },
+ -- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
+ -- 'super-tab' for mappings similar to vscode (tab to accept)
+ -- 'enter' for enter to accept
+ -- 'none' for no mappings
+ --
+ -- All presets have the following mappings:
+ -- C-space: Open menu or open docs if already open
+ -- C-n/C-p or Up/Down: Select next/previous item
+ -- C-e: Hide menu
+ -- C-k: Toggle signature help (if signature.enabled = true)
+ --
+ -- See :h blink-cmp-config-keymap for defining your own keymap
+ keymap = {
+ preset = "default",
+ },
+
+ appearance = {
+ -- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
+ -- Adjusts spacing to ensure icons are aligned
+ nerd_font_variant = "mono",
+ },
+
+ -- (Default) Only show the documentation popup when manually triggered
+ completion = {
+ menu = { auto_show = true },
+ trigger = {
+ show_on_keyword = true,
+ show_on_trigger_character = true,
+ show_on_insert_on_trigger_character = true,
+ },
+ documentation = { auto_show = true, window = { border = "single" } },
+ },
+ signature = { enabled = true },
+
+ sources = {
+ default = { "lsp", "path", "snippets", "buffer", "emoji", "sql" },
+ providers = {
+ lsp = {
+ name = "LSP",
+ module = "blink.cmp.sources.lsp",
+ min_keyword_length = 0,
+ },
+ snippets = {
+ name = "snippets",
+ module = "blink.cmp.sources.snippets",
+ enabled = true,
+ min_keyword_length = 2,
+ score_offset = 80,
+ },
+ emoji = {
+ module = "blink-emoji",
+ name = "Emoji",
+ score_offset = 15, -- Tune by preference
+ opts = { insert = true }, -- Insert emoji (default) or complete its name
+ -- should_show_items = function()
+ -- return vim.tbl_contains(
+ -- -- Enable emoji completion only for git commits and markdown.
+ -- -- By default, enabled for all file-types.
+ -- { "gitcommit", "markdown" },
+ -- vim.o.filetype
+ -- )
+ -- end,
+ },
+ sql = {
+ -- IMPORTANT: use the same name as you would for nvim-cmp
+ name = "sql",
+ module = "blink.compat.source",
+
+ -- all blink.cmp source config options work as normal:
+ score_offset = -3,
+
+ -- this table is passed directly to the proxied completion source
+ -- as the `option` field in nvim-cmp's source config
+ --
+ -- this is NOT the same as the opts in a plugin's lazy.nvim spec
+ opts = {},
+ should_show_items = function()
+ return vim.tbl_contains(
+ -- Enable emoji completion only for git commits and markdown.
+ -- By default, enabled for all file-types.
+ { "sql" },
+ vim.o.filetype
+ )
+ end,
+ },
+ },
+ },
+
+ -- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
+ -- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
+ -- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
+ --
+ -- See the fuzzy documentation for more information
+ fuzzy = { implementation = "prefer_rust_with_warning" },
+ },
+ opts_extend = { "sources.default" },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/colorscheme.lua b/.config/nvim-old/lua/config/plugins/colorscheme.lua
new file mode 100644
index 0000000..ea130c7
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/colorscheme.lua
@@ -0,0 +1,14 @@
+return {
+ "shaunsingh/nord.nvim",
+ priority = 1000,
+ init = function()
+ vim.cmd.colorscheme("nord")
+ vim.cmd.hi("Comment gui=none")
+ -- Set transparency
+ vim.cmd("hi Normal guibg=NONE ctermbg=NONE")
+ vim.cmd("hi NormalFloat guibg=NONE ctermbg=NONE")
+ vim.cmd("hi SignColumn guibg=NONE")
+ vim.cmd("hi FloatBorder guibg=NONE")
+ vim.cmd("hi CursorLine guibg=NONE")
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/conform.lua b/.config/nvim-old/lua/config/plugins/conform.lua
new file mode 100644
index 0000000..5747200
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/conform.lua
@@ -0,0 +1,40 @@
+return {
+ "stevearc/conform.nvim",
+ event = "VeryLazy",
+ keys = {
+ {
+ "<leader>f",
+ function()
+ require("conform").format({ async = true, lsp_format = "fallback" })
+ end,
+ mode = "",
+ desc = "Format buffer",
+ },
+ },
+
+ opts = {
+ formatters_by_ft = {
+ lua = { "stylua" },
+ python = { "isort", "black" },
+ rust = { "rustfmt" },
+ javascript = { "prettierd", "prettier", stop_after_first = true },
+ typescript = { "prettierd", "prettier", stop_after_first = true },
+ typescriptreact = { "prettierd", "prettier", stop_after_first = true },
+ css = { "prettierd", "prettier", stop_after_first = true },
+ html = { "prettierd", "prettier", stop_after_first = true },
+ typst = { "prettypst" },
+ xml = { "xmlformatter" },
+ },
+ format_on_save = {
+ timeout_ms = 500,
+ lsp_format = "fallback",
+ },
+ formatters = {
+ xmlformat = {
+ command = "xmlformat",
+ args = { "--selfclose", "-" },
+ stdin = true,
+ },
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/flash.lua b/.config/nvim-old/lua/config/plugins/flash.lua
new file mode 100644
index 0000000..feec135
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/flash.lua
@@ -0,0 +1,18 @@
+return {
+ "folke/flash.nvim",
+ event = "VeryLazy",
+ opts = {
+ modes = {
+ search = { enabled = false },
+ char = { enabled = false },
+ treesitter = { enabled = false },
+ remote = { enabled = false },
+ },
+ },
+ -- stylua: ignore
+ keys = {
+ { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
+ { "R", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
+ { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/fzflua.lua b/.config/nvim-old/lua/config/plugins/fzflua.lua
new file mode 100644
index 0000000..8dfdeb3
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/fzflua.lua
@@ -0,0 +1,29 @@
+return {
+ "ibhagwan/fzf-lua",
+ event = "VeryLazy",
+ dependencies = { "echasnovski/mini.icons" },
+ opts = {
+ keymap = {
+ builtin = {
+ ["<S-j>"] = "preview-page-down",
+ ["<S-k>"] = "preview-page-up",
+ },
+ },
+ winopts = {
+ row = 1,
+ col = 0,
+ width = 1,
+ height = 0.4,
+ title_pos = "left",
+ preview = {
+ layout = "horizontal",
+ title_pos = "right",
+ },
+ },
+ files = {
+ -- Show hidden files but respect .gitignore
+ -- rg_opts = [[--color=never --hidden --files -g "!.git" --ignore-file ~/.config/git/ignore]],
+ -- fd_opts = [[--color=never --hidden --type f --type l --exclude .git --ignore-file ~/.config/git/ignore]],
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/gitsigns.lua b/.config/nvim-old/lua/config/plugins/gitsigns.lua
new file mode 100644
index 0000000..13c3b20
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/gitsigns.lua
@@ -0,0 +1,36 @@
+return {
+ {
+ "lewis6991/gitsigns.nvim",
+ event = "VeryLazy",
+ opts = {
+ signs = {
+ add = { text = "▎" },
+ change = { text = "▎" },
+ delete = { text = "" },
+ topdelete = { text = "" },
+ changedelete = { text = "▎" },
+ untracked = { text = "▎" },
+ },
+ on_attach = function(buffer)
+ local gs = package.loaded.gitsigns
+
+ local function map(mode, l, r, desc)
+ vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc })
+ end
+
+ -- stylua: ignore start
+ map("n", "]g", gs.next_hunk, "Next Hunk")
+ map("n", "[g", gs.prev_hunk, "Prev Hunk")
+ map({ "n", "v" }, "<leader>gs", ":Gitsigns stage_hunk<CR>", "Stage Hunk")
+ map({ "n", "v" }, "<leader>gr", ":Gitsigns reset_hunk<CR>", "Reset Hunk")
+ map("n", "<leader>gS", gs.stage_buffer, "Stage Buffer")
+ map("n", "<leader>gd", gs.diffthis, "Diff this")
+ map("n", "<leader>gu", gs.undo_stage_hunk, "Undo Stage Hunk")
+ map("n", "<leader>gR", gs.reset_buffer, "Reset Buffer")
+ map("n", "<leader>gp", gs.preview_hunk, "Preview Hunk")
+ map("n", "<leader>gb", function() gs.blame_line({ full = true }) end, "Blame Line")
+ map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>", "GitSigns Select Hunk")
+ end,
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/leetcode.lua b/.config/nvim-old/lua/config/plugins/leetcode.lua
new file mode 100644
index 0000000..920aba9
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/leetcode.lua
@@ -0,0 +1,22 @@
+return {
+ "kawre/leetcode.nvim",
+ build = function()
+ if vim.fn.exists(":TSUpdate") == 2 then
+ vim.cmd("TSUpdate html")
+ end
+ end,
+ dependencies = {
+ -- include a picker of your choice, see picker section for more details
+ "nvim-lua/plenary.nvim",
+ "MunifTanjim/nui.nvim",
+ },
+ opts = {
+ -- configuration goes here
+ lang = "rust",
+ storage = {
+ home = vim.fn.expand("~/leetcode"),
+ cache = vim.fn.stdpath("cache") .. "/leetcode",
+ },
+ image_support = false,
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/lsp.lua b/.config/nvim-old/lua/config/plugins/lsp.lua
new file mode 100644
index 0000000..eb812d2
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/lsp.lua
@@ -0,0 +1,240 @@
+return {
+ "neovim/nvim-lspconfig",
+ event = "VeryLazy",
+ dependencies = {
+ { "williamboman/mason.nvim", opts = {} },
+ "williamboman/mason-lspconfig.nvim",
+ "WhoIsSethDaniel/mason-tool-installer.nvim",
+ {
+ "j-hui/fidget.nvim",
+ opts = {
+ notification = {
+ window = {
+ winblend = 0,
+ },
+ },
+ },
+ },
+ },
+ config = function()
+ vim.api.nvim_create_autocmd("LspAttach", {
+ group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }),
+ callback = function(event)
+ local map = function(keys, func, desc, mode)
+ mode = mode or "n"
+ vim.keymap.set(mode, keys, func, { buffer = event.buf, desc = "LSP: " .. desc })
+ end
+
+ -- Jump to the definition of the word under your cursor.
+ -- This is where a variable was first declared, or where a function is defined, etc.
+ -- To jump back, press <C-t>.
+ map("gd", require("fzf-lua").lsp_definitions, "Goto Definition")
+
+ map("gk", function()
+ vim.diagnostic.open_float()
+ end, "Open floating diagnostic")
+
+ -- Find references for the word under your cursor.
+ map("gr", require("fzf-lua").lsp_references, "Goto References")
+
+ -- Jump to the implementation of the word under your cursor.
+ -- Useful when your language has ways of declaring types without an actual implementation.
+ map("gI", require("fzf-lua").lsp_implementations, "Goto Implementation")
+
+ -- Jump to the type of the word under your cursor.
+ -- Useful when you're not sure what type a variable is and you want to see
+ -- the definition of its *type*, not where it was *defined*.
+ map("<leader>D", require("fzf-lua").lsp_typedefs, "Type Definition")
+
+ -- Fuzzy find all the symbols in your current document.
+ -- Symbols are things like variables, functions, types, etc.
+ map("<leader>ds", require("fzf-lua").lsp_document_symbols, "Document Symbols")
+
+ -- Fuzzy find all the symbols in your current workspace.
+ -- Similar to document symbols, except searches over your entire project.
+ map("<leader>ws", require("fzf-lua").lsp_live_workspace_symbols, "Workspace Symbols")
+
+ -- Rename the variable under your cursor.
+ -- Most Language Servers support renaming across files, etc.
+ map("gR", vim.lsp.buf.rename, "Rename")
+
+ -- Execute a code action, usually your cursor needs to be on top of an error
+ -- or a suggestion from your LSP for this to activate.
+ map("<leader>ca", vim.lsp.buf.code_action, "Code Action", { "n", "x" })
+
+ -- WARN: This is not Goto Definition, this is Goto Declaration.
+ -- For example, in C this would take you to the header.
+ map("gD", vim.lsp.buf.declaration, "Goto Declaration")
+ local function client_supports_method(client, method, bufnr)
+ if vim.fn.has("nvim-0.11") == 1 then
+ return client:supports_method(method, bufnr)
+ else
+ return client.supports_method(method, { bufnr = bufnr })
+ end
+ end
+
+ -- The following two autocommands are used to highlight references of the
+ -- word under your cursor when your cursor rests there for a little while.
+ -- See `:help CursorHold` for information about when this is executed
+ --
+ -- When you move your cursor, the highlights will be cleared (the second autocommand).
+ local client = vim.lsp.get_client_by_id(event.data.client_id)
+ if
+ client
+ and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_documentHighlight, event.buf)
+ then
+ local highlight_augroup = vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false })
+ vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, {
+ buffer = event.buf,
+ group = highlight_augroup,
+ callback = vim.lsp.buf.document_highlight,
+ })
+
+ vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
+ buffer = event.buf,
+ group = highlight_augroup,
+ callback = vim.lsp.buf.clear_references,
+ })
+
+ vim.api.nvim_create_autocmd("LspDetach", {
+ group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }),
+ callback = function(event2)
+ vim.lsp.buf.clear_references()
+ vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf })
+ end,
+ })
+ end
+
+ -- The following code creates a keymap to toggle inlay hints in your
+ -- code, if the language server you are using supports them
+ --
+ vim.api.nvim_set_hl(0, "LspInlayHint", { fg = "#4c566a", bg = "NONE", italic = true })
+
+ -- This may be unwanted, since they displace some of your code
+ if client and client_supports_method(client, vim.lsp.protocol.Methods.textDocument_inlayHint, event.buf) then
+ map("<leader>th", function()
+ vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf }))
+ end, "Toggle Inlay Hints")
+ end
+ end,
+ })
+
+ vim.keymap.set("n", "gK", function()
+ local new_config = not vim.diagnostic.config().virtual_lines
+ vim.diagnostic.config({ virtual_lines = new_config })
+ end, { desc = "Toggle diagnostic virtual_lines" })
+
+ -- Diagnostic Config
+ -- See :help vim.diagnostic.Opts
+ vim.diagnostic.config({
+ severity_sort = true,
+ float = { border = "rounded", source = "if_many" },
+ underline = { severity = vim.diagnostic.severity.ERROR },
+ signs = {
+ text = {
+ [vim.diagnostic.severity.ERROR] = "󰅚 ",
+ [vim.diagnostic.severity.WARN] = "󰀪 ",
+ [vim.diagnostic.severity.INFO] = "󰋽 ",
+ [vim.diagnostic.severity.HINT] = "󰌶 ",
+ },
+ },
+ virtual_text = {
+ source = "if_many",
+ spacing = 2,
+ },
+ update_in_insert = true,
+ virtual_lines = false,
+ -- virtual_text = {
+ -- source = "if_many",
+ -- spacing = 2,
+ -- format = function(diagnostic)
+ -- local diagnostic_message = {
+ -- [vim.diagnostic.severity.ERROR] = diagnostic.message,
+ -- [vim.diagnostic.severity.WARN] = diagnostic.message,
+ -- [vim.diagnostic.severity.INFO] = diagnostic.message,
+ -- [vim.diagnostic.severity.HINT] = diagnostic.message,
+ -- }
+ -- return diagnostic_message[diagnostic.severity]
+ -- end,
+ -- },
+ })
+ local original_capabilities = vim.lsp.protocol.make_client_capabilities()
+ local capabilities = require("blink.cmp").get_lsp_capabilities(original_capabilities)
+ -- Enable the following language servers
+ -- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
+ --
+ -- Add any additional override configuration in the following tables. Available keys are:
+ -- - cmd (table): Override the default command used to start the server
+ -- - filetypes (table): Override the default list of associated filetypes for the server
+ -- - capabilities (table): Override fields in capabilities. Can be used to disable certain LSP features.
+ -- - settings (table): Override the default settings passed when initializing the server.
+ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
+ local lspconfig_util = require("lspconfig.util")
+ local servers = {
+ bashls = {},
+ marksman = {},
+ pyright = {
+ settings = {
+ python = {
+ analysis = {
+ typeCheckingMode = "basic",
+ autoSearchPaths = true,
+ useLibraryCodeForTypes = true,
+ },
+ },
+ },
+ },
+ clangd = {
+ cmd = {
+ "clangd",
+ "--fallback-style={BasedOnStyle: LLVM, IndentWidth: 4, TabWidth: 4, UseTab: Never}",
+ },
+ },
+ rust_analyzer = {
+ single_file_support = true,
+ root_dir = function(fname)
+ return lspconfig_util.root_pattern("Cargo.toml", "rust-project.json", ".git")(fname)
+ or vim.fs.dirname(fname)
+ end,
+ },
+ lua_ls = {},
+ } -- Ensure the servers and tools above are installed
+ --
+ -- To check the current status of installed tools and/or manually install
+ -- other tools, you can run
+ -- :Mason
+ --
+ -- You can press `g?` for help in this menu.
+ --
+ -- `mason` had to be setup earlier: to configure its options see the
+ -- `dependencies` table for `nvim-lspconfig` above.
+ --
+ -- You can add other tools here that you want Mason to install
+ -- for you, so that they are available from within Neovim.
+ local ensure_installed = vim.tbl_keys(servers or {})
+ vim.list_extend(ensure_installed, {
+ "stylua",
+ "prettierd",
+ })
+ require("mason-tool-installer").setup({ ensure_installed = ensure_installed })
+
+ require("mason-lspconfig").setup({
+ ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
+ automatic_installation = false,
+ automatic_enable = false,
+ handlers = {
+ function(server_name)
+ if server_name == "rust_analyzer" then
+ return
+ end
+ local server = servers[server_name] or {}
+ -- This handles overriding only values explicitly passed
+ -- by the server configuration above. Useful when disabling
+ -- certain features of an LSP (for example, turning off formatting for ts_ls)
+ server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {})
+ require("lspconfig")[server_name].setup(server)
+ end,
+ },
+ })
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/lualine.lua b/.config/nvim-old/lua/config/plugins/lualine.lua
new file mode 100644
index 0000000..466d7b4
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/lualine.lua
@@ -0,0 +1,218 @@
+return {
+ "nvim-lualine/lualine.nvim",
+ event = "VeryLazy",
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ -- Eviline config for lualine
+ -- Author: shadmansaleh
+ -- Credit: glepnir
+ config = function()
+ local lualine = require("lualine")
+
+ -- Color table for highlights
+ -- stylua: ignore
+ local colors = {
+ bg = '#434c5e',
+ fg = '#d8dee9',
+ yellow = '#ebcb8b',
+ cyan = '#88c0d0',
+ darkblue = '#5e81ac',
+ green = '#a3be8c',
+ orange = '#d08770',
+ violet = '#b48ead',
+ blue = '#81a1c1',
+ red = '#bf616a',
+ }
+
+ local conditions = {
+ buffer_not_empty = function()
+ return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
+ end,
+ hide_in_width = function()
+ return vim.fn.winwidth(0) > 80
+ end,
+ check_git_workspace = function()
+ local filepath = vim.fn.expand("%:p:h")
+ local gitdir = vim.fn.finddir(".git", filepath .. ";")
+ return gitdir and #gitdir > 0 and #gitdir < #filepath
+ end,
+ }
+
+ local config = {
+ options = {
+ component_separators = "",
+ section_separators = "",
+ theme = {
+ normal = { c = { fg = colors.fg, bg = colors.bg } },
+ inactive = { c = { fg = colors.fg, bg = colors.bg } },
+ },
+ },
+ sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_y = {},
+ lualine_z = {},
+ lualine_c = {},
+ lualine_x = {},
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_y = {},
+ lualine_z = {},
+ lualine_c = {},
+ lualine_x = {},
+ },
+ }
+
+ -- Inserts a component in lualine_c at left section
+ local function ins_left(component)
+ table.insert(config.sections.lualine_c, component)
+ end
+
+ -- Inserts a component in lualine_x at right section
+ local function ins_right(component)
+ table.insert(config.sections.lualine_x, component)
+ end
+
+ -- ins_left({
+ -- function()
+ -- return "▊"
+ -- end,
+ -- color = { fg = colors.blue }, -- Sets highlighting of component
+ -- padding = { left = 0, right = 1 }, -- We don't need space before this
+ -- })
+
+ ins_left({
+ -- mode component
+ function()
+ return "  " .. string.upper(vim.fn.mode())
+ end,
+ color = function()
+ -- auto change color according to neovims mode
+ local mode_color = {
+ n = colors.red,
+ i = colors.green,
+ v = colors.blue,
+ [""] = colors.blue,
+ V = colors.blue,
+ c = colors.violet,
+ no = colors.red,
+ s = colors.orange,
+ S = colors.orange,
+ [""] = colors.orange,
+ ic = colors.yellow,
+ R = colors.violet,
+ Rv = colors.violet,
+ cv = colors.red,
+ ce = colors.red,
+ r = colors.cyan,
+ rm = colors.cyan,
+ ["r?"] = colors.cyan,
+ ["!"] = colors.red,
+ t = colors.red,
+ }
+ return { fg = mode_color[vim.fn.mode()] }
+ end,
+ padding = { right = 1 },
+ })
+
+ ins_left({
+ "filename",
+ cond = conditions.buffer_not_empty,
+ color = { fg = colors.green, gui = "bold" },
+ })
+ ins_left({
+ "filesize",
+ cond = conditions.buffer_not_empty,
+ })
+
+ ins_right({ "location" })
+
+ ins_right({ "progress", color = { fg = colors.fg, gui = "bold" } })
+
+ ins_left({
+ "diagnostics",
+ sources = { "nvim_diagnostic" },
+ symbols = { error = " ", warn = " ", info = " " },
+ diagnostics_color = {
+ error = { fg = colors.red },
+ warn = { fg = colors.yellow },
+ info = { fg = colors.cyan },
+ },
+ })
+ --
+ -- -- Insert mid section. You can make any number of sections in neovim :)
+ -- -- for lualine it's any number greater then 2
+ -- ins_left({
+ -- function()
+ -- return "%="
+ -- end,
+ -- })
+ --
+ -- ins_left({
+ -- -- Lsp server name .
+ -- function()
+ -- local msg = "No Active Lsp"
+ -- local buf_ft = vim.api.nvim_get_option_value("filetype", { buf = 0 })
+ -- local clients = vim.lsp.get_clients()
+ -- if next(clients) == nil then
+ -- return msg
+ -- end
+ -- for _, client in ipairs(clients) do
+ -- local filetypes = client.config.filetypes
+ -- if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then
+ -- return client.name
+ -- end
+ -- end
+ -- return msg
+ -- end,
+ -- icon = " LSP:",
+ -- color = { fg = "#ffffff", gui = "bold" },
+ -- })
+
+ -- ins_right({
+ -- "filetype",
+ -- color = { fg = colors.fg, gui = "bold" },
+ -- })
+ -- -- Add components to right sections
+ -- ins_right({
+ -- "o:encoding", -- option component same as &encoding in viml
+ -- fmt = string.upper, -- I'm not sure why it's upper case either ;)
+ -- cond = conditions.hide_in_width,
+ -- color = { fg = colors.green, gui = "bold" },
+ -- })
+ --
+ -- ins_right({
+ -- "fileformat",
+ -- fmt = string.upper,
+ -- color = { fg = colors.green, gui = "bold" },
+ -- })
+
+ -- ins_right({
+ -- "branch",
+ -- icon = "",
+ -- color = { fg = colors.violet, gui = "bold" },
+ -- })
+
+ -- ins_right({
+ -- "diff",
+ -- symbols = { added = " ", modified = " ", removed = " " },
+ -- diff_color = {
+ -- added = { fg = colors.green },
+ -- modified = { fg = colors.orange },
+ -- removed = { fg = colors.red },
+ -- },
+ -- cond = conditions.hide_in_width,
+ -- })
+
+ -- ins_right({
+ -- function()
+ -- return "▊"
+ -- end,
+ -- color = { fg = colors.blue },
+ -- padding = { left = 1 },
+ -- })
+
+ lualine.setup(config)
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/luasnip.lua b/.config/nvim-old/lua/config/plugins/luasnip.lua
new file mode 100644
index 0000000..a051cee
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/luasnip.lua
@@ -0,0 +1,21 @@
+return {
+ "L3MON4D3/LuaSnip",
+ version = "v2.*",
+ event = "VeryLazy",
+ build = "make install_jsregexp",
+ config = function()
+ require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/config/snippets/" })
+ local ls = require("luasnip")
+ vim.keymap.set({ "i", "s" }, "<C-d>", function()
+ ls.jump(1)
+ end, { silent = true })
+ vim.keymap.set({ "i", "s" }, "<C-u>", function()
+ ls.jump(-1)
+ end, { silent = true })
+ ls.config.setup({
+ enable_autosnippets = true,
+ region_check_events = "InsertEnter",
+ delete_check_events = "InsertLeave",
+ })
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/markdown.lua b/.config/nvim-old/lua/config/plugins/markdown.lua
new file mode 100644
index 0000000..223d3fb
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/markdown.lua
@@ -0,0 +1,220 @@
+return {
+ {
+ "bullets-vim/bullets.vim",
+ ft = "markdown",
+ config = function()
+ vim.g.bullets_delete_last_bullet_if_empty = 1
+ end,
+ },
+ {
+ "stevearc/conform.nvim",
+ event = "VeryLazy",
+ optional = true,
+ opts = {
+ formatters = {
+ ["markdownlint-cli2"] = {
+ condition = function(_, ctx)
+ local diag = vim.tbl_filter(function(d)
+ return d.source == "markdownlint"
+ end, vim.diagnostic.get(ctx.buf))
+ return #diag > 0
+ end,
+ },
+ },
+ formatters_by_ft = {
+ ["markdown"] = { "prettier", "markdownlint-cli2" },
+ ["markdown.mdx"] = { "prettier", "markdownlint-cli2" },
+ },
+ },
+ },
+ {
+ "williamboman/mason.nvim",
+ event = "VeryLazy",
+ opts = { ensure_installed = { "markdownlint-cli2" } },
+ },
+ {
+ "nvimtools/none-ls.nvim",
+ event = "VeryLazy",
+ optional = true,
+ opts = function(_, opts)
+ local nls = require("null-ls")
+ opts.sources = vim.list_extend(opts.sources or {}, {
+ nls.builtins.diagnostics.markdownlint_cli2,
+ })
+ end,
+ },
+ {
+ "mfussenegger/nvim-lint",
+ event = "VeryLazy",
+
+ optional = true,
+ opts = {
+ linters_by_ft = {
+ markdown = { "markdownlint-cli2" },
+ },
+ },
+ },
+ {
+ "neovim/nvim-lspconfig",
+ event = "VeryLazy",
+
+ opts = {
+ servers = {
+ marksman = {},
+ },
+ },
+ },
+
+ {
+ "iamcco/markdown-preview.nvim",
+ event = "VeryLazy",
+
+ cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
+ build = function()
+ require("lazy").load({ plugins = { "markdown-preview.nvim" } })
+ vim.fn["mkdp#util#install"]()
+ end,
+ keys = {
+ {
+ "<leader>ow",
+ ft = "markdown",
+ "<cmd>MarkdownPreviewToggle<cr>",
+ desc = "Markdown Preview",
+ },
+ },
+ config = function()
+ vim.cmd([[do FileType]])
+ end,
+ },
+
+ {
+ "MeanderingProgrammer/render-markdown.nvim",
+ ft = "markdown",
+ config = function()
+ require("render-markdown").setup({
+ win_options = {
+ conceallevel = {
+ default = 0, -- Set default conceallevel to 0
+ rendered = 3, -- Keep rendered mode at 3
+ },
+ },
+ bullet = {
+ -- Turn on / off list bullet rendering
+ enabled = true,
+ },
+ latex = { enabled = false },
+ checkbox = {
+ -- Turn on / off checkbox state rendering
+ enabled = true,
+ -- Determines how icons fill the available space:
+ -- inline: underlying text is concealed resulting in a left aligned icon
+ -- overlay: result is left padded with spaces to hide any additional text
+ position = "inline",
+ unchecked = {
+ -- Replaces '[ ]' of 'task_list_marker_unchecked'
+ icon = " 󰄱 ",
+ -- Highlight for the unchecked icon
+ highlight = "RenderMarkdownUnchecked",
+ -- Highlight for item associated with unchecked checkbox
+ scope_highlight = nil,
+ },
+ checked = {
+ -- Replaces '[x]' of 'task_list_marker_checked'
+ icon = " 󰱒 ",
+ -- Highlight for the checked icon
+ highlight = "RenderMarkdownChecked",
+ -- Highlight for item associated with checked checkbox
+ scope_highlight = nil,
+ },
+ },
+ html = {
+ -- Turn on / off all HTML rendering
+ enabled = true,
+ comment = {
+ -- Turn on / off HTML comment concealing
+ conceal = false,
+ },
+ },
+ heading = {
+ -- left_pad = 1,
+ sign = false,
+ icons = { " 󰎤 ", " 󰎧 ", " 󰎪 ", " 󰎭 ", " 󰎱 ", " 󰎳 " },
+ backgrounds = {
+ "Headline1Bg",
+ "Headline2Bg",
+ "Headline3Bg",
+ "Headline4Bg",
+ "Headline5Bg",
+ "Headline6Bg",
+ },
+ foregrounds = {
+ "Headline1Fg",
+ "Headline2Fg",
+ "Headline3Fg",
+ "Headline4Fg",
+ "Headline5Fg",
+ "Headline6Fg",
+ },
+ },
+ ft = { "markdown" },
+ })
+
+ local color1_bg = "#bf616a"
+ local color2_bg = "#d08770"
+ local color5_bg = "#5e81ac"
+ local color4_bg = "#a3be8c"
+ local color6_bg = "#b48ead"
+ local color3_bg = "#ebcb8b"
+ local color_fg = "#2e3440"
+
+ vim.cmd(string.format([[highlight @markup.strong guifg=%s]], color2_bg))
+ vim.cmd(string.format([[highlight @markup.italic guifg=%s]], color2_bg))
+ vim.cmd(string.format([[highlight RenderMarkdownCodeInline guifg=%s]], color4_bg))
+
+ -- Heading background color highlights
+ vim.cmd(string.format([[highlight Headline1Bg guifg=%s guibg=%s]], color_fg, color1_bg))
+ vim.cmd(string.format([[highlight Headline2Bg guifg=%s guibg=%s]], color_fg, color2_bg))
+ vim.cmd(string.format([[highlight Headline3Bg guifg=%s guibg=%s]], color_fg, color3_bg))
+ vim.cmd(string.format([[highlight Headline4Bg guifg=%s guibg=%s]], color_fg, color4_bg))
+ vim.cmd(string.format([[highlight Headline5Bg guifg=%s guibg=%s]], color_fg, color5_bg))
+ vim.cmd(string.format([[highlight Headline6Bg guifg=%s guibg=%s]], color_fg, color6_bg))
+
+ -- Heading foreground color highlights (bold and with specific colors)
+ vim.cmd(string.format([[highlight Headline1Fg cterm=bold gui=bold guifg=%s]], color1_bg))
+ vim.cmd(string.format([[highlight Headline2Fg cterm=bold gui=bold guifg=%s]], color2_bg))
+ vim.cmd(string.format([[highlight Headline3Fg cterm=bold gui=bold guifg=%s]], color3_bg))
+ vim.cmd(string.format([[highlight Headline4Fg cterm=bold gui=bold guifg=%s]], color4_bg))
+ vim.cmd(string.format([[highlight Headline5Fg cterm=bold gui=bold guifg=%s]], color5_bg))
+ vim.cmd(string.format([[highlight Headline6Fg cterm=bold gui=bold guifg=%s]], color6_bg))
+
+ vim.cmd(string.format([[highlight RenderMarkdownH1Bg guifg=%s guibg=%s]], color_fg, color1_bg))
+ vim.cmd(string.format([[highlight RenderMarkdownH2Bg guifg=%s guibg=%s]], color_fg, color2_bg))
+ vim.cmd(string.format([[highlight RenderMarkdownH3Bg guifg=%s guibg=%s]], color_fg, color3_bg))
+ vim.cmd(string.format([[highlight RenderMarkdownH4Bg guifg=%s guibg=%s]], color_fg, color4_bg))
+ vim.cmd(string.format([[highlight RenderMarkdownH5Bg guifg=%s guibg=%s]], color_fg, color5_bg))
+ vim.cmd(string.format([[highlight RenderMarkdownH6Bg guifg=%s guibg=%s]], color_fg, color6_bg))
+
+ -- Apply custom foreground colors for headings (bold)
+ vim.cmd(string.format([[highlight RenderMarkdownH1 guifg=%s guibg=%s cterm=bold gui=bold]], color1_bg, color_fg))
+ vim.cmd(string.format([[highlight RenderMarkdownH2 guifg=%s guibg=%s cterm=bold gui=bold]], color2_bg, color_fg))
+ vim.cmd(string.format([[highlight RenderMarkdownH3 guifg=%s guibg=%s cterm=bold gui=bold]], color3_bg, color_fg))
+ vim.cmd(string.format([[highlight RenderMarkdownH4 guifg=%s guibg=%s cterm=bold gui=bold]], color4_bg, color_fg))
+ vim.cmd(string.format([[highlight RenderMarkdownH5 guifg=%s guibg=%s cterm=bold gui=bold]], color5_bg, color_fg))
+ vim.cmd(string.format([[highlight RenderMarkdownH6 guifg=%s guibg=%s cterm=bold gui=bold]], color6_bg, color_fg))
+ Snacks.toggle({
+ name = "Render Markdown",
+ get = function()
+ return require("render-markdown.state").enabled
+ end,
+ set = function(enabled)
+ local m = require("render-markdown")
+ if enabled then
+ m.enable()
+ else
+ m.disable()
+ end
+ end,
+ }):map("<leader>or", { desc = "Toggle Render Markdown" })
+ end,
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/mini.lua b/.config/nvim-old/lua/config/plugins/mini.lua
new file mode 100644
index 0000000..fe6a3aa
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/mini.lua
@@ -0,0 +1,27 @@
+return {
+ {
+ "echasnovski/mini.nvim",
+ event = "VeryLazy",
+ enabled = true,
+ config = function()
+ require("mini.icons").setup()
+ require("mini.move").setup()
+ require("mini.ai").setup()
+ require("mini.surround").setup()
+ require("mini.pairs").setup()
+ --
+ -- HACK: The Key Commands -> for help run ;h nvim-surround.usage
+ --
+ -- Old text Command New text
+ -- --------------------------------------------------------------------------------
+ -- surr*ound_words ysiw) (surround_words)
+ -- *make strings ys$" "make strings"
+ -- [delete ar*ound me!] ds] delete around me!
+ -- remove <b>HTML t*ags</b> dst remove HTML tags
+ -- 'change quot*es' cs'" "change quotes"
+ -- <b>or tag* types</b> csth1<CR> <h1>or tag types</h1>
+ -- delete(functi*on calls) dsf function calls
+ --
+ end,
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/neotree.lua b/.config/nvim-old/lua/config/plugins/neotree.lua
new file mode 100644
index 0000000..11a0a98
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/neotree.lua
@@ -0,0 +1,17 @@
+return {
+ {
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v3.x",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "MunifTanjim/nui.nvim",
+ "nvim-tree/nvim-web-devicons", -- optional, but recommended
+ },
+ lazy = false, -- neo-tree will lazily load itself
+ opts = {
+ window = {
+ position = "right",
+ },
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/oil.lua b/.config/nvim-old/lua/config/plugins/oil.lua
new file mode 100644
index 0000000..555768f
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/oil.lua
@@ -0,0 +1,37 @@
+return {
+ "stevearc/oil.nvim",
+ dependencies = { "nvim-tree/nvim-web-devicons" },
+ config = function()
+ require("oil").setup({
+ default_file_explorer = true,
+ keymaps = {
+ ["l"] = "actions.select",
+ ["h"] = "actions.parent",
+ ["<CR>"] = "actions.select",
+ ["<C-s>"] = nil,
+ ["<C-h>"] = nil,
+ ["<C-l>"] = nil,
+ },
+ delete_to_trash = true,
+ view_options = {
+ show_hidden = true,
+ },
+ skip_confirm_for_simple_edits = true,
+ float = {
+ max_width = 80,
+ max_height = 30,
+ override = function(conf)
+ return conf
+ end,
+ },
+ })
+ vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
+
+ vim.api.nvim_create_autocmd("FileType", {
+ pattern = "oil",
+ callback = function()
+ vim.opt_local.cursorline = true
+ end,
+ })
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/rustacean.lua b/.config/nvim-old/lua/config/plugins/rustacean.lua
new file mode 100644
index 0000000..1187aad
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/rustacean.lua
@@ -0,0 +1,29 @@
+return {
+ "mrcjkb/rustaceanvim",
+ version = "^8", -- Recommended
+ lazy = false, -- This plugin is already lazy
+ init = function()
+ local capabilities = vim.lsp.protocol.make_client_capabilities()
+ local ok, blink = pcall(require, "blink.cmp")
+ if ok then
+ capabilities = blink.get_lsp_capabilities(capabilities)
+ end
+
+ vim.g.rustaceanvim = {
+ tools = {
+ enable_clippy = false,
+ },
+ server = {
+ capabilities = capabilities,
+ standalone = true,
+ status_notify_level = false,
+ load_vscode_settings = false,
+ default_settings = {
+ ["rust-analyzer"] = {
+ checkOnSave = false,
+ },
+ },
+ },
+ }
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/snacks.lua b/.config/nvim-old/lua/config/plugins/snacks.lua
new file mode 100644
index 0000000..dd731dd
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/snacks.lua
@@ -0,0 +1,84 @@
+return {
+ "folke/snacks.nvim",
+ priority = 1000,
+ lazy = false,
+ opts = {
+ bigfile = { enabled = true },
+ notifier = { timeout = 2000 },
+ quickfile = { enabled = true },
+ statuscolumn = { enabled = true },
+ image = {
+ enabled = true,
+ doc = {
+ enabled = true,
+ float = true,
+ inline = false,
+ max_width = 60,
+ max_height = 30,
+ },
+ },
+ dashboard = {
+ enabled = true,
+ autokeys = "wert",
+ preset = {
+ keys = {
+ { icon = " ", key = "f", desc = "Find File", action = ":lua Snacks.dashboard.pick('files')" },
+ { icon = " ", key = "g", desc = "Grep", action = ":lua Snacks.dashboard.pick('live_grep')", padding = 1 },
+ { icon = " ", key = "n", desc = "New File", action = ":ene | startinsert" },
+ { icon = " ", key = "c", desc = "LeetCode", action = ":Leet" },
+ { icon = "󰒲 ", key = "l", desc = "Lazy", action = ":Lazy", enabled = package.loaded.lazy ~= nil },
+ { icon = " ", key = "q", desc = "Quit", action = ":qa" },
+ },
+ },
+ formats = {
+ key = function(item)
+ return { { "[", hl = "special" }, { item.key, hl = "key" }, { "]", hl = "special" } }
+ end,
+ },
+ sections = {
+ { section = "recent_files", limit = 4, padding = 1 },
+ { section = "keys", padding = 1 },
+ { section = "startup" },
+ },
+ },
+ styles = {
+ snacks_image = {
+ relative = "editor",
+ col = -1,
+ },
+ lazygit = {
+ wo = {
+ winhighlight = "NormalFloat:None,FloatBorder:SnacksInputBorder,FloatTitle:SnacksInputTitle",
+ cursorline = false,
+ },
+ },
+ float = {
+ backdrop = false,
+ },
+ blame_line = {
+ backdrop = false,
+ },
+ },
+ },
+ init = function()
+ vim.api.nvim_create_autocmd("User", {
+ pattern = "VeryLazy",
+ callback = function()
+ _G.dd = function(...)
+ Snacks.debug.inspect(...)
+ end
+ _G.bt = function()
+ Snacks.debug.backtrace()
+ end
+ vim.print = _G.dd
+ Snacks.toggle.option("spell", { name = "Spelling" }):map("<leader>ts")
+ Snacks.toggle.option("wrap", { name = "Wrap" }):map("<leader>tw")
+ Snacks.toggle.diagnostics():map("<leader>td")
+ Snacks.toggle
+ .option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 })
+ :map("<leader>tc")
+ Snacks.toggle.indent():map("<leader>ti")
+ end,
+ })
+ end,
+}
diff --git a/.config/nvim-old/lua/config/plugins/treesitter.lua b/.config/nvim-old/lua/config/plugins/treesitter.lua
new file mode 100644
index 0000000..3e866c5
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/treesitter.lua
@@ -0,0 +1,43 @@
+return {
+ {
+ "nvim-treesitter/nvim-treesitter",
+ event = "VeryLazy",
+ opts = {
+ ensure_installed = {
+ "c",
+ "lua",
+ "vim",
+ "vimdoc",
+ "query",
+ "markdown",
+ "markdown_inline",
+ "rust",
+ "css",
+ "javascript",
+ "svelte",
+ "tsx",
+ "typst",
+ },
+ auto_install = true,
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ node_incremental = "<Enter>",
+ scope_incremental = false,
+ node_decremental = "<Backspace>",
+ },
+ },
+ highlight = {
+ enable = true,
+ disable = function(lang, buf)
+ local max_filesize = 100 * 1024 -- 100 KB
+ local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
+ if ok and stats and stats.size > max_filesize then
+ return true
+ end
+ end,
+ additional_vim_regex_highlighting = false,
+ },
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/typst.lua b/.config/nvim-old/lua/config/plugins/typst.lua
new file mode 100644
index 0000000..2443773
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/typst.lua
@@ -0,0 +1,9 @@
+return {
+ "chomosuke/typst-preview.nvim",
+ -- lazy = false, -- or ft = 'typst'
+ ft = "typst",
+ version = "1.*",
+ opts = {
+ invert_colors = "auto",
+ }, -- lazy.nvim will implicitly calls `setup {}`
+}
diff --git a/.config/nvim-old/lua/config/plugins/utils.lua b/.config/nvim-old/lua/config/plugins/utils.lua
new file mode 100644
index 0000000..273de1a
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/utils.lua
@@ -0,0 +1,58 @@
+return {
+ {
+ "ojroques/nvim-osc52",
+ event = "VeryLazy",
+ config = function()
+ vim.keymap.set("v", "Y", require("osc52").copy_visual)
+ end,
+ },
+ { -- For CSS colors
+ "NvChad/nvim-colorizer.lua",
+ event = "BufReadPre",
+ opts = {
+ user_default_options = {
+ names = false,
+ tailwind = "both",
+ css = true,
+ css_fn = true,
+ mode = "background",
+ },
+ },
+ },
+ { -- for file outline
+ "hedyhli/outline.nvim",
+ event = "VeryLazy",
+ opts = {},
+ },
+ { -- Undotree
+ "mbbill/undotree",
+ event = "VeryLazy",
+ config = function()
+ vim.g.undotree_SplitWidth = 50
+ vim.g.undotree_WindowLayout = 3
+ end,
+ },
+ { -- for colored brackets and divs
+ "HiPhish/rainbow-delimiters.nvim",
+ event = "VeryLazy",
+ },
+ { -- for tmux navigation
+ event = "VeryLazy",
+ "christoomey/vim-tmux-navigator",
+ cmd = {
+ "TmuxNavigateLeft",
+ "TmuxNavigateDown",
+ "TmuxNavigateUp",
+ "TmuxNavigateRight",
+ "TmuxNavigatePrevious",
+ "TmuxNavigatorProcessList",
+ },
+ keys = {
+ { "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
+ { "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
+ { "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
+ { "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
+ { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/uv.lua b/.config/nvim-old/lua/config/plugins/uv.lua
new file mode 100644
index 0000000..121921b
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/uv.lua
@@ -0,0 +1,7 @@
+return {
+ "benomahony/uv.nvim",
+ event = "VeryLazy",
+ opts = {
+ picker_integration = true,
+ },
+}
diff --git a/.config/nvim-old/lua/config/plugins/which-key.lua b/.config/nvim-old/lua/config/plugins/which-key.lua
new file mode 100644
index 0000000..9e97f9f
--- /dev/null
+++ b/.config/nvim-old/lua/config/plugins/which-key.lua
@@ -0,0 +1,27 @@
+return {
+ "folke/which-key.nvim",
+ event = "VeryLazy",
+ opts = {
+ win = {
+ wo = {
+ winblend = 0,
+ },
+ },
+ preset = "helix",
+ icons = {
+ rules = false,
+ },
+ delay = 500,
+ spec = {
+ { "<leader>c", group = "Code", mode = { "n", "x" } },
+ { "<leader>d", group = "Document" },
+ { "<leader>g", group = "Git" },
+ { "<leader>m", group = "Marks" },
+ { "<leader>r", group = "Rename" },
+ { "<leader>s", group = "Search" },
+ { "<leader>t", group = "Toggle" },
+ { "<leader>w", group = "Workspace" },
+ { "<leader>l", group = "LSP" },
+ },
+ },
+}
diff --git a/.config/nvim-old/lua/config/snippets/all.lua b/.config/nvim-old/lua/config/snippets/all.lua
new file mode 100644
index 0000000..e2a2ef1
--- /dev/null
+++ b/.config/nvim-old/lua/config/snippets/all.lua
@@ -0,0 +1,10 @@
+local ls = require("luasnip")
+local s = ls.snippet
+local t = ls.text_node
+local i = ls.insert_node
+
+return {
+ s("hi", {
+ t("Hello, world!"),
+ }),
+}