diff options
author | mhsn <mail@mhsn.net> | 2025-01-22 00:44:19 +0000 |
---|---|---|
committer | mhsn <mail@mhsn.net> | 2025-01-22 00:44:19 +0000 |
commit | dc17ab2fb051efceafddc3b97ebe9f67c775e9b7 (patch) | |
tree | b9c65af3f8d64f1bd5f48488afd69f2596ab4dec | |
parent | c0ee49298161bccb75b9e23ed64fe80aacec2fd4 (diff) | |
download | nvim-dc17ab2fb051efceafddc3b97ebe9f67c775e9b7.tar.gz nvim-dc17ab2fb051efceafddc3b97ebe9f67c775e9b7.zip |
split plugins into separate files and other changes
-rw-r--r-- | lazy-lock.json | 24 | ||||
-rw-r--r-- | lua/config/lazy.lua | 19 | ||||
-rw-r--r-- | lua/config/opt.lua | 1 | ||||
-rw-r--r-- | lua/plugins/conform.lua | 13 | ||||
-rw-r--r-- | lua/plugins/general.lua | 42 | ||||
-rw-r--r-- | lua/plugins/gitsigns.lua | 6 | ||||
-rw-r--r-- | lua/plugins/mason.lua (renamed from lua/plugins/lsp.lua) | 8 | ||||
-rw-r--r-- | lua/plugins/nvim-autopairs.lua | 6 | ||||
-rw-r--r-- | lua/plugins/nvim-cmp.lua | 48 | ||||
-rw-r--r-- | lua/plugins/nvim-tree.lua | 13 | ||||
-rw-r--r-- | lua/plugins/nvim-treesitter.lua | 14 | ||||
-rw-r--r-- | lua/plugins/telescope.lua | 9 | ||||
-rw-r--r-- | lua/plugins/tiny-inline-diagnostic.lua | 18 | ||||
-rw-r--r-- | lua/plugins/vim-ledger.lua | 9 |
14 files changed, 157 insertions, 73 deletions
diff --git a/lazy-lock.json b/lazy-lock.json index 71b3a91..1af7ddd 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,14 +1,22 @@ { - "conform.nvim": { "branch": "master", "commit": "62d5accad8b29d6ba9b58d3dff90c43a55621c60" }, + "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "conform.nvim": { "branch": "master", "commit": "a203480a350b03092e473bf3001733d547160a73" }, + "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "gruvbox-material": { "branch": "master", "commit": "170148af9350f578f3623f810e54698fa1e5bdbf" }, "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "43894adcf10bb1190c2184bd7c1750e8ea2b3dce" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "nvim-lspconfig": { "branch": "master", "commit": "c646154d6e4db9b2979eeb517d0b817ad00c9c47" }, - "nvim-tree.lua": { "branch": "master", "commit": "c7639482a1598f4756798df1b2d72f79fe5bb34f" }, - "nvim-treesitter": { "branch": "master", "commit": "efb2e9c607cab1e4f7171493b7c6f63bd39073fc" }, - "nvim-web-devicons": { "branch": "master", "commit": "f09be61d05bebcba85bb47be1931322d51b95644" }, + "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, + "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "nvim-lspconfig": { "branch": "master", "commit": "1aa9f36b6d542dafc0b4a38c48969d036003b00a" }, + "nvim-tree.lua": { "branch": "master", "commit": "ca7c4c33cac2ad66ec69d45e465379716ef0cc97" }, + "nvim-treesitter": { "branch": "master", "commit": "69170c93149ddb71a22bd954514806395c430c02" }, + "nvim-web-devicons": { "branch": "master", "commit": "203da76ecfbb4b192cf830665b03eb651b635c94" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "vim-ledger": { "branch": "master", "commit": "3d76cee270b1a9583d535737ac2e63166335d45c" } + "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "tiny-inline-diagnostic.nvim": { "branch": "main", "commit": "0e6b2d0005335a0e1eddb58e9ec9e01a1dbc4823" }, + "vim-ledger": { "branch": "master", "commit": "dbc683e24bd5338b8c12540227a58b2d247e097a" } } diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 7e90925..07420fd 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,17 +1,14 @@ -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end + local out = vim.fn.system({ + "git", + "clone", + "https://github.com/folke/lazy.nvim.git", + "--filter=blob:none", + "--branch=stable", + lazypath, + }) end vim.opt.rtp:prepend(lazypath) diff --git a/lua/config/opt.lua b/lua/config/opt.lua index 60b1d5b..37b785c 100644 --- a/lua/config/opt.lua +++ b/lua/config/opt.lua @@ -7,6 +7,7 @@ vim.opt.tabstop = 4 vim.opt.softtabstop = 0 vim.opt.shiftwidth = 4 vim.opt.smarttab = true +vim.opt.expandtab = true -- Smart indenting vim.opt.autoindent = true diff --git a/lua/plugins/conform.lua b/lua/plugins/conform.lua index 2751524..7b7cd46 100644 --- a/lua/plugins/conform.lua +++ b/lua/plugins/conform.lua @@ -1,11 +1,12 @@ return { { "stevearc/conform.nvim", - config = function() - require("conform").setup({ - formatters_by_ft = { lua = { "stylua" } }, - format_on_save = { timeout_ms = 500, lsp_format = "fallback" }, - }) - end, + opts = { + formatters_by_ft = { + lua = { "stylua" }, + python = { "ruff_fix", "ruff_format", "ruff_organize_imports" }, + }, + format_on_save = { timeout_ms = 500, lsp_format = "fallback" }, + }, }, } diff --git a/lua/plugins/general.lua b/lua/plugins/general.lua deleted file mode 100644 index ee08d88..0000000 --- a/lua/plugins/general.lua +++ /dev/null @@ -1,42 +0,0 @@ -return { - { - "nvim-tree/nvim-tree.lua", - version = "*", - lazy = false, - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - keys = { - { "<leader>e", "<cmd>NvimTreeFocus<cr>", desc = "NvimTree focus" }, - }, - config = function() - require("nvim-tree").setup({}) - end, - }, - { - "nvim-telescope/telescope.nvim", - tag = "0.1.8", - keys = { - { "<C-p>", "<cmd>Telescope find_files<cr>", desc = "Telescope find files" }, - }, - }, - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - require("nvim-treesitter.configs").setup({ - ensure_installed = { "lua" }, - sync_install = false, - highlight = { enable = true }, - indent = { enable = true }, - }) - end, - }, - { - "ledger/vim-ledger", - version = "*", - config = function() - vim.g.ledger_fuzzy_account_completion = 1 - end, - }, -} diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..b9399e9 --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,6 @@ +return { + { + "lewis6991/gitsigns.nvim", + opts = {}, + }, +} diff --git a/lua/plugins/lsp.lua b/lua/plugins/mason.lua index 66a7e76..01132d7 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/mason.lua @@ -1,12 +1,8 @@ return { - { - "neovim/nvim-lspconfig", - }, + { "neovim/nvim-lspconfig" }, { "williamboman/mason.nvim", - config = function() - require("mason").setup() - end, + opts = {}, }, { "williamboman/mason-lspconfig.nvim", diff --git a/lua/plugins/nvim-autopairs.lua b/lua/plugins/nvim-autopairs.lua new file mode 100644 index 0000000..a35707a --- /dev/null +++ b/lua/plugins/nvim-autopairs.lua @@ -0,0 +1,6 @@ +return { + { + "windwp/nvim-autopairs", + opts = {}, + }, +} diff --git a/lua/plugins/nvim-cmp.lua b/lua/plugins/nvim-cmp.lua new file mode 100644 index 0000000..c4dd59d --- /dev/null +++ b/lua/plugins/nvim-cmp.lua @@ -0,0 +1,48 @@ +return { + { + "L3MON4D3/LuaSnip", + version = "v2.*", + }, + { + "hrsh7th/nvim-cmp", + dependencies = { + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-path", + "L3MON4D3/LuaSnip", + }, + opts = function() + local cmp = require("cmp") + return { + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + mapping = cmp.mapping.preset.insert({ + ["<C-h>"] = cmp.mapping.scroll_docs(-4), + ["<C-l>"] = cmp.mapping.scroll_docs(4), + ["<C-j>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + ["<C-k>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + ["<C-Space>"] = cmp.mapping(function(fallback) + -- Confirm with C-Space. If none selected, confirm first. + if cmp.visible() then + local entry = cmp.get_selected_entry() + if not entry then + cmp.select_next_item({ behaviour = cmp.SelectBehavior.Select }) + end + cmp.confirm() + else + fallback() + end + end, { "i", "s", "c" }), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "path" }, + { name = "buffer" }, + }), + } + end, + }, +} diff --git a/lua/plugins/nvim-tree.lua b/lua/plugins/nvim-tree.lua new file mode 100644 index 0000000..39fe2cf --- /dev/null +++ b/lua/plugins/nvim-tree.lua @@ -0,0 +1,13 @@ +return { + { + "nvim-tree/nvim-tree.lua", + lazy = false, + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + keys = { + { "<leader>e", "<cmd>NvimTreeFocus<cr>", desc = "NvimTree focus" }, + }, + opts = {}, + }, +} diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua new file mode 100644 index 0000000..5fc91d5 --- /dev/null +++ b/lua/plugins/nvim-treesitter.lua @@ -0,0 +1,14 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + require("nvim-treesitter.configs").setup({ + ensure_installed = { "lua", "python", "rust" }, + sync_install = false, + highlight = { enable = true }, + indent = { enable = true }, + }) + end, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..59efa89 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,9 @@ +return { + { + "nvim-telescope/telescope.nvim", + keys = { + { "<C-p>", "<cmd>Telescope find_files<cr>", desc = "Telescope find files" }, + { "<C-b>", "<cmd>Telescope keymaps<cr>", desc = "Telescope search keymaps" }, + }, + }, +} diff --git a/lua/plugins/tiny-inline-diagnostic.lua b/lua/plugins/tiny-inline-diagnostic.lua new file mode 100644 index 0000000..4bcfc6c --- /dev/null +++ b/lua/plugins/tiny-inline-diagnostic.lua @@ -0,0 +1,18 @@ +return { + { + "rachartier/tiny-inline-diagnostic.nvim", + priority = 1000, + opts = { + preset = "minimal", + options = { + show_source = true, + multiple_diag_under_cursor = true, + multiline = true, + enable_on_insert = true, + }, + }, + init = function() + vim.diagnostic.config({ virtual_text = false }) + end, + }, +} diff --git a/lua/plugins/vim-ledger.lua b/lua/plugins/vim-ledger.lua new file mode 100644 index 0000000..b90d293 --- /dev/null +++ b/lua/plugins/vim-ledger.lua @@ -0,0 +1,9 @@ +return { + { + "ledger/vim-ledger", + ft = "ledger", + init = function() + vim.g.ledger_fuzzy_account_completion = 1 + end, + }, +} |