all repos

init.lua @ bcebe86

my nvim config
10 files changed, 266 insertions(+), 255 deletions(-)
refactor way that plugins stores
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2023-06-29 00:22:56 +0300
Parent: 49fa37b
M lazy-lock.json

@@ -1,51 +1,51 @@

{ "Comment.nvim": { "branch": "master", "commit": "176e85eeb63f1a5970d6b88f1725039d85ca0055" }, - "LuaSnip": { "branch": "master", "commit": "4964cd11e19de4671189b97de37f3c4930d43191" }, + "LuaSnip": { "branch": "master", "commit": "c7984d1cca3d8615e4daefc196597872a0b8d590" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-conjure": { "branch": "master", "commit": "d76e1fe5d724afe604dfa7b4b5ba93f3d3730617" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" }, + "cmp-conjure": { "branch": "master", "commit": "d97816d5007be2b060f3a4e09f5b144d97d96fe8" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, - "codeium.vim": { "branch": "main", "commit": "99714b06b85e79d9247066f7612e9cc55458bcf1" }, + "codeium.vim": { "branch": "main", "commit": "3cd85d90c112c72ecd93763e0602b93e263f194c" }, "conjure": { "branch": "develop", "commit": "31a1626273e2bab479b6b8416a137f9edaba7daa" }, "debugprint.nvim": { "branch": "main", "commit": "3e27d34a767063033ca17e7e9d65c5cfae615354" }, "fidget.nvim": { "branch": "main", "commit": "f1c375ba68839eaa4a65efdf2aa078c0da0548fe" }, - "friendly-snippets": { "branch": "main", "commit": "70b727d3454cceb3a818b1746be09786568b7e33" }, + "friendly-snippets": { "branch": "main", "commit": "5749f093759c29e3694053d048ceb940fe12c3d3" }, "git-conflict.nvim": { "branch": "main", "commit": "3c89812a83ac749b8851a473863958325a1cd57c" }, - "gitsigns.nvim": { "branch": "main", "commit": "256569c2fe697a3003dbd49ff474e5935af9066c" }, + "gitsigns.nvim": { "branch": "main", "commit": "a36bc3360d584d39b4fb076d855c4180842d4444" }, "harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" }, - "lazy.nvim": { "branch": "main", "commit": "67af46a7f53e06322753cdd8cfd524bbb8ca30a2" }, + "lazy.nvim": { "branch": "main", "commit": "4c8b625bc873ca76b76eee0c28c98f1f7148f17f" }, "lsp-inlayhints.nvim": { "branch": "main", "commit": "d981f65c9ae0b6062176f0accb9c151daeda6f16" }, "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "d381fcb78d7a562c3244e1c8f76406954649db36" }, - "mason.nvim": { "branch": "main", "commit": "f7f81ab41b153e2902ebded401a8a0a6abe28607" }, - "neodev.nvim": { "branch": "main", "commit": "b41da3926ce1c022a2f6a7ea8858889c3a8be4d7" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "4c3baba22189aa2a08d32bb8d08b32c7e22a2e84" }, + "mason.nvim": { "branch": "main", "commit": "10da1a33b4ac24ad4d76a9af91871720ac6b65e4" }, + "neodev.nvim": { "branch": "main", "commit": "a2b1d8fb9fa4daa35d3fd9123bccccccbd4a3520" }, "neogit": { "branch": "master", "commit": "68a3e90e9d1ed9e362317817851d0f34b19e426b" }, "neotest": { "branch": "master", "commit": "e46eae5739c470aa011ee43108ea8a730736174e" }, "neotest-go": { "branch": "main", "commit": "4e7a87967e45f2b357fd546b0b7877774191772e" }, "neotest-plenary": { "branch": "master", "commit": "e0d9b1530307a03abcc52fc0ae28f054dea3f752" }, "null-ls.nvim": { "branch": "main", "commit": "bbaf5a96913aa92281f154b08732be2f57021c45" }, "nvim-autopairs": { "branch": "master", "commit": "e8f7dd7a72de3e7b6626c050a802000e69d53ff0" }, - "nvim-cmp": { "branch": "main", "commit": "b8c2a62b3bd3827aa059b43be3dd4b5c45037d65" }, + "nvim-cmp": { "branch": "main", "commit": "e1f1b40790a8cb7e64091fb12cc5ffe350363aa0" }, "nvim-dap": { "branch": "master", "commit": "a6d48d23407fbad7a4c1451803b8f34cab31c441" }, "nvim-dap-ui": { "branch": "master", "commit": "c020f660b02772f9f3d11f599fefad3268628a9e" }, "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, - "nvim-lspconfig": { "branch": "master", "commit": "9a2cc569c88662fa41d414bdb65b13ea72349f86" }, + "nvim-lspconfig": { "branch": "master", "commit": "b6b34b9acf84949f0ac1c00747765e62b81fb38d" }, "nvim-parinfer": { "branch": "master", "commit": "c0d95d9f4c5f921872ba11790b76efbb02cc8af5" }, - "nvim-treesitter": { "branch": "master", "commit": "fdddbff57665c872a92108da41c87adf040fda2e" }, - "nvim-treesitter-context": { "branch": "master", "commit": "05aa871a41078ae82158a37940972f6fea057c01" }, - "nvim-treesitter-endwise": { "branch": "master", "commit": "944b0d85bb6817948eaaf78893cbb23c25641d8f" }, + "nvim-treesitter": { "branch": "master", "commit": "e7f2b1276b7aa68099acc8169ce51f7e389b1772" }, + "nvim-treesitter-context": { "branch": "master", "commit": "6eccc445394df5ab9b1c1e2c445c033949a6a784" }, + "nvim-treesitter-endwise": { "branch": "master", "commit": "9298b3ac8fd6d0d8f9e321194c6d3fd37e417cf9" }, "nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" }, - "nvim-web-devicons": { "branch": "master", "commit": "14b3a5ba63b82b60cde98d0a40319d80f25e8301" }, - "oil.nvim": { "branch": "master", "commit": "6f8bf067c09e96d6bff548b5e6addb6d9c25a678" }, + "nvim-web-devicons": { "branch": "master", "commit": "9ab9b0b894b2388a9dbcdee5f00ce72e25d85bf9" }, + "oil.nvim": { "branch": "master", "commit": "0138a2e0f9baacd98d5531ebb5078fafc5114fae" }, "plenary.nvim": { "branch": "master", "commit": "36aaceb6e93addd20b1b18f94d86aecc552f30c4" }, "project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" }, - "schemastore.nvim": { "branch": "main", "commit": "335569380e25ef49b4837195f295f144012e3c87" }, + "schemastore.nvim": { "branch": "main", "commit": "7322390c9abff6f137774d9e04bddb3cd725afd1" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" }, - "telescope.nvim": { "branch": "master", "commit": "00cf15074a2997487813672a75f946d2ead95eb0" }, + "telescope.nvim": { "branch": "master", "commit": "6074847b6ee4b725747c8fc540d9b6b128ac8a12" }, "todo-comments.nvim": { "branch": "main", "commit": "09b0b17d824d2d56f02ff15967e8a2499a89c731" }, - "tokyonight.nvim": { "branch": "main", "commit": "18259404c962736c70c0f670b71c976c4a5ac2bb" }, - "trouble.nvim": { "branch": "main", "commit": "2af0dd9767526410c88c628f1cbfcb6cf22dd683" }, + "tokyonight.nvim": { "branch": "main", "commit": "fd0a005fd8986ec0d98a1938dc570303e8d8444b" }, + "trouble.nvim": { "branch": "main", "commit": "d99e2abd10808ef91738ce98a5c767e6a51df449" }, "undotree": { "branch": "master", "commit": "485f01efde4e22cb1ce547b9e8c9238f36566f21" }, "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
M lua/plugins.lua

@@ -2,7 +2,6 @@ return {

"nvim-lua/plenary.nvim", "kyazdani42/nvim-web-devicons", { "olexsmir/gopher.nvim", ft = "go", dev = true }, - { "mbbill/undotree", cmd = "UndotreeToggle" }, { "tpope/vim-surround", keys = { "c", "d", "y" } }, { "tpope/vim-repeat", event = "VeryLazy" }, { "tpope/vim-sleuth", event = "VeryLazy" },

@@ -14,28 +13,9 @@ vim.cmd.colorscheme "tokyonight-night"

end, }, { - "numToStr/Comment.nvim", - event = "BufRead", - keys = "gc", - config = true, - }, - { - "windwp/nvim-autopairs", - event = "InsertEnter", - opts = { - check_ts = true, - disable_filetype = { "TelescopePrompt", "clojure" }, - }, - }, - { "folke/todo-comments.nvim", event = "BufRead", config = true, - }, - { - "folke/trouble.nvim", - config = true, - cmd = { "Trouble", "TroubleToggle" }, }, { "williamboman/mason.nvim",
D

@@ -1,99 +0,0 @@

-return { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-buffer", - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-path", - "hrsh7th/cmp-nvim-lsp", - }, - config = function() - local cmp = require "cmp" - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - local luasnip = require "luasnip" - - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) - cmp.setup.filetype({ "gitcommit", "NeogitCommitMessage" }, { - sources = { { name = "buffer" }, { name = "luasnip" } }, - }) - - cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - window = {}, - formatting = { - format = function(_, vim_item) - vim_item.kind = ({ - Text = "", - Method = "", - Function = "", - Constructor = "", - Field = "", - Variable = "", - Class = "", - Interface = "", - Module = "", - Property = "", - Unit = "", - Value = "", - Enum = "", - Keyword = "", - Snippet = "", - Color = "", - File = "", - Reference = "", - Folder = "", - EnumMember = "", - Constant = "", - Struct = "", - Event = "", - Operator = "", - TypeParameter = "", - })[vim_item.kind] - - return vim_item - end, - }, - mapping = cmp.mapping.preset.insert { - ["<C-j>"] = cmp.mapping.select_next_item(), - ["<C-k>"] = cmp.mapping.select_prev_item(), - ["<C-d>"] = cmp.mapping.scroll_docs(-4), - ["<C-f>"] = cmp.mapping.scroll_docs(4), - ["<C-Space>"] = cmp.mapping.complete {}, - ["<CR>"] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }, - ["<Tab>"] = function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then - -- stylua: ignore - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, - ["<S-Tab>"] = function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - -- stylua: ignore - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end, - }, - sources = cmp.config.sources { - { name = "nvim_lsp", max_item_count = 8 }, - { name = "buffer", max_item_count = 4 }, - { name = "luasnip", max_item_count = 3 }, - { name = "path", max_item_count = 2 }, - }, - } - end, -}
D

@@ -1,32 +0,0 @@

-return { - "Exafunction/codeium.vim", - cmd = "Codeium", - event = "InsertEnter", - keys = { - { "<C-;>", vim.fn["codeium#Accept"], mode = "i", expr = true }, - { - "<C-,>", - function() - return vim.fn["codeium#CycleCompletions"](1) - end, - mode = "i", - expr = true, - }, - { - "<C-.>", - function() - return vim.fn["codeium#CycleCompletions"](-1) - end, - mode = "i", - expr = true, - }, - }, - init = function() - vim.g.codeium_disable_bindings = 1 - vim.g.codeium_filetypes = { - ["markdown"] = false, - ["gitcommit"] = false, - ["NeogitCommitMessage"] = false, - } - end, -}
A lua/plugins/common.lua

@@ -0,0 +1,36 @@

+return { + { + "ahmedkhalf/project.nvim", + event = "VeryLazy", + config = function() + require("project_nvim").setup { + show_hidden = true, + patterns = { + "^\\.git$", + "Makefile", + "Justfile", + "package.json", + "go.mod", + "go.work", + "pyproject.toml", + "Cargo.toml", + "deps.edn", + }, + } + end, + }, + { + "numToStr/Comment.nvim", + event = "BufRead", + keys = "gc", + config = true, + }, + { + "windwp/nvim-autopairs", + event = "InsertEnter", + opts = { + check_ts = true, + disable_filetype = { "TelescopePrompt", "clojure", "markdown" }, + }, + }, +}
A lua/plugins/completion.lua

@@ -0,0 +1,134 @@

+return { + { + "Exafunction/codeium.vim", + cmd = "Codeium", + event = "InsertEnter", + keys = { + { "<C-;>", vim.fn["codeium#Accept"], mode = "i", expr = true }, + { + "<C-,>", + function() + return vim.fn["codeium#CycleCompletions"](1) + end, + mode = "i", + expr = true, + }, + { + "<C-.>", + function() + return vim.fn["codeium#CycleCompletions"](-1) + end, + mode = "i", + expr = true, + }, + }, + init = function() + vim.g.codeium_disable_bindings = 1 + vim.g.codeium_filetypes = { + ["markdown"] = false, + ["gitcommit"] = false, + ["NeogitCommitMessage"] = false, + } + end, + }, + + { + "hrsh7th/nvim-cmp", + event = "InsertEnter", + dependencies = { + "hrsh7th/cmp-buffer", + "saadparwaiz1/cmp_luasnip", + "hrsh7th/cmp-path", + "hrsh7th/cmp-nvim-lsp", + }, + config = function() + local cmp = require "cmp" + local cmp_autopairs = require "nvim-autopairs.completion.cmp" + local luasnip = require "luasnip" + + cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) + cmp.setup.filetype({ "gitcommit", "NeogitCommitMessage" }, { + sources = { { name = "buffer" }, { name = "luasnip" } }, + }) + + cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + window = {}, + formatting = { + format = function(_, vim_item) + vim_item.kind = ({ + Text = "", + Method = "", + Function = "", + Constructor = "", + Field = "", + Variable = "", + Class = "", + Interface = "", + Module = "", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + })[vim_item.kind] + + return vim_item + end, + }, + mapping = cmp.mapping.preset.insert { + ["<C-j>"] = cmp.mapping.select_next_item(), + ["<C-k>"] = cmp.mapping.select_prev_item(), + ["<C-d>"] = cmp.mapping.scroll_docs(-4), + ["<C-f>"] = cmp.mapping.scroll_docs(4), + ["<C-Space>"] = cmp.mapping.complete {}, + ["<CR>"] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = false, + }, + ["<Tab>"] = function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + -- stylua: ignore + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "") + else + fallback() + end + end, + ["<S-Tab>"] = function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + -- stylua: ignore + vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "") + else + fallback() + end + end, + }, + sources = cmp.config.sources { + { name = "nvim_lsp", max_item_count = 8 }, + { name = "buffer", max_item_count = 4 }, + { name = "luasnip", max_item_count = 3 }, + { name = "path", max_item_count = 2 }, + }, + } + end, + }, +}
D

@@ -1,13 +0,0 @@

-local map = require("core.utils").smap -return { - "ThePrimeagen/harpoon", - config = true, - keys = { - { "<leader>a", map("harpoon.mark", "add_file") }, - { "<leader>1", map("harpoon.ui", "toggle_quick_menu") }, - { "<leader>3", map("harpoon.ui", "nav_file", "1") }, - { "<leader>4", map("harpoon.ui", "nav_file", "2") }, - { "<leader>5", map("harpoon.ui", "nav_file", "3") }, - { "<leader>6", map("harpoon.ui", "nav_file", "4") }, - }, -}
A lua/plugins/navigation.lua

@@ -0,0 +1,75 @@

+local map = require("core.utils").smap +return { + { "mbbill/undotree", cmd = "UndotreeToggle" }, + { + "ThePrimeagen/harpoon", + config = true, + keys = { + { "<leader>a", map("harpoon.mark", "add_file") }, + { "<leader>1", map("harpoon.ui", "toggle_quick_menu") }, + { "<leader>3", map("harpoon.ui", "nav_file", "1") }, + { "<leader>4", map("harpoon.ui", "nav_file", "2") }, + { "<leader>5", map("harpoon.ui", "nav_file", "3") }, + { "<leader>6", map("harpoon.ui", "nav_file", "4") }, + }, + }, + + { + "folke/trouble.nvim", + config = true, + cmd = { "Trouble", "TroubleToggle" }, + }, + + { + "stevearc/oil.nvim", + lazy = false, + keys = { { "<leader>e", map("oil", "open") } }, + opts = { + columns = { "icon" }, + use_default_keymaps = false, + delete_to_trash = true, + keymaps = { + ["?"] = "actions.show_help", + ["."] = "actions.toggle_hidden", + + ["<CR>"] = "actions.select", + ["<tab>"] = "actions.select", + + ["<C-v>"] = "actions.select_vsplit", + ["<C-s>"] = "actions.select_split", + ["<A-p>"] = "actions.preview", + ["<C-r>"] = "actions.refresh", + ["<C-c>"] = "actions.close", + + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + [","] = "actions.parent", + ["<"] = "actions.open_cwd", + + ["\\"] = "actions.cd", + ["C-\\"] = "actions.tcd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + }, + view_options = { + show_hidden = true, + is_always_hidden = function(name, _) + if + ({ + [".git"] = {}, + [".vscode"] = {}, + ["dist"] = {}, + ["node_modules"] = {}, + ["__pycache__"] = {}, + ["vendor"] = {}, + ["target"] = {}, + })[name] + then + return true + end + return false + end, + }, + }, + }, +}
D

@@ -1,50 +0,0 @@

-local map = require("core.utils").smap -return { - "stevearc/oil.nvim", - lazy = false, - keys = { { "<leader>e", map("oil", "open") } }, - opts = { - columns = { "icon" }, - use_default_keymaps = false, - delete_to_trash = true, - keymaps = { - ["?"] = "actions.show_help", - ["."] = "actions.toggle_hidden", - - ["<CR>"] = "actions.select", - ["<tab>"] = "actions.select", - - ["<C-v>"] = "actions.select_vsplit", - ["<C-s>"] = "actions.select_split", - ["<A-p>"] = "actions.preview", - ["<C-r>"] = "actions.refresh", - ["<C-c>"] = "actions.close", - - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - [","] = "actions.parent", - ["<"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["~"] = "actions.tcd", - }, - view_options = { - show_hidden = true, - is_always_hidden = function(name, _) - if - ({ - [".git"] = {}, - [".vscode"] = {}, - ["dist"] = {}, - ["node_modules"] = {}, - ["__pycache__"] = {}, - ["vendor"] = {}, - ["target"] = {}, - })[name] - then - return true - end - return false - end, - }, - }, -}
D

@@ -1,20 +0,0 @@

-return { - "ahmedkhalf/project.nvim", - event = "VeryLazy", - config = function() - require("project_nvim").setup { - show_hidden = true, - patterns = { - "^\\.git$", - "Makefile", - "Justfile", - "package.json", - "go.mod", - "go.work", - "pyproject.toml", - "Cargo.toml", - "deps.edn", - }, - } - end, -}