From 4d4ff2fadcac4bae2305b7e8daefd30b67dc2506 Mon Sep 17 00:00:00 2001 From: Shubham Pawar Date: Sun, 1 Dec 2024 12:14:43 +0530 Subject: [PATCH] chore: lazyvim setup and remove default shell for terminals --- .config/alacritty/alacritty.toml | 6 +- .config/kitty/kitty.conf | 20 +- .config/nvim-lazy/.gitignore | 4 + .config/nvim-lazy/lazy-lock.json | 74 +++--- .config/nvim-lazy/lazyvim.json | 4 +- .config/nvim-lazy/lua/config/autocmds.lua | 64 +---- .config/nvim-lazy/lua/config/keymaps.lua | 25 -- .config/nvim-lazy/lua/config/lazy.lua | 15 +- .../nvim-lazy/lua/{ => config}/m-utils.lua | 2 +- .config/nvim-lazy/lua/config/options.lua | 3 - .config/nvim-lazy/lua/plugins/ai.lua | 161 +++++++++++++ .config/nvim-lazy/lua/plugins/autopairs.lua | 13 - .config/nvim-lazy/lua/plugins/blink-cmp.lua | 29 --- .config/nvim-lazy/lua/plugins/cmp.lua | 149 ------------ .config/nvim-lazy/lua/plugins/completion.lua | 171 +++++++++++++ .config/nvim-lazy/lua/plugins/conform.lua | 98 ++++---- .../lua/plugins/{lsps => }/copilot.lua | 0 .config/nvim-lazy/lua/plugins/disabled.lua | 1 + .config/nvim-lazy/lua/plugins/example.lua | 6 +- .config/nvim-lazy/lua/plugins/fzf.lua | 225 ------------------ .config/nvim-lazy/lua/plugins/grapple.lua | 3 +- .../lua/plugins/{lsps => lsp}/mappings.lua | 0 .config/nvim-lazy/lua/plugins/lsps/php.lua | 66 ----- .../lsps/typescript-errors-translate.lua | 11 - .config/nvim-lazy/lua/plugins/mini/misc.lua | 26 -- .../nvim-lazy/lua/plugins/mini/surround.lua | 26 ++ .config/nvim-lazy/lua/plugins/neogen.lua | 1 + .config/nvim-lazy/lua/plugins/neotree.lua | 16 +- .config/nvim-lazy/lua/plugins/nvim-lint.lua | 52 ---- .config/nvim-lazy/lua/plugins/session.lua | 90 ------- .config/nvim-lazy/lua/plugins/sessions.lua | 19 ++ .config/nvim-lazy/lua/plugins/surround.lua | 6 - .config/nvim-lazy/lua/plugins/telescope.lua | 154 ++++++++++++ .../nvim-lazy/lua/plugins/template-string.lua | 8 + .config/nvim-lazy/lua/plugins/tests.lua | 50 ---- .../plugins/{colorscheme.lua => theme.lua} | 16 +- .config/nvim-lazy/lua/plugins/yazi.lua | 16 +- .config/nvim/lua/plugins/avante.lua | 2 +- .config/nvim/lua/plugins/config/astrolsp.lua | 1 + .config/nvim/lua/plugins/config/telescope.lua | 25 ++ .../nvim/lua/plugins/config/tree-sitter.lua | 38 +-- .config/nvim/lua/plugins/flash.lua | 4 +- .config/nvim/lua/plugins/mini/ai.lua | 28 +-- .config/nvim/lua/plugins/mini/pairs.lua | 54 +++++ .config/nvim/lua/plugins/mini/pick.lua | 28 ++- .config/nvim/lua/plugins/mini/surround.lua | 24 +- .config/nvim/lua/plugins/neogit.lua | 4 +- .config/nvim/lua/plugins/sessions.lua | 19 +- .config/nvim/lua/plugins/surround.lua | 2 +- .../nvim/lua/plugins/ultimate-autopair.lua | 2 +- .config/nvim/lua/plugins/yazi.lua | 6 +- .config/wezterm/wezterm.lua | 5 +- 52 files changed, 872 insertions(+), 1000 deletions(-) rename .config/nvim-lazy/lua/{ => config}/m-utils.lua (92%) create mode 100644 .config/nvim-lazy/lua/plugins/ai.lua delete mode 100644 .config/nvim-lazy/lua/plugins/autopairs.lua delete mode 100644 .config/nvim-lazy/lua/plugins/blink-cmp.lua delete mode 100644 .config/nvim-lazy/lua/plugins/cmp.lua create mode 100644 .config/nvim-lazy/lua/plugins/completion.lua rename .config/nvim-lazy/lua/plugins/{lsps => }/copilot.lua (100%) delete mode 100644 .config/nvim-lazy/lua/plugins/fzf.lua rename .config/nvim-lazy/lua/plugins/{lsps => lsp}/mappings.lua (100%) delete mode 100644 .config/nvim-lazy/lua/plugins/lsps/php.lua delete mode 100644 .config/nvim-lazy/lua/plugins/lsps/typescript-errors-translate.lua delete mode 100644 .config/nvim-lazy/lua/plugins/mini/misc.lua create mode 100644 .config/nvim-lazy/lua/plugins/mini/surround.lua delete mode 100644 .config/nvim-lazy/lua/plugins/nvim-lint.lua delete mode 100644 .config/nvim-lazy/lua/plugins/session.lua create mode 100644 .config/nvim-lazy/lua/plugins/sessions.lua delete mode 100644 .config/nvim-lazy/lua/plugins/surround.lua create mode 100644 .config/nvim-lazy/lua/plugins/telescope.lua create mode 100644 .config/nvim-lazy/lua/plugins/template-string.lua delete mode 100644 .config/nvim-lazy/lua/plugins/tests.lua rename .config/nvim-lazy/lua/plugins/{colorscheme.lua => theme.lua} (100%) create mode 100644 .config/nvim/lua/plugins/mini/pairs.lua diff --git a/.config/alacritty/alacritty.toml b/.config/alacritty/alacritty.toml index eceed36..33b4946 100644 --- a/.config/alacritty/alacritty.toml +++ b/.config/alacritty/alacritty.toml @@ -402,9 +402,9 @@ mouse = "Left" save_to_clipboard = true semantic_escape_chars = ",│`|:\"' ()[]{}<>\t" -[terminal.shell] -args = ["--login"] -program = "/bin/fish" +# [terminal.shell] +# args = ["--login"] +# program = "/bin/fish" [window] opacity = 0.9 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 6489cff..b7b26b2 100644 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -6,7 +6,7 @@ #: individual font faces and even specify special fonts for particular #: characters. -font_family RecMonoCasual Nerd Font +font_family FiraCode Nerd Font bold_font auto italic_font auto bold_italic_font auto @@ -313,7 +313,7 @@ pointer_shape_when_grabbed arrow #: Performance tuning {{{ -repaint_delay 10 +repaint_delay 2 #: Delay (in milliseconds) between screen updates. Decreasing it, #: increases frames-per-second (FPS) at the cost of more CPU usage. @@ -323,7 +323,7 @@ repaint_delay 10 #: rate. Also, to minimize latency when there is pending input to be #: processed, repaint_delay is ignored. -input_delay 3 +input_delay 1 #: Delay (in milliseconds) before input from the program running in #: the terminal is processed. Note that decreasing it will increase @@ -331,7 +331,7 @@ input_delay 3 #: in full screen programs that redraw the entire screen on each loop, #: because kitty is so fast that partial screen updates will be drawn. -sync_to_monitor yes +sync_to_monitor no #: Sync screen updates to the refresh rate of the monitor. This #: prevents tearing (https://en.wikipedia.org/wiki/Screen_tearing) @@ -340,6 +340,13 @@ sync_to_monitor yes #: keyboard repeat rate, you may notice some slight input latency. If #: so, set this to no. +wayland_enable_ime no + +#: Enable Input Method Extension on Wayland. +#: This is typically used for inputting text in East Asian languages. +#: However, its implementation in Wayland is often buggy and introduces latency into the input loop, so disable this if you know you dont need it. +#: Changing this option by reloading the config is not supported, it will not have any effect. + #: }}} #: Terminal bell {{{ @@ -547,7 +554,8 @@ tab_separator " ┇" #: The separator between tabs in the tab bar when using separator as #: the tab_bar_style. -tab_title_template "{index}: {title}" +# tab_title_template "{index}: {title}" +tab_title_template "{index}: {tab.active_oldest_wd.split('/')[-1]}" #: A template to render the tab title. The default just renders the #: title. If you wish to include the tab-index as well, use something @@ -723,7 +731,7 @@ mark3_background #f274bc #: Advanced {{{ -shell /bin/fish --login +# shell /bin/fish --login # shell /bin/fish #: The shell program to execute. The default value of . means to use diff --git a/.config/nvim-lazy/.gitignore b/.config/nvim-lazy/.gitignore index cc5457a..c85928c 100644 --- a/.config/nvim-lazy/.gitignore +++ b/.config/nvim-lazy/.gitignore @@ -6,3 +6,7 @@ debug foo.* *.log data +lazy-lock.json +lazyvim.json +README.md +LICENSE \ No newline at end of file diff --git a/.config/nvim-lazy/lazy-lock.json b/.config/nvim-lazy/lazy-lock.json index a70452e..70e04d1 100644 --- a/.config/nvim-lazy/lazy-lock.json +++ b/.config/nvim-lazy/lazy-lock.json @@ -1,106 +1,96 @@ { "LazyVim": { "branch": "main", "commit": "adcbfc72fd8d0808d78bdfe0940d98c6432c4ef0" }, - "LuaSnip": { "branch": "master", "commit": "0f7bbce41ea152a94d12aea286f2ce98e63c0f58" }, + "LuaSnip": { "branch": "master", "commit": "2592b91577136dbb355a4708be1e60619456b7f6" }, "NeoTerm.lua": { "branch": "main", "commit": "f71a4a9663c52673a677a09894d945983c8da303" }, - "SchemaStore.nvim": { "branch": "main", "commit": "bbd005a56daab7a19ceea22360a836957ac2c42c" }, - "age.nvim": { "branch": "main", "commit": "49f5f7c56901fe219ff4371ecf67124345d20185" }, - "avante.nvim": { "branch": "main", "commit": "16c4254b14ebe8acb79f6abecb49ca36b9d96cb0" }, - "blink.cmp": { "branch": "main", "commit": "917026450f5fa051cda9c538b517f0cf28ceec6f" }, - "bufferline.nvim": { "branch": "main", "commit": "5cc447cb2b463cb499c82eaeabbed4f5fa6a0a44" }, + "SchemaStore.nvim": { "branch": "main", "commit": "f922d46e17019e7fcadc1f0c1cfba31e8300819a" }, + "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, + "avante.nvim": { "branch": "main", "commit": "57311bf8cd2f48729565d2351bcbf383b6a56907" }, + "bufferline.nvim": { "branch": "main", "commit": "261a72b90d6db4ed8014f7bda976bcdc9dd7ce76" }, "bullets.vim": { "branch": "master", "commit": "2253f970e54320dbd76fd6bb4f5a0bf2436ce232" }, "catppuccin": { "branch": "main", "commit": "faf15ab0201b564b6368ffa47b56feefc92ce3f4" }, "clangd_extensions.nvim": { "branch": "main", "commit": "8f7b72100883e0e34400d9518d40a03f21e4d0a6" }, "cmp-async-path": { "branch": "main", "commit": "d6d1ffa2075039632a2d71e8fa139818e15ac757" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-git": { "branch": "main", "commit": "ec049036e354ed8ed0215f2427112882e1ea7051" }, - "cmp-look": { "branch": "master", "commit": "971e65a6be0e75c3438fe7b176d4fc020cb89d7b" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp-rg": { "branch": "master", "commit": "70a43543f61b6083ba9c3b7deb9ccee671410ac6" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "codecompanion.nvim": { "branch": "main", "commit": "4394bc14642f3fecd5b074ac9304c3e457888b58" }, + "codecompanion.nvim": { "branch": "main", "commit": "1848048ae804097538c8b58269fe28d58f953453" }, "conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" }, "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, "crates.nvim": { "branch": "main", "commit": "8bf8358ee326d5d8c11dcd7ac0bcc9ff97dbc785" }, - "dashboard-nvim": { "branch": "master", "commit": "fabf5feec96185817c732d47d363f34034212685" }, "dial.nvim": { "branch": "master", "commit": "46b4375e84e8eb771129bff6b2b1e47746601ef9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, - "fzf-lua": { "branch": "main", "commit": "ce978474e406f4faacd2e66ec35d93b9e8ae069e" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" }, - "gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" }, "grug-far.nvim": { "branch": "main", "commit": "9a2f78219390b47d67795ab09390d7f092e23976" }, - "gx.nvim": { "branch": "main", "commit": "cc70d112b14d18dd7b123a5d5288266a60e8189e" }, - "img-clip.nvim": { "branch": "main", "commit": "28a32d811d69042f4fa5c3d5fa35571df2bc1623" }, + "gx.nvim": { "branch": "main", "commit": "b01db725a001e4215f363159fc04727f6fde0a1c" }, + "img-clip.nvim": { "branch": "main", "commit": "5ff183655ad98b5fc50c55c66540375bbd62438c" }, "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, - "kanagawa.nvim": { "branch": "master", "commit": "e5f7b8a804360f0a48e40d0083a97193ee4fcc87" }, "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, "mason-nvim-dap.nvim": { "branch": "main", "commit": "8b9363d83b5d779813cdd2819b8308651cec2a09" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.ai": { "branch": "main", "commit": "31c149067d38b97720d2a179619f7745a0006ecc" }, "mini.align": { "branch": "main", "commit": "26111a737494bc39576ad67b52bbc2638ca23553" }, "mini.icons": { "branch": "main", "commit": "54686be7d58807906cb2c8c2216e0bf9c044f19a" }, - "mini.misc": { "branch": "main", "commit": "428da688126b320194a944233f9f8dfc46669307" }, "mini.move": { "branch": "main", "commit": "4caa1c212f5ca3d1633d21cfb184808090ed74b1" }, - "mini.pairs": { "branch": "main", "commit": "927d19cbdd0e752ab1c7eed87072e71d2cd6ff51" }, + "mini.pairs": { "branch": "main", "commit": "7e834c5937d95364cc1740e20d673afe2d034cdb" }, + "mini.surround": { "branch": "main", "commit": "48a9795c9d352c771e1ab5dedab6063c0a2df037" }, "neo-tree.nvim": { "branch": "main", "commit": "42caaf5c3b7ca346ab278201151bb878006a6031" }, "neogen": { "branch": "main", "commit": "e3b8f6dca1c67c73ae2817418d39c061fdb65064" }, - "neogit": { "branch": "master", "commit": "26c5550016b20e4f47b376192f12a54be8897aaa" }, + "neogit": { "branch": "master", "commit": "446197d90d179d579fa9c6970d4f98d494a2090b" }, "neotest": { "branch": "master", "commit": "6d3d22cdad49999ef774ebe1bc250a4994038964" }, "neotest-elixir": { "branch": "master", "commit": "c5067bcc3ec6a0bba7b5694fa15aeb17f16aeb3c" }, - "neotest-golang": { "branch": "main", "commit": "cdb0eb0edfedcdf145972fdbe19fb95d17d987c2" }, - "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, + "neotest-golang": { "branch": "main", "commit": "51a165e0b9d6c757d9da2b467b3c05e61f54a8ee" }, "neotest-python": { "branch": "master", "commit": "a2861ab3c9a0bf75a56b11835c2bfc8270f5be7e" }, - "neotest-vitest": { "branch": "main", "commit": "9e30dca989a2287cf3fde86b3e138ea7fa4de935" }, - "neovim-session-manager": { "branch": "master", "commit": "35c154a4b904cbe2aa7acce00a8c1c54a8831780" }, - "noice.nvim": { "branch": "main", "commit": "5af819a250f6b73727e10bab09df61673e5db7f2" }, + "noice.nvim": { "branch": "main", "commit": "c6f6fb178ebe9b4fd90383de743c3399f8c3a37c" }, "nordic.nvim": { "branch": "main", "commit": "1ee4044077059b34eacd18d93613495a602c131f" }, "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, - "nvim-cmp": { "branch": "main", "commit": "ed31156aa2cc14e3bc066c59357cc91536a2bc01" }, - "nvim-dap": { "branch": "master", "commit": "cc92b054720a96170eca6bd9bdedd43d2b0a7a8a" }, + "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "nvim-dap": { "branch": "master", "commit": "0a0daa796a5919a51e5e5019ffa91219c94c4fef" }, "nvim-dap-go": { "branch": "main", "commit": "6aa88167ea1224bcef578e8c7160fe8afbb44848" }, - "nvim-dap-python": { "branch": "master", "commit": "3e3dd98d4d83715c9e0e429b4a5da7bd706e6ceb" }, + "nvim-dap-python": { "branch": "master", "commit": "34282820bb713b9a5fdb120ae8dd85c2b3f49b51" }, "nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "76d80c3d171224315b61c006502a1e30c213a9ab" }, "nvim-highlight-colors": { "branch": "main", "commit": "e967e2ba13fd4ca731b41d0e5cc1ac2edcd6e25e" }, "nvim-lint": { "branch": "master", "commit": "6b46370d02cd001509a765591a3ffc481b538794" }, "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, - "nvim-lspconfig": { "branch": "master", "commit": "fe88eade4ab50fca9ace99205cad1d91645ed9e8" }, + "nvim-lspconfig": { "branch": "master", "commit": "7b0a2f6b14485bb5a237fc1328a487ff3e4a08c5" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, "nvim-snippets": { "branch": "main", "commit": "56b4052f71220144689caaa2e5b66222ba5661eb" }, - "nvim-surround": { "branch": "main", "commit": "dca2e998ff26681ee422b92c6ed39b3d2908d8a9" }, - "nvim-treesitter": { "branch": "master", "commit": "28591731d84c2fc18ddda60e1d53da24c31c4987" }, + "nvim-treesitter": { "branch": "master", "commit": "454354e5998edb448111574e58d5f5f2d6a940bd" }, "nvim-treesitter-context": { "branch": "master", "commit": "6b081ea63a3711243d11540ce28ccdb6f35ecd33" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "ad8f0a472148c3e0ae9851e26a722ee4e29b1595" }, - "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, - "nvim-web-devicons": { "branch": "master", "commit": "edbe0a65cfacbbfff6a4a1e98ddd60c28c560509" }, + "nvim-ts-autotag": { "branch": "main", "commit": "f2d24aca1bcbbd2c0306fd93d52e3697027b77ff" }, + "nvim-web-devicons": { "branch": "master", "commit": "203da76ecfbb4b192cf830665b03eb651b635c94" }, "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "quick-scope": { "branch": "master", "commit": "4d35d3b2bc6794666353dcc241b2680bd560416f" }, "refactoring.nvim": { "branch": "master", "commit": "2db6d378e873de31d18ade549c2edba64ff1c2e3" }, - "render-markdown.nvim": { "branch": "main", "commit": "6096cf3608b576a38fd1396227dbc0473091714d" }, - "resession.nvim": { "branch": "master", "commit": "c4d92a57b3936a2d6e1c087dbd6b670da2b1b082" }, - "rustaceanvim": { "branch": "master", "commit": "fee0aa094b0c9f93fffe5a385b3d5d2386c2b072" }, + "render-markdown.nvim": { "branch": "main", "commit": "1b5d11734122d9451d2e5e2e567fd61a62822293" }, + "rustaceanvim": { "branch": "master", "commit": "4ac7a3c6cca9e393229651cc90733afbdc7c6395" }, + "snacks.nvim": { "branch": "main", "commit": "3c1849a09b9618cbc49eed337f0a302394ef049b" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, - "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, + "telescope-egrepify.nvim": { "branch": "master", "commit": "a8070970a661330c4e00450d25f874f6c2b00af9" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "template-string.nvim": { "branch": "main", "commit": "419bfb2e4d5f0e6ddd0d4435f85b69da0d88d524" }, "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "tokyonight.nvim": { "branch": "main", "commit": "6c30395146c246055ac3cea32d39d6b9876a1dcc" }, - "trouble.nvim": { "branch": "main", "commit": "3dc00c0447c016cd43e03054c3d49436a1f2076d" }, + "tokyonight.nvim": { "branch": "main", "commit": "c2725eb6d086c8c9624456d734bd365194660017" }, + "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, "ts-comments.nvim": { "branch": "main", "commit": "2002692ad1d3f6518d016550c20c2a890f0cbf0e" }, - "ts-error-translator.nvim": { "branch": "main", "commit": "47e5ba89f71b9e6c72eaaaaa519dd59bd6897df4" }, - "ultimate-autopair.nvim": { "branch": "v0.6", "commit": "9e3209190c22953566ae4e6436ad2b4ff4dabb95" }, "venv-selector.nvim": { "branch": "regexp", "commit": "e82594274bf7b54387f9a2abe65f74909ac66e97" }, "vim-subversive": { "branch": "master", "commit": "cea98a62ded4028118ad71c3e81b26eff2e0b8a0" }, "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, - "which-key.nvim": { "branch": "main", "commit": "68e37e12913a66b60073906f5d3f14dee0de19f2" }, - "yazi.nvim": { "branch": "main", "commit": "053867916a9be3cb46f84b6f095ee731bbddd213" } + "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" }, + "yazi.nvim": { "branch": "main", "commit": "a54ec0506fc40afa8f0215931bcf462347d77331" } } diff --git a/.config/nvim-lazy/lazyvim.json b/.config/nvim-lazy/lazyvim.json index 8e6b0ec..7fd2a72 100644 --- a/.config/nvim-lazy/lazyvim.json +++ b/.config/nvim-lazy/lazyvim.json @@ -3,7 +3,7 @@ ], "news": { - "NEWS.md": "6520" + "NEWS.md": "7429" }, - "version": 6 + "version": 7 } \ No newline at end of file diff --git a/.config/nvim-lazy/lua/config/autocmds.lua b/.config/nvim-lazy/lua/config/autocmds.lua index 0bd716c..9f51375 100644 --- a/.config/nvim-lazy/lua/config/autocmds.lua +++ b/.config/nvim-lazy/lua/config/autocmds.lua @@ -7,60 +7,6 @@ end local au_buffer = augroup("buffer") -vim.api.nvim_create_autocmd("CmdlineEnter", { - group = au_buffer, - command = "set nosmartcase", - desc = "Make search case-sensitive by default", -}) -vim.api.nvim_create_autocmd("CmdlineLeave", { - group = au_buffer, - command = "set smartcase", - desc = "Make search case-insensitive by default", -}) - -vim.api.nvim_create_autocmd("FileType", { - group = augroup("webdev"), - desc = "Set spaces to 2", - pattern = { - "lua", - "php", - "blade", - "heex", - "jsonc", - "json", - "json5", - "typescriptreact", - "typescript", - "typescript.tsx", - "typescript.jsx", - "javascriptreact", - "javascript", - "javascript.jsx", - "vue", - "html", - "css", - "less", - "scss", - }, - callback = function() - vim.opt_local.tabstop = 2 - vim.opt_local.softtabstop = 2 - vim.opt_local.shiftwidth = 2 - vim.opt_local.expandtab = true - vim.opt_local.smartindent = true - vim.opt_local.autoindent = true - vim.opt_local.smarttab = true - end, -}) - -vim.api.nvim_create_autocmd("FileType", { - group = au_buffer, - desc = "Fix Comment Continuation", - callback = function() - vim.opt_local.formatoptions = "jcrqlnt" - end, -}) - vim.filetype.add({ extension = { fish = "fish", @@ -84,3 +30,13 @@ vim.filetype.add({ [".*/hyprland%.conf"] = "hyprlang", }, }) + +vim.api.nvim_create_autocmd("FileType", { + group = au_buffer, + desc = "Fix Comment Continuation", + callback = function() + vim.opt_local.formatoptions = "jcrqlnt" + end, +}) + +vim.cmd.packadd("cfilter") diff --git a/.config/nvim-lazy/lua/config/keymaps.lua b/.config/nvim-lazy/lua/config/keymaps.lua index a7fd8eb..40c5663 100644 --- a/.config/nvim-lazy/lua/config/keymaps.lua +++ b/.config/nvim-lazy/lua/config/keymaps.lua @@ -1,10 +1,7 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here -vim.keymap.del("n", "l") - vim.keymap.set("", "0", "^", { silent = false }) - vim.keymap.set("n", ",w", "w!", { desc = "Save file" }) vim.keymap.set("n", ",W", "noautocmd w!", { desc = "Save file(noautocmd)" }) @@ -28,29 +25,7 @@ vim.keymap.set("n", "dl", '"_dl') vim.keymap.set("v", "D", '"_D') vim.keymap.set({ "n", "v" }, "c", '"_c') vim.keymap.set("n", "C", '"_C') --- floating terminal -local lazyterm = function() - LazyVim.terminal(nil, { cwd = LazyVim.root() }) -end -vim.keymap.del({ "n", "t" }, "") -vim.keymap.del("t", "") -vim.keymap.del({ "n", "t" }, "") -vim.keymap.set("n", "", lazyterm, { desc = "Open terminal" }) --- vim.keymap.set("n", "", function() --- LazyVim.terminal() --- end, { desc = "Terminal (cwd)" }) -vim.keymap.set("n", "", lazyterm, { desc = "Open terminal" }) -vim.keymap.set("t", "", "", { desc = "Terminal Escape mode" }) -vim.keymap.set("t", "", "close", { desc = "Hide Terminal" }) -vim.keymap.set("t", "", "close", { desc = "Hide Terminal" }) for i = 1, 9 do vim.keymap.set("n", "" .. i, i .. "gt", { desc = "Goto Tab " .. i }) end - -vim.keymap.set("n", "tf", function() - LazyVim.terminal({ "yazi" }, { cwd = LazyVim.root.cwd(), esc_esc = false, ctrl_hjkl = false }) -end, { desc = "Yazi (Root cwd)" }) -vim.keymap.set("n", "tF", function() - LazyVim.terminal({ "yazi" }, { esc_esc = false, ctrl_hjkl = false }) -end, { desc = "Yazi" }) diff --git a/.config/nvim-lazy/lua/config/lazy.lua b/.config/nvim-lazy/lua/config/lazy.lua index 0579d32..14635e4 100644 --- a/.config/nvim-lazy/lua/config/lazy.lua +++ b/.config/nvim-lazy/lua/config/lazy.lua @@ -22,11 +22,11 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.editor.refactoring" }, { import = "lazyvim.plugins.extras.editor.dial" }, { import = "lazyvim.plugins.extras.coding.luasnip" }, - -- { import = "lazyvim.plugins.extras.coding.copilot" }, + -- { import = "lazyvim.plugins.extras.coding.blink" }, { import = "lazyvim.plugins.extras.ui.treesitter-context" }, - { import = "lazyvim.plugins.extras.dap.core" }, + { import = "lazyvim.plugins.extras.test.core" }, { import = "lazyvim.plugins.extras.lang.clangd" }, { import = "lazyvim.plugins.extras.lang.typescript" }, @@ -52,14 +52,10 @@ require("lazy").setup({ { import = "lazyvim.plugins.extras.lang.rust" }, { import = "lazyvim.plugins.extras.lang.php" }, - { import = "lazyvim.plugins.extras.editor.fzf" }, - - { import = "lazyvim.plugins.extras.test.core" }, -- import/override with your plugins { import = "plugins" }, - { import = "plugins.lsps" }, + { import = "plugins.lsp" }, { import = "plugins.mini" }, - { import = "plugins.ai" }, }, defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. @@ -70,12 +66,11 @@ require("lazy").setup({ version = false, -- always use the latest git commit -- version = "*", -- try installing the latest stable version for plugins that support semver }, - install = { colorscheme = { "habamax" } }, + install = { colorscheme = { "default" } }, checker = { - enabled = false, -- check for plugin updates periodically + enabled = true, -- check for plugin updates periodically notify = false, -- notify on update }, -- automatically check for plugin updates - change_detection = { enabled = true, notify = false }, performance = { rtp = { -- disable some rtp plugins diff --git a/.config/nvim-lazy/lua/m-utils.lua b/.config/nvim-lazy/lua/config/m-utils.lua similarity index 92% rename from .config/nvim-lazy/lua/m-utils.lua rename to .config/nvim-lazy/lua/config/m-utils.lua index ba7ab0e..b88d8c0 100644 --- a/.config/nvim-lazy/lua/m-utils.lua +++ b/.config/nvim-lazy/lua/config/m-utils.lua @@ -9,7 +9,7 @@ function M.get_age_credentials(secret_file) end local identity = vim.fn.expand("$HOME/.config/age/identity.txt") local secret = vim.fn.expand("$HOME/.config/age/" .. secret_file) - return require("age").get(identity, secret) + return require("age").get(secret, identity) end return M diff --git a/.config/nvim-lazy/lua/config/options.lua b/.config/nvim-lazy/lua/config/options.lua index aba92c8..8001584 100644 --- a/.config/nvim-lazy/lua/config/options.lua +++ b/.config/nvim-lazy/lua/config/options.lua @@ -2,8 +2,5 @@ -- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua -- Add any additional options here vim.opt.wrap = true --- vim.opt.lazyredraw = true vim.opt.showbreak = "󰄾 " vim.opt.iskeyword:append("-") - -vim.g.lazyvim_picker = "fzf" diff --git a/.config/nvim-lazy/lua/plugins/ai.lua b/.config/nvim-lazy/lua/plugins/ai.lua new file mode 100644 index 0000000..bbd7b6b --- /dev/null +++ b/.config/nvim-lazy/lua/plugins/ai.lua @@ -0,0 +1,161 @@ +local get_age_credentials = require("config.m-utils").get_age_credentials + +---@type LazySpec +return { + { + "yetone/avante.nvim", + version = false, + build = "make", + keys = { + { "a", "", mode = { "n", "x" }, desc = "+avante" }, + { "aa", mode = { "n", "x" }, desc = "Ask" }, + { "ae", mode = { "n", "x" }, desc = "Edit" }, + }, + opts = function() + vim.env.GEMINI_API_KEY = get_age_credentials("gemini_api.age") + local ollama_setup = { + -- add any opts here + ---@type Provider + provider = "gemini", + vendors = { + ---@type AvanteProvider + ollama = { + ["local"] = true, + endpoint = "127.0.0.1:11434/v1", + model = "llama3.2", + parse_curl_args = function(opts, code_opts) + return { + url = opts.endpoint .. "/chat/completions", + headers = { + ["Accept"] = "application/json", + ["Content-Type"] = "application/json", + }, + body = { + model = opts.model, + messages = require("avante.providers").copilot.parse_message(code_opts), -- you can make your own message, but this is very advanced + max_tokens = 2048, + stream = true, + }, + } + end, + parse_response_data = function(data_stream, event_state, opts) + require("avante.providers").openai.parse_response(data_stream, event_state, opts) + end, + }, + }, + } + if not vim.env.GEMINI_API_KEY then + return ollama_setup + end + return { + ---@type Provider + provider = "gemini", + } + end, + dependencies = { + -- 'KingMichaelPark/age.nvim', -- Add age dependency + { dir = "~/Downloads/GitClones/age.nvim" }, -- Add age dependency + "nvim-treesitter/nvim-treesitter", + { + "stevearc/dressing.nvim", + opts = { + select = { + -- Priority list of preferred vim.select implementations + backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" }, + -- Options for fzf-lua + fzf_lua = { + winopts = { + height = 0.5, + width = 0.8, + }, + }, + }, + }, + }, + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + --- The below dependencies are optional, + "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + "MeanderingProgrammer/render-markdown.nvim", + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, + }, + { + "olimorris/codecompanion.nvim", + cmd = { + "CodeCompanion", + "CodeCompanionChat", + "CodeCompanionCmd", + "CodeCompanionActions", + }, + keys = { + { "C", "", desc = "+codecompanion", mode = { "n", "x" } }, + { "Cc", "CodeCompanionChat toggle", desc = "Chat Toggle", mode = { "n", "x" } }, + { "CA", "CodeCompanionChat add", desc = "Chat Add Selection", mode = "x" }, + { "Ca", "CodeCompanionActions", desc = "Chat Actions", mode = { "n", "x" } }, + { "Cd", "CodeCompanionCmd/", desc = "Chat Cmd" }, + }, + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-treesitter/nvim-treesitter", + "KingMichaelPark/age.nvim", + { + "MeanderingProgrammer/render-markdown.nvim", + opts = { + file_types = { "markdown", "Avante", "codecompanion" }, + }, + ft = { "markdown", "Avante", "codecompanion" }, + }, + }, + config = function() + require("codecompanion").setup({ + display = { chat = { render_headers = false } }, + strategies = { + --NOTE: Change the adapter as required + chat = { adapter = "openai_compatible" }, + inline = { adapter = "openai_compatible" }, + }, + adapters = { + openai_compatible = function() + return require("codecompanion.adapters").extend("openai_compatible", { + env = { + url = "https://glhf.chat", + api_key = function() + get_age_credentials("glhf.age") + end, + chat_url = "/api/openai/v1/chat/completions", + }, + schema = { + model = { default = "hf:Qwen/Qwen2.5-Coder-32B-Instruct" }, + num_ctx = { default = 32768 }, + }, + }) + end, + }, + }) + end, + }, +} diff --git a/.config/nvim-lazy/lua/plugins/autopairs.lua b/.config/nvim-lazy/lua/plugins/autopairs.lua deleted file mode 100644 index 319c93f..0000000 --- a/.config/nvim-lazy/lua/plugins/autopairs.lua +++ /dev/null @@ -1,13 +0,0 @@ ----@type LazySpec -return { - { "echasnovski/mini.pairs", enabled = false }, - { - "altermo/ultimate-autopair.nvim", - event = { "InsertEnter", "CmdlineEnter" }, - enabled = true, - branch = "v0.6", --recommended as each new version will have breaking changes - opts = { - --Config goes here - }, - }, -} diff --git a/.config/nvim-lazy/lua/plugins/blink-cmp.lua b/.config/nvim-lazy/lua/plugins/blink-cmp.lua deleted file mode 100644 index 826042b..0000000 --- a/.config/nvim-lazy/lua/plugins/blink-cmp.lua +++ /dev/null @@ -1,29 +0,0 @@ ----@type LazySpec -return { - "Saghen/blink.cmp", - enabled = false, - lazy = false, -- lazy loading handled internally - -- optional: provides snippets for the snippet source - dependencies = "rafamadriz/friendly-snippets", - - -- use a release tag to download pre-built binaries - version = "v0.*", - -- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust - -- build = 'cargo build --release', - - opts = { - highlight = { - -- sets the fallback highlight groups to nvim-cmp's highlight groups - -- useful for when your theme doesn't support blink.cmp - -- will be removed in a future release, assuming themes add support - use_nvim_cmp_as_default = true, - }, - -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font' - -- adjusts spacing to ensure icons are aligned - nerd_font_variant = "normal", - -- experimental auto-brackets support - accept = { auto_brackets = { enabled = true } }, - -- experimental signature help support - trigger = { signature_help = { enabled = true } }, - }, -} diff --git a/.config/nvim-lazy/lua/plugins/cmp.lua b/.config/nvim-lazy/lua/plugins/cmp.lua deleted file mode 100644 index d425e58..0000000 --- a/.config/nvim-lazy/lua/plugins/cmp.lua +++ /dev/null @@ -1,149 +0,0 @@ -local function feedkey(key, mode) - vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) -end --- local function has_words_before() --- unpack = unpack or table.unpack --- local line, col = unpack(vim.api.nvim_win_get_cursor(0)) --- return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil --- end ----@type LazySpec -return { - "hrsh7th/nvim-cmp", - dependencies = { - { "hrsh7th/cmp-path", enabled = false }, - "lukas-reineke/cmp-rg", - "octaltree/cmp-look", - "https://codeberg.org/FelipeLema/cmp-async-path", - }, - opts = function(_, opts) - local cmp = require("cmp") - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - [""] = cmp.mapping({ - c = function() - if cmp.visible() then - cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - else - feedkey("", "n") - end - end, - i = function(fallback) - if cmp.visible() then - cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - else - fallback() - end - end, - }), - [""] = cmp.mapping({ - c = function() - if cmp.visible() then - cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) - else - feedkey("", "n") - end - end, - i = function(fallback) - if cmp.visible() then - cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) - else - fallback() - end - end, - }), - [""] = cmp.mapping.complete({ - config = { sources = { { name = "luasnip" } } }, - }), - [""] = cmp.mapping.complete({ - config = { - sources = { - { - name = "nvim_lsp", - entry_filter = function(entry) - vim.print(entry.source:get_debug_name()) - if - ( - entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Text - or entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Snippet - ) and entry.source:get_debug_name() == "nvim_lsp:emmet_language_server" - then - return true - end - return false - end, - }, - }, - }, - }), - [""] = cmp.mapping.complete({ - config = { sources = { { name = "path" } } }, - }), - [""] = cmp.mapping({ - i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), - c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }), - }), - }) - opts.sources = cmp.config.sources({ - { - name = "nvim_lsp", - max_item_count = 20, - entry_filter = function(entry) - if - ( - entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Text - or entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Snippet - ) and entry.source:get_debug_name() == "nvim_lsp:emmet_language_server" - then - return false - end - return true - end, - }, - -- { name = "path" }, - { name = "luasnip" }, - { name = "async_path", option = { trailing_slash = false } }, - }, { - { - name = "buffer", - option = { - keyword_length = 2, - -- get_bufnrs = function() - -- local bufIsSmall = function(bufnr) - -- return vim.api.nvim_buf_line_count(bufnr) < 2000 - -- end - -- return vim.tbl_filter(bufIsSmall, vim.api.nvim_list_bufs()) - -- -- return vim.api.nvim_list_bufs() - -- end, - }, - }, - { - name = "rg", - keyword_length = 3, - max_item_count = 10, - priority_weight = 50, - option = { - additional_arguments = "--smart-case --hidden", - set_filetype = true, - marker = " ❰❰❰", - }, - -- entry_filter = function(entry) - -- return not entry.exact - -- end, - }, - { - name = "look", - keyword_length = 4, - priority = 30, - option = { - convert_case = true, - loud = true, - --dict = '/usr/share/dict/words' - }, - }, - }) - opts.experimental = { - ghost_text = false, - } - end, -} diff --git a/.config/nvim-lazy/lua/plugins/completion.lua b/.config/nvim-lazy/lua/plugins/completion.lua new file mode 100644 index 0000000..63da08f --- /dev/null +++ b/.config/nvim-lazy/lua/plugins/completion.lua @@ -0,0 +1,171 @@ +local function feedkey(key, mode) + vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true) +end + +local function deprio(kind) + return function(e1, e2) + if e1:get_kind() == kind then + return false + end + if e2:get_kind() == kind then + return true + end + end +end + +---@type LazySpec +return { + -- "saghen/blink.cmp", + -- opts = { + -- keymap = { + -- preset = "enter", + -- [""] = { "accept", "fallback" }, + -- [""] = { "select_prev", "fallback" }, + -- [""] = { "select_next", "fallback" }, + -- }, + -- }, + { + "hrsh7th/nvim-cmp", + dependencies = { + { "hrsh7th/cmp-path", enabled = false }, + "lukas-reineke/cmp-rg", + "https://codeberg.org/FelipeLema/cmp-async-path", + }, + opts = function(_, opts) + local cmp = require("cmp") + local compare = require("cmp.config.compare") + opts.mapping = vim.tbl_extend("force", opts.mapping, { + [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + [""] = cmp.mapping({ + c = function() + if cmp.visible() then + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) + else + feedkey("", "n") + end + end, + i = function(fallback) + if cmp.visible() then + cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) + else + fallback() + end + end, + }), + [""] = cmp.mapping({ + c = function() + if cmp.visible() then + cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) + else + feedkey("", "n") + end + end, + i = function(fallback) + if cmp.visible() then + cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) + else + fallback() + end + end, + }), + [""] = cmp.mapping.complete({ + config = { sources = { { name = "luasnip" } } }, + }), + [""] = cmp.mapping.complete({ + config = { + sources = { + { + name = "nvim_lsp", + entry_filter = function(entry) + vim.print(entry.source:get_debug_name()) + if + ( + entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Text + or entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Snippet + ) and entry.source:get_debug_name() == "nvim_lsp:emmet_language_server" + then + return true + end + return false + end, + }, + }, + }, + }), + [""] = cmp.mapping.complete({ + config = { sources = { { name = "path" } } }, + }), + [""] = cmp.mapping({ + i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }), + c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false }), + }), + }) + + opts.sources = cmp.config.sources({ + { + name = "nvim_lsp", + max_item_count = 20, + entry_filter = function(entry) + if + ( + entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Text + or entry:get_kind() == require("cmp.types").lsp.CompletionItemKind.Snippet + ) and entry.source:get_debug_name() == "nvim_lsp:emmet_language_server" + then + return false + end + return true + end, + }, + -- { name = "path" }, + { name = "luasnip" }, + { name = "async_path", option = { trailing_slash = false } }, + }, { + { + name = "buffer", + option = { + keyword_length = 2, + -- get_bufnrs = function() + -- local bufIsSmall = function(bufnr) + -- return vim.api.nvim_buf_line_count(bufnr) < 2000 + -- end + -- return vim.tbl_filter(bufIsSmall, vim.api.nvim_list_bufs()) + -- -- return vim.api.nvim_list_bufs() + -- end, + }, + }, + { + name = "rg", + keyword_length = 3, + max_item_count = 10, + priority_weight = 50, + option = { + additional_arguments = "--smart-case --hidden", + set_filetype = true, + marker = " ❰❰❰", + }, + }, + }) + opts.experimental = { + ghost_text = false, + } + -- opts.sorting = { + -- priority_weight = 100, + -- comparators = { + -- deprio(require("cmp.types").lsp.CompletionItemKind.Text), + -- compare.exact, + -- compare.offset, + -- compare.score, + -- -- require('cmp-under-comparator').under, + -- compare.recently_used, + -- compare.kind, + -- compare.locality, + -- -- compare.sort_text, + -- compare.length, + -- compare.order, + -- }, + -- } + end, + }, +} diff --git a/.config/nvim-lazy/lua/plugins/conform.lua b/.config/nvim-lazy/lua/plugins/conform.lua index 6bd6e49..af184c6 100644 --- a/.config/nvim-lazy/lua/plugins/conform.lua +++ b/.config/nvim-lazy/lua/plugins/conform.lua @@ -14,67 +14,53 @@ local function first(bufnr, ...) end local function prettier_eslint(bufnr) - return { first(bufnr, "prettierd", "prettier"), "eslint_d" } + -- return { first(bufnr, "prettierd", "prettier"), "eslint_d" } + return { first(bufnr, "prettierd", "prettier") } end - ---@type LazySpec return { - { - "williamboman/mason.nvim", - opts = { - PATH = "append", - ensure_installed = { - "prettierd", - "prettier", - "shfmt", - }, + "stevearc/conform.nvim", + keys = { + { + -- Customize or remove this keymap to your liking + "=", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + mode = "", + desc = "Format buffer(c)", }, }, - { - "stevearc/conform.nvim", - optional = true, - keys = { - { - -- Customize or remove this keymap to your liking - "=", - function() - require("conform").format({ async = true, lsp_fallback = true }) - end, - mode = "", - desc = "Format buffer(c)", - }, - }, - opts = { - formatters_by_ft = { - css = prettier, - scss = prettier, - less = prettier, - html = prettier, - json = prettier, - jsonc = prettier, - yaml = prettier, - markdown = prettier, - handlebars = prettier, - ["markdown.mdx"] = prettier, - ["graphql"] = prettier_eslint, - ["javascript"] = prettier_eslint, - ["javascriptreact"] = prettier_eslint, - ["typescript"] = prettier_eslint, - ["typescriptreact"] = prettier_eslint, - ["vue"] = prettier_eslint, - ["svelte"] = prettier_eslint, - ["astro"] = prettier_eslint, - fish = { "fish_indent" }, - nim = { "nimpretty" }, - zig = { "zigfmt" }, - bash = { "shfmt" }, - php = { "phpcbf", "php_cs_fixer" }, - blade = { "blade-formatter" }, - go = function(bufnr) - return { "goimports", first(bufnr, "gofumpt", "gofmt") } - end, - python = { "ruff_format", "ruff_fix", "ruff_organize_imports" }, - }, + opts = { + formatters_by_ft = { + css = prettier, + scss = prettier, + less = prettier, + html = prettier, + json = prettier, + jsonc = prettier, + yaml = prettier, + markdown = prettier, + handlebars = prettier, + ["markdown.mdx"] = prettier, + ["graphql"] = prettier_eslint, + ["javascript"] = prettier_eslint, + ["javascriptreact"] = prettier_eslint, + ["typescript"] = prettier_eslint, + ["typescriptreact"] = prettier_eslint, + ["vue"] = prettier_eslint, + ["svelte"] = prettier_eslint, + ["astro"] = prettier_eslint, + fish = { "fish_indent" }, + nim = { "nimpretty" }, + zig = { "zigfmt" }, + bash = { "shfmt" }, + php = { "phpcbf", "php_cs_fixer" }, + blade = { "blade-formatter" }, + go = function(bufnr) + return { "goimports", first(bufnr, "gofumpt", "gofmt") } + end, + python = { "ruff_format", "ruff_fix", "ruff_organize_imports" }, }, }, } diff --git a/.config/nvim-lazy/lua/plugins/lsps/copilot.lua b/.config/nvim-lazy/lua/plugins/copilot.lua similarity index 100% rename from .config/nvim-lazy/lua/plugins/lsps/copilot.lua rename to .config/nvim-lazy/lua/plugins/copilot.lua diff --git a/.config/nvim-lazy/lua/plugins/disabled.lua b/.config/nvim-lazy/lua/plugins/disabled.lua index 7fe4195..cd16464 100644 --- a/.config/nvim-lazy/lua/plugins/disabled.lua +++ b/.config/nvim-lazy/lua/plugins/disabled.lua @@ -2,4 +2,5 @@ return { { "dashboard-nvim", enabled = false }, { "folke/tokyonight.nvim", enabled = false }, + { "folke/snacks.nvim", opts = { dashboard = { enabled = false } } }, } diff --git a/.config/nvim-lazy/lua/plugins/example.lua b/.config/nvim-lazy/lua/plugins/example.lua index 4ad9825..17f53d6 100644 --- a/.config/nvim-lazy/lua/plugins/example.lua +++ b/.config/nvim-lazy/lua/plugins/example.lua @@ -157,7 +157,11 @@ return { "nvim-lualine/lualine.nvim", event = "VeryLazy", opts = function(_, opts) - table.insert(opts.sections.lualine_x, "😄") + table.insert(opts.sections.lualine_x, { + function() + return "😄" + end, + }) end, }, diff --git a/.config/nvim-lazy/lua/plugins/fzf.lua b/.config/nvim-lazy/lua/plugins/fzf.lua deleted file mode 100644 index 0516726..0000000 --- a/.config/nvim-lazy/lua/plugins/fzf.lua +++ /dev/null @@ -1,225 +0,0 @@ -local rg_cmd = - 'rg --files -l ".*" --follow --color=never --sortr=modified -g "!.git/" -g "!*.png" -g "!node_modules/" -g "!*.jpeg" -g "!*.jpg" -g "!*.ico" -g "!*.exe" -g "!*.out"' - -local function fzf_create_file() - local fzf = require("fzf-lua") - local path = require("fzf-lua.path") - local uv = vim.uv or vim.loop - local cmd = "fd -t d . " .. uv.cwd() - local function get_full_path(selected) - if #selected < 1 then - return - end - local entry = path.entry_to_file(selected[1], { cwd = uv.cwd() }) - if entry.path == "" then - return - end - - local fullpath = entry.path or entry.uri and entry.uri:match("^%a+://(.*)") - if not path.is_absolute(fullpath) then - fullpath = path.join({ uv.cwd(), fullpath }) - end - return fullpath - end - - --- This will create a file in the selected directory - ---@param split_dir ?"e" | "vs" | "sp" | "tabe" Default is "e" - ---@return function - local function perform_action(split_dir) - split_dir = split_dir or "e" - return function(selected) - local fullpath = get_full_path(selected) - vim.ui.input({ prompt = "File Name: " }, function(name) - if name == nil then - return - end - vim.cmd(string.format("%s %s%s", split_dir, fullpath, name)) - vim.cmd("w ++p") - end) - end - end - - fzf.fzf_exec(cmd, { - defaults = {}, - prompt = "Create> ", - cwd = uv.cwd(), - cwd_prompt_shorten_len = 32, - cwd_prompt_shorten_val = 1, - fzf_opts = { - ["--tiebreak"] = "end", - ["--preview-window"] = "nohidden,50%", - ["--preview"] = { - type = "cmd", - fn = function(selected) - local fullpath = get_full_path(selected) - local ls_cmd = "command ls --color -hsv1F --group-directories-first" - local eza_cmd = - "eza -al --color=always --icons=always --group-directories-first --no-user --no-permissions --no-time" - return string.format("%s %s", vim.fn.executable("eza") == 1 and eza_cmd or ls_cmd, fullpath) - end, - }, - }, - fn_transform = function(x) - return fzf.make_entry.file(x, { file_icons = true, color_icons = true, cwd = uv.cwd() }) - end, - actions = { - ["default"] = perform_action(), - ["ctrl-x"] = perform_action("sp"), - ["ctrl-v"] = perform_action("vs"), - ["ctrl-t"] = perform_action("tabe"), - }, - }) -end - -local function project_files(default_opts) - local opts = vim.tbl_extend("force", { - fzf_opts = { - ["--layout"] = "reverse", - ["--info"] = "inline-right", - ["--tiebreak"] = "index", - }, - }, default_opts or {}) - local fzf = require("fzf-lua") - if vim.b.gitsigns_head then - -- Either use one of the following .local/bin/myscripts/sort_file.rs or .local/bin/myscripts/sorting_filev3.cpp - -- compile and then add to `PATH` - --`sort_files` is a program that sorts files based on modified time, recently modified files will be shown first - if vim.fn.executable("sort_files") == 1 then - opts.cmd = "git ls-files --exclude-standard --cached --others | sort_files" -- '--others' is used to show untracked files - else - vim.cmd('echohl WarningMsg | echo "`sort_files` not found in `PATH`. Please compile the program" | echohl None') - end - fzf.git_files(opts) - else - opts.cmd = rg_cmd - fzf.files(opts) - end -end - ----@type LazySpec -return { - "ibhagwan/fzf-lua", - keys = { - { - "", - project_files, - desc = "[F]iles", - }, - { - "fn", - function() - require("fzf-lua").files({ cwd = vim.fn.stdpath("config") }) - end, - desc = "Config [N]eovim", - }, - { - "fd", - function() - require("fzf-lua").git_files({ cwd = vim.fn.expand("~/Documents/dotfiles/") }) - end, - desc = "Config [D]otfiles", - }, - { - "fc", - fzf_create_file, - desc = "Create File", - }, - }, - opts = function(_, opts) - local actions = require("fzf-lua.actions") - local m_keys = { - ["alt-enter"] = actions.file_tabedit, - ["ctrl-x"] = actions.file_split, - ["ctrl-q"] = actions.file_edit_or_qf, - } - opts.defaults = { formatter = { "path.filename_first", 2 } } - opts.keymap = vim.tbl_deep_extend("force", opts.keymap or {}, { - fzf = { - ["alt-a"] = "toggle-all", - ["alt-p"] = "toggle-preview", - ["alt-j"] = "preview-down", - ["alt-k"] = "preview-up", - ["ctrl-q"] = "select-all+accept", - }, - }) - opts.winopts = vim.tbl_extend("force", opts.winopts or {}, { - preview = { - default = "bat", -- override the default previewer? - }, - }) - opts.fzf_opts = vim.tbl_extend("force", opts.fzf_opts or {}, { - ["--layout"] = "reverse", - ["--info"] = "inline-right", - -- ['--tiebreak'] = 'end', - }) - opts.files = vim.tbl_deep_extend("force", opts.files or {}, { - fzf_opts = { ["--layout"] = "reverse", ["--tiebreak"] = "chunk" }, - winopts = { - height = 0.55, - width = 0.65, - row = 0.52, - col = 0.47, - preview = { - ---@type 'wrap'|'nowrap' - wrap = "nowrap", - ---@type 'hidden'|'nohidden' - hidden = "hidden", - }, - }, - actions = m_keys, - }) - opts.git = vim.tbl_deep_extend("force", opts.git or {}, { - files = { - cmd = "git ls-files --exclude-standard --cached --others", -- '--others' is used to show untracked files - actions = m_keys, - winopts = { height = 0.55, width = 0.65, row = 0.52, col = 0.47 }, - previewer = false, - }, - bcommits = { actions = m_keys, winopts = { preview = { layout = "vertical", vertical = "up:60%" } } }, - commits = { actions = m_keys, winopts = { preview = { layout = "vertical", vertical = "up:60%" } } }, - branches = { - winopts = { preview = { layout = "vertical", vertical = "up:60%" } }, - cmd = "git branch --all --color | sed 's#remotes/origin/##g'", - cmd_add = { "git", "checkout", "-b" }, - }, - }) - opts.buffers = vim.tbl_deep_extend("force", opts.buffers or {}, { - ignore_current_buffer = true, - winopts = { preview = { layout = "vertical", vertical = "up:60%" } }, - actions = vim.tbl_extend("force", m_keys, { - ["ctrl-d"] = actions.buf_delete, - ["ctrl-x"] = actions.buf_split, - ["ctrl-v"] = actions.buf_vsplit, - ["ctrl-q"] = actions.buf_edit_or_qf, - }), - }) - opts.grep = vim.tbl_deep_extend("force", opts.grep or {}, { - winopts = { preview = { layout = "vertical", vertical = "up:60%" } }, - actions = m_keys, - rg_glob = true, - glob_flah = "--glob", - glob_separator = "%s%-%-", - }) - opts.blines = vim.tbl_deep_extend("force", opts.blines or {}, { - actions = m_keys, - no_term_buffers = false, - winopts = { preview = { layout = "vertical", vertical = "up:60%" } }, - }) - opts.lines = vim.tbl_deep_extend("force", opts.lines or {}, { - actions = m_keys, - winopts = { preview = { layout = "vertical", vertical = "up:60%" } }, - }) - opts.lsp = vim.tbl_deep_extend("force", opts.lsp or {}, { - definitions = { jump_to_single_result = true, actions = m_keys }, - references = { ignore_current_line = true, actions = m_keys }, - symbols = { actions = m_keys, winopts = { preview = { layout = "vertical", vertical = "up:60%" } } }, - finder = { actions = m_keys, winopts = { preview = { layout = "vertical", vertical = "up:60%" } } }, - code_actions = { actions = m_keys, winopts = { preview = { layout = "vertical", vertical = "up:60%" } } }, - }) - - local ok_dressing, _ = pcall(require, "dressing") - if not ok_dressing then - require("fzf-lua").register_ui_select() - end - end, -} diff --git a/.config/nvim-lazy/lua/plugins/grapple.lua b/.config/nvim-lazy/lua/plugins/grapple.lua index 1660225..d138a6a 100644 --- a/.config/nvim-lazy/lua/plugins/grapple.lua +++ b/.config/nvim-lazy/lua/plugins/grapple.lua @@ -13,7 +13,8 @@ return { status = false, }, keys = { - { "a", "Grapple toggle", desc = "Tag a file" }, + { "A", "Grapple toggle", desc = "Tag a file" }, + { "", "Grapple toggle", desc = "Tag a file" }, { "", "Grapple toggle_tags", desc = "Toggle tags menu" }, { "'1", "Grapple select index=1", desc = "Select first tag" }, diff --git a/.config/nvim-lazy/lua/plugins/lsps/mappings.lua b/.config/nvim-lazy/lua/plugins/lsp/mappings.lua similarity index 100% rename from .config/nvim-lazy/lua/plugins/lsps/mappings.lua rename to .config/nvim-lazy/lua/plugins/lsp/mappings.lua diff --git a/.config/nvim-lazy/lua/plugins/lsps/php.lua b/.config/nvim-lazy/lua/plugins/lsps/php.lua deleted file mode 100644 index ac6e9a4..0000000 --- a/.config/nvim-lazy/lua/plugins/lsps/php.lua +++ /dev/null @@ -1,66 +0,0 @@ ----@type LazySpec -return { - { - "williamboman/mason.nvim", - opts = { - ensure_installed = { - "phpcbf", - "phpcs", - "php-cs-fixer", - "blade-formatter", - "phpactor", - "php-debug-adapter", - }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - opts = function(_, opts) - local parser_config = require("nvim-treesitter.parsers").get_parser_configs() - - parser_config.blade = { - install_info = { - url = "https://github.com/EmranMR/tree-sitter-blade", - files = { "src/parser.c" }, - branch = "main", - }, - filetype = "blade", - } - - vim.filetype.add({ - pattern = { - [".*%.blade%.php"] = "blade", - }, - }) - opts.ensure_installed = vim.tbl_extend("force", opts.ensure_installed, { - "php", - "phpdoc", - "blade", - }) - return opts - end, - }, - -- { - -- "mfussenegger/nvim-dap", - -- optional = true, - -- opts = function() - -- local dap = require("dap") - -- - -- dap.adapters.php = { - -- type = "executable", - -- command = require("mason-registry").get_package("php-debug-adapter"):get_install_path() .. "php-debug-adapter", - -- -- command = 'node', - -- -- args = { require('mason-registry').get_package('php-debug-adapter'):get_install_path() .. '/out/phpDebug.js' } - -- } - -- - -- dap.configurations.php = { - -- { - -- type = "php", - -- request = "launch", - -- name = "Listen for Xdebug", - -- port = 9000, - -- }, - -- } - -- end, - -- }, -} diff --git a/.config/nvim-lazy/lua/plugins/lsps/typescript-errors-translate.lua b/.config/nvim-lazy/lua/plugins/lsps/typescript-errors-translate.lua deleted file mode 100644 index 6e469a3..0000000 --- a/.config/nvim-lazy/lua/plugins/lsps/typescript-errors-translate.lua +++ /dev/null @@ -1,11 +0,0 @@ ----@type LazySpec -return { - "dmmulroy/ts-error-translator.nvim", - ft = { - "typescript", - "typescriptreact", - "javascript", - "javascriptreact", - }, - opts = {}, -} diff --git a/.config/nvim-lazy/lua/plugins/mini/misc.lua b/.config/nvim-lazy/lua/plugins/mini/misc.lua deleted file mode 100644 index 9a59e71..0000000 --- a/.config/nvim-lazy/lua/plugins/mini/misc.lua +++ /dev/null @@ -1,26 +0,0 @@ ----@type LazySpec -return { - 'echasnovski/mini.misc', - version = '*', - event = 'BufWinEnter', - keys = { - { - 'wm', - function() - require('mini.misc').zoom() - end, - desc = 'Window zoom', - }, - { - 'm', - function() - require('mini.misc').zoom() - end, - desc = 'Window zoom', - }, - }, - config = function() - require('mini.misc').setup({}) - require('mini.misc').setup_restore_cursor() - end, -} diff --git a/.config/nvim-lazy/lua/plugins/mini/surround.lua b/.config/nvim-lazy/lua/plugins/mini/surround.lua new file mode 100644 index 0000000..5d80d83 --- /dev/null +++ b/.config/nvim-lazy/lua/plugins/mini/surround.lua @@ -0,0 +1,26 @@ +---@type LazySpec +return { + "echasnovski/mini.surround", + enabled = true, + keys = { + { "gz", "", desc = "+surround" }, + { "ys", mode = { "n", "v" }, desc = "Surround add" }, + { "ds", mode = { "n" }, desc = "Surround delete" }, + { "cs", mode = { "n" }, desc = "Surround replace" }, + { "gzf", mode = { "n" }, desc = "Surround find" }, + { "gzh", mode = { "n" }, desc = "Surround highlight" }, + }, + opts = { + search_method = "cover_or_prev", + n_lines = 500, + mappings = { + add = "ys", -- Add surrounding in Normal and Visual modes + delete = "ds", -- Delete surrounding + replace = "cs", -- Replace surrounding + find = "gzf", -- Find surrounding (to the right) + find_left = "sF", -- Find surrounding (to the left) + highlight = "gzh", -- Highlight surrounding + update_n_lines = "gzn", -- Update `n_lines` + }, + }, +} diff --git a/.config/nvim-lazy/lua/plugins/neogen.lua b/.config/nvim-lazy/lua/plugins/neogen.lua index 31a78d6..ceaaf27 100644 --- a/.config/nvim-lazy/lua/plugins/neogen.lua +++ b/.config/nvim-lazy/lua/plugins/neogen.lua @@ -3,6 +3,7 @@ return { "danymat/neogen", cmd = "Neogen", keys = { + { "n", "", desc = "+neogen" }, { "nn", "Neogen", desc = "Default" }, { "nt", "Neogen type", desc = "Type" }, { "nf", "Neogen file", desc = "File" }, diff --git a/.config/nvim-lazy/lua/plugins/neotree.lua b/.config/nvim-lazy/lua/plugins/neotree.lua index c656554..27fefda 100644 --- a/.config/nvim-lazy/lua/plugins/neotree.lua +++ b/.config/nvim-lazy/lua/plugins/neotree.lua @@ -2,11 +2,19 @@ local cmd = "trash" if vim.fn.executable("trash-put") == 1 then cmd = "trash-put" end + ---@type LazySpec return { "nvim-neo-tree/neo-tree.nvim", dependencies = { - "antosha417/nvim-lsp-file-operations", + { + "antosha417/nvim-lsp-file-operations", + config = function() + LazyVim.on_load("neo-tree.nvim", function() + require("lsp-file-operations").setup({}) + end) + end, + }, { "s1n7ax/nvim-window-picker", version = "2.*", @@ -29,6 +37,7 @@ return { end, }, }, + opts = function(_, opts) opts.window.mappings["l"] = "open" -- opts.window.mappings['l'] = 'open' @@ -64,9 +73,4 @@ return { }) return opts end, - config = function(_, opts) - require("neo-tree").setup(opts) - - require("lsp-file-operations").setup({}) - end, } diff --git a/.config/nvim-lazy/lua/plugins/nvim-lint.lua b/.config/nvim-lazy/lua/plugins/nvim-lint.lua deleted file mode 100644 index 67adef5..0000000 --- a/.config/nvim-lazy/lua/plugins/nvim-lint.lua +++ /dev/null @@ -1,52 +0,0 @@ ----@type LazySpec -return { - { - "williamboman/mason.nvim", - opts = { - PATH = "append", - ensure_installed = { - "eslint_d", - "shellcheck", - "golangci-lint", - }, - }, - }, - - { - "mfussenegger/nvim-lint", - opts = { - linters_by_ft = { - fish = { "fish" }, - bash = { "shellcheck" }, - sh = { "shellcheck" }, - svelte = { "eslint_d" }, - javascript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, - typescript = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - vue = { "eslint_d" }, - astro = { "eslint_d" }, - go = { "golangcilint" }, - php = { "phpcs" }, - }, - linters = { - -- -- Example of using selene only when a selene.toml file is present - eslint_d = { - condition = function(ctx) - return vim.fs.find({ - ".eslintrc", - ".eslintrc.js", - ".eslintrc.cjs", - ".eslintrc.yaml", - ".eslintrc.yml", - ".eslintrc.json", - "eslint.config.js", - "eslint.config.mjs", - "eslint.config.cjs", - }, { path = ctx.filename, upward = true })[1] - end, - }, - }, - }, - }, -} diff --git a/.config/nvim-lazy/lua/plugins/session.lua b/.config/nvim-lazy/lua/plugins/session.lua deleted file mode 100644 index 3f49631..0000000 --- a/.config/nvim-lazy/lua/plugins/session.lua +++ /dev/null @@ -1,90 +0,0 @@ -local au_group = vim.api.nvim_create_augroup("sp_sessions", { clear = true }) ----@type LazySpec -return { - { - "Shatur/neovim-session-manager", - event = "BufWinEnter", - enabled = false, - cmd = "SessionManager", - keys = { - { "Sl", "SessionManager! load_session", desc = "[S]ession [L]oad" }, - { "SL", "SessionManager! load_last_session", desc = "[S]ession [L]oad Last" }, - { - "Sc", - "SessionManager! load_current_dir_session", - desc = "[S]ession Load Current Directory", - }, - }, - dependencies = { - "nvim-lua/plenary.nvim", - }, - config = function() - local session_manager = require("session_manager") - session_manager.setup({ - -- Possible values: Disabled, CurrentDir, LastSession - autoload_mode = require("session_manager.config").AutoloadMode.CurrentDir, - }) - end, - }, - { - "stevearc/resession.nvim", - enabled = true, - lazy = true, - init = function() - local function get_session_name() - local name = vim.fn.getcwd() - local branch = vim.trim(vim.fn.system("git branch --show-current")) - if vim.v.shell_error == 0 then - return name .. branch - else - return name - end - end - -- vim.api.nvim_create_autocmd("UIEnter", { - -- desc = "Load session on VimEnter", - -- group = au_group, - -- callback = function() - -- -- Only load the session if nvim was started with no args - -- if vim.fn.argc(-1) == 0 then - -- vim.schedule(function() - -- require("resession").load(get_session_name(), { dir = "dirsession", silence_errors = true }) - -- end) - -- end - -- end, - -- nested = true, - -- }) - vim.api.nvim_create_autocmd("VimLeavePre", { - desc = "Save session on VimLeavePre", - group = au_group, - callback = function() - print("Saving session") - require("resession").save(get_session_name(), { dir = "dirsession", notify = false }) - end, - }) - end, - opts = {}, - config = function(_, opts) - require("resession").setup(opts) - end, - keys = { - { "Ss", 'lua require("resession").save()', desc = "[S]ession [S]ave" }, - { "Sd", 'lua require("resession").delete()', desc = "[S]ession [D]elete" }, - { - "Sl", - function() - vim.ui.select( - require("resession").list({ dir = "dirsession" }), - { prompt = "Select Session> " }, - function(selected_session) - if selected_session == nil or not selected_session then - return - end - require("resession").load(selected_session, { dir = "dirsession", silence_errors = true }) - end - ) - end, - desc = "[S]ession [L]ist", - }, - }, - }, -} diff --git a/.config/nvim-lazy/lua/plugins/sessions.lua b/.config/nvim-lazy/lua/plugins/sessions.lua new file mode 100644 index 0000000..0f7d70d --- /dev/null +++ b/.config/nvim-lazy/lua/plugins/sessions.lua @@ -0,0 +1,19 @@ +---@type LazySpec +return { + "rmagatti/auto-session", + lazy = false, + + ---enables autocomplete for opts + ---@module "auto-session" + ---@type AutoSession.Config + opts = { + suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, + use_git_branch = true, + }, + keys = { + { "S", "", desc = "+[S]ession" }, + { "Ss", "SessionSave", desc = "[S]ave" }, + { "Sl", "AutoSession search", desc = "[L]ist" }, + { "Sd", "AutoSession delete", desc = "[D]elte" }, + }, +} diff --git a/.config/nvim-lazy/lua/plugins/surround.lua b/.config/nvim-lazy/lua/plugins/surround.lua deleted file mode 100644 index 9466a42..0000000 --- a/.config/nvim-lazy/lua/plugins/surround.lua +++ /dev/null @@ -1,6 +0,0 @@ ----@type LazySpec -return { - "kylechui/nvim-surround", - opts = {}, - keys = { "ys", "ds", "cs", { "S", mode = "x", silent = false } }, -} diff --git a/.config/nvim-lazy/lua/plugins/telescope.lua b/.config/nvim-lazy/lua/plugins/telescope.lua new file mode 100644 index 0000000..6f54cdd --- /dev/null +++ b/.config/nvim-lazy/lua/plugins/telescope.lua @@ -0,0 +1,154 @@ +local au_telescope = vim.api.nvim_create_augroup("au_telescope", { clear = true }) +local dropdown = { + layout_strategy = "vertical", + layout_config = { width = 0.6, preview_cutoff = 1, prompt_position = "top" }, +} +local function filename_first(_, path) + local tail = vim.fs.basename(path) + local parent = vim.fs.dirname(path) + if parent == "." then + return tail + end + return string.format("%s\t\t%s", tail, parent) +end +---@type LazySpec +return { + "fdschmidt93/telescope-egrepify.nvim", + dependencies = { + { + "nvim-telescope/telescope.nvim", + opts = { + defaults = { + sorting_strategy = "ascending", + layout_config = { + horizontal = { prompt_position = "top", preview_width = 0.40 }, + vertical = { mirror = false }, + width = 0.87, + height = 0.80, + preview_cutoff = 120, + }, + mappings = { + i = { + [""] = function(...) + require("telescope.actions").move_selection_next(...) + end, + [""] = function(...) + require("telescope.actions").move_selection_previous(...) + end, + [""] = function(...) + require("telescope.actions").cycle_history_next(...) + end, + [""] = function(...) + require("telescope.actions").cycle_history_prev(...) + end, + [""] = function(...) + require("telescope.actions").select_tab(...) + end, + [""] = function(...) + require("telescope.actions").select_tab(...) + end, + [""] = function(...) + require("telescope.actions").close(...) + end, + [""] = function(...) + require("telescope.actions").toggle_preview(...) + end, + }, + }, + }, + extensions = { + egrepify = { + prefixes = { + --- trying to use flag `--type` + [">"] = { + flag = "type", + cb = function(input) + -- check if the input has any commas + if string.find(input, ",") then + return string.format([[{%s}]], input) + end + return string.format([[%s]], input) + end, + }, + ["<"] = { + flag = "type-not", + cb = function(input) + -- check if the input has any commas + if string.find(input, ",") then + return string.format([[{%s}]], input) + end + return string.format([[%s]], input) + end, + }, + }, + }, + }, + pickers = { + find_files = { path_display = filename_first, previewer = false }, + buffers = { + ignore_current_buffer = true, + sort_lastused = true, + mappings = { + i = { [""] = "delete_buffer" }, + n = { d = "delete_buffer" }, + }, + }, + lsp_references = dropdown, + lsp_definitions = dropdown, + git_branches = dropdown, + git_commits = dropdown, + git_bcommits = dropdown, + lsp_document_symbols = dropdown, + lsp_workspace_symbols = dropdown, + grep_string = vim.tbl_extend("force", dropdown, { + path_display = { "truncate" }, + }), + }, + }, + }, + }, + config = function() + vim.api.nvim_create_autocmd("FileType", { + pattern = "TelescopeResults", + group = au_telescope, + callback = function(ctx) + vim.api.nvim_buf_call(ctx.buf, function() + vim.fn.matchadd("TelescopeParent", "\t\t.*$") + vim.api.nvim_set_hl(0, "TelescopeParent", { link = "Comment" }) + end) + end, + }) + LazyVim.on_load("telescope.nvim", function() + require("telescope").load_extension("egrepify") + end) + end, + keys = { + { "", LazyVim.pick("files"), desc = "Find Files (Root Dir)" }, + { "fn", LazyVim.pick.config_files(), desc = "Find Config File" }, + { + "fd", + LazyVim.pick("files", { cwd = vim.fn.expand("~/Documents/dotfiles/.config/") }), + desc = "Find Dotfiles", + }, + { "fN", LazyVim.pick("files", { cwd = vim.fn.stdpath("data") .. "/lazy" }), desc = "Find Data files" }, + { "fs", "Telescope egrepify", desc = "Egrepify" }, + { "sf", "Telescope egrepify", desc = "Egrepify" }, + }, + -- -- NOTE: in insert-mode(and when fzf-native plugin is installed) you can use to refine the results i.e further search on searched results + -- opts.defaults.mappings.i = vim.tbl_extend("force", opts.defaults.mappings.i, { + -- [""] = actions.move_selection_next, + -- [""] = actions.move_selection_previous, + -- [""] = actions.cycle_history_next, + -- [""] = actions.cycle_history_prev, + -- [""] = actions.select_tab, + -- [""] = actions.close, + -- [""] = action_layout.toggle_preview, + -- [""] = actions.smart_send_to_qflist + actions.open_qflist, + -- }) + -- opts.defaults.mappings.n = vim.tbl_extend("force", opts.defaults.mappings.n, { + -- q = actions.close, + -- [""] = action_layout.toggle_preview, + -- [""] = actions.toggle_selection, + -- }) + -- +} diff --git a/.config/nvim-lazy/lua/plugins/template-string.lua b/.config/nvim-lazy/lua/plugins/template-string.lua new file mode 100644 index 0000000..b1e32a8 --- /dev/null +++ b/.config/nvim-lazy/lua/plugins/template-string.lua @@ -0,0 +1,8 @@ +---@type LazySpec +return { + "axelvc/template-string.nvim", + event = "InsertEnter", + opts = { + remove_template_string = true, + }, +} diff --git a/.config/nvim-lazy/lua/plugins/tests.lua b/.config/nvim-lazy/lua/plugins/tests.lua deleted file mode 100644 index 8a2653a..0000000 --- a/.config/nvim-lazy/lua/plugins/tests.lua +++ /dev/null @@ -1,50 +0,0 @@ -local group = vim.api.nvim_create_augroup("sp_tests", { clear = true }) - -vim.api.nvim_create_autocmd("BufReadPost", { - pattern = { - "*.test.js", - "*.spec.js", - "*.test.ts", - "*.spec.ts", - "*.test.jsx", - "*.spec.jsx", - "*.test.tsx", - "*.spec.tsx", - }, - desc = "Neotest binds", - callback = function(args) - local bufnr = args.buf - vim.keymap.set("n", "tw", function() - require("neotest").run.run({ vim.fn.expand("%"), jestCommand = "jest --watch " }) - end, { - buffer = bufnr, - description = "Run test in watch mode(current file)", - }) - vim.keymap.set("n", "tW", function() - require("neotest").run.run({ jestCommand = "jest --watch " }) - end, { - buffer = bufnr, - description = "Run test in watch mode(project)", - }) - end, -}) - ----@type LazySpec -return { - "nvim-neotest/neotest", - dependencies = { - "marilari88/neotest-vitest", - "nvim-neotest/neotest-jest", - }, - opts = { - adapters = { - ["neotest-jest"] = {}, - ["neotest-vitest"] = { - -- Filter directories when searching for test files. Useful in large projects (see Filter directories notes). - filter_dir = function(name, rel_path, root) - return name ~= "node_modules" - end, - }, - }, - }, -} diff --git a/.config/nvim-lazy/lua/plugins/colorscheme.lua b/.config/nvim-lazy/lua/plugins/theme.lua similarity index 100% rename from .config/nvim-lazy/lua/plugins/colorscheme.lua rename to .config/nvim-lazy/lua/plugins/theme.lua index 80f7ca6..e1af4b9 100644 --- a/.config/nvim-lazy/lua/plugins/colorscheme.lua +++ b/.config/nvim-lazy/lua/plugins/theme.lua @@ -5,27 +5,27 @@ return { opts = { colorscheme = "nordic" }, }, { - "rebelot/kanagawa.nvim", - enabled = false, + "AlexvZyl/nordic.nvim", + enabled = true, event = "VimEnter", config = function() - require("config.kangawa") + require("config.nordic") end, }, { - "blazkowolf/gruber-darker.nvim", + "rebelot/kanagawa.nvim", enabled = false, event = "VimEnter", config = function() - require("config.gruber-darker") + require("config.kangawa") end, }, { - "AlexvZyl/nordic.nvim", - enabled = true, + "blazkowolf/gruber-darker.nvim", + enabled = false, event = "VimEnter", config = function() - require("config.nordic") + require("config.gruber-darker") end, }, } diff --git a/.config/nvim-lazy/lua/plugins/yazi.lua b/.config/nvim-lazy/lua/plugins/yazi.lua index b04990a..52d276a 100644 --- a/.config/nvim-lazy/lua/plugins/yazi.lua +++ b/.config/nvim-lazy/lua/plugins/yazi.lua @@ -1,15 +1,15 @@ ---@type LazySpec return { - 'mikavilpas/yazi.nvim', + "mikavilpas/yazi.nvim", version = false, dependencies = { - 'nvim-lua/plenary.nvim', + "nvim-lua/plenary.nvim", }, - cmd = 'Yazi', + cmd = "Yazi", keys = { - { '-', 'Yazi', desc = 'Open the file manager' }, - { 'of', 'Yazi toggle', desc = 'Toggle Yazi' }, - { '\\', 'Yazi cwd', desc = 'File Manager in cwd' }, + { "", "Yazi toggle", desc = "Togggle Yazi" }, + { "-", "Yazi", desc = "Open Yazi at the current file" }, + { "tf", "Yazi cwd", desc = "File Manager in cwd(Yazi)" }, }, ---@type YaziConfig opts = { @@ -21,8 +21,8 @@ return { --- What should be done when the user wants to grep in a directory ---@param directory string grep_in_directory = function(directory) - require('fzf-lua').live_grep_native({ - prompt = 'Search in ' .. directory, + require("telescope.builtin").live_grep({ + prompt = "Search in " .. directory, cwd = directory, }) end, diff --git a/.config/nvim/lua/plugins/avante.lua b/.config/nvim/lua/plugins/avante.lua index 720374d..d4013bb 100644 --- a/.config/nvim/lua/plugins/avante.lua +++ b/.config/nvim/lua/plugins/avante.lua @@ -4,7 +4,7 @@ local function get_age_credentials(secret_file) end local identity = vim.fn.expand '$HOME/.config/age/identity.txt' local secret = vim.fn.expand('$HOME/.config/age/' .. secret_file) - return require('age').get(identity, secret) + return require('age').get(secret, identity) end ---@type LazySpec diff --git a/.config/nvim/lua/plugins/config/astrolsp.lua b/.config/nvim/lua/plugins/config/astrolsp.lua index 5a53665..5b39ea7 100644 --- a/.config/nvim/lua/plugins/config/astrolsp.lua +++ b/.config/nvim/lua/plugins/config/astrolsp.lua @@ -51,6 +51,7 @@ M.opts = { mappings = { n = { K = { vim.lsp.buf.hover, desc = 'Hover', cond = 'textDocument/hover' }, + gl = { vim.diagnostic.open_float, desc = 'Hover diagnostics' }, ['le'] = { vim.diagnostic.open_float, desc = 'Hover diagnostics' }, ['ld'] = { vim.lsp.buf.definition, diff --git a/.config/nvim/lua/plugins/config/telescope.lua b/.config/nvim/lua/plugins/config/telescope.lua index b8cb497..2a4e918 100644 --- a/.config/nvim/lua/plugins/config/telescope.lua +++ b/.config/nvim/lua/plugins/config/telescope.lua @@ -328,11 +328,36 @@ M.config = function() }, }, ['ui-select'] = require('telescope.themes').get_dropdown({}), + egrepify = { + prefixes = { + ['>'] = { + flag = 'type', + cb = function(input) + -- check if the input has any commas + if string.find(input, ',') then + return string.format([[{%s}]], input) + end + return string.format([[%s]], input) + end, + }, + ['<'] = { + flag = 'type-not', + cb = function(input) + -- check if the input has any commas + if string.find(input, ',') then + return string.format([[{%s}]], input) + end + return string.format([[%s]], input) + end, + }, + }, + }, }, }) require('telescope').load_extension 'zf-native' require('telescope').load_extension 'ui-select' require('telescope').load_extension 'egrepify' + vim.lsp.handlers['textDocument/definition'] = builtin.lsp_definitions vim.lsp.handlers['textDocument/typeDefinition'] = builtin.lsp_type_definitions vim.lsp.handlers['textDocument/implementation'] = builtin.lsp_implementations diff --git a/.config/nvim/lua/plugins/config/tree-sitter.lua b/.config/nvim/lua/plugins/config/tree-sitter.lua index 97e232b..d5dbebc 100644 --- a/.config/nvim/lua/plugins/config/tree-sitter.lua +++ b/.config/nvim/lua/plugins/config/tree-sitter.lua @@ -48,25 +48,25 @@ configs.setup({ }, }, textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = { query = '@class.inner', desc = 'Select inner part of a class region' }, - ['al'] = { query = '@scope', query_group = 'locals', desc = 'Select language scope' }, - ['a/'] = { query = '@comment.outer', desc = 'Select outer comment' }, - ['i/'] = { query = '@comment.inner', desc = 'Select inner comment' }, - }, - selection_modes = { - ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise - ['@class.outer'] = '', -- blockwise - }, - include_surrounding_whitespace = true, - }, + -- select = { + -- enable = true, + -- lookahead = true, + -- keymaps = { + -- ['af'] = '@function.outer', + -- ['if'] = '@function.inner', + -- ['ac'] = '@class.outer', + -- ['ic'] = { query = '@class.inner', desc = 'Select inner part of a class region' }, + -- ['al'] = { query = '@scope', query_group = 'locals', desc = 'Select language scope' }, + -- ['a/'] = { query = '@comment.outer', desc = 'Select outer comment' }, + -- ['i/'] = { query = '@comment.inner', desc = 'Select inner comment' }, + -- }, + -- selection_modes = { + -- ['@parameter.outer'] = 'v', -- charwise + -- ['@function.outer'] = 'V', -- linewise + -- ['@class.outer'] = '', -- blockwise + -- }, + -- include_surrounding_whitespace = true, + -- }, move = { enable = true, set_jumps = true, -- whether to set jumps in the jumplist diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index 373194e..fc90fc0 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -7,8 +7,8 @@ return { }, -- stylua: ignore keys = { - { "S", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, - { "S", mode = { "n", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, + { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, + { "S", mode = { "n", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" }, { "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" }, { "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" }, { "", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" }, diff --git a/.config/nvim/lua/plugins/mini/ai.lua b/.config/nvim/lua/plugins/mini/ai.lua index 4c32bad..b760a08 100644 --- a/.config/nvim/lua/plugins/mini/ai.lua +++ b/.config/nvim/lua/plugins/mini/ai.lua @@ -3,7 +3,7 @@ return { 'echasnovski/mini.ai', version = '*', event = { 'BufReadPost', 'BufNewFile' }, - enabled = false, + enabled = true, dependencies = { { 'echasnovski/mini.extra', @@ -18,22 +18,22 @@ return { local ai = require 'mini.ai' local gen_ai_spec = require('mini.extra').gen_ai_spec return { - search_method = 'cover_or_prev', - n_lines = 100, - o = ai.gen_spec.treesitter({ -- code block - a = { '@block.outer', '@conditional.outer', '@loop.outer' }, - i = { '@block.inner', '@conditional.inner', '@loop.inner' }, - }), - f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }), -- function - c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }), -- class - t = { '<([%p%w]-)%f[^<%w][^<>]->.-', '^<.->().*()$' }, -- tags - B = gen_ai_spec.buffer(), - D = gen_ai_spec.diagnostic(), - L = gen_ai_spec.line(), + n_lines = 500, + custom_textobjects = { + o = ai.gen_spec.treesitter({ -- code block + a = { '@block.outer', '@conditional.outer', '@loop.outer' }, + i = { '@block.inner', '@conditional.inner', '@loop.inner' }, + }), + f = ai.gen_spec.treesitter({ a = '@function.outer', i = '@function.inner' }), -- function + c = ai.gen_spec.treesitter({ a = '@class.outer', i = '@class.inner' }), -- class + t = { '<([%p%w]-)%f[^<%w][^<>]->.-', '^<.->().*()$' }, -- tags + B = gen_ai_spec.buffer(), + D = gen_ai_spec.diagnostic(), + L = gen_ai_spec.line(), + }, } end, config = function(_, opts) - vim.print(opts) require('mini.ai').setup(opts) end, } diff --git a/.config/nvim/lua/plugins/mini/pairs.lua b/.config/nvim/lua/plugins/mini/pairs.lua new file mode 100644 index 0000000..a8037b0 --- /dev/null +++ b/.config/nvim/lua/plugins/mini/pairs.lua @@ -0,0 +1,54 @@ +---@type LazySpec +return { + 'echasnovski/mini.pairs', + event = { 'InsertEnter', 'CmdlineEnter' }, + opts = { + modes = { insert = true, command = true, terminal = false }, + -- skip autopair when next character is one of these + skip_next = [=[[%w%%%'%[%"%.%`%$]]=], + -- skip autopair when the cursor is inside these treesitter nodes + skip_ts = { 'string' }, + -- skip autopair when next character is closing pair + -- and there are more closing pairs than opening pairs + skip_unbalanced = true, + -- better deal with markdown code blocks + markdown = true, + }, + config = function(_, opts) + local pairs = require 'mini.pairs' + pairs.setup(opts) + local open = pairs.open + pairs.open = function(pair, neigh_pattern) + if vim.fn.getcmdline() ~= '' then + return open(pair, neigh_pattern) + end + local o, c = pair:sub(1, 1), pair:sub(2, 2) + local line = vim.api.nvim_get_current_line() + local cursor = vim.api.nvim_win_get_cursor(0) + local next = line:sub(cursor[2] + 1, cursor[2] + 1) + local before = line:sub(1, cursor[2]) + if opts.markdown and o == '`' and vim.bo.filetype == 'markdown' and before:match '^%s*``' then + return '`\n```' .. vim.api.nvim_replace_termcodes('', true, true, true) + end + if opts.skip_next and next ~= '' and next:match(opts.skip_next) then + return o + end + if opts.skip_ts and #opts.skip_ts > 0 then + local ok, captures = pcall(vim.treesitter.get_captures_at_pos, 0, cursor[1] - 1, math.max(cursor[2] - 1, 0)) + for _, capture in ipairs(ok and captures or {}) do + if vim.tbl_contains(opts.skip_ts, capture.capture) then + return o + end + end + end + if opts.skip_unbalanced and next == c and c ~= o then + local _, count_open = line:gsub(vim.pesc(pair:sub(1, 1)), '') + local _, count_close = line:gsub(vim.pesc(pair:sub(2, 2)), '') + if count_close > count_open then + return o + end + end + return open(pair, neigh_pattern) + end + end, +} diff --git a/.config/nvim/lua/plugins/mini/pick.lua b/.config/nvim/lua/plugins/mini/pick.lua index dcd33ca..7e2eaaf 100644 --- a/.config/nvim/lua/plugins/mini/pick.lua +++ b/.config/nvim/lua/plugins/mini/pick.lua @@ -2,16 +2,39 @@ return { { 'echasnovski/mini.pick', - enabled = false, + enabled = true, dependencies = { - { 'echasnovski/mini.extra', version = '*' }, + { + 'echasnovski/mini.extra', + version = '*', + config = function() + require('mini.extra').setup() + end, + }, }, version = '*', keys = function() local pick = require 'mini.pick' return { + { 'p', '', desc = '+pick' }, + { + 'pb', + function() + pick.builtin.buffers({ include_current = false }) + end, + desc = '[B]uffer', + }, { 'pf', pick.builtin.files, desc = '[F]ile' }, + { + 'pn', + function() + local opts = { source = { cwd = vim.fn.stdpath 'config' } } + local local_opts = { cwd = nil, tool = 'fd' } + pick.builtin.files(local_opts, opts) + end, + desc = '[N]eovim config', + }, } end, config = function() @@ -32,7 +55,6 @@ return { use_cache = true, }, }) - require('mini.extra').setup() end, }, } diff --git a/.config/nvim/lua/plugins/mini/surround.lua b/.config/nvim/lua/plugins/mini/surround.lua index f6564e5..80e98a5 100644 --- a/.config/nvim/lua/plugins/mini/surround.lua +++ b/.config/nvim/lua/plugins/mini/surround.lua @@ -2,17 +2,27 @@ return { 'echasnovski/mini.surround', version = '*', - enabled = false, + enabled = true, keys = { - { 'sa', mode = { 'n', 'v' }, desc = 'Surround add' }, - { 'sd', mode = { 'n' }, desc = 'Surround delete' }, - { 'sr', mode = { 'n' }, desc = 'Surround replace' }, - { 'sf', mode = { 'n' }, desc = 'Surround find' }, - { 'sh', mode = { 'n' }, desc = 'Surround highlight' }, + { 'gz', '', desc = '+surround' }, + { 'ys', mode = { 'n', 'v' }, desc = 'Surround add' }, + { 'ds', mode = { 'n' }, desc = 'Surround delete' }, + { 'cs', mode = { 'n' }, desc = 'Surround replace' }, + { 'gzf', mode = { 'n' }, desc = 'Surround find' }, + { 'gzh', mode = { 'n' }, desc = 'Surround highlight' }, }, opts = { search_method = 'cover_or_prev', - n_lines = 200, + n_lines = 500, + mappings = { + add = 'ys', -- Add surrounding in Normal and Visual modes + delete = 'ds', -- Delete surrounding + replace = 'cs', -- Replace surrounding + find = 'gzf', -- Find surrounding (to the right) + find_left = 'sF', -- Find surrounding (to the left) + highlight = 'gzh', -- Highlight surrounding + update_n_lines = 'gzn', -- Update `n_lines` + }, }, config = function(_, opts) require('mini.surround').setup(opts) diff --git a/.config/nvim/lua/plugins/neogit.lua b/.config/nvim/lua/plugins/neogit.lua index 9d433e4..1bdf6eb 100644 --- a/.config/nvim/lua/plugins/neogit.lua +++ b/.config/nvim/lua/plugins/neogit.lua @@ -2,8 +2,8 @@ return { 'NeogitOrg/neogit', cmd = 'Neogit', keys = { - { 'og', 'Neogit', desc = 'Neogit' }, - { 'gn', 'Neogit', desc = 'Neogit' }, + { 'og', 'Neogit kind=floating', desc = 'Neogit' }, + { 'gn', 'Neogit kind=floating', desc = 'Neogit' }, }, dependencies = { 'nvim-lua/plenary.nvim', -- required diff --git a/.config/nvim/lua/plugins/sessions.lua b/.config/nvim/lua/plugins/sessions.lua index 64b5980..aa79a59 100644 --- a/.config/nvim/lua/plugins/sessions.lua +++ b/.config/nvim/lua/plugins/sessions.lua @@ -36,7 +36,7 @@ return { }, { 'stevearc/resession.nvim', - enabled = true, + enabled = false, lazy = true, init = function() local function get_session_name() @@ -92,4 +92,21 @@ return { }, }, }, + { + 'rmagatti/auto-session', + lazy = false, + ---enables autocomplete for opts + ---@module "auto-session" + ---@type AutoSession.Config + opts = { + suppressed_dirs = { '~/', '~/Projects', '~/Downloads', '/' }, + use_git_branch = true, + }, + keys = { + { 's', '', desc = '+[S]ession' }, + { 'ss', 'SessionSave', desc = '[S]ave' }, + { 'sl', 'AutoSession search', desc = '[L]ist' }, + { 'sd', 'AutoSession delete', desc = '[D]elte' }, + }, + }, } diff --git a/.config/nvim/lua/plugins/surround.lua b/.config/nvim/lua/plugins/surround.lua index b07cbb7..e3ce04d 100644 --- a/.config/nvim/lua/plugins/surround.lua +++ b/.config/nvim/lua/plugins/surround.lua @@ -1,7 +1,7 @@ ---@type LazySpec return { 'kylechui/nvim-surround', - enabled = true, + enabled = false, config = true, -- config = function() -- require("nvim-surround").setup() diff --git a/.config/nvim/lua/plugins/ultimate-autopair.lua b/.config/nvim/lua/plugins/ultimate-autopair.lua index 839c1ed..684c9a5 100644 --- a/.config/nvim/lua/plugins/ultimate-autopair.lua +++ b/.config/nvim/lua/plugins/ultimate-autopair.lua @@ -3,7 +3,7 @@ return { 'altermo/ultimate-autopair.nvim', event = { 'InsertEnter', 'CmdlineEnter' }, branch = 'v0.6', --recommended as each new version will have breaking changes - enabled = true, + enabled = false, config = function() local ok_cmp, _ = pcall(require, 'cmp') local inits = { diff --git a/.config/nvim/lua/plugins/yazi.lua b/.config/nvim/lua/plugins/yazi.lua index b04990a..b152301 100644 --- a/.config/nvim/lua/plugins/yazi.lua +++ b/.config/nvim/lua/plugins/yazi.lua @@ -7,9 +7,9 @@ return { }, cmd = 'Yazi', keys = { - { '-', 'Yazi', desc = 'Open the file manager' }, - { 'of', 'Yazi toggle', desc = 'Toggle Yazi' }, - { '\\', 'Yazi cwd', desc = 'File Manager in cwd' }, + { '', 'Yazi toggle', desc = 'Togggle Yazi' }, + { '-', 'Yazi', desc = 'Open Yazi at the current file' }, + { 'tf', 'Yazi cwd', desc = 'File Manager in cwd(Yazi)' }, }, ---@type YaziConfig opts = { diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua index 1117770..dcf6faa 100644 --- a/.config/wezterm/wezterm.lua +++ b/.config/wezterm/wezterm.lua @@ -17,12 +17,11 @@ config.colors = { background = "#14131A", } -- Spawn a fish shell in login mode -config.default_prog = { "/bin/fish", "-l" } +-- config.default_prog = { "/bin/fish", "-l" } config.font_size = 11.5 config.font = wezterm.font_with_fallback({ - -- "Iosevka Custom Extended", - -- "FiraCode Nerd Font", + "FiraCode Nerd Font", "JetBrainsMono Nerd Font", "FontAwesome", })