From 6f5292d290dfae26d396e2788d0e4a968061f467 Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Sat, 11 Jan 2025 14:31:30 +0100 Subject: [PATCH] revert --- init.lua | 29 ++++--- lazy-lock.json | 1 + lua/configs/cmp.lua | 57 ------------ lua/configs/gitsigns.lua | 8 -- lua/configs/lspconfig.lua | 167 +++++++++++++++++------------------ lua/configs/luasnip.lua | 22 ----- lua/configs/mason.lua | 15 ---- lua/configs/nvimtree.lua | 34 -------- lua/configs/telescope.lua | 24 ----- lua/mappings.lua | 33 ++++++- lua/nvchad/autocmds.lua | 27 ------ lua/nvchad/mappings.lua | 107 ----------------------- lua/nvchad/options.lua | 56 ------------ lua/nvchad/plugins/init.lua | 169 ------------------------------------ lua/plugins/init.lua | 132 ---------------------------- 15 files changed, 125 insertions(+), 756 deletions(-) delete mode 100644 lua/configs/cmp.lua delete mode 100644 lua/configs/gitsigns.lua delete mode 100644 lua/configs/luasnip.lua delete mode 100644 lua/configs/mason.lua delete mode 100644 lua/configs/nvimtree.lua delete mode 100644 lua/configs/telescope.lua delete mode 100644 lua/nvchad/autocmds.lua delete mode 100644 lua/nvchad/mappings.lua delete mode 100644 lua/nvchad/options.lua delete mode 100644 lua/nvchad/plugins/init.lua diff --git a/init.lua b/init.lua index 0b64f56..2ab4cc9 100644 --- a/init.lua +++ b/init.lua @@ -1,20 +1,15 @@ vim.g.base46_cache = vim.fn.stdpath "data" .. "/base46/" vim.g.mapleader = " " -vim.cmd "source test.vim" +vim.cmd("source test.vim") -- bootstrap lazy and all plugins local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim" if not vim.uv.fs_stat(lazypath) then - local repo = "https://github.com/folke/lazy.nvim.git" - vim.fn.system { - "git", - "clone", - "--filter=blob:none", - repo, - "--branch=stable", - lazypath, - } + local repo = "https://github.com/folke/lazy.nvim.git" + vim.fn.system { + "git", "clone", "--filter=blob:none", repo, "--branch=stable", lazypath + } end vim.opt.rtp:prepend(lazypath) @@ -23,7 +18,14 @@ local lazy_config = require "configs.lazy" -- load plugins require("lazy").setup({ - import = "plugins" + { + "NvChad/NvChad", + lazy = false, + branch = "v2.5", + import = "nvchad.plugins", + }, + + { import = "plugins" }, }, lazy_config) -- load theme @@ -31,13 +33,12 @@ dofile(vim.g.base46_cache .. "defaults") dofile(vim.g.base46_cache .. "statusline") require "options" -require "plugins" require "nvchad.autocmds" -require "configs.set" +require("configs.set") vim.opt.relativenumber = true vim.schedule(function() - require "mappings" + require "mappings" end) diff --git a/lazy-lock.json b/lazy-lock.json index c6394df..5efcac9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,6 +1,7 @@ { "CopilotChat.nvim": { "branch": "main", "commit": "2ebe591cff06018e265263e71e1dbc4c5aa8281e" }, "LuaSnip": { "branch": "master", "commit": "c9b9a22904c97d0eb69ccb9bab76037838326817" }, + "NvChad": { "branch": "v2.5", "commit": "bbc3d43db088c141b142a40cd5f717635833a54e" }, "auto-session": { "branch": "main", "commit": "021b64ed7d4ac68a37be3ad28d8e1cba5bec582c" }, "base46": { "branch": "v2.5", "commit": "5009bc479de4f53ec98e9dd1692beb1f39ff3a82" }, "bufresize.nvim": { "branch": "master", "commit": "3b19527ab936d6910484dcc20fb59bdb12322d8b" }, diff --git a/lua/configs/cmp.lua b/lua/configs/cmp.lua deleted file mode 100644 index 28071ae..0000000 --- a/lua/configs/cmp.lua +++ /dev/null @@ -1,57 +0,0 @@ -dofile(vim.g.base46_cache .. "cmp") - -local cmp = require "cmp" - -local options = { - completion = { completeopt = "menu,menuone" }, - - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - - mapping = { - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }, - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_jumpable() then - require("luasnip").expand_or_jump() - else - fallback() - end - end, { "i", "s" }), - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - require("luasnip").jump(-1) - else - fallback() - end - end, { "i", "s" }), - }, - - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "nvim_lua" }, - { name = "path" }, - }, -} - -return vim.tbl_deep_extend("force", options, require "nvchad.cmp") diff --git a/lua/configs/gitsigns.lua b/lua/configs/gitsigns.lua deleted file mode 100644 index 421348b..0000000 --- a/lua/configs/gitsigns.lua +++ /dev/null @@ -1,8 +0,0 @@ -dofile(vim.g.base46_cache .. "git") - -return { - signs = { - delete = { text = "󰍵" }, - changedelete = { text = "󱕖" }, - }, -} diff --git a/lua/configs/lspconfig.lua b/lua/configs/lspconfig.lua index cf56df5..8e72635 100644 --- a/lua/configs/lspconfig.lua +++ b/lua/configs/lspconfig.lua @@ -1,88 +1,78 @@ -local M = {} -local map = vim.keymap.set +local cmp = require("cmp") +local cmp_lsp = require("cmp_nvim_lsp") +local capabilities = vim.tbl_deep_extend( + "force", + {}, + vim.lsp.protocol.make_client_capabilities(), + cmp_lsp.default_capabilities() +) --- export on_attach & capabilities -M.on_attach = function(_, bufnr) - local function opts(desc) - return { buffer = bufnr, desc = "LSP " .. desc } - end - - map("n", "gD", vim.lsp.buf.declaration, opts "Go to declaration") - map("n", "gd", vim.lsp.buf.definition, opts "Go to definition") - map("n", "gi", vim.lsp.buf.implementation, opts "Go to implementation") - map("n", "sh", vim.lsp.buf.signature_help, opts "Show signature help") - map("n", "wa", vim.lsp.buf.add_workspace_folder, opts "Add workspace folder") - map("n", "wr", vim.lsp.buf.remove_workspace_folder, opts "Remove workspace folder") - - map("n", "wl", function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, opts "List workspace folders") - - map("n", "D", vim.lsp.buf.type_definition, opts "Go to type definition") - map("n", "ra", require "nvchad.lsp.renamer", opts "NvRenamer") - - map({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts "Code action") - map("n", "gr", vim.lsp.buf.references, opts "Show references") -end - --- disable semanticTokens -M.on_init = function(client, _) - if client.supports_method "textDocument/semanticTokens" then - client.server_capabilities.semanticTokensProvider = nil - end -end - -M.capabilities = vim.lsp.protocol.make_client_capabilities() - -M.capabilities.textDocument.completion.completionItem = { - documentationFormat = { "markdown", "plaintext" }, - snippetSupport = true, - preselectSupport = true, - insertReplaceSupport = true, - labelDetailsSupport = true, - deprecatedSupport = true, - commitCharactersSupport = true, - tagSupport = { valueSet = { 1 } }, - resolveSupport = { - properties = { - "documentation", - "detail", - "additionalTextEdits", - }, - }, -} - -M.defaults = function() - dofile(vim.g.base46_cache .. "lsp") - require("nvchad.lsp").diagnostic_config() - - require("lspconfig").lua_ls.setup { - on_attach = M.on_attach, - capabilities = M.capabilities, - on_init = M.on_init, - - settings = { - Lua = { - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = { - vim.fn.expand "$VIMRUNTIME/lua", - vim.fn.expand "$VIMRUNTIME/lua/vim/lsp", - vim.fn.stdpath "data" .. "/lazy/ui/nvchad_types", - vim.fn.stdpath "data" .. "/lazy/lazy.nvim/lua/lazy", - "${3rd}/luv/library", - }, - maxPreload = 100000, - preloadFileSize = 10000, - }, - }, - }, - } -end +require("nvchad.configs.lspconfig").defaults() require("fidget").setup({}) +require("mason").setup() +require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "rust_analyzer", + "gopls", + }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup { + capabilities = capabilities + } + end, + + zls = function() + local lspconfig = require("lspconfig") + lspconfig.zls.setup({ + root_dir = lspconfig.util.root_pattern(".git", "build.zig", "zls.json"), + settings = { + zls = { + enable_inlay_hints = true, + enable_snippets = true, + warn_style = true, + }, + }, + }) + vim.g.zig_fmt_parse_errors = 0 + vim.g.zig_fmt_autosave = 0 + + end, + ["lua_ls"] = function() + local lspconfig = require("lspconfig") + lspconfig.lua_ls.setup { + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "Lua 5.1" }, + diagnostics = { + globals = { "bit", "vim", "it", "describe", "before_each", "after_each" }, + } + } + } + } + end, + } +}) + +local cmp_select = { behaivior = cmp.SelectBehavior.Select } + +cmp.setup({ + snippet = { + expand = function(args) + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, + { + { name = 'buffer' }, + }) +}) vim.diagnostic.config({ -- update_in_insert = true, @@ -97,6 +87,7 @@ vim.diagnostic.config({ }) local lspconfig = require "lspconfig" +local nvlsp = require "nvchad.configs.lspconfig" -- EXAMPLE local servers = { @@ -114,15 +105,15 @@ local servers = { -- lsps with default config for _, lsp in ipairs(servers) do lspconfig[lsp].setup { - on_attach = M.on_attach, - on_init = M.on_init, - capabilities = M.capabilities, + on_attach = nvlsp.on_attach, + on_init = nvlsp.on_init, + capabilities = nvlsp.capabilities, } end -- configuring single server, example: typescript -- lspconfig.ts_ls.setup { --- on_attach = M.on_attach, --- on_init = M.on_init, --- capabilities = M.capabilities, +-- on_attach = nvlsp.on_attach, +-- on_init = nvlsp.on_init, +-- capabilities = nvlsp.capabilities, -- } diff --git a/lua/configs/luasnip.lua b/lua/configs/luasnip.lua deleted file mode 100644 index 18a6094..0000000 --- a/lua/configs/luasnip.lua +++ /dev/null @@ -1,22 +0,0 @@ --- vscode format -require("luasnip.loaders.from_vscode").lazy_load { exclude = vim.g.vscode_snippets_exclude or {} } -require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" } - --- snipmate format -require("luasnip.loaders.from_snipmate").load() -require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" } - --- lua format -require("luasnip.loaders.from_lua").load() -require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" } - -vim.api.nvim_create_autocmd("InsertLeave", { - callback = function() - if - require("luasnip").session.current_nodes[vim.api.nvim_get_current_buf()] - and not require("luasnip").session.jump_active - then - require("luasnip").unlink_current() - end - end, -}) diff --git a/lua/configs/mason.lua b/lua/configs/mason.lua deleted file mode 100644 index f3288b6..0000000 --- a/lua/configs/mason.lua +++ /dev/null @@ -1,15 +0,0 @@ -dofile(vim.g.base46_cache .. "mason") - -return { - PATH = "skip", - - ui = { - icons = { - package_pending = " ", - package_installed = " ", - package_uninstalled = " ", - }, - }, - - max_concurrent_installers = 10, -} diff --git a/lua/configs/nvimtree.lua b/lua/configs/nvimtree.lua deleted file mode 100644 index 20b3ac5..0000000 --- a/lua/configs/nvimtree.lua +++ /dev/null @@ -1,34 +0,0 @@ -dofile(vim.g.base46_cache .. "nvimtree") - -return { - filters = { dotfiles = false }, - disable_netrw = true, - hijack_cursor = true, - sync_root_with_cwd = true, - update_focused_file = { - enable = true, - update_root = false, - }, - view = { - width = 30, - preserve_window_proportions = true, - }, - renderer = { - root_folder_label = false, - highlight_git = true, - indent_markers = { enable = true }, - icons = { - glyphs = { - default = "󰈚", - folder = { - default = "", - empty = "", - empty_open = "", - open = "", - symlink = "", - }, - git = { unmerged = "" }, - }, - }, - }, -} diff --git a/lua/configs/telescope.lua b/lua/configs/telescope.lua deleted file mode 100644 index 58f4a72..0000000 --- a/lua/configs/telescope.lua +++ /dev/null @@ -1,24 +0,0 @@ -dofile(vim.g.base46_cache .. "telescope") - -return { - defaults = { - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - sorting_strategy = "ascending", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - }, - width = 0.87, - height = 0.80, - }, - mappings = { - n = { ["q"] = require("telescope.actions").close }, - }, - }, - - extensions_list = { "themes", "terms" }, - extensions = {}, -} diff --git a/lua/mappings.lua b/lua/mappings.lua index b821fcd..a809c7e 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -1,9 +1,34 @@ +-- local function resize_left() +-- local cur_win = vim.api.nvim_get_current_win() +-- vim.cmd('wincmd h') +-- local new_win = vim.api.nvim_get_current_win() +-- if cur_win == new_win then +-- vim.cmd('vertical resize -10') +-- elseif vim.bo[new_win].filetype == 'NvimTree' then +-- +-- else +-- vim.cmd('vertical resize -10') +-- vim.cmd('wincmd l') +-- end +-- end +-- +-- local function resize_right() +-- local cur_win = vim.api.nvim_get_current_win() +-- vim.cmd('wincmd l') +-- local new_win = vim.api.nvim_get_current_win() +-- if cur_win == new_win then +-- vim.cmd('vertical resize -10') +-- else +-- vim.cmd('vertical resize -10') +-- vim.cmd('wincmd h') +-- end +-- end + require "nvchad.mappings" -local map = vim.keymap.set +-- add yours here -map("v", "S-Up", ":m '<-2gv=gv") -map("v", "S-Down", ":m '>+1gv=gv") +local map = vim.keymap.set map("n", ";", ":", { desc = "CMD enter command mode" }) map("i", "jk", "") @@ -24,3 +49,5 @@ map('n', 'u', vim.cmd.UndotreeToggle) map("n", "", "BufDel") map("n", "", "ggVG", { noremap = true, silent = true }) + +-- map({ "n", "i", "v" }, "", " w ") diff --git a/lua/nvchad/autocmds.lua b/lua/nvchad/autocmds.lua deleted file mode 100644 index 47437aa..0000000 --- a/lua/nvchad/autocmds.lua +++ /dev/null @@ -1,27 +0,0 @@ -local autocmd = vim.api.nvim_create_autocmd - --- user event that loads after UIEnter + only if file buf is there -autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, { - group = vim.api.nvim_create_augroup("NvFilePost", { clear = true }), - callback = function(args) - local file = vim.api.nvim_buf_get_name(args.buf) - local buftype = vim.api.nvim_get_option_value("buftype", { buf = args.buf }) - - if not vim.g.ui_entered and args.event == "UIEnter" then - vim.g.ui_entered = true - end - - if file ~= "" and buftype ~= "nofile" and vim.g.ui_entered then - vim.api.nvim_exec_autocmds("User", { pattern = "FilePost", modeline = false }) - vim.api.nvim_del_augroup_by_name "NvFilePost" - - vim.schedule(function() - vim.api.nvim_exec_autocmds("FileType", {}) - - if vim.g.editorconfig then - require("editorconfig").config(args.buf) - end - end) - end - end, -}) diff --git a/lua/nvchad/mappings.lua b/lua/nvchad/mappings.lua deleted file mode 100644 index 526909b..0000000 --- a/lua/nvchad/mappings.lua +++ /dev/null @@ -1,107 +0,0 @@ -local map = vim.keymap.set - -map("i", "", "^i", { desc = "move beginning of line" }) -map("i", "", "", { desc = "move end of line" }) -map("i", "", "", { desc = "move left" }) -map("i", "", "", { desc = "move right" }) -map("i", "", "", { desc = "move down" }) -map("i", "", "", { desc = "move up" }) - -map("n", "", "h", { desc = "switch window left" }) -map("n", "", "l", { desc = "switch window right" }) -map("n", "", "j", { desc = "switch window down" }) -map("n", "", "k", { desc = "switch window up" }) - -map("n", "", "noh", { desc = "general clear highlights" }) - -map("n", "", "w", { desc = "general save file" }) -map("n", "", "%y+", { desc = "general copy whole file" }) - -map("n", "n", "set nu!", { desc = "toggle line number" }) -map("n", "rn", "set rnu!", { desc = "toggle relative number" }) -map("n", "ch", "NvCheatsheet", { desc = "toggle nvcheatsheet" }) - -map("n", "fm", function() - require("conform").format { lsp_fallback = true } -end, { desc = "general format file" }) - --- global lsp mappings -map("n", "ds", vim.diagnostic.setloclist, { desc = "LSP diagnostic loclist" }) - --- tabufline -map("n", "b", "enew", { desc = "buffer new" }) - -map("n", "", function() - require("nvchad.tabufline").next() -end, { desc = "buffer goto next" }) - -map("n", "", function() - require("nvchad.tabufline").prev() -end, { desc = "buffer goto prev" }) - -map("n", "x", function() - require("nvchad.tabufline").close_buffer() -end, { desc = "buffer close" }) - --- Comment -map("n", "/", "gcc", { desc = "toggle comment", remap = true }) -map("v", "/", "gc", { desc = "toggle comment", remap = true }) - --- nvimtree -map("n", "", "NvimTreeToggle", { desc = "nvimtree toggle window" }) -map("n", "e", "NvimTreeFocus", { desc = "nvimtree focus window" }) - --- telescope -map("n", "fw", "Telescope live_grep", { desc = "telescope live grep" }) -map("n", "fb", "Telescope buffers", { desc = "telescope find buffers" }) -map("n", "fh", "Telescope help_tags", { desc = "telescope help page" }) -map("n", "ma", "Telescope marks", { desc = "telescope find marks" }) -map("n", "fo", "Telescope oldfiles", { desc = "telescope find oldfiles" }) -map("n", "fz", "Telescope current_buffer_fuzzy_find", { desc = "telescope find in current buffer" }) -map("n", "cm", "Telescope git_commits", { desc = "telescope git commits" }) -map("n", "gt", "Telescope git_status", { desc = "telescope git status" }) -map("n", "pt", "Telescope terms", { desc = "telescope pick hidden term" }) - -map("n", "th", function() - require("nvchad.themes").open() -end, { desc = "telescope nvchad themes" }) - -map("n", "ff", "Telescope find_files", { desc = "telescope find files" }) -map( - "n", - "fa", - "Telescope find_files follow=true no_ignore=true hidden=true", - { desc = "telescope find all files" } -) - --- terminal -map("t", "", "", { desc = "terminal escape terminal mode" }) - --- new terminals -map("n", "h", function() - require("nvchad.term").new { pos = "sp" } -end, { desc = "terminal new horizontal term" }) - -map("n", "v", function() - require("nvchad.term").new { pos = "vsp" } -end, { desc = "terminal new vertical term" }) - --- toggleable -map({ "n", "t" }, "", function() - require("nvchad.term").toggle { pos = "vsp", id = "vtoggleTerm" } -end, { desc = "terminal toggleable vertical term" }) - -map({ "n", "t" }, "", function() - require("nvchad.term").toggle { pos = "sp", id = "htoggleTerm" } -end, { desc = "terminal toggleable horizontal term" }) - -map({ "n", "t" }, "", function() - require("nvchad.term").toggle { pos = "float", id = "floatTerm" } -end, { desc = "terminal toggle floating term" }) - --- whichkey -map("n", "wK", "WhichKey ", { desc = "whichkey all keymaps" }) - -map("n", "wk", function() - vim.cmd("WhichKey " .. vim.fn.input "WhichKey: ") -end, { desc = "whichkey query lookup" }) diff --git a/lua/nvchad/options.lua b/lua/nvchad/options.lua deleted file mode 100644 index 88270f1..0000000 --- a/lua/nvchad/options.lua +++ /dev/null @@ -1,56 +0,0 @@ -local opt = vim.opt -local o = vim.o -local g = vim.g - --------------------------------------- options ------------------------------------------ -o.laststatus = 3 -o.showmode = false - -o.clipboard = "unnamedplus" -o.cursorline = true -o.cursorlineopt = "number" - --- Indenting -o.expandtab = true -o.shiftwidth = 2 -o.smartindent = true -o.tabstop = 2 -o.softtabstop = 2 - -opt.fillchars = { eob = " " } -o.ignorecase = true -o.smartcase = true -o.mouse = "a" - --- Numbers -o.number = true -o.numberwidth = 2 -o.ruler = false - --- disable nvim intro -opt.shortmess:append "sI" - -o.signcolumn = "yes" -o.splitbelow = true -o.splitright = true -o.timeoutlen = 400 -o.undofile = true - --- interval for writing swap file to disk, also used by gitsigns -o.updatetime = 250 - --- go to previous/next line with h,l,left arrow and right arrow --- when cursor reaches end/beginning of line -opt.whichwrap:append "<>[]hl" - --- disable some default providers -g.loaded_node_provider = 0 -g.loaded_python3_provider = 0 -g.loaded_perl_provider = 0 -g.loaded_ruby_provider = 0 - --- add binaries installed by mason.nvim to path -local is_windows = vim.fn.has "win32" ~= 0 -local sep = is_windows and "\\" or "/" -local delim = is_windows and ";" or ":" -vim.env.PATH = table.concat({ vim.fn.stdpath "data", "mason", "bin" }, sep) .. delim .. vim.env.PATH diff --git a/lua/nvchad/plugins/init.lua b/lua/nvchad/plugins/init.lua deleted file mode 100644 index 30d376e..0000000 --- a/lua/nvchad/plugins/init.lua +++ /dev/null @@ -1,169 +0,0 @@ -return { - "nvim-lua/plenary.nvim", - - { - "nvchad/base46", - build = function() - require("base46").load_all_highlights() - end, - }, - - { - "nvchad/ui", - lazy = false, - config = function() - require "nvchad" - end, - }, - - "nvzone/volt", - "nvzone/menu", - { "nvzone/minty", cmd = { "Huefy", "Shades" } }, - - { - "nvim-tree/nvim-web-devicons", - opts = function() - dofile(vim.g.base46_cache .. "devicons") - return { override = require "nvchad.icons.devicons" } - end, - }, - - { - "lukas-reineke/indent-blankline.nvim", - event = "User FilePost", - opts = { - indent = { char = "│", highlight = "IblChar" }, - scope = { char = "│", highlight = "IblScopeChar" }, - }, - config = function(_, opts) - dofile(vim.g.base46_cache .. "blankline") - - local hooks = require "ibl.hooks" - hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level) - require("ibl").setup(opts) - - dofile(vim.g.base46_cache .. "blankline") - end, - }, - - -- file managing , picker etc - { - "nvim-tree/nvim-tree.lua", - cmd = { "NvimTreeToggle", "NvimTreeFocus" }, - opts = function() - return require "nvchad.configs.nvimtree" - end, - }, - - { - "folke/which-key.nvim", - keys = { "", "", '"', "'", "`", "c", "v", "g" }, - cmd = "WhichKey", - opts = function() - dofile(vim.g.base46_cache .. "whichkey") - return {} - end, - }, - - -- formatting! - { - "stevearc/conform.nvim", - opts = { - formatters_by_ft = { lua = { "stylua" } }, - }, - }, - - -- git stuff - { - "lewis6991/gitsigns.nvim", - event = "User FilePost", - opts = function() - return require "nvchad.configs.gitsigns" - end, - }, - - -- lsp stuff - { - "williamboman/mason.nvim", - cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" }, - opts = function() - return require "nvchad.configs.mason" - end, - }, - - { - "neovim/nvim-lspconfig", - event = "User FilePost", - config = function() - require("nvchad.configs.lspconfig").defaults() - end, - }, - - -- load luasnips + cmp related in insert mode only - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { - -- snippet plugin - "L3MON4D3/LuaSnip", - dependencies = "rafamadriz/friendly-snippets", - opts = { history = true, updateevents = "TextChanged,TextChangedI" }, - config = function(_, opts) - require("luasnip").config.set_config(opts) - require "nvchad.configs.luasnip" - end, - }, - - -- autopairing of (){}[] etc - { - "windwp/nvim-autopairs", - opts = { - fast_wrap = {}, - disable_filetype = { "TelescopePrompt", "vim" }, - }, - config = function(_, opts) - require("nvim-autopairs").setup(opts) - - -- setup cmp for autopairs - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, - }, - - -- cmp sources plugins - { - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, - }, - opts = function() - return require "nvchad.configs.cmp" - end, - }, - - { - "nvim-telescope/telescope.nvim", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - cmd = "Telescope", - opts = function() - return require "nvchad.configs.telescope" - end, - }, - - { - "nvim-treesitter/nvim-treesitter", - event = { "BufReadPost", "BufNewFile" }, - cmd = { "TSInstall", "TSBufEnable", "TSBufDisable", "TSModuleInfo" }, - build = ":TSUpdate", - opts = function() - return require "nvchad.configs.treesitter" - end, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, - }, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index d109d51..5ae44a3 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -146,136 +146,4 @@ return { }, }, }, - "nvim-lua/plenary.nvim", - - { - "nvchad/base46", - build = function() - require("base46").load_all_highlights() - end, - }, - - { - "nvchad/ui", - lazy = false, - config = function() - require "nvchad" - end, - }, - - "nvzone/volt", - "nvzone/menu", - { "nvzone/minty", cmd = { "Huefy", "Shades" } }, - - { - "nvim-tree/nvim-web-devicons", - opts = function() - dofile(vim.g.base46_cache .. "devicons") - end, - }, - - { - "lukas-reineke/indent-blankline.nvim", - event = "User FilePost", - opts = { - indent = { char = "│", highlight = "IblChar" }, - scope = { char = "│", highlight = "IblScopeChar" }, - }, - config = function(_, opts) - dofile(vim.g.base46_cache .. "blankline") - - local hooks = require "ibl.hooks" - hooks.register(hooks.type.WHITESPACE, hooks.builtin.hide_first_space_indent_level) - require("ibl").setup(opts) - - dofile(vim.g.base46_cache .. "blankline") - end, - }, - - -- file managing , picker etc - { - "nvim-tree/nvim-tree.lua", - cmd = { "NvimTreeToggle", "NvimTreeFocus" }, - opts = function() - return require "configs.nvimtree" - end, - }, - - { - "folke/which-key.nvim", - keys = { "", "", '"', "'", "`", "c", "v", "g" }, - cmd = "WhichKey", - opts = function() - dofile(vim.g.base46_cache .. "whichkey") - return {} - end, - }, - - -- git stuff - { - "lewis6991/gitsigns.nvim", - event = "User FilePost", - opts = function() - return require "configs.gitsigns" - end, - }, - - -- lsp stuff - { - "williamboman/mason.nvim", - cmd = { "Mason", "MasonInstall", "MasonInstallAll", "MasonUpdate" }, - opts = function() - return require "configs.mason" - end, - }, - - -- load luasnips + cmp related in insert mode only - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { - -- snippet plugin - "L3MON4D3/LuaSnip", - dependencies = "rafamadriz/friendly-snippets", - opts = { history = true, updateevents = "TextChanged,TextChangedI" }, - config = function(_, opts) - require("luasnip").config.set_config(opts) - require "configs.luasnip" - end, - }, - - -- autopairing of (){}[] etc - { - "windwp/nvim-autopairs", - opts = { - fast_wrap = {}, - disable_filetype = { "TelescopePrompt", "vim" }, - }, - config = function(_, opts) - require("nvim-autopairs").setup(opts) - - -- setup cmp for autopairs - local cmp_autopairs = require "nvim-autopairs.completion.cmp" - require("cmp").event:on("confirm_done", cmp_autopairs.on_confirm_done()) - end, - }, - - -- cmp sources plugins - { - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lua", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-path", - }, - }, - }, - { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - opts = function() - return require "configs.telescope" - end, - }, }