diff --git a/README.md b/README.md index 290ed54..22ae6c0 100644 --- a/README.md +++ b/README.md @@ -192,14 +192,14 @@ you can read a little bit more about the above utils in [this article](https://m - _Install plugins :_ - - `:PackerInstall` - - `:PackerCompile` + - `:Lazy install` + - `:Lazy check` - Please quit and reopen Neovim and execute `:PackerUpdate` and `:PackerCompile` again + Please quit and reopen Neovim and execute `:Lazy update` and `:Lazy sync` again - After launching Neovim, install these `TreeSitter` lib with `:TSInstall` : - `:TSInstall comment css fish graphql javascript lua regex scss toml tsx vim http json dockerfile` + `:TSInstall comment css fish graphql javascript typescript markdown lua regex scss toml tsx vim http json dockerfile` - And any other you want @@ -259,7 +259,7 @@ You might have already noticed that all the shortcuts here begin with `command` For instance, you can easily jump between lines with a glance by pressing `j|k`. - - As mentioned in the setup section, we manage plugins with [Packer](https://github.com/wbthomason/packer.nvim). + - As mentioned in the setup section, we manage plugins with [Lazy](https://github.com/folke/lazy.nvim). A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config @@ -344,13 +344,17 @@ You might have already noticed that all the shortcuts here begin with `command` - `s` show document symbols with the telescope - `t` find document or project troubles - `w` show workspace diagnostics - - `leader + p` is for packer things: + - `leader + p` is for Lazy Plugins : - `i` install the package if a new package is available - - `c` compile packer and create `plugin/packer_compiled.lua` file + - `c` check plugins for available updates + - `l` log plugins last release notes + - `r` restore plugins to prior commits + - `p` plugins profile + - `d` debugging plugins - `s` sync packages with git repos - `u` update packages - - `r` clean unused package - - `S` packer status + - `x` clean unused package + - `h` lazy plugin help - `leader + z` for spell stuff: - `p` a special command that fixed a spell and jumps to the next misspelled word - `t` toggle spell checker to on and off @@ -385,9 +389,9 @@ Some of the plugins have a unique configuration, some of them just copied config ##### So We use this plugins: -- [`packer`](https://github.com/wbthomason/packer.nvim) for manage plugins: +- [`lazy`](https://github.com/folke/lazy.nvim) for manage plugins: - A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config + 💤 A modern plugin manager for Neovim - [`plenary`](https://github.com/nvim-lua/plenary.nvim) as dependencies for many plugins and Lua utils: diff --git a/init.lua b/init.lua index afb831a..9a73823 100644 --- a/init.lua +++ b/init.lua @@ -1,22 +1,25 @@ -- Global Variables require("global.vars") --Package configurations -require("packer.loader") -require("packer.plugins") - --- Key Mappings -require("keymap") +-- require("packer.loader") +-- require("packer.plugins") -- Settings require("settings") -- require("terminal") --- LSP -require("lsp.init") --- require("lsp.lspinstall") --- require("lsp.ts-js-deno") +--Package configurations +require("lazy.init") -- Global Mappings and functions executed on startup require("global.colorschema") require("global.map") require("global.exec") + +-- Key Mappings +require("keymap") + +-- LSP +require("lsp.init") +-- require("lsp.lspinstall") +-- require("lsp.ts-js-deno") diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..7b70618 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,68 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "7bb563ff2d811a63b207e9de63e3e9c0877cb6d5" }, + "alpha-nvim": { "branch": "main", "commit": "21a0f2520ad3a7c32c0822f943368dc063a569fb" }, + "better-escape.nvim": { "branch": "master", "commit": "d5ee0cef56a7e41a86048c14f25e964876ac20c1" }, + "bracey.vim": { "branch": "master", "commit": "4e1a22acc01787814819df1057d039d4ecf357eb" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "23c51b2a3c00f6abc4e922dbd7c3b9aca6992063" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "59224771f91b86d1de12570b4070fe4ad7cd1eeb" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp-snippy": { "branch": "master", "commit": "9af1635fe40385ffa3dabf322039cb5ae1fd7d35" }, + "copilot.vim": { "branch": "release", "commit": "324ec9eb69e20971b58340d0096c3caac7bc2089" }, + "crates.nvim": { "branch": "main", "commit": "a70328ae638e20548bcfc64eb9561101104b3008" }, + "filetype.nvim": { "branch": "main", "commit": "b522628a45a17d58fc0073ffd64f9dc9530a8027" }, + "formatter.nvim": { "branch": "master", "commit": "8a4c961330cc4688087f23d18fa7d2f1af9a4902" }, + "gitsigns.nvim": { "branch": "main", "commit": "2ab3bdf0a40bab53033048c6be75bda86316b55d" }, + "glow.nvim": { "branch": "main", "commit": "20d1cd087f8728f21a048a3b6259f6177237b39e" }, + "hop.nvim": { "branch": "v1", "commit": "75f73d3959a0df7ef3642fd5138acdb1ce50fdc8" }, + "indent-blankline.nvim": { "branch": "master", "commit": "c4c203c3e8a595bc333abaf168fcb10c13ed5fb7" }, + "lazy.nvim": { "branch": "main", "commit": "8d452e37bbf16cfd8841cca4286c2b0f7c8db669" }, + "lspsaga.nvim": { "branch": "main", "commit": "b7b4777369b441341b2dcd45c738ea4167c11c9e" }, + "markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" }, + "noice.nvim": { "branch": "main", "commit": "7816fcd8a43a9de84d7f4695b0688b4f54b25570" }, + "nui.nvim": { "branch": "main", "commit": "4939282919885e1c83aff68ecb35b3cadf6015a9" }, + "numb.nvim": { "branch": "master", "commit": "d95b7ea62e320b02ca1aa9df3635471a88d6f3b1" }, + "nvim-autopairs": { "branch": "master", "commit": "03580d758231956d33c8dd91e2be195106a79fa4" }, + "nvim-biscuits": { "branch": "main", "commit": "e58b47d7ff6bded07f30f51ca1fa4855a1a6dfb1" }, + "nvim-bufferline.lua": { "branch": "main", "commit": "c7492a76ce8218e3335f027af44930576b561013" }, + "nvim-cmp": { "branch": "main", "commit": "e55033fce468c9c578b946948807f2ac48a6ee08" }, + "nvim-code-action-menu": { "branch": "main", "commit": "e4399dbaf6eabff998d3d5f1cbcd8d9933710027" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, + "nvim-cursorline": { "branch": "main", "commit": "804f0023692653b2b2368462d67d2a87056947f9" }, + "nvim-dap": { "branch": "master", "commit": "6f2ea9e33b48a51849ec93c6c38148a5372018e4" }, + "nvim-hlslens": { "branch": "main", "commit": "0e59a9d29c5811dfc1ffcb032e18064fa2008b4e" }, + "nvim-lspconfig": { "branch": "master", "commit": "9c73b57ed03ad0a906e2cdc2fc348bf86ae53e3a" }, + "nvim-notify": { "branch": "master", "commit": "b005821516f1f37801a73067afd1cef2dbc4dfe8" }, + "nvim-regexplainer": { "branch": "main", "commit": "dddc9ff5f9837b02c3e07ee30b833bc39a0b6759" }, + "nvim-snippy": { "branch": "master", "commit": "47def62945611212a242657cc414dac91ca0453a" }, + "nvim-spectre": { "branch": "master", "commit": "68ea562b485b6593e325e7916c3bd6e833d433e7" }, + "nvim-tree.lua": { "branch": "master", "commit": "9e4c39572f631bb60ee15cb9d46e1daa9927a45e" }, + "nvim-treesitter": { "branch": "master", "commit": "ee3e9f4dc0e5ee9e2bfb1ee47638375840b8fe0f" }, + "nvim-treesitter-context": { "branch": "master", "commit": "d28654b012d4c56beafec630ef7143275dff76f8" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "247e392a8beb28c5d43a1375f93f8f90f1cc11ad" }, + "nvim-ts-autotag": { "branch": "main", "commit": "fdefe46c6807441460f11f11a167a2baf8e4534b" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "32d9627123321db65a4f158b72b757bcaef1a3f4" }, + "nvim-ts-rainbow": { "branch": "master", "commit": "064fd6c0a15fae7f876c2c6dd4524ca3fad96750" }, + "nvim-web-devicons": { "branch": "master", "commit": "05e1072f63f6c194ac6e867b567e6b437d3d4622" }, + "nvim_context_vt": { "branch": "master", "commit": "31436f34f3f95e4e70853cd653fdf78246cb0e85" }, + "plenary.nvim": { "branch": "master", "commit": "4b7e52044bbb84242158d977a50c4cbcd85070c7" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "portal.nvim": { "branch": "main", "commit": "6198977abbfe30e19075edf106a507a6a708402c" }, + "project.nvim": { "branch": "main", "commit": "685bc8e3890d2feb07ccf919522c97f7d33b94e4" }, + "registers.nvim": { "branch": "main", "commit": "667ae447d2c7efb64461a2c58f5311d1248cdb5f" }, + "renamer.nvim": { "branch": "master", "commit": "1614d466df53899f11dd5395eaac3c09a275c384" }, + "rest.nvim": { "branch": "main", "commit": "e1482ea4333a019ec8ef6cf43f406d52e9782800" }, + "rust-tools.nvim": { "branch": "master", "commit": "99fd1238c6068d0637df30b6cee9a264334015e9" }, + "stabilize.nvim": { "branch": "master", "commit": "34069870a8e72632c5447188e638e1c6bfebc353" }, + "telescope.nvim": { "branch": "master", "commit": "a606bd10c79ec5989c76c49cc6f736e88b63f0da" }, + "tokyonight.nvim": { "branch": "main", "commit": "8a619f0cf3ed9051081d9fc0cd4f852a7355f546" }, + "trouble.nvim": { "branch": "main", "commit": "897542f90050c3230856bc6e45de58b94c700bbf" }, + "twilight.nvim": { "branch": "main", "commit": "1ffa6a4d89fb2fbb784c6674044bf54f1fca936f" }, + "vim-fugitive": { "branch": "master", "commit": "99cdb88bc64063dc4656ae53496f06fb2a394cd4" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, + "vim-yin-yang": { "branch": "master", "commit": "77ed628fe5d23abfe297d58a0f46ac94bbc987f6" }, + "which-key.nvim": { "branch": "main", "commit": "8682d3003595017cd8ffb4c860a07576647cc6f8" }, + "windline.nvim": { "branch": "master", "commit": "047c6175e7871cd17e79f1c53f923f6695370bbe" }, + "winshift.nvim": { "branch": "main", "commit": "37468ed6f385dfb50402368669766504c0e15583" } +} \ No newline at end of file diff --git a/lua/lazy/config/alpha.lua b/lua/lazy/config/alpha.lua new file mode 100644 index 0000000..0758d6a --- /dev/null +++ b/lua/lazy/config/alpha.lua @@ -0,0 +1,11 @@ +-- Description : a lua powered greeter like vim-startify / dashboard-nvim +-- Link : https://github.com/goolord/alpha-nvim + +local M = { + "goolord/alpha-nvim", + config = function() + require("packer.settings.alpha") + end, +} + +return M diff --git a/lua/lazy/config/autopairs.lua b/lua/lazy/config/autopairs.lua new file mode 100644 index 0000000..721f649 --- /dev/null +++ b/lua/lazy/config/autopairs.lua @@ -0,0 +1,11 @@ +-- Description : A super powerful autopair plugin for Neovim that supports multiple characters. +-- Link : https://github.com/windwp/nvim-autopairs + +local M = { + "windwp/nvim-autopairs", + config = function() + require("packer.settings.autopairs") + end, +} + +return M diff --git a/lua/lazy/config/autotag.lua b/lua/lazy/config/autotag.lua new file mode 100644 index 0000000..e7e7e8c --- /dev/null +++ b/lua/lazy/config/autotag.lua @@ -0,0 +1,11 @@ +-- Description : Use treesitter to auto close and auto rename html tag +-- Link : https://github.com/windwp/nvim-ts-autotag + +local M = { + "windwp/nvim-ts-autotag", + config = function() + require("nvim-ts-autotag").setup() + end, +} + +return M diff --git a/lua/lazy/config/bisquits.lua b/lua/lazy/config/bisquits.lua new file mode 100644 index 0000000..a3f3fbc --- /dev/null +++ b/lua/lazy/config/bisquits.lua @@ -0,0 +1,44 @@ +-- Description : A neovim port of Assorted Biscuits. Ends up with more supported languages too. +-- Link : https://github.com/code-biscuits/nvim-biscuits + +local M = { + "code-biscuits/nvim-biscuits", + + config = function() + require("nvim-biscuits").setup({ + ensure_installed = "maintained", + + default_config = { + max_length = 12, + min_distance = 5, + prefix_string = " 📎 ", + }, + language_config = { + html = { + prefix_string = " 🌐 ", + }, + javascript = { + prefix_string = " ✨ ", + max_length = 80, + }, + javascriptreact = { + prefix_string = " ✨ ", + max_length = 80, + }, + typescript = { + prefix_string = " ✨ ", + max_length = 80, + }, + typescriptreact = { + prefix_string = " ✨ ", + max_length = 80, + }, + }, + }) + end, + dependencies = { + { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, + }, +} + +return M diff --git a/lua/lazy/config/blankline.lua b/lua/lazy/config/blankline.lua new file mode 100644 index 0000000..5384867 --- /dev/null +++ b/lua/lazy/config/blankline.lua @@ -0,0 +1,11 @@ +-- Description : This plugin adds indentation guides to all lines (including empty lines). +-- Link : https://github.com/lukas-reineke/indent-blankline.nvim + +local M = { + "lukas-reineke/indent-blankline.nvim", + config = function() + require("packer.settings.blankline") + end, +} + +return M diff --git a/lua/lazy/config/bracey.lua b/lua/lazy/config/bracey.lua new file mode 100644 index 0000000..0c3ce0b --- /dev/null +++ b/lua/lazy/config/bracey.lua @@ -0,0 +1,6 @@ +-- Description : live edit html, css, and javascript in vim +-- Link : https://github.com/turbio/bracey.vim + +local M = { "turbio/bracey.vim", build = "npm install --prefix server" } + +return M diff --git a/lua/lazy/config/bufferline.lua b/lua/lazy/config/bufferline.lua new file mode 100644 index 0000000..b16cd15 --- /dev/null +++ b/lua/lazy/config/bufferline.lua @@ -0,0 +1,12 @@ +-- Description : A snazzy 💅 buffer line (with tabpage integration) for Neovim built using lua. +-- Link : https://github.com/akinsho/nvim-bufferline.lua + +local M = { + "akinsho/nvim-bufferline.lua", + dependencies = { "kyazdani42/nvim-web-devicons" }, + config = function() + require("bufferline").setup(require("packer.settings.bufferline")) + end, +} + +return M diff --git a/lua/lazy/config/cmp.lua b/lua/lazy/config/cmp.lua new file mode 100644 index 0000000..8e48103 --- /dev/null +++ b/lua/lazy/config/cmp.lua @@ -0,0 +1,24 @@ +-- Description : A completion engine plugin for neovim written in Lua. Completion sources are installed from external repositories and "sourced". +-- Link : https://github.com/hrsh7th/nvim-cmp + +local M = { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + -- "L3MON4D3/LuaSnip", + -- "saadparwaiz1/cmp_luasnip", + "dcampos/nvim-snippy", + "dcampos/cmp-snippy", + "hrsh7th/cmp-emoji", + }, + + -- event = "InsertEnter", + config = function() + require("packer.settings.cmp") + end, +} + +return M diff --git a/lua/lazy/config/colorizer.lua b/lua/lazy/config/colorizer.lua new file mode 100644 index 0000000..892bc5a --- /dev/null +++ b/lua/lazy/config/colorizer.lua @@ -0,0 +1,11 @@ +-- Description : A high-performance color highlighter for Neovim which has no external dependencies! Written in performant Luajit. +-- Link : https://github.com/norcalli/nvim-colorizer.lua + +local M = { + "norcalli/nvim-colorizer.lua", + config = function() + require("colorizer").setup() + end, +} + +return M diff --git a/lua/lazy/config/comment.lua b/lua/lazy/config/comment.lua new file mode 100644 index 0000000..85882c7 --- /dev/null +++ b/lua/lazy/config/comment.lua @@ -0,0 +1,11 @@ +-- Description : 🧠 💪 // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more +-- Link : https://github.com/numToStr/Comment.nvim + +local M = { + "numToStr/Comment.nvim", + config = function() + require("packer.settings.ts-comment") + end, +} + +return M diff --git a/lua/lazy/config/crates.lua b/lua/lazy/config/crates.lua new file mode 100644 index 0000000..e04ac03 --- /dev/null +++ b/lua/lazy/config/crates.lua @@ -0,0 +1,13 @@ +-- Description : A neovim plugin that helps managing crates.io dependencies +-- Link : https://github.com/saecki/crates.nvim + +local M = { + "saecki/crates.nvim", + event = { "BufRead Cargo.toml" }, + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("crates").setup() + end, +} + +return M diff --git a/lua/lazy/config/cursorline.lua b/lua/lazy/config/cursorline.lua new file mode 100644 index 0000000..e5210e3 --- /dev/null +++ b/lua/lazy/config/cursorline.lua @@ -0,0 +1,8 @@ +-- Description : A plugin for neovim that highlights cursor words and lines +-- Link : https://github.com/yamatsum/nvim-cursorline + +local M = { + "yamatsum/nvim-cursorline", +} + +return M diff --git a/lua/lazy/config/escap.lua b/lua/lazy/config/escap.lua new file mode 100644 index 0000000..6a9484f --- /dev/null +++ b/lua/lazy/config/escap.lua @@ -0,0 +1,11 @@ +-- Description : Escape from insert mode without delay when typing +-- Link : https://github.com/max397574/better-escape.nvim + +local M = { + "max397574/better-escape.nvim", + config = function() + require("packer.settings.escape") + end, +} + +return M diff --git a/lua/lazy/config/formatter.lua b/lua/lazy/config/formatter.lua new file mode 100644 index 0000000..7fe4804 --- /dev/null +++ b/lua/lazy/config/formatter.lua @@ -0,0 +1,11 @@ +-- Description : A format runner for Neovim. +-- Link : https://github.com/mhartington/formatter.nvim + +local M = { + "mhartington/formatter.nvim", + config = function() + require("packer.settings.format") + end, +} + +return M diff --git a/lua/lazy/config/fugitive.lua b/lua/lazy/config/fugitive.lua new file mode 100644 index 0000000..1dfc29d --- /dev/null +++ b/lua/lazy/config/fugitive.lua @@ -0,0 +1,8 @@ +-- Description : fugitive.vim: A Git wrapper so awesome, it should be illegal +-- Link : https://github.com/tpope/vim-fugitive + +local M = { + "tpope/vim-fugitive", +} + +return M diff --git a/lua/lazy/config/gitsigns.lua b/lua/lazy/config/gitsigns.lua new file mode 100644 index 0000000..ddbf6cf --- /dev/null +++ b/lua/lazy/config/gitsigns.lua @@ -0,0 +1,14 @@ +-- Description : Super fast git decorations implemented purely in lua/teal. +-- Link : https://github.com/lewis6991/gitsigns.nvim + +local M = { + "lewis6991/gitsigns.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + require("gitsigns").setup() + end, +} + +return M diff --git a/lua/lazy/config/hlslens.lua b/lua/lazy/config/hlslens.lua new file mode 100644 index 0000000..aa1567a --- /dev/null +++ b/lua/lazy/config/hlslens.lua @@ -0,0 +1,32 @@ +-- Description : nvim-hlslens helps you better glance at matched information, seamlessly jump between matched instances. +-- Link : https://github.com/kevinhwang91/nvim-hlslens + +local M = { + "kevinhwang91/nvim-hlslens", + config = function() + require("hlslens").setup() + + local kopts = { noremap = true, silent = true } + + vim.api.nvim_set_keymap( + "n", + "n", + [[execute('normal! ' . v:count1 . 'n')lua require('hlslens').start()]], + kopts + ) + vim.api.nvim_set_keymap( + "n", + "N", + [[execute('normal! ' . v:count1 . 'N')lua require('hlslens').start()]], + kopts + ) + vim.api.nvim_set_keymap("n", "*", [[*lua require('hlslens').start()]], kopts) + vim.api.nvim_set_keymap("n", "#", [[#lua require('hlslens').start()]], kopts) + vim.api.nvim_set_keymap("n", "g*", [[g*lua require('hlslens').start()]], kopts) + vim.api.nvim_set_keymap("n", "g#", [[g#lua require('hlslens').start()]], kopts) + + vim.api.nvim_set_keymap("n", "l", ":noh", kopts) + end, +} + +return M diff --git a/lua/lazy/config/hop.lua b/lua/lazy/config/hop.lua new file mode 100644 index 0000000..523c8c7 --- /dev/null +++ b/lua/lazy/config/hop.lua @@ -0,0 +1,13 @@ +-- Description : Neovim motions on speed! +-- Link : https://github.com/phaazon/hop.nvim + +local M = { + "phaazon/hop.nvim", + branch = "v1", -- optional but strongly recommended + config = function() + -- you can configure Hop the way you like here; see :h hop-config + require("hop").setup({ keys = "etovxqpdygfblzhckisuran" }) + end, +} + +return M diff --git a/lua/lazy/config/init.lua b/lua/lazy/config/init.lua new file mode 100644 index 0000000..e69de29 diff --git a/lua/lazy/config/lspsaga.lua b/lua/lazy/config/lspsaga.lua new file mode 100644 index 0000000..58cefdb --- /dev/null +++ b/lua/lazy/config/lspsaga.lua @@ -0,0 +1,12 @@ +-- Description : A light-weight lsp plugin based on neovim's built-in lsp with a highly performant UI. +-- Link : https://github.com/glepnir/lspsaga.nvim + +local M = { + "glepnir/lspsaga.nvim", + config = function() + -- you can configure Hop the way you like here; see :h hop-config + require("lspsaga").init_lsp_saga() + end, +} + +return M diff --git a/lua/lazy/config/markdown.lua b/lua/lazy/config/markdown.lua new file mode 100644 index 0000000..c9aca7c --- /dev/null +++ b/lua/lazy/config/markdown.lua @@ -0,0 +1,6 @@ +-- Description : markdown preview plugin for (neo)vim +-- Link : https://github.com/iamcco/markdown-preview.nvim + +local M = { "iamcco/markdown-preview.nvim", build = "cd app && npm install" } + +return M diff --git a/lua/lazy/config/neoscroll.lua b/lua/lazy/config/neoscroll.lua new file mode 100644 index 0000000..8551264 --- /dev/null +++ b/lua/lazy/config/neoscroll.lua @@ -0,0 +1,11 @@ +-- Description : Smooth scrolling neovim plugin written in lua +-- Link : https://github.com/karb94/neoscroll.nvim + +local M = { + "karb94/neoscroll.nvim", + config = function() + require("neoscroll").setup() + end, +} + +return M diff --git a/lua/lazy/config/noice.lua b/lua/lazy/config/noice.lua new file mode 100644 index 0000000..606cd0b --- /dev/null +++ b/lua/lazy/config/noice.lua @@ -0,0 +1,16 @@ +-- Description : 💥 Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu. +-- Link : https://github.com/folke/noice.nvim + +local M = { + "folke/noice.nvim", + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup() + end, +} + +return M diff --git a/lua/lazy/config/numb.lua b/lua/lazy/config/numb.lua new file mode 100644 index 0000000..bc196ba --- /dev/null +++ b/lua/lazy/config/numb.lua @@ -0,0 +1,11 @@ +-- Description : Peek lines just when you intend +-- Link : https://github.com/nacro90/numb.nvim + +local M = { + "nacro90/numb.nvim", + config = function() + require("numb").setup() + end, +} + +return M diff --git a/lua/lazy/config/packer.lua b/lua/lazy/config/packer.lua new file mode 100644 index 0000000..f76dde4 --- /dev/null +++ b/lua/lazy/config/packer.lua @@ -0,0 +1,8 @@ +-- Description : A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config +-- Link : https://github.com/wbthomason/packer.nvim + +local M = { + "wbthomason/packer.nvim", +} + +return M diff --git a/lua/lazy/config/plenary.lua b/lua/lazy/config/plenary.lua new file mode 100644 index 0000000..c1e2aef --- /dev/null +++ b/lua/lazy/config/plenary.lua @@ -0,0 +1,8 @@ +-- Description : plenary: full; complete; entire; absolute; unqualified. All the lua functions I don't want to write twice. +-- Link : https://github.com/nvim-lua/plenary.nvim + +local M = { + "nvim-lua/plenary.nvim", +} + +return M diff --git a/lua/lazy/config/popup.lua b/lua/lazy/config/popup.lua new file mode 100644 index 0000000..66c8915 --- /dev/null +++ b/lua/lazy/config/popup.lua @@ -0,0 +1,8 @@ +-- Description : [WIP] An implementation of the Popup API from vim in Neovim. Hope to upstream when complete +-- Link : https://github.com/nvim-lua/popup.nvim + +local M = { + "nvim-lua/popup.nvim", +} + +return M diff --git a/lua/lazy/config/portal.lua b/lua/lazy/config/portal.lua new file mode 100644 index 0000000..23c0bab --- /dev/null +++ b/lua/lazy/config/portal.lua @@ -0,0 +1,15 @@ +-- Description : Look at you, sailing through the [jumplist] majestically, like an eagle... piloting a blimp. +-- Link : https://github.com/cbochs/portal.nvim + +local M = { + "cbochs/portal.nvim", + config = function() + require("portal").setup({ + -- Your configuration goes here + -- Leave empty to use the default configuration + -- Please see the Configuration section below for more information + }) + end, +} + +return M diff --git a/lua/lazy/config/project.lua b/lua/lazy/config/project.lua new file mode 100644 index 0000000..b3299a2 --- /dev/null +++ b/lua/lazy/config/project.lua @@ -0,0 +1,16 @@ +-- Description : project.nvim is an all in one neovim plugin written in lua that provides superior project management. +-- Link : https://github.com/ahmedkhalf/project.nvim + +local M = { + "ahmedkhalf/project.nvim", + config = function() + require("project_nvim").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + require("telescope").load_extension("projects"), + }) + end, +} + +return M diff --git a/lua/lazy/config/rainbow.lua b/lua/lazy/config/rainbow.lua new file mode 100644 index 0000000..24662b2 --- /dev/null +++ b/lua/lazy/config/rainbow.lua @@ -0,0 +1,11 @@ +-- Description : Rainbow parentheses for neovim using tree-sitter. This is a module for nvim-treesitter, not a standalone plugin. It requires and is configured via nvim-treesitter +-- Link : https://github.com/p00f/nvim-ts-rainbow + +local M = { + "p00f/nvim-ts-rainbow", + config = function() + require("packer.settings.rainbow") + end, +} + +return M diff --git a/lua/lazy/config/regexplainer.lua b/lua/lazy/config/regexplainer.lua new file mode 100644 index 0000000..8b3321a --- /dev/null +++ b/lua/lazy/config/regexplainer.lua @@ -0,0 +1,15 @@ +-- Description : Describe the regular expression under the cursor. +-- Link : https://github.com/bennypowers/nvim-regexplainer + +local M = { + "bennypowers/nvim-regexplainer", + requires = { + "nvim-treesitter/nvim-treesitter", + "MunifTanjim/nui.nvim", + }, + config = function() + require("regexplainer").setup({}) + end, +} + +return M diff --git a/lua/lazy/config/renamer.lua b/lua/lazy/config/renamer.lua new file mode 100644 index 0000000..d787b75 --- /dev/null +++ b/lua/lazy/config/renamer.lua @@ -0,0 +1,13 @@ +-- Description : VS Code-like renaming UI for Neovim, writen in Lua. +-- Link : https://github.com/filipdutescu/renamer.nvim + +local M = { + "filipdutescu/renamer.nvim", + branch = "master", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("packer.settings.renamer") + end, +} + +return M diff --git a/lua/lazy/config/rest.lua b/lua/lazy/config/rest.lua new file mode 100644 index 0000000..eccf7f9 --- /dev/null +++ b/lua/lazy/config/rest.lua @@ -0,0 +1,12 @@ +-- Description : A fast Neovim http client written in Lua +-- Link : https://github.com/NTBBloodbath/rest.nvim + +local M = { + "NTBBloodbath/rest.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + require("packer.settings.rest") + end, +} + +return M diff --git a/lua/lazy/config/rust.lua b/lua/lazy/config/rust.lua new file mode 100644 index 0000000..d9295e3 --- /dev/null +++ b/lua/lazy/config/rust.lua @@ -0,0 +1,11 @@ +-- Description : Tools for better development in rust using neovim's builtin lsp +-- Link : https://github.com/simrat39/rust-tools.nvim + +local M = { + "simrat39/rust-tools.nvim", + config = function() + require("packer.settings.rust") + end, +} + +return M diff --git a/lua/lazy/config/snippy.lua b/lua/lazy/config/snippy.lua new file mode 100644 index 0000000..2c0da34 --- /dev/null +++ b/lua/lazy/config/snippy.lua @@ -0,0 +1,21 @@ +-- Description : A snippets plugin for Neovim 0.5.0+ written in Lua. +-- Link : https://github.com/dcampos/nvim-snippy + +local M = { + "dcampos/nvim-snippy", + config = function() + require("snippy").setup({ + mappings = { + is = { + [""] = "expand_or_advance", + [""] = "previous", + }, + nx = { + ["x"] = "cut_text", + }, + }, + }) + end, +} + +return M diff --git a/lua/lazy/config/spectre.lua b/lua/lazy/config/spectre.lua new file mode 100644 index 0000000..a3193fa --- /dev/null +++ b/lua/lazy/config/spectre.lua @@ -0,0 +1,11 @@ +-- Description : Find the enemy and replace them with dark power. +-- Link : https://github.com/windwp/nvim-spectre + +local M = { + "windwp/nvim-spectre", + config = function() + require("spectre").setup() + end, +} + +return M diff --git a/lua/lazy/config/stablize.lua b/lua/lazy/config/stablize.lua new file mode 100644 index 0000000..2ba419e --- /dev/null +++ b/lua/lazy/config/stablize.lua @@ -0,0 +1,11 @@ +-- Description : Neovim plugin to stabilize window open/close events. +-- Link : https://github.com/luukvbaal/stabilize.nvim + +local M = { + "luukvbaal/stabilize.nvim", + config = function() + require("stabilize").setup() + end, +} + +return M diff --git a/lua/lazy/config/telescope.lua b/lua/lazy/config/telescope.lua new file mode 100644 index 0000000..1f9581d --- /dev/null +++ b/lua/lazy/config/telescope.lua @@ -0,0 +1,9 @@ +-- Description : Find, Filter, Preview, Pick. All lua, all the time. +-- Link : https://github.com/nvim-telescope/telescope.nvim + +local M = { "nvim-telescope/telescope.nvim", dependencies = { + "nvim-lua/popup.nvim", + "nvim-lua/plenary.nvim", +} } + +return M diff --git a/lua/lazy/config/tree.lua b/lua/lazy/config/tree.lua new file mode 100644 index 0000000..02d0633 --- /dev/null +++ b/lua/lazy/config/tree.lua @@ -0,0 +1,12 @@ +-- Description : A file explorer tree for neovim written in lua +-- Link : https://github.com/kyazdani42/nvim-tree.lua + +local M = { + "kyazdani42/nvim-tree.lua", + dependencies ={ "kyazdani42/nvim-web-devicons"}, + config = function() + require("packer.settings.tree") + end, +} + +return M diff --git a/lua/lazy/config/treesitter.lua b/lua/lazy/config/treesitter.lua new file mode 100644 index 0000000..99ad1aa --- /dev/null +++ b/lua/lazy/config/treesitter.lua @@ -0,0 +1,12 @@ +-- Description : Nvim Treesitter configurations and abstraction layer +-- Link : https://github.com/nvim-treesitter/nvim-treesitter + +local M = { + "nvim-treesitter/nvim-treesitter", + build= ":TSUpdate", + config = function() + require("packer.settings.treesitter") + end, +} + +return M diff --git a/lua/lazy/config/trouble.lua b/lua/lazy/config/trouble.lua new file mode 100644 index 0000000..0f5afe3 --- /dev/null +++ b/lua/lazy/config/trouble.lua @@ -0,0 +1,16 @@ +-- Description : 🚦 A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing. +-- Link : https://github.com/folke/trouble.nvim + +local M = { + "folke/trouble.nvim", + dependencies = { "kyazdani42/nvim-web-devicons" }, + config = function() + require("trouble").setup({ + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }) + end, +} + +return M diff --git a/lua/lazy/config/twilight.lua b/lua/lazy/config/twilight.lua new file mode 100644 index 0000000..a7a79d0 --- /dev/null +++ b/lua/lazy/config/twilight.lua @@ -0,0 +1,11 @@ +-- Description : 🌅 Twilight is a Lua plugin for Neovim 0.5 that dims inactive portions of the code you're editing using TreeSitter. +-- Link : https://github.com/folke/twilight.nvim + +local M = { + "folke/twilight.nvim", + config = function() + require("twilight").setup({}) + end, +} + +return M diff --git a/lua/lazy/config/which-key.lua b/lua/lazy/config/which-key.lua new file mode 100644 index 0000000..fddeaa7 --- /dev/null +++ b/lua/lazy/config/which-key.lua @@ -0,0 +1,23 @@ +-- Description : 💥 Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing. +-- Link : https://github.com/folke/which-key.nvim + +local M = { + "folke/which-key.nvim", + config = function() + local myWKConfig = require("packer.settings.which-key") + local wk = require("which-key") + wk.setup({ + myWKConfig.settings, + }) + local opts = myWKConfig.normalOpts + local vopts = myWKConfig.visualOpts + + local mappings = myWKConfig.mappings + local vmappings = myWKConfig.vmappings + + wk.register(mappings, opts) + wk.register(vmappings, vopts) + end, +} + +return M diff --git a/lua/lazy/config/windline.lua b/lua/lazy/config/windline.lua new file mode 100644 index 0000000..249b76a --- /dev/null +++ b/lua/lazy/config/windline.lua @@ -0,0 +1,12 @@ +-- Description : Animation statusline, floating window statusline. Use lua + luv make some wind +-- Link : https://github.com/windwp/windline.nvim + +local M = { + "windwp/windline.nvim", + config = function() + require("packer.settings.windline") + -- require("windline").add_status(require("spectre.state_utils").status_line()) + end, +} + +return M diff --git a/lua/lazy/config/winshift.lua b/lua/lazy/config/winshift.lua new file mode 100644 index 0000000..2beeb67 --- /dev/null +++ b/lua/lazy/config/winshift.lua @@ -0,0 +1,11 @@ +-- Description : Rearrange your windows with ease. +-- Link : https://github.com/sindrets/winshift.nvim + +local M = { + "sindrets/winshift.nvim", + config = function() + require("packer.settings.winshift") + end, +} + +return M diff --git a/lua/lazy/init.lua b/lua/lazy/init.lua new file mode 100644 index 0000000..5113457 --- /dev/null +++ b/lua/lazy/init.lua @@ -0,0 +1,2 @@ +require("lazy.loader") +require("lazy.plugins") diff --git a/lua/lazy/loader.lua b/lua/lazy/loader.lua new file mode 100644 index 0000000..049159d --- /dev/null +++ b/lua/lazy/loader.lua @@ -0,0 +1,12 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "--single-branch", + "https://github.com/folke/lazy.nvim.git", + lazypath, + }) +end +vim.opt.runtimepath:prepend(lazypath) diff --git a/lua/lazy/plugins.lua b/lua/lazy/plugins.lua new file mode 100644 index 0000000..5be3a95 --- /dev/null +++ b/lua/lazy/plugins.lua @@ -0,0 +1,65 @@ +require("lazy").setup({ + + require("lazy.config.plenary"), + require("lazy.config.popup"), + require("lazy.config.fugitive"), + require("lazy.config.cursorline"), + require("lazy.config.bracey"), + require("lazy.config.markdown"), + require("lazy.config.renamer"), + require("lazy.config.autotag"), + require("lazy.config.spectre"), + { "tpope/vim-surround" }, + require("lazy.config.regexplainer"), + require("lazy.config.hop"), + require("lazy.config.rainbow"), + require("lazy.config.alpha"), + require("lazy.config.blankline"), + require("lazy.config.winshift"), + require("lazy.config.telescope"), + { "folke/tokyonight.nvim" }, + require("lazy.config.windline"), + require("lazy.config.gitsigns"), + require("lazy.config.treesitter"), + "nvim-treesitter/nvim-treesitter-textobjects", + "romgrk/nvim-treesitter-context", + require("lazy.config.lspsaga"), + require("lazy.config.trouble"), + "neovim/nvim-lspconfig", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + require("lazy.config.snippy"), + require("lazy.config.cmp"), + "dcampos/cmp-snippy", + "tversteeg/registers.nvim", + require("lazy.config.autopairs"), + { "weilbith/nvim-code-action-menu", cmd = "CodeActionMenu" }, + require("lazy.config.bufferline"), + require("lazy.config.tree"), + require("lazy.config.project"), + "nathom/filetype.nvim", + require("lazy.config.twilight"), + require("lazy.config.formatter"), + require("lazy.config.which-key"), + "JoosepAlviste/nvim-ts-context-commentstring", + require("lazy.config.comment"), + require("lazy.config.stablize"), + { "ellisonleao/glow.nvim" }, + require("lazy.config.rest"), + require("lazy.config.hlslens"), + require("lazy.config.rust"), + require("lazy.config.crates"), + { "mfussenegger/nvim-dap" }, + require("lazy.config.colorizer"), + { "haringsrob/nvim_context_vt" }, + { "pgdouyon/vim-yin-yang" }, + require("lazy.config.escap"), + require("lazy.config.numb"), + { "github/copilot.vim" }, + require("lazy.config.bisquits"), + -- require("lazy.config.neoscroll")) + require("lazy.config.noice"), + require("lazy.config.portal"), +}) diff --git a/lua/packer/settings/treesitter.lua b/lua/packer/settings/treesitter.lua index 706451d..68a65d0 100644 --- a/lua/packer/settings/treesitter.lua +++ b/lua/packer/settings/treesitter.lua @@ -1,60 +1,60 @@ -- Treesitter configuration -- Parsers must be installed manually via :TSInstall require("nvim-treesitter.configs").setup({ - autopairs = { enable = true }, - autotag = { - enable = true, - }, - context_commentstring = { - enable = true, - enable_autocmd = false, - }, - highlight = { - enable = true, -- false will disable the whole extension - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "gnn", - node_incremental = "grn", - scope_incremental = "grc", - node_decremental = "grm", - }, - }, - indent = { - enable = true, - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - 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", - }, - }, - }, + autopairs = { enable = true }, + autotag = { + enable = true, + }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, + highlight = { + enable = true, -- false will disable the whole extension + }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "gnn", + node_incremental = "grn", + scope_incremental = "grc", + node_decremental = "grm", + }, + }, + indent = { + enable = true, + }, + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + 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", + }, + }, + }, }) diff --git a/lua/packer/settings/which-key.lua b/lua/packer/settings/which-key.lua index b9e0365..eccd148 100644 --- a/lua/packer/settings/which-key.lua +++ b/lua/packer/settings/which-key.lua @@ -116,13 +116,17 @@ M.mappings = { }, }, p = { - name = "Packer", - c = { "PackerCompile", "Compile" }, - r = { "PackerClean", "Clean" }, - i = { "PackerInstall", "Install" }, - s = { "PackerSync", "Sync" }, - S = { "PackerStatus", "Status" }, - u = { "PackerUpdate", "Update" }, + name = "Lazy Plugins", + i = { "Lazy install", "install the package if a new package is available" }, + c = { "Lazy check", "check plugins for available updates" }, + l = { "Lazy log", "log plugins last release notes" }, + r = { "Lazy restore", "restore plugins to prior commits" }, + p = { "Lazy profile", "plugins profile" }, + d = { "Lazy debug", "debugging plugins" }, + s = { "Lazy sync", "sync packages with git repos" }, + u = { "Lazy update", "update packages" }, + x = { "Lazy clean", "clean unused package" }, + h = { "Lazy help", "lazy plugin help" }, }, -- " Available Debug Adapters: