From aa58c4de173f6c70fac900af7ea625bf040d4f2e Mon Sep 17 00:00:00 2001 From: mavantgarderc Date: Sat, 3 Jan 2026 11:12:03 +0330 Subject: [PATCH 1/2] chore(update) --- lazy-lock.json | 26 +++++++------- lua/core/options.lua | 73 ++++++++++++++++++++++++--------------- lua/plugins/init.lua | 3 +- lua/plugins/lspconfig.lua | 36 +++++++++---------- lua/plugins/raphael.lua | 24 ++++++------- 5 files changed, 90 insertions(+), 72 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index 8c84970..c3ea800 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -8,43 +8,43 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25" }, + "conform.nvim": { "branch": "master", "commit": "8314f4c9e205e7f30b62147069729f9a1227d8bf" }, "fidget.nvim": { "branch": "main", "commit": "64463022a1f2ff1318ab22a2ea4125ed9313a483" }, "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, - "gitsigns.nvim": { "branch": "main", "commit": "718e1eda17ebab87f686af5dcc7684b204041eef" }, + "gitsigns.nvim": { "branch": "main", "commit": "6bd29494e3f79ff08be1d35bc1926ed23c22ed9a" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "9f9c67795d0795a6e8612f5a899ca64a074a1076" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "4cfe411526a7a99c18281135e8b4765ae6330d15" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, "mini.hipatterns": { "branch": "main", "commit": "add8d8abad602787377ec5d81f6b248605828e0f" }, - "mini.icons": { "branch": "main", "commit": "ff2e4f1d29f659cc2bad0f9256f2f6195c6b2428" }, + "mini.icons": { "branch": "main", "commit": "efc85e42262cd0c9e1fdbf806c25cb0be6de115c" }, "nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, - "none-ls.nvim": { "branch": "main", "commit": "5abf61927023ea83031753504adb19630ba80eef" }, + "none-ls.nvim": { "branch": "main", "commit": "0b457958cb958c16850b5a1fb38bbcd982909181" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim": { "branch": "main", "commit": "ed86852e01f03853326c68961ff10bcaf8ff5f9c" }, + "nvim": { "branch": "main", "commit": "260ec2597830c8b3077d5cd7e2c0e46936326119" }, "nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" }, - "nvim-cmp": { "branch": "main", "commit": "d97d85e01339f01b842e6ec1502f639b080cb0fc" }, + "nvim-cmp": { "branch": "main", "commit": "c4f7dc770cdebfc9723333175bcd88d9cdbe8408" }, "nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" }, "nvim-dap": { "branch": "master", "commit": "818cd8787a77a97703eb1d9090543a374f79a9ac" }, "nvim-dap-python": { "branch": "master", "commit": "1808458eba2b18f178f990e01376941a42c7f93b" }, "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, - "nvim-lspconfig": { "branch": "master", "commit": "d696e36d5792daf828f8c8e8d4b9aa90c1a10c2a" }, + "nvim-lspconfig": { "branch": "master", "commit": "41ceb6bba3a40128b7841f5b7f5a9dae7201e823" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "main", "commit": "45d08da7bb3ea206d698b33f0576fdf9661e2979" }, + "nvim-treesitter": { "branch": "main", "commit": "c6dd314086f7b471bf6c9110092a94ce1c06d220" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, "nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, - "oil.nvim": { "branch": "master", "commit": "756dec855b4811f2d27f067a3aca477f368d99f5" }, + "oil.nvim": { "branch": "master", "commit": "81b8a91735ad5cd24a6b3137f14a89f19176364f" }, "oxocarbon.nvim": { "branch": "main", "commit": "9f85f6090322f39b11ae04a343d4eb9d12a86897" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "snap.nvim": { "branch": "main", "commit": "ffa1d6887ea21098f85688023610b314de832ca9" }, + "snap.nvim": { "branch": "main", "commit": "781d05a9727206f3c47181d89a58ee77520d0bda" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "4d0f5e0e7f69071e315515c385fab2a4eff07b3d" }, + "telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, - "undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" }, + "undotree": { "branch": "master", "commit": "178d19e00a643f825ea11d581b1684745d0c4eda" }, "vim-dadbod": { "branch": "master", "commit": "e95afed23712f969f83b4857a24cf9d59114c2e6" }, "vim-dadbod-completion": { "branch": "master", "commit": "a8dac0b3cf6132c80dc9b18bef36d4cf7a9e1fe6" }, "vim-dadbod-ui": { "branch": "master", "commit": "48c4f271da13d380592f4907e2d1d5558044e4e5" }, diff --git a/lua/core/options.lua b/lua/core/options.lua index 960d386..f3c94a8 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -4,6 +4,10 @@ local o = vim.o local schedule = vim.schedule local map = vim.keymap local opt_local = vim.opt_local +local env = vim.env +local wo = vim.wo +local w = vim.w +local fn = vim.fn map.set("n", "J", "") map.set("n", "gc", "") @@ -28,13 +32,22 @@ g.loaded_ruby_provider = 0 -- Don't force markdown recommended defaults (let your config decide) g.markdown_recommended_style = 0 +-- Enable spellchecking in markdown buffers +vim.api.nvim_create_autocmd("FileType", { + pattern = "markdown", + callback = function() + vim.opt_local.spell = true + vim.opt_local.spelllang = { "en_us" } + end, +}) + -- mason.nvim $PATH setup -local mason_bin = vim.fn.stdpath("data") .. "/mason/bin" -if vim.fn.has("win32") == 1 then +local mason_bin = fn.stdpath("data") .. "/mason/bin" +if fn.has("win32") == 1 then mason_bin = mason_bin:gsub("/", "\\") - vim.env.PATH = mason_bin .. ";" .. vim.env.PATH + env.PATH = mason_bin .. ";" .. env.PATH else - vim.env.PATH = mason_bin .. ":" .. vim.env.PATH + env.PATH = mason_bin .. ":" .. env.PATH end -- Global wrapping defaults + per-window toggle @@ -48,31 +61,31 @@ local grp = vim.api.nvim_create_augroup("GlobalWrap", { clear = true }) vim.api.nvim_create_autocmd({ "BufWinEnter", "WinNew" }, { group = grp, callback = function() - if vim.w.__wrap_user_enabled then - vim.wo.wrap = true - vim.wo.linebreak = true - vim.wo.colorcolumn = "120" + if w.__wrap_user_enabled then + wo.wrap = true + wo.linebreak = true + wo.colorcolumn = "120" else - vim.wo.wrap = false - vim.wo.linebreak = false - vim.wo.colorcolumn = "" + wo.wrap = false + wo.linebreak = false + wo.colorcolumn = "" end end, }) -- Toggle wrapping for the current window (sticky per-window toggle) local function toggle_wrap() - if vim.w.__wrap_user_enabled then - vim.w.__wrap_user_enabled = nil - vim.wo.wrap = false - vim.wo.linebreak = false - vim.wo.colorcolumn = "" + if w.__wrap_user_enabled then + w.__wrap_user_enabled = nil + wo.wrap = false + wo.linebreak = false + wo.colorcolumn = "" print("Wrap OFF") else - vim.w.__wrap_user_enabled = true - vim.wo.wrap = true - vim.wo.linebreak = true - vim.wo.colorcolumn = "135" + w.__wrap_user_enabled = true + wo.wrap = true + wo.linebreak = true + wo.colorcolumn = "135" print("Wrap ON (sticky for this window)") end end @@ -100,6 +113,7 @@ o.cursorline = true -- highlight the line with the cursor o.guicursor = "n-v-c:block-Cursor/lCursor,i-ci-ve:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor" -- fine-grained cursor shapes o.list = true -- show whitespace characters according to 'listchars' +opt.autoread = true -- auto read file if changed outside vim -- Symbols used to represent whitespace when 'list' is on opt.listchars = { @@ -128,11 +142,14 @@ opt.updatetime = 20 -- faster CursorHold & swap writes (default is 4000ms) opt.splitright = true -- vertical splits open to the right opt.splitbelow = true -- horizontal splits open below --- Enable spellchecking in markdown buffers -vim.api.nvim_create_autocmd("FileType", { - pattern = "markdown", - callback = function() - vim.opt_local.spell = true - vim.opt_local.spelllang = { "en_us" } - end, -}) +opt.cmdheight = 1 -- command line height +opt.showcmd = true -- show command in status line + +opt.smoothscroll = true -- smooth scrolling (if available) +opt.undolevels = 1000 -- number of changes to undo +opt.mouse = "a" -- enable mouse in all modes +opt.mousefocus = true -- focus window when mouse is moved over it +opt.mousehide = true -- hide mouse pointer when typing +opt.selectmode = "mouse,key" -- selection mode +opt.modeline = true -- enable modeline +opt.modelines = 5 -- number of lines to check for modeline diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 27f05e3..e491f73 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -1,7 +1,7 @@ return { "mavantgarderc/raphael.nvim", "mavantgarderc/prismpunk.nvim", - "mavantgarderc/conscious.nvim", + -- "mavantgarderc/conscious.nvim", -- ================================================== -- === ui === -- status line & tabbar @@ -27,4 +27,5 @@ return { "mistweaverco/snap.nvim", "christoomey/vim-tmux-navigator", -- "swaits/zellij-nav.nvim", + "nvim-lua/plenary.nvim", } diff --git a/lua/plugins/lspconfig.lua b/lua/plugins/lspconfig.lua index 62b20d2..b9d01d4 100644 --- a/lua/plugins/lspconfig.lua +++ b/lua/plugins/lspconfig.lua @@ -42,24 +42,24 @@ return { mason_lspconfig.setup({ ensure_installed = { "lua_ls", - "ts_ls", - "pyright", - "omnisharp", - "html", - "cssls", - "texlab", - "sqls", - "solidity_ls", - "dockerls", - "jsonls", - "gopls", - "rust_analyzer", - "zls", - "graphql", - "yamlls", - "marksman", - "bashls", - "vimls", + -- "ts_ls", + -- "pyright", + -- "omnisharp", + -- "html", + -- "cssls", + -- "texlab", + -- "sqls", + -- "solidity_ls", + -- "dockerls", + -- "jsonls", + -- "gopls", + -- "rust_analyzer", + -- "zls", + -- "graphql", + -- "yamlls", + -- "marksman", + -- "bashls", + -- "vimls", }, handlers = { function(server_name) diff --git a/lua/plugins/raphael.lua b/lua/plugins/raphael.lua index 987a67d..2d1f40f 100644 --- a/lua/plugins/raphael.lua +++ b/lua/plugins/raphael.lua @@ -74,18 +74,18 @@ return { random = "r", }, - profiles = { - work = { - default_theme = "kanagawa-paper-edo", - }, - night = { - default_theme = "detox-ink", - }, - presentation = { - default_theme = "kanagawa-paper-obsidian", - }, - }, - current_profile = "work", + -- profiles = { + -- work = { + -- default_theme = "kanagawa-paper-edo", + -- }, + -- night = { + -- default_theme = "detox-ink", + -- }, + -- presentation = { + -- default_theme = "kanagawa-paper-obsidian", + -- }, + -- }, + -- current_profile = "work", sample_preview = { enabled = true, From 83a12cc5b0d8cf9d2625ca3f67d9ad8a7a0c1ef5 Mon Sep 17 00:00:00 2001 From: mavantgarderc Date: Sun, 4 Jan 2026 04:59:59 +0330 Subject: [PATCH 2/2] feat(plugins): treesitter extended --- lua/core/navigations_cheatsheet.md | 429 ++++++++++++++++------------- lua/core/options.lua | 4 + lua/plugins/treesitter.lua | 142 +++++++++- 3 files changed, 378 insertions(+), 197 deletions(-) diff --git a/lua/core/navigations_cheatsheet.md b/lua/core/navigations_cheatsheet.md index 4be7efd..545f735 100644 --- a/lua/core/navigations_cheatsheet.md +++ b/lua/core/navigations_cheatsheet.md @@ -5,175 +5,195 @@ Designed to be **AuDHD-friendly** with clear, concise categories, short descript --- ## 🖥️ Terminal Multiplexer Navigation + Navigate between panes in tmux/zellij or Neovim windows if no multiplexer is detected. -| Keybinding | Action | -|------------|--------| -| `Alt+h` | Move left (tmux/zellij or window) | -| `Alt+j` | Move down (tmux/zellij or window) | -| `Alt+k` | Move up (tmux/zellij or window) | +| Keybinding | Action | +| ---------- | ---------------------------------- | +| `Alt+h` | Move left (tmux/zellij or window) | +| `Alt+j` | Move down (tmux/zellij or window) | +| `Alt+k` | Move up (tmux/zellij or window) | | `Alt+l` | Move right (tmux/zellij or window) | --- ## 📑 Buffer Management + Work with open files (buffers) in Neovim. -| Keybinding | Action | -|---------------|--------| -| `bb` | Show current buffer's file path | -| `bl` | List all open buffers | -| `bn` | Go to next buffer | -| `bp` | Go to previous buffer | -| `bd` | Delete current buffer | +| Keybinding | Action | +| ------------ | ------------------------------- | +| `bb` | Show current buffer's file path | +| `bl` | List all open buffers | +| `bn` | Go to next buffer | +| `bp` | Go to previous buffer | +| `bd` | Delete current buffer | --- ## 🪟 Pane Management + Manage split windows (panes) in Neovim. ### Switch Panes -| Keybinding | Action | -|---------------|--------| -| `;h` | Switch to left pane | -| `;l` | Switch to right pane | -| `;j` | Switch to bottom pane | -| `;k` | Switch to top pane | -| `hh` | Switch to left pane (alt) | -| `ll` | Switch to right pane (alt) | -| `jj` | Switch to bottom pane (alt) | -| `kk` | Switch to top pane (alt) | + +| Keybinding | Action | +| ------------ | --------------------------- | +| `;h` | Switch to left pane | +| `;l` | Switch to right pane | +| `;j` | Switch to bottom pane | +| `;k` | Switch to top pane | +| `hh` | Switch to left pane (alt) | +| `ll` | Switch to right pane (alt) | +| `jj` | Switch to bottom pane (alt) | +| `kk` | Switch to top pane (alt) | ### Move Panes -| Keybinding | Action | -|---------------|--------| -| `HH` | Move pane to left | -| `LL` | Move pane to right | -| `JJ` | Move pane to bottom | -| `KK` | Move pane to top | + +| Keybinding | Action | +| ------------ | ------------------- | +| `HH` | Move pane to left | +| `LL` | Move pane to right | +| `JJ` | Move pane to bottom | +| `KK` | Move pane to top | ### Split Panes -| Keybinding | Action | -|---------------|--------| + +| Keybinding | Action | +| ------------- | ----------------------- | | `sph` | Split pane horizontally | -| `spv` | Split pane vertically | +| `spv` | Split pane vertically | ### Resize Panes -| Keybinding | Action | -|-----------------|--------| -| `Ctrl+Alt+h` | Shrink pane width (-1) | -| `Ctrl+Alt+l` | Expand pane width (+1) | -| `Ctrl+Alt+j` | Shrink pane height (-1) | -| `Ctrl+Alt+k` | Expand pane height (+1) | -| `Ctrl+Alt+Shift+H` | Shrink pane width (-5) | -| `Ctrl+Alt+Shift+L` | Expand pane width (+5) | + +| Keybinding | Action | +| ------------------ | ----------------------- | +| `Ctrl+Alt+h` | Shrink pane width (-1) | +| `Ctrl+Alt+l` | Expand pane width (+1) | +| `Ctrl+Alt+j` | Shrink pane height (-1) | +| `Ctrl+Alt+k` | Expand pane height (+1) | +| `Ctrl+Alt+Shift+H` | Shrink pane width (-5) | +| `Ctrl+Alt+Shift+L` | Expand pane width (+5) | | `Ctrl+Alt+Shift+J` | Shrink pane height (-5) | | `Ctrl+Alt+Shift+K` | Expand pane height (+5) | ### Other -| Keybinding | Action | -|---------------|--------| -| `T` | Move pane to new tab | + +| Keybinding | Action | +| ----------- | -------------------- | +| `T` | Move pane to new tab | --- ## 📑 Tab Management + Manage multiple tabs in Neovim. ### Tab Operations -| Keybinding | Action | -|---------------|--------| -| `tn` | Create new tab | -| `tc` | Close current tab | -| `to` | Close all other tabs | -| `tt` | Go to next tab | -| `tp` | Go to previous tab | -| `te` | Edit file in new tab (prompt) | -| `tf` | Find file to open in new tab | -| `tT` | Open terminal in new tab | -| `tb` | Open current buffer in new tab | -| `td` | Drop file in tab (prompt) | -| `ti` | List all tabs | + +| Keybinding | Action | +| ------------ | ------------------------------ | +| `tn` | Create new tab | +| `tc` | Close current tab | +| `to` | Close all other tabs | +| `tt` | Go to next tab | +| `tp` | Go to previous tab | +| `te` | Edit file in new tab (prompt) | +| `tf` | Find file to open in new tab | +| `tT` | Open terminal in new tab | +| `tb` | Open current buffer in new tab | +| `td` | Drop file in tab (prompt) | +| `ti` | List all tabs | ### Tab Navigation -| Keybinding | Action | -|---------------|--------| -| `g1` | Go to tab 1 | -| `g2` | Go to tab 2 | -| `g3` | Go to tab 3 | -| `g4` | Go to tab 4 | -| `g5` | Go to tab 5 | -| `g6` | Go to tab 6 | -| `g7` | Go to tab 7 | -| `g8` | Go to tab 8 | -| `g9` | Go to tab 9 | -| `g0` | Go to last tab | -| `th` | Go to first tab | -| `tl` | Go to last tab | + +| Keybinding | Action | +| ------------ | --------------- | +| `g1` | Go to tab 1 | +| `g2` | Go to tab 2 | +| `g3` | Go to tab 3 | +| `g4` | Go to tab 4 | +| `g5` | Go to tab 5 | +| `g6` | Go to tab 6 | +| `g7` | Go to tab 7 | +| `g8` | Go to tab 8 | +| `g9` | Go to tab 9 | +| `g0` | Go to last tab | +| `th` | Go to first tab | +| `tl` | Go to last tab | ### Move Tabs -| Keybinding | Action | -|---------------|--------| -| `tm` | Move tab (prompt for position) | -| `t<` | Move tab left | -| `t>` | Move tab right | + +| Keybinding | Action | +| ------------ | ------------------------------ | +| `tm` | Move tab (prompt for position) | +| `t<` | Move tab left | +| `t>` | Move tab right | ### Close Tabs -| Keybinding | Action | -|---------------|--------| -| `tO` | Close all other tabs | -| `tR` | Close tabs to the right | -| `tL` | Close tabs to the left | + +| Keybinding | Action | +| ------------ | ----------------------- | +| `tO` | Close all other tabs | +| `tR` | Close tabs to the right | +| `tL` | Close tabs to the left | --- ## 📂 Folding + Manage code folding for better organization. ### Create/Delete Folds -| Keybinding | Action | -|---------------|--------| + +| Keybinding | Action | +| ------------- | ----------------------------------- | | `zff` | Create fold (normal or visual mode) | -| `zd` | Delete fold under cursor | -| `zD` | Delete all folds in current line | -| `zE` | Eliminate all folds | +| `zd` | Delete fold under cursor | +| `zD` | Delete all folds in current line | +| `zE` | Eliminate all folds | ### Open/Close Folds -| Keybinding | Action | -|------------|--------| -| `zo` | Open fold under cursor | -| `zO` | Open all folds under cursor | -| `zc` | Close fold under cursor | -| `zC` | Close all folds under cursor | -| `za` | Toggle fold under cursor | + +| Keybinding | Action | +| ---------- | ----------------------------- | +| `zo` | Open fold under cursor | +| `zO` | Open all folds under cursor | +| `zc` | Close fold under cursor | +| `zC` | Close all folds under cursor | +| `za` | Toggle fold under cursor | | `zA` | Toggle all folds under cursor | ### Global Fold Operations -| Keybinding | Action | -|---------------|--------| -| `z+` | Open one fold level (reduce) | -| `z-` | Close one fold level (fold more) | -| `zR` | Open all folds | -| `zM` | Close all folds | + +| Keybinding | Action | +| ------------ | -------------------------------- | +| `z+` | Open one fold level (reduce) | +| `z-` | Close one fold level (fold more) | +| `zR` | Open all folds | +| `zM` | Close all folds | ### Fold Navigation -| Keybinding | Action | -|------------|--------| -| `zj` | Move to next fold | -| `zk` | Move to previous fold | + +| Keybinding | Action | +| ---------- | ----------------------------- | +| `zj` | Move to next fold | +| `zk` | Move to previous fold | | `[z` | Move to start of current fold | -| `]z` | Move to end of current fold | +| `]z` | Move to end of current fold | ### Fold View -| Keybinding | Action | -|------------|--------| -| `zv` | Open folds to view cursor line | -| `zx` | Update folds | + +| Keybinding | Action | +| ---------- | --------------------------------- | +| `zv` | Open folds to view cursor line | +| `zx` | Update folds | | `zX` | Undo manually opened/closed folds | ### Fold Levels -| Keybinding | Action | -|------------|--------| + +| Keybinding | Action | +| ---------- | ------------------- | | `z1` | Set fold level to 1 | | `z2` | Set fold level to 2 | | `z3` | Set fold level to 3 | @@ -186,55 +206,61 @@ Manage code folding for better organization. | `z0` | Set fold level to 0 | ### Fold Methods -| Keybinding | Action | -|--------------|--------| -| `zmi`| Set fold method to indent | -| `zms`| Set fold method to syntax | -| `zmm`| Set fold method to manual | -| `zme`| Set fold method to expr | -| `zmk`| Set fold method to marker | -| `zmd`| Set fold method to diff | + +| Keybinding | Action | +| ------------- | ------------------------- | +| `zmi` | Set fold method to indent | +| `zms` | Set fold method to syntax | +| `zmm` | Set fold method to manual | +| `zme` | Set fold method to expr | +| `zmk` | Set fold method to marker | +| `zmd` | Set fold method to diff | ### Other Fold Actions -| Keybinding | Action | -|--------------|--------| -| `zfc`| Toggle fold column visibility | -| `zi` | Show fold info (method, level, etc.) | -| `zt` | Toggle folding on/off | -| `zcc`| Fold all comments | -| `zs` | Save fold state | -| `zl` | Load fold state | + +| Keybinding | Action | +| ------------- | ------------------------------------ | +| `zfc` | Toggle fold column visibility | +| `zi` | Show fold info (method, level, etc.) | +| `zt` | Toggle folding on/off | +| `zcc` | Fold all comments | +| `zs` | Save fold state | +| `zl` | Load fold state | --- ## 🔖 Marks + Mark and jump to specific locations in files. ### Set Marks -| Keybinding | Action | -|--------------|--------| -| `mm` | Set mark M (Main) | -| `mt` | Set mark T (Top) | -| `mb` | Set mark B (Bottom) | -| `ms` | Set mark S (Section) | + +| Keybinding | Action | +| ------------ | --------------------- | +| `mm` | Set mark M (Main) | +| `mt` | Set mark T (Top) | +| `mb` | Set mark B (Bottom) | +| `ms` | Set mark S (Section) | | `mf` | Set mark F (Function) | | `m.` | Mark current position | -| `mr` | Mark for return | +| `mr` | Mark for return | ### Jump to Marks (Line) -| Keybinding | Action | -|--------------|--------| -| `jm` | Jump to mark M | -| `jt` | Jump to mark T | -| `jb` | Jump to mark B | -| `js` | Jump to mark S | -| `jf` | Jump to mark F | + +| Keybinding | Action | +| ------------ | ----------------------- | +| `jm` | Jump to mark M | +| `jt` | Jump to mark T | +| `jb` | Jump to mark B | +| `js` | Jump to mark S | +| `jf` | Jump to mark F | | `j.` | Jump to marked position | -| `jr` | Return to mark | +| `jr` | Return to mark | ### Jump to Marks (Exact Position) -| Keybinding | Action | -|--------------|--------| + +| Keybinding | Action | +| ------------ | -------------------- | | `gm` | Go to mark M (exact) | | `gt` | Go to mark T (exact) | | `gb` | Go to mark B (exact) | @@ -242,99 +268,114 @@ Mark and jump to specific locations in files. | `gf` | Go to mark F (exact) | ### Project Bookmarks -| Keybinding | Action | -|--------------|--------| -| `bm` | Set bookmark: Main file (M) | + +| Keybinding | Action | +| ------------ | ----------------------------- | +| `bm` | Set bookmark: Main file (M) | | `bc` | Set bookmark: Config file (C) | -| `bt` | Set bookmark: Test file (T) | +| `bt` | Set bookmark: Test file (T) | | `br` | Set bookmark: README file (R) | -| `Bm` | Go to Main bookmark | -| `Bc` | Go to Config bookmark | -| `Bt` | Go to Test bookmark | -| `Br` | Go to README bookmark | +| `Bm` | Go to Main bookmark | +| `Bc` | Go to Config bookmark | +| `Bt` | Go to Test bookmark | +| `Br` | Go to README bookmark | ### Recent File Marks -| Keybinding | Action | -|--------------|--------| + +| Keybinding | Action | +| ------------ | -------------------------- | | `j0` | Jump to last exit position | -| `j1` | Jump to recent file 1 | -| `j2` | Jump to recent file 2 | -| `j3` | Jump to recent file 3 | +| `j1` | Jump to recent file 1 | +| `j2` | Jump to recent file 2 | +| `j3` | Jump to recent file 3 | ### Automatic Marks -| Keybinding | Action | -|--------------|--------| -| `j`` | Jump to last jump position | -| `j'` | Jump to last jump line | -| `j"` | Jump to last exit position | -| `j^` | Jump to last insert position | -| `j.` | Jump to last change position | -| `j[` | Jump to change/yank start | -| `j]` | Jump to change/yank end | + +| Keybinding | Action | +| ------------ | ------------------------------ | +| `j`` | Jump to last jump position | +| `j'` | Jump to last jump line | +| `j"` | Jump to last exit position | +| `j^` | Jump to last insert position | +| `j.` | Jump to last change position | +| `j[` | Jump to change/yank start | +| `j]` | Jump to change/yank end | | `j<` | Jump to visual selection start | -| `j>` | Jump to visual selection end | +| `j>` | Jump to visual selection end | ### Mark Management -| Keybinding | Action | -|--------------|--------| -| `ml` | List all marks | -| `md` | Delete specific marks (prompt) | -| `mD` | Delete all lowercase marks | -| `mCa`| Clear all local marks (a-z) | -| `mCA`| Clear all global marks (A-Z) | -| `mC0`| Clear all numbered marks (0-9) | + +| Keybinding | Action | +| ------------- | ------------------------------ | +| `ml` | List all marks | +| `md` | Delete specific marks (prompt) | +| `mD` | Delete all lowercase marks | +| `mCa` | Clear all local marks (a-z) | +| `mCA` | Clear all global marks (A-Z) | +| `mC0` | Clear all numbered marks (0-9) | ### Enhanced Mark Actions -| Keybinding | Action | -|--------------|--------| -| `mM` | Set mark M with feedback | -| `mT` | Set mark T with feedback | -| `mB` | Set mark B with feedback | + +| Keybinding | Action | +| ------------ | ---------------------------- | +| `mM` | Set mark M with feedback | +| `mT` | Set mark T with feedback | +| `mB` | Set mark B with feedback | | `JM` | Jump to mark M with feedback | | `JT` | Jump to mark T with feedback | | `JB` | Jump to mark B with feedback | ### Search with Marks -| Keybinding | Action | -|------------|--------| -| `/` | Search (marks position) | + +| Keybinding | Action | +| ---------- | --------------------------------- | +| `/` | Search (marks position) | | `?` | Search backwards (marks position) | ### Telescope Integration -| Keybinding | Action | -|--------------|--------| + +| Keybinding | Action | +| ------------ | ------------------------- | | `fm` | Find marks with Telescope | --- ## 📍 Jump and Change Lists + Navigate through previous positions and changes. -| Keybinding | Action | -|--------------|--------| +| Keybinding | Action | +| ------------ | ---------------------- | | `Ctrl+o` | Jump to older position | | `Ctrl+i` | Jump to newer position | -| `jo` | Show jump list | -| `g;` | Go to older change | -| `g,` | Go to newer change | -| `jc` | Show change list | +| `jo` | Show jump list | +| `g;` | Go to older change | +| `g,` | Go to newer change | +| `jc` | Show change list | --- ## 🛠️ Commands + Useful commands for marks and navigation. -| Command | Action | -|-----------------|--------| -| `:ShowMarks` | Show all marks | -| `:ClearMarks` | Clear all local marks | -| `:ClearAllMarks`| Clear all marks | -| `:MarkInfo` | Show mark information | +| Command | Action | +| ---------------- | --------------------- | +| `:ShowMarks` | Show all marks | +| `:ClearMarks` | Clear all local marks | +| `:ClearAllMarks` | Clear all marks | +| `:MarkInfo` | Show mark information | --- **Tips for AuDHD Users**: + - **Focus**: Use `zi` to check fold status or `ml` for marks when overwhelmed. - **Consistency**: `` prefix is consistent; group similar actions (e.g., `t*` for tabs). - **Feedback**: Use enhanced mark commands (`mM`, `JM`) for visual confirmation. - **Simplify**: Try `zfc` to toggle fold column for visual cues or `zt` to toggle folding. + +```py +print("hi") +a = 56 +``` diff --git a/lua/core/options.lua b/lua/core/options.lua index f3c94a8..64ad471 100644 --- a/lua/core/options.lua +++ b/lua/core/options.lua @@ -91,6 +91,10 @@ local function toggle_wrap() end map.set("n", "ww", toggle_wrap, { desc = "Toggle line wrap, linebreak, and colorcolumn" }) +opt.foldmethod = "expr" +opt.foldexpr = "v:lua.vim.treesitter.foldexpr()" +opt.foldlevel = 99 + opt.number = true -- show absolute line number on the current line opt.relativenumber = true -- show relative line numbers on others opt.numberwidth = 2 -- minimum width of line number column diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index dce7a03..9b2c6bd 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -25,7 +25,8 @@ return { "query", "latex", }, - sync_install = false, + + sync_install = true, auto_install = true, ignore_install = { "phpdoc" }, highlight = { @@ -33,17 +34,106 @@ return { disable = { "css" }, additional_vim_regex_highlighting = { "latex" }, }, + + inject = { + enable = true, + }, + indent = { enable = true, - disable = { "python", "css", "latex" }, + disable = { "css", "latex" }, }, + incremental_selection = { enable = true, keymaps = { init_selection = "", node_incremental = "", scope_incremental = false, - node_decremental = "", + node_decremental = "", + }, + }, + + fold = { + enable = true, + }, + + playground = { + enable = true, + disable = {}, + updatetime = 25, + persist_queries = false, + keybindings = { + toggle_query_editor = "o", + toggle_hl_groups = "i", + toggle_injected_languages = "t", + toggle_anonymous_nodes = "a", + toggle_language_display = "I", + focus_language = "f", + unfocus_language = "F", + update = "R", + goto_node = "", + show_help = "?", + }, + }, + + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + ["aa"] = "@parameter.outer", + ["ia"] = "@parameter.inner", + }, + }, + + swap = { + enable = true, + swap_next = { + ["a"] = "@parameter.inner", + }, + swap_previous = { + ["A"] = "@parameter.inner", + }, + }, + + move = { + enable = true, + set_jumps = true, + goto_next_start = { + ["]m"] = "@function.outer", + ["]]"] = "@class.outer", + }, + goto_next_end = { + ["]M"] = "@function.outer", + ["]["] = "@class.outer", + }, + goto_previous_start = { + ["[m"] = "@function.outer", + ["[["] = "@class.outer", + }, + goto_previous_end = { + ["[M"] = "@function.outer", + ["[]"] = "@class.outer", + }, + }, + }, + + context_commentstring = { + enable = true, + enable_autocmd = false, + config = { + typescript = "// %s", + css = "/* %s */", + scss = "/* %s */", + html = "", + svelte = "", + vue = "", + json = {}, }, }, }, @@ -51,6 +141,52 @@ return { require("nvim-treesitter.config").setup(opts) end, }, + + { + "nvim-treesitter/nvim-treesitter-context", + event = "BufReadPost", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { + enable = false, + max_lines = 3, + min_window_height = 0, + line_numbers = true, + multiline_threshold = 20, + trim_scope = "outer", + mode = "cursor", + separator = nil, + zindex = 20, + }, + }, + + { + "HiPhish/rainbow-delimiters.nvim", + event = "BufReadPost", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = function() + local rainbow_delimiters = require("rainbow-delimiters") + vim.g.rainbow_delimiters = { + strategy = { + [""] = rainbow_delimiters.strategy["global"], + vim = rainbow_delimiters.strategy["local"], + }, + query = { + [""] = "rainbow-delimiters", + lua = "rainbow-blocks", + }, + highlight = { + "RainbowDelimiterRed", + "RainbowDelimiterYellow", + "RainbowDelimiterBlue", + "RainbowDelimiterOrange", + "RainbowDelimiterGreen", + "RainbowDelimiterViolet", + "RainbowDelimiterCyan", + }, + } + end, + }, + { "JoosepAlviste/nvim-ts-context-commentstring", event = "VeryLazy",