summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/config/plugins
diff options
context:
space:
mode:
authorTom Li Dobnik <tomlidobnik1@gmail.com>2025-08-09 17:12:43 +0200
committerTom Li Dobnik <tomlidobnik1@gmail.com>2025-08-09 17:12:43 +0200
commitea82cbb1c0b778dd946c717cceace53fab391ba8 (patch)
treef0c84a86f48d61d918b6de9dc464c08370ab6a7c /.config/nvim/lua/config/plugins
init
Diffstat (limited to '.config/nvim/lua/config/plugins')
-rw-r--r--.config/nvim/lua/config/plugins/blink-cmp.lua114
-rw-r--r--.config/nvim/lua/config/plugins/colorscheme.lua14
-rw-r--r--.config/nvim/lua/config/plugins/conform.lua33
-rw-r--r--.config/nvim/lua/config/plugins/flash.lua17
-rw-r--r--.config/nvim/lua/config/plugins/fzflua.lua29
-rw-r--r--.config/nvim/lua/config/plugins/gitsigns.lua36
-rw-r--r--.config/nvim/lua/config/plugins/harpoon.lua49
-rw-r--r--.config/nvim/lua/config/plugins/learn.lua8
-rw-r--r--.config/nvim/lua/config/plugins/lsp.lua236
-rw-r--r--.config/nvim/lua/config/plugins/lualine.lua218
-rw-r--r--.config/nvim/lua/config/plugins/luasnip.lua21
-rw-r--r--.config/nvim/lua/config/plugins/markdown.lua220
-rw-r--r--.config/nvim/lua/config/plugins/mini.lua27
-rw-r--r--.config/nvim/lua/config/plugins/obsidian.lua42
-rw-r--r--.config/nvim/lua/config/plugins/oil.lua37
-rw-r--r--.config/nvim/lua/config/plugins/rustacean.lua5
-rw-r--r--.config/nvim/lua/config/plugins/snacks.lua83
-rw-r--r--.config/nvim/lua/config/plugins/treesitter.lua41
-rw-r--r--.config/nvim/lua/config/plugins/typst.lua9
-rw-r--r--.config/nvim/lua/config/plugins/ufo.lua28
-rw-r--r--.config/nvim/lua/config/plugins/utils.lua71
-rw-r--r--.config/nvim/lua/config/plugins/which-key.lua29
22 files changed, 1367 insertions, 0 deletions
diff --git a/.config/nvim/lua/config/plugins/blink-cmp.lua b/.config/nvim/lua/config/plugins/blink-cmp.lua
new file mode 100644
index 0000000..d51ba4a
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/blink-cmp.lua
@@ -0,0 +1,114 @@
+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 = {
+ documentation = { auto_show = true, window = { border = "single" } },
+ },
+ signature = { enabled = true },
+
+ sources = {
+ default = { "lsp", "path", "snippets", "buffer", "emoji", "sql" },
+ providers = {
+ 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/lua/config/plugins/colorscheme.lua b/.config/nvim/lua/config/plugins/colorscheme.lua
new file mode 100644
index 0000000..ea130c7
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/conform.lua b/.config/nvim/lua/config/plugins/conform.lua
new file mode 100644
index 0000000..afc2dd5
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/conform.lua
@@ -0,0 +1,33 @@
+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 },
+ htmldjango = { "djlint" },
+ typst = { "prettypst" },
+ },
+ format_on_save = {
+ timeout_ms = 500,
+ lsp_format = "fallback",
+ },
+ },
+}
diff --git a/.config/nvim/lua/config/plugins/flash.lua b/.config/nvim/lua/config/plugins/flash.lua
new file mode 100644
index 0000000..d4de4ee
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/flash.lua
@@ -0,0 +1,17 @@
+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 = "o", function() require("flash").remote() end, desc = "Remote Flash" },
+ },
+}
diff --git a/.config/nvim/lua/config/plugins/fzflua.lua b/.config/nvim/lua/config/plugins/fzflua.lua
new file mode 100644
index 0000000..ea8a744
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/gitsigns.lua b/.config/nvim/lua/config/plugins/gitsigns.lua
new file mode 100644
index 0000000..13c3b20
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/harpoon.lua b/.config/nvim/lua/config/plugins/harpoon.lua
new file mode 100644
index 0000000..25168cc
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/harpoon.lua
@@ -0,0 +1,49 @@
+return {
+ "https://github.com/theprimeagen/harpoon",
+ branch = "harpoon2",
+ event = "VeryLazy",
+ config = function()
+ local harpoon = require("harpoon")
+ harpoon.setup({
+ settings = {
+ save_on_toggle = true,
+ sync_on_ui_close = true,
+ key = function()
+ return vim.fn.getcwd()
+ end,
+ },
+ })
+ harpoon:setup()
+
+ local list = harpoon:list("default")
+ local wk = require("which-key")
+
+ wk.add({
+ mode = { "n" },
+ {
+ "<leader>a",
+ function()
+ list:add()
+ end,
+ hidden = true,
+ },
+ {
+ "<leader><leader>",
+ function()
+ harpoon.ui:toggle_quick_menu(list)
+ end,
+ hidden = true,
+ },
+ })
+ for i = 1, 6 do
+ wk.add({
+ "<leader>" .. i,
+ function()
+ list:select(i)
+ end,
+ hidden = true,
+ mode = "n",
+ })
+ end
+ end,
+}
diff --git a/.config/nvim/lua/config/plugins/learn.lua b/.config/nvim/lua/config/plugins/learn.lua
new file mode 100644
index 0000000..ebaf057
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/learn.lua
@@ -0,0 +1,8 @@
+return {
+ {
+ "m4xshen/hardtime.nvim",
+ lazy = false,
+ dependencies = { "MunifTanjim/nui.nvim" },
+ opts = {},
+ },
+}
diff --git a/.config/nvim/lua/config/plugins/lsp.lua b/.config/nvim/lua/config/plugins/lsp.lua
new file mode 100644
index 0000000..dca3f5f
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/lsp.lua
@@ -0,0 +1,236 @@
+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 = { current_line = true },
+ -- 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 servers = {
+ bashls = {},
+ marksman = {},
+ -- clangd = {},
+ -- gopls = {},
+ -- pyright = {},
+ -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
+ --
+ -- Some languages (like typescript) have entire language plugins that can be useful:
+ -- https://github.com/pmizio/typescript-tools.nvim
+ --
+ -- But for many setups, the LSP (`ts_ls`) will work just fine
+ -- ts_ls = {},
+ --
+
+ lua_ls = {
+ -- cmd = { ... },
+ -- filetypes = { ... },
+ -- capabilities = {},
+ -- settings = {
+ -- Lua = {
+ -- completion = {
+ -- callSnippet = 'Replace',
+ -- },
+ -- -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
+ -- -- diagnostics = { disable = { 'missing-fields' } },
+ -- },
+ -- },
+ },
+ }
+
+ -- 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,
+ 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/lua/config/plugins/lualine.lua b/.config/nvim/lua/config/plugins/lualine.lua
new file mode 100644
index 0000000..466d7b4
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/luasnip.lua b/.config/nvim/lua/config/plugins/luasnip.lua
new file mode 100644
index 0000000..a051cee
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/markdown.lua b/.config/nvim/lua/config/plugins/markdown.lua
new file mode 100644
index 0000000..223d3fb
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/mini.lua b/.config/nvim/lua/config/plugins/mini.lua
new file mode 100644
index 0000000..fe6a3aa
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/obsidian.lua b/.config/nvim/lua/config/plugins/obsidian.lua
new file mode 100644
index 0000000..64992fc
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/obsidian.lua
@@ -0,0 +1,42 @@
+return {
+ "epwalsh/obsidian.nvim",
+ event = "VeryLazy",
+ version = "*",
+ dependencies = {
+ "nvim-lua/plenary.nvim",
+ "ibhagwan/fzf-lua",
+ },
+ opts = {
+ ui = { enable = false },
+ daily_notes = {
+ date_format = "%Y-%m-%d",
+ alias_format = "%B %-d, %Y",
+ default_tags = { "daily" },
+ template = nil,
+ folder = "daily",
+ },
+ dir = "$HOME/Library/Mobile Documents/iCloud~md~obsidian/Documents/Obsidian/",
+ mappings = {},
+ follow_url_func = function(url)
+ -- Open the URL in the default web browser.
+ -- if URL contains @ it should be replaced with %40
+ vim.fn.jobstart({ "open", url }) -- Mac OS
+ end,
+ note_id_func = function(title)
+ -- Create note IDs in a Zettelkasten format with a timestamp and a suffix.
+ -- In this case a note with the title 'My new note' will be given an ID that looks
+ -- like '1657296016-my-new-note', and therefore the file name '1657296016-my-new-note.md'
+ local suffix = ""
+ if title ~= nil then
+ -- If title is given, transform it into valid file name.
+ suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
+ else
+ -- If title is nil, just add 4 random uppercase letters to the suffix.
+ for _ = 1, 4 do
+ suffix = suffix .. string.char(math.random(65, 90))
+ end
+ end
+ return tostring(os.time()) .. "-" .. suffix
+ end,
+ },
+}
diff --git a/.config/nvim/lua/config/plugins/oil.lua b/.config/nvim/lua/config/plugins/oil.lua
new file mode 100644
index 0000000..555768f
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/rustacean.lua b/.config/nvim/lua/config/plugins/rustacean.lua
new file mode 100644
index 0000000..849db6e
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/rustacean.lua
@@ -0,0 +1,5 @@
+return {
+ "mrcjkb/rustaceanvim",
+ version = "^6", -- Recommended
+ lazy = false, -- This plugin is already lazy
+}
diff --git a/.config/nvim/lua/config/plugins/snacks.lua b/.config/nvim/lua/config/plugins/snacks.lua
new file mode 100644
index 0000000..b83beb9
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/snacks.lua
@@ -0,0 +1,83 @@
+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 = "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/lua/config/plugins/treesitter.lua b/.config/nvim/lua/config/plugins/treesitter.lua
new file mode 100644
index 0000000..3c95b41
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/treesitter.lua
@@ -0,0 +1,41 @@
+return {
+ {
+ "nvim-treesitter/nvim-treesitter",
+ event = "VeryLazy",
+ build = ":TSUpdate",
+ config = function()
+ require("nvim-treesitter.configs").setup({
+ ensure_installed = {
+ "c",
+ "lua",
+ "vim",
+ "vimdoc",
+ "query",
+ "markdown",
+ "markdown_inline",
+ "rust",
+ },
+ 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,
+ },
+ })
+ end,
+ },
+}
diff --git a/.config/nvim/lua/config/plugins/typst.lua b/.config/nvim/lua/config/plugins/typst.lua
new file mode 100644
index 0000000..2443773
--- /dev/null
+++ b/.config/nvim/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/lua/config/plugins/ufo.lua b/.config/nvim/lua/config/plugins/ufo.lua
new file mode 100644
index 0000000..21380b8
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/ufo.lua
@@ -0,0 +1,28 @@
+return {
+ -- {
+ -- event = "VeryLazy",
+ -- "kevinhwang91/nvim-ufo",
+ -- dependencies = {
+ -- "kevinhwang91/promise-async",
+ -- },
+ -- config = function()
+ -- require("ufo").setup({
+ -- -- treesitter not required
+ -- -- ufo uses the same query files for folding (queries/<lang>/folds.scm)
+ -- -- performance and stability are better than `foldmethod=nvim_treesitter#foldexpr()`-
+ -- provider_selector = function(_, _, _)
+ -- return { "treesitter", "indent" }
+ -- end,
+ -- open_fold_hl_timeout = 0, -- Disable highlight timeout after opening
+ -- })
+ --
+ -- vim.o.foldenable = true
+ -- vim.o.foldcolumn = "0" -- '0' is not bad
+ -- vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
+ -- vim.o.foldlevelstart = 99
+ --
+ -- vim.keymap.set("n", "zR", require("ufo").openAllFolds)
+ -- vim.keymap.set("n", "zM", require("ufo").closeAllFolds)
+ -- end,
+ -- },
+}
diff --git a/.config/nvim/lua/config/plugins/utils.lua b/.config/nvim/lua/config/plugins/utils.lua
new file mode 100644
index 0000000..fd57680
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/utils.lua
@@ -0,0 +1,71 @@
+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 diagnostics
+ event = "VeryLazy",
+ "folke/trouble.nvim",
+ opts = {},
+ cmd = "Trouble",
+ keys = {
+ {
+ "<leader>h",
+ "<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
+ desc = "Buffer Diagnostics (Trouble)",
+ },
+ },
+ },
+ { -- 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/lua/config/plugins/which-key.lua b/.config/nvim/lua/config/plugins/which-key.lua
new file mode 100644
index 0000000..47098fb
--- /dev/null
+++ b/.config/nvim/lua/config/plugins/which-key.lua
@@ -0,0 +1,29 @@
+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>o", group = "Obsidian" },
+ { "<leader>r", group = "Rename" },
+ { "<leader>s", group = "Search" },
+ { "<leader>t", group = "Toggle" },
+ { "<leader>w", group = "Workspace" },
+ { "<leader>l", group = "LSP" },
+ { "<leader>x", group = "Trouble" },
+ },
+ },
+}