diff --git a/lazyvim.json b/lazyvim.json index 51aa85d..9dc70b4 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -1,11 +1,13 @@ { "extras": [ + "lazyvim.plugins.extras.coding.mini-surround", + "lazyvim.plugins.extras.editor.mini-files" "lazyvim.plugins.extras.dap.core", "lazyvim.plugins.extras.lang.java", "lazyvim.plugins.extras.test.core" ], "news": { - "NEWS.md": "2123" + "NEWS.md": "6520" }, - "version": 3 -} \ No newline at end of file + "version": 6 +} diff --git a/lazyvim.json.orig b/lazyvim.json.orig new file mode 100644 index 0000000..7735fff --- /dev/null +++ b/lazyvim.json.orig @@ -0,0 +1,20 @@ +{ + "extras": [ +<<<<<<< HEAD + "lazyvim.plugins.extras.dap.core", + "lazyvim.plugins.extras.lang.java", + "lazyvim.plugins.extras.test.core" +======= + "lazyvim.plugins.extras.coding.mini-surround", + "lazyvim.plugins.extras.editor.mini-files" +>>>>>>> main + ], + "news": { + "NEWS.md": "6520" + }, +<<<<<<< HEAD + "version": 3 +======= + "version": 6 +>>>>>>> main +} \ No newline at end of file diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 891b190..d73bfa1 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -1,19 +1,23 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - -- bootstrap lazy.nvim - -- stylua: ignore - vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) +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 end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) +vim.opt.rtp:prepend(lazypath) require("lazy").setup({ spec = { -- add LazyVim and import its plugins { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- import any extras modules here - -- { import = "lazyvim.plugins.extras.lang.typescript" }, - -- { import = "lazyvim.plugins.extras.lang.json" }, - -- { import = "lazyvim.plugins.extras.ui.mini-animate" }, -- import/override with your plugins { import = "plugins" }, }, @@ -27,7 +31,10 @@ require("lazy").setup({ -- version = "*", -- try installing the latest stable version for plugins that support semver }, install = { colorscheme = { "tokyonight", "habamax" } }, - checker = { enabled = true }, -- automatically check for plugin updates + checker = { + enabled = true, -- check for plugin updates periodically + notify = false, -- notify on update + }, -- automatically check for plugin updates performance = { rtp = { -- disable some rtp plugins diff --git a/lua/plugins/example.lua b/lua/plugins/example.lua index 6859c0e..4ad9825 100644 --- a/lua/plugins/example.lua +++ b/lua/plugins/example.lua @@ -30,14 +30,6 @@ return { -- disable trouble { "folke/trouble.nvim", enabled = false }, - -- add symbols-outline - { - "simrat39/symbols-outline.nvim", - cmd = "SymbolsOutline", - keys = { { "cs", "SymbolsOutline", desc = "Symbols Outline" } }, - config = true, - }, - -- override nvim-cmp and add cmp-emoji { "hrsh7th/nvim-cmp", @@ -71,18 +63,6 @@ return { }, }, - -- add telescope-fzf-native - { - "telescope.nvim", - dependencies = { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - config = function() - require("telescope").load_extension("fzf") - end, - }, - }, - -- add pyright to lspconfig { "neovim/nvim-lspconfig", @@ -210,56 +190,4 @@ return { }, }, }, - - -- Use for completion and snippets (supertab) - -- first: disable default and behavior in LuaSnip - { - "L3MON4D3/LuaSnip", - keys = function() - return {} - end, - }, - -- then: setup supertab in cmp - { - "hrsh7th/nvim-cmp", - dependencies = { - "hrsh7th/cmp-emoji", - }, - ---@param opts cmp.ConfigSchema - opts = function(_, opts) - local has_words_before = function() - 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 - - local luasnip = require("luasnip") - local cmp = require("cmp") - - opts.mapping = vim.tbl_extend("force", opts.mapping, { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() - -- this way you will only jump inside the snippet region - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { "i", "s" }), - }) - end, - }, } diff --git a/lua/plugins/extend-mini-files.lua b/lua/plugins/extend-mini-files.lua new file mode 100644 index 0000000..b557ea8 --- /dev/null +++ b/lua/plugins/extend-mini-files.lua @@ -0,0 +1,10 @@ +return { + "echasnovski/mini.files", + opts = { + windows = { + width_nofocus = 20, + width_focus = 50, + width_preview = 100, + }, + }, +} diff --git a/lua/plugins/extend-treesitter.lua b/lua/plugins/extend-treesitter.lua new file mode 100644 index 0000000..fdd44b9 --- /dev/null +++ b/lua/plugins/extend-treesitter.lua @@ -0,0 +1,9 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + -- add parsers, without replacing the default ones + vim.list_extend(opts.ensure_installed, { + "java", + }) + end, +} diff --git a/lua/plugins/in-and-out.lua b/lua/plugins/in-and-out.lua new file mode 100644 index 0000000..d42814d --- /dev/null +++ b/lua/plugins/in-and-out.lua @@ -0,0 +1,12 @@ +return { + "ysmb-wtsg/in-and-out.nvim", + keys = { + { + "", + function() + require("in-and-out").in_and_out() + end, + mode = "i", + }, + }, +} diff --git a/lua/plugins/undotree.lua b/lua/plugins/undotree.lua new file mode 100644 index 0000000..6becb88 --- /dev/null +++ b/lua/plugins/undotree.lua @@ -0,0 +1,12 @@ +return { + "jiaoshijie/undotree", + dependencies = "nvim-lua/plenary.nvim", + config = true, + keys = { -- load the plugin only when using it's keybinding: + { + "uu", + "lua require('undotree').toggle()", + desc = "Toggle UndoTree", + }, + }, +}