From 3cb62eeef00693830590d98a5ee993eacf383c0f Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Mon, 16 Dec 2024 17:13:36 -0500 Subject: [PATCH] neovim 2: electric boogaloo --- nvim/.config/nvim/init.lua | 1107 ++++++++--------- nvim/.config/nvim/lazy-lock.json | 41 +- nvim/.config/nvim/lua/vxclutch/compile.lua | 11 + nvim/.config/nvim/lua/vxclutch/init.lua | 3 + .../nvim/lua/vxclutch/lazy/appearance.lua | 32 + .../.config/nvim/lua/vxclutch/lazy/format.lua | 30 + .../nvim/lua/vxclutch/lazy/gitsigns.lua | 12 + .../nvim/lua/vxclutch/lazy/harpoon.lua | 40 + nvim/.config/nvim/lua/vxclutch/lazy/lsp.lua | 95 ++ nvim/.config/nvim/lua/vxclutch/lazy/oil.lua | 19 + .../nvim/lua/vxclutch/lazy/telescope.lua | 36 + nvim/.config/nvim/lua/vxclutch/lazy_init.lua | 17 + nvim/.config/nvim/lua/vxclutch/remap.lua | 26 + nvim/.config/nvim/lua/vxclutch/set.lua | 31 + nvim/.config/nvim/lua/vxclutch/telescope.lua | 29 + wezterm/.wezterm.lua | 117 +- 16 files changed, 956 insertions(+), 690 deletions(-) create mode 100644 nvim/.config/nvim/lua/vxclutch/compile.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/init.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/format.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/gitsigns.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/harpoon.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/lsp.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/oil.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy_init.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/remap.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/set.lua create mode 100644 nvim/.config/nvim/lua/vxclutch/telescope.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index d59b575..d18c037 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -1,592 +1,523 @@ -vim.g.mapleader = " " -vim.g.maplocalleader = " " -vim.opt.number = true -vim.opt.mouse = "a" -vim.opt.showmode = false -vim.opt.breakindent = true -vim.opt.undofile = true -vim.opt.ignorecase = true -vim.opt.smartcase = true -vim.opt.signcolumn = "yes" -vim.opt.updatetime = 250 -vim.opt.timeoutlen = 300 -vim.opt.splitright = true -vim.opt.splitbelow = true -vim.opt.inccommand = "split" -vim.opt.cursorline = true -vim.opt.scrolloff = 8 -vim.keymap.set("n", "", "nohlsearch") -vim.opt.tabstop = 2 -vim.opt.shiftwidth = 2 -vim.opt.expandtab = true -vim.bo.softtabstop = 2 -vim.opt.termguicolors = true -vim.opt.guicursor = "" -vim.opt.nu = true -vim.opt.relativenumber = true -vim.opt.wrap = false -vim.opt.smartindent = true -vim.opt.swapfile = false -vim.opt.scrolloff = 8 -vim.opt.updatetime = 50 -vim.opt.colorcolumn = "127" +require("vxclutch") vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) -vim.keymap.set("v", "J", ":m '>+1gv=gv") -vim.keymap.set("v", "K", ":m '>-2gv=gv") - --- File navigation -vim.keymap.set("n", "-", "Oil", { noremap = true, silent = true, desc = "Open Oil" }) -function NavigationLogic() - local orgWin = vim.api.nvim_get_current_win() - vim.cmd("split | Oil") - local secWin = vim.api.nvim_get_current_buf() -end -vim.keymap.set( - "n", - "-", - "lua NavigationLogic()", - { noremap = true, silent = true, desc = "File navigation" } -) - --- Compile -vim.keymap.set("n", "cc", "Compile", { noremap = true, silent = true, desc = "Compile" }) -vim.keymap.set("n", "rc", "Recompile", { noremap = true, silent = true, desc = "Recompile" }) -vim.api.nvim_create_autocmd("FileType", { - pattern = "compilation", - callback = function() - vim.keymap.set("n", "", ":quit", { buffer = true }) - end, -}) - --- TIP: Disable arrow keys in normal mode -vim.keymap.set("n", "", 'echo "Use h to move!!"') -vim.keymap.set("n", "", 'echo "Use l to move!!"') -vim.keymap.set("n", "", 'echo "Use k to move!!"') -vim.keymap.set("n", "", 'echo "Use j to move!!"') --- Window Controls -vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) -vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.uv.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 - error("Error cloning lazy.nvim:\n" .. out) - end -end ---@diagnostic disable-next-line: undefined-field -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ - "tpope/vim-sleuth", - { - "lewis6991/gitsigns.nvim", - opts = { - signs = { - add = { text = "+" }, - change = { text = "~" }, - delete = { text = "_" }, - topdelete = { text = "‾" }, - changedelete = { text = "~" }, - }, - }, - }, - { - "folke/which-key.nvim", - event = "VimEnter", - config = function() - require("which-key").setup() - require("which-key").add({ - { "c", group = "[C]ode" }, - { "d", group = "[D]ocument" }, - { "r", group = "[R]ename" }, - { "s", group = "[S]earch" }, - { "w", group = "[W]orkspace" }, - { "h", group = "Git [H]unk", mode = { "n", "v" } }, - }) - end, - }, - { - "nvim-telescope/telescope.nvim", - event = "VimEnter", - branch = "0.1.x", - dependencies = { - "nvim-lua/plenary.nvim", - { - "nvim-telescope/telescope-fzf-native.nvim", - build = "make", - cond = function() - return vim.fn.executable("make") == 1 - end, - }, - { "nvim-telescope/telescope-ui-select.nvim" }, - { "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font }, - }, - config = function() - require("telescope").setup({ - extensions = { - ["ui-select"] = { - require("telescope.themes").get_dropdown(), - }, - }, - }) - pcall(require("telescope").load_extension, "fzf") - pcall(require("telescope").load_extension, "ui-select") - local builtin = require("telescope.builtin") - vim.keymap.set("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) - vim.keymap.set("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) - vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) - vim.keymap.set("n", "ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" }) - vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch current [W]ord" }) - vim.keymap.set("n", "", builtin.live_grep, { desc = "[S]earch by [G]rep" }) - vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) - vim.keymap.set("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) - vim.keymap.set("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set("n", "sb", builtin.buffers, { desc = "[ ] Find existing buffers" }) - vim.keymap.set("n", "/", function() - builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ - winblend = 10, - previewer = false, - })) - end, { desc = "[/] Fuzzily search in current buffer" }) - vim.keymap.set("n", "s/", function() - builtin.live_grep({ - grep_open_files = true, - prompt_title = "Live Grep in Open Files", - }) - end, { desc = "[S]earch [/] in Open Files" }) - vim.keymap.set("n", "sn", function() - builtin.find_files({ cwd = vim.fn.stdpath("config") }) - end, { desc = "[S]earch [N]eovim files" }) - end, - }, - -- LSP Plugins - { - "folke/lazydev.nvim", - ft = "lua", - opts = { - library = { - { path = "luvit-meta/library", words = { "vim%.uv" } }, - }, - }, - }, - { "Bilal2453/luvit-meta", lazy = true }, - { - "neovim/nvim-lspconfig", - dependencies = { - { "williamboman/mason.nvim", config = true }, -- NOTE: Must be loaded before dependants - "williamboman/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", - { "j-hui/fidget.nvim", opts = {} }, - "hrsh7th/cmp-nvim-lsp", - }, - config = function() - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), - callback = function(event) - local map = function(keys, func, desc) - vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) - end - map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") - map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") - map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") - map("D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") - map("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") - map( - "ws", - require("telescope.builtin").lsp_dynamic_workspace_symbols, - "[W]orkspace [S]ymbols" - ) - map("rn", vim.lsp.buf.rename, "[R]e[n]ame") - map("ca", vim.lsp.buf.code_action, "[C]ode [A]ction") - map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") - local client = vim.lsp.get_client_by_id(event.data.client_id) - if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then - local highlight_augroup = - vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) - vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.document_highlight, - }) - - vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { - buffer = event.buf, - group = highlight_augroup, - callback = vim.lsp.buf.clear_references, - }) - - vim.api.nvim_create_autocmd("LspDetach", { - group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }), - callback = function(event2) - vim.lsp.buf.clear_references() - vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf }) - end, - }) - end - if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then - map("th", function() - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) - end, "[T]oggle Inlay [H]ints") - end - end, - }) - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) - local servers = { - lua_ls = { - settings = { - Lua = { - completion = { - callSnippet = "Replace", - }, - }, - }, - }, - clangd = {}, - } - require("mason").setup() - local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, { - "stylua", - }) - require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) - - require("mason-lspconfig").setup({ - handlers = { - function(server_name) - local server = servers[server_name] or {} - server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) - require("lspconfig")[server_name].setup(server) - end, - }, - }) - end, - }, - - { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - "f", - function() - require("conform").format({ async = true, lsp_fallback = true }) - end, - mode = "", - desc = "[F]ormat buffer", - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - local disable_filetypes = { c = true, cpp = true } - return { - timeout_ms = 500, - lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], - } - end, - formatters_by_ft = { - lua = { "stylua" }, - }, - }, - }, - - { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { - "L3MON4D3/LuaSnip", - build = (function() - if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then - return - end - return "make install_jsregexp" - end)(), - dependencies = {}, - }, - "saadparwaiz1/cmp_luasnip", - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-path", - }, - config = function() - local cmp = require("cmp") - local luasnip = require("luasnip") - luasnip.config.setup({}) - cmp.setup({ - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { completeopt = "menu,menuone,noinsert" }, - mapping = cmp.mapping.preset.insert({ - [""] = cmp.mapping.select_next_item(), - [""] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.confirm({ select = true }), - [""] = cmp.mapping.complete({}), - [""] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { "i", "s" }), - [""] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { "i", "s" }), - }), - sources = { - { - name = "lazydev", - group_index = 0, - }, - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "path" }, - }, - }) - end, - }, - { - "folke/todo-comments.nvim", - event = "VimEnter", - dependencies = { "nvim-lua/plenary.nvim" }, - opts = { signs = false }, - }, - { - "echasnovski/mini.nvim", - config = function() - require("mini.ai").setup({ n_lines = 500 }) - require("mini.surround").setup() - local statusline = require("mini.statusline") - statusline.setup({ use_icons = vim.g.have_nerd_font }) - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return "%2l:%-2v" - end - end, - }, - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - opts = { - ensure_installed = { - "bash", - "go", - "diff", - "html", - "lua", - "luadoc", - "markdown", - "markdown_inline", - "query", - "vim", - "vimdoc", - }, - auto_install = true, - highlight = { - enable = true, - additional_vim_regex_highlighting = { "ruby" }, - }, - indent = { enable = true, disable = { "ruby" } }, - }, - config = function(_, opts) - ---@diagnostic disable-next-line: missing-fields - require("nvim-treesitter.configs").setup(opts) - end, - }, - { - "stevearc/oil.nvim", - opts = {}, - config = function() - require("oil").setup({ - default_file_explorer = true, - delete_to_trash = true, - skip_confirm_for_simple_edits = true, - view_options = { - show_hidden = true, - natural_order = true, - is_always_hidden = function(name, _) - return name == ".." or name == ".git" - end, - }, - }) - end, - dependencies = { "nvim-tree/nvim-web-devicons" }, - }, - { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local harpoon = require("harpoon") - - -- REQUIRED - harpoon:setup() - -- REQUIRED - - vim.keymap.set("n", "a", function() - harpoon:list():add() - end, { desc = "Append to harpoon" }) - vim.keymap.set("n", "", function() - harpoon.ui:toggle_quick_menu(harpoon:list()) - end, { desc = "Quick Menu" }) - - vim.keymap.set("n", "", function() - harpoon:list():select(1) - end, { desc = "Select First" }) - vim.keymap.set("n", "", function() - harpoon:list():select(2) - end, { desc = "Select Second" }) - vim.keymap.set("n", "", function() - harpoon:list():select(3) - end, { desc = "Select Third" }) - vim.keymap.set("n", "", function() - harpoon:list():select(4) - end, { desc = "Select Fourth" }) - - -- Toggle previous & next buffers stored within Harpoon list - vim.keymap.set("n", "", function() - harpoon:list():prev() - end, { desc = "Select Previous" }) - vim.keymap.set("n", "", function() - harpoon:list():next() - end, { desc = "Select Next" }) - end, - }, - { - "tpope/vim-fugitive", - }, - { - "tpope/vim-surround", - }, - { - "utilyre/barbecue.nvim", - name = "barbecue", - version = "*", - config = function() - require("barbecue").setup({ - theme = "solarized", - }) - end, - dependencies = { - "SmiteshP/nvim-navic", - "nvim-tree/nvim-web-devicons", - }, - }, - { - "folke/trouble.nvim", - opts = {}, - cmd = "Trouble", - keys = { - { - "xx", - "Trouble diagnostics toggle", - desc = "Diagnostics (Trouble)", - }, - { - "xX", - "Trouble diagnostics toggle filter.buf=0", - desc = "Buffer Diagnostics (Trouble)", - }, - { - "cl", - "Trouble lsp toggle focus=false win.position=right", - desc = "LSP Definitions / references / ... (Trouble)", - }, - { - "xL", - "Trouble loclist toggle", - desc = "Location List (Trouble)", - }, - { - "xQ", - "Trouble qflist toggle", - desc = "Quickfix List (Trouble)", - }, - }, - }, - { - "vague2k/vague.nvim", - config = function() - require("vague").setup({}) - end, - }, - { - "nvim-lualine/lualine.nvim", - requires = { "kyazdani42/nvim-web-devicons" }, - config = function() - require("lualine").setup({ - options = { - theme = "ayu_mirage", - component_separators = "", - section_separators = "", - }, - sections = { - lualine_a = { "mode" }, - lualine_b = {}, - lualine_c = { "filename" }, - lualine_x = {}, - lualine_y = {}, - lualine_z = { - function() - return "[" .. vim.bo.filetype .. "]" - end, - }, - }, - }) - end, - }, - { - "ckarnell/Antonys-macro-repeater", - }, - { - "norcalli/nvim-colorizer.lua", - config = function() - require("colorizer").setup({ - "*", - css = { rgb_fn = true }, - }) - end, - }, - { - "ej-shafran/compile-mode.nvim", - branch = "nightly", - dependencies = { - "nvim-lua/plenary.nvim", - }, - config = function() - ---@type CompileModeOpts - vim.g.compile_mode = {} - end, - }, - { - "folke/snacks.nvim", - priority = 1000, - lazy = false, - opts = { - bigfile = { enabled = true }, - quickfile = { enabled = true }, - terminal = { enabled = true }, - lazygit = { enabled = true }, - }, - config = function() - vim.keymap.set("n", "lg", function() - Snacks.lazygit() - end, { noremap = true, silent = true, desc = "Open LazyGit" }) - vim.keymap.set("n", "t", function() - Snacks.terminal() - end, { noremap = true, silent = true, desc = "Open terminal" }) - end, - }, -}) +-- local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +-- if not vim.uv.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 +-- error("Error cloning lazy.nvim:\n" .. out) +-- end +-- end ---@diagnostic disable-next-line: undefined-field +-- vim.opt.rtp:prepend(lazypath) +-- +-- require("lazy").setup({ +-- "tpope/vim-sleuth", +-- { +-- "lewis6991/gitsigns.nvim", +-- opts = { +-- signs = { +-- add = { text = "+" }, +-- change = { text = "~" }, +-- delete = { text = "_" }, +-- topdelete = { text = "‾" }, +-- changedelete = { text = "~" }, +-- }, +-- }, +-- }, +-- { +-- "folke/which-key.nvim", +-- event = "VimEnter", +-- config = function() +-- require("which-key").setup() +-- require("which-key").add({ +-- { "c", group = "[C]ode" }, +-- { "d", group = "[D]ocument" }, +-- { "r", group = "[R]ename" }, +-- { "s", group = "[S]earch" }, +-- { "w", group = "[W]orkspace" }, +-- { "h", group = "Git [H]unk", mode = { "n", "v" } }, +-- }) +-- end, +-- }, +-- { +-- "nvim-telescope/telescope.nvim", +-- event = "VimEnter", +-- branch = "0.1.x", +-- dependencies = { +-- "nvim-lua/plenary.nvim", +-- { +-- "nvim-telescope/telescope-fzf-native.nvim", +-- build = "make", +-- cond = function() +-- return vim.fn.executable("make") == 1 +-- end, +-- }, +-- { "nvim-telescope/telescope-ui-select.nvim" }, +-- { "nvim-tree/nvim-web-devicons", enabled = vim.g.have_nerd_font }, +-- }, +-- config = function() +-- require("telescope").setup({ +-- extensions = { +-- ["ui-select"] = { +-- require("telescope.themes").get_dropdown(), +-- }, +-- }, +-- }) +-- pcall(require("telescope").load_extension, "fzf") +-- pcall(require("telescope").load_extension, "ui-select") +-- local builtin = require("telescope.builtin") +-- vim.keymap.set("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) +-- vim.keymap.set("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) +-- vim.keymap.set("n", "sf", builtin.find_files, { desc = "[S]earch [F]iles" }) +-- vim.keymap.set("n", "ss", builtin.builtin, { desc = "[S]earch [S]elect Telescope" }) +-- vim.keymap.set("n", "sw", builtin.grep_string, { desc = "[S]earch current [W]ord" }) +-- vim.keymap.set("n", "", builtin.live_grep, { desc = "[S]earch by [G]rep" }) +-- vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) +-- vim.keymap.set("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) +-- vim.keymap.set("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) +-- vim.keymap.set("n", "sb", builtin.buffers, { desc = "[ ] Find existing buffers" }) +-- vim.keymap.set("n", "/", function() +-- builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ +-- winblend = 10, +-- previewer = false, +-- })) +-- end, { desc = "[/] Fuzzily search in current buffer" }) +-- vim.keymap.set("n", "s/", function() +-- builtin.live_grep({ +-- grep_open_files = true, +-- prompt_title = "Live Grep in Open Files", +-- }) +-- end, { desc = "[S]earch [/] in Open Files" }) +-- vim.keymap.set("n", "sn", function() +-- builtin.find_files({ cwd = vim.fn.stdpath("config") }) +-- end, { desc = "[S]earch [N]eovim files" }) +-- end, +-- }, +-- -- LSP Plugins +-- { +-- "folke/lazydev.nvim", +-- ft = "lua", +-- opts = { +-- library = { +-- { path = "luvit-meta/library", words = { "vim%.uv" } }, +-- }, +-- }, +-- }, +-- { "Bilal2453/luvit-meta", lazy = true }, +-- { +-- "neovim/nvim-lspconfig", +-- dependencies = { +-- { "williamboman/mason.nvim", config = true }, -- NOTE: Must be loaded before dependants +-- "williamboman/mason-lspconfig.nvim", +-- "WhoIsSethDaniel/mason-tool-installer.nvim", +-- { "j-hui/fidget.nvim", opts = {} }, +-- "hrsh7th/cmp-nvim-lsp", +-- }, +-- config = function() +-- vim.api.nvim_create_autocmd("LspAttach", { +-- group = vim.api.nvim_create_augroup("kickstart-lsp-attach", { clear = true }), +-- callback = function(event) +-- local map = function(keys, func, desc) +-- vim.keymap.set("n", keys, func, { buffer = event.buf, desc = "LSP: " .. desc }) +-- end +-- map("gd", require("telescope.builtin").lsp_definitions, "[G]oto [D]efinition") +-- map("gr", require("telescope.builtin").lsp_references, "[G]oto [R]eferences") +-- map("gI", require("telescope.builtin").lsp_implementations, "[G]oto [I]mplementation") +-- map("D", require("telescope.builtin").lsp_type_definitions, "Type [D]efinition") +-- map("ds", require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols") +-- map( +-- "ws", +-- require("telescope.builtin").lsp_dynamic_workspace_symbols, +-- "[W]orkspace [S]ymbols" +-- ) +-- map("rn", vim.lsp.buf.rename, "[R]e[n]ame") +-- map("ca", vim.lsp.buf.code_action, "[C]ode [A]ction") +-- map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") +-- local client = vim.lsp.get_client_by_id(event.data.client_id) +-- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_documentHighlight) then +-- local highlight_augroup = +-- vim.api.nvim_create_augroup("kickstart-lsp-highlight", { clear = false }) +-- vim.api.nvim_create_autocmd({ "CursorHold", "CursorHoldI" }, { +-- buffer = event.buf, +-- group = highlight_augroup, +-- callback = vim.lsp.buf.document_highlight, +-- }) +-- +-- vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, { +-- buffer = event.buf, +-- group = highlight_augroup, +-- callback = vim.lsp.buf.clear_references, +-- }) +-- +-- vim.api.nvim_create_autocmd("LspDetach", { +-- group = vim.api.nvim_create_augroup("kickstart-lsp-detach", { clear = true }), +-- callback = function(event2) +-- vim.lsp.buf.clear_references() +-- vim.api.nvim_clear_autocmds({ group = "kickstart-lsp-highlight", buffer = event2.buf }) +-- end, +-- }) +-- end +-- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then +-- map("th", function() +-- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({ bufnr = event.buf })) +-- end, "[T]oggle Inlay [H]ints") +-- end +-- end, +-- }) +-- local capabilities = vim.lsp.protocol.make_client_capabilities() +-- capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) +-- local servers = { +-- lua_ls = { +-- settings = { +-- Lua = { +-- completion = { +-- callSnippet = "Replace", +-- }, +-- }, +-- }, +-- }, +-- clangd = {}, +-- } +-- require("mason").setup() +-- local ensure_installed = vim.tbl_keys(servers or {}) +-- vim.list_extend(ensure_installed, { +-- "stylua", +-- }) +-- require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) +-- +-- require("mason-lspconfig").setup({ +-- handlers = { +-- function(server_name) +-- local server = servers[server_name] or {} +-- server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) +-- require("lspconfig")[server_name].setup(server) +-- end, +-- }, +-- }) +-- end, +-- }, +-- +-- { +-- "stevearc/conform.nvim", +-- event = { "BufWritePre" }, +-- cmd = { "ConformInfo" }, +-- keys = { +-- { +-- "f", +-- function() +-- require("conform").format({ async = true, lsp_fallback = true }) +-- end, +-- mode = "", +-- desc = "[F]ormat buffer", +-- }, +-- }, +-- opts = { +-- notify_on_error = false, +-- format_on_save = function(bufnr) +-- local disable_filetypes = { c = true, cpp = true } +-- return { +-- timeout_ms = 500, +-- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], +-- } +-- end, +-- formatters_by_ft = { +-- lua = { "stylua" }, +-- }, +-- }, +-- }, +-- +-- { +-- "hrsh7th/nvim-cmp", +-- event = "InsertEnter", +-- dependencies = { +-- { +-- "L3MON4D3/LuaSnip", +-- build = (function() +-- if vim.fn.has("win32") == 1 or vim.fn.executable("make") == 0 then +-- return +-- end +-- return "make install_jsregexp" +-- end)(), +-- dependencies = {}, +-- }, +-- "saadparwaiz1/cmp_luasnip", +-- "hrsh7th/cmp-nvim-lsp", +-- "hrsh7th/cmp-path", +-- }, +-- config = function() +-- local cmp = require("cmp") +-- local luasnip = require("luasnip") +-- luasnip.config.setup({}) +-- cmp.setup({ +-- snippet = { +-- expand = function(args) +-- luasnip.lsp_expand(args.body) +-- end, +-- }, +-- completion = { completeopt = "menu,menuone,noinsert" }, +-- mapping = cmp.mapping.preset.insert({ +-- [""] = cmp.mapping.select_next_item(), +-- [""] = cmp.mapping.select_prev_item(), +-- [""] = cmp.mapping.scroll_docs(-4), +-- [""] = cmp.mapping.scroll_docs(4), +-- [""] = cmp.mapping.confirm({ select = true }), +-- [""] = cmp.mapping.complete({}), +-- [""] = cmp.mapping(function() +-- if luasnip.expand_or_locally_jumpable() then +-- luasnip.expand_or_jump() +-- end +-- end, { "i", "s" }), +-- [""] = cmp.mapping(function() +-- if luasnip.locally_jumpable(-1) then +-- luasnip.jump(-1) +-- end +-- end, { "i", "s" }), +-- }), +-- sources = { +-- { +-- name = "lazydev", +-- group_index = 0, +-- }, +-- { name = "nvim_lsp" }, +-- { name = "luasnip" }, +-- { name = "path" }, +-- }, +-- }) +-- end, +-- }, +-- { +-- "folke/todo-comments.nvim", +-- event = "VimEnter", +-- dependencies = { "nvim-lua/plenary.nvim" }, +-- opts = { signs = false }, +-- }, +-- { +-- "echasnovski/mini.nvim", +-- config = function() +-- require("mini.ai").setup({ n_lines = 500 }) +-- require("mini.surround").setup() +-- local statusline = require("mini.statusline") +-- statusline.setup({ use_icons = vim.g.have_nerd_font }) +-- ---@diagnostic disable-next-line: duplicate-set-field +-- statusline.section_location = function() +-- return "%2l:%-2v" +-- end +-- end, +-- }, +-- { +-- "nvim-treesitter/nvim-treesitter", +-- build = ":TSUpdate", +-- opts = { +-- ensure_installed = { +-- "bash", +-- "go", +-- "diff", +-- "html", +-- "lua", +-- "luadoc", +-- "markdown", +-- "markdown_inline", +-- "query", +-- "vim", +-- "vimdoc", +-- }, +-- auto_install = true, +-- highlight = { +-- enable = true, +-- additional_vim_regex_highlighting = { "ruby" }, +-- }, +-- indent = { enable = true, disable = { "ruby" } }, +-- }, +-- config = function(_, opts) +-- ---@diagnostic disable-next-line: missing-fields +-- require("nvim-treesitter.configs").setup(opts) +-- end, +-- }, +-- { +-- "stevearc/oil.nvim", +-- opts = {}, +-- config = function() +-- require("oil").setup({ +-- default_file_explorer = true, +-- delete_to_trash = true, +-- skip_confirm_for_simple_edits = true, +-- view_options = { +-- show_hidden = true, +-- natural_order = true, +-- is_always_hidden = function(name, _) +-- return name == ".." or name == ".git" +-- end, +-- }, +-- }) +-- end, +-- dependencies = { "nvim-tree/nvim-web-devicons" }, +-- }, +-- { +-- "ThePrimeagen/harpoon", +-- branch = "harpoon2", +-- dependencies = { "nvim-lua/plenary.nvim" }, +-- config = function() +-- local harpoon = require("harpoon") +-- +-- -- REQUIRED +-- harpoon:setup() +-- -- REQUIRED +-- +-- vim.keymap.set("n", "a", function() +-- harpoon:list():add() +-- end, { desc = "Append to harpoon" }) +-- vim.keymap.set("n", "", function() +-- harpoon.ui:toggle_quick_menu(harpoon:list()) +-- end, { desc = "Quick Menu" }) +-- +-- vim.keymap.set("n", "", function() +-- harpoon:list():select(1) +-- end, { desc = "Select First" }) +-- vim.keymap.set("n", "", function() +-- harpoon:list():select(2) +-- end, { desc = "Select Second" }) +-- vim.keymap.set("n", "", function() +-- harpoon:list():select(3) +-- end, { desc = "Select Third" }) +-- vim.keymap.set("n", "", function() +-- harpoon:list():select(4) +-- end, { desc = "Select Fourth" }) +-- +-- -- Toggle previous & next buffers stored within Harpoon list +-- vim.keymap.set("n", "", function() +-- harpoon:list():prev() +-- end, { desc = "Select Previous" }) +-- vim.keymap.set("n", "", function() +-- harpoon:list():next() +-- end, { desc = "Select Next" }) +-- end, +-- }, +-- { +-- "tpope/vim-fugitive", +-- }, +-- { +-- "tpope/vim-surround", +-- }, +-- { +-- "utilyre/barbecue.nvim", +-- name = "barbecue", +-- version = "*", +-- config = function() +-- require("barbecue").setup({ +-- theme = "solarized", +-- }) +-- end, +-- dependencies = { +-- "SmiteshP/nvim-navic", +-- "nvim-tree/nvim-web-devicons", +-- }, +-- }, +-- { +-- "folke/trouble.nvim", +-- opts = {}, +-- cmd = "Trouble", +-- keys = { +-- { +-- "xx", +-- "Trouble diagnostics toggle", +-- desc = "Diagnostics (Trouble)", +-- }, +-- { +-- "xX", +-- "Trouble diagnostics toggle filter.buf=0", +-- desc = "Buffer Diagnostics (Trouble)", +-- }, +-- { +-- "cl", +-- "Trouble lsp toggle focus=false win.position=right", +-- desc = "LSP Definitions / references / ... (Trouble)", +-- }, +-- { +-- "xL", +-- "Trouble loclist toggle", +-- desc = "Location List (Trouble)", +-- }, +-- { +-- "xQ", +-- "Trouble qflist toggle", +-- desc = "Quickfix List (Trouble)", +-- }, +-- }, +-- }, +-- { +-- "vague2k/vague.nvim", +-- config = function() +-- require("vague").setup({}) +-- end, +-- }, +-- { +-- "nvim-lualine/lualine.nvim", +-- requires = { "kyazdani42/nvim-web-devicons" }, +-- config = function() +-- require("lualine").setup({ +-- options = { +-- theme = "ayu_mirage", +-- component_separators = "", +-- section_separators = "", +-- }, +-- sections = { +-- lualine_a = { "mode" }, +-- lualine_b = {}, +-- lualine_c = { "filename" }, +-- lualine_x = {}, +-- lualine_y = {}, +-- lualine_z = { +-- function() +-- return "[" .. vim.bo.filetype .. "]" +-- end, +-- }, +-- }, +-- }) +-- end, +-- }, +-- { +-- "ckarnell/Antonys-macro-repeater", +-- }, +-- { +-- "norcalli/nvim-colorizer.lua", +-- config = function() +-- require("colorizer").setup({ +-- "*", +-- css = { rgb_fn = true }, +-- }) +-- end, +-- }, +-- { +-- "ej-shafran/compile-mode.nvim", +-- branch = "nightly", +-- dependencies = { +-- "nvim-lua/plenary.nvim", +-- }, +-- config = function() +-- ---@type CompileModeOpts +-- vim.g.compile_mode = {} +-- end, +-- }, +-- { +-- "folke/snacks.nvim", +-- priority = 1000, +-- lazy = false, +-- opts = { +-- bigfile = { enabled = true }, +-- quickfile = { enabled = true }, +-- terminal = { enabled = true }, +-- lazygit = { enabled = true }, +-- }, +-- config = function() +-- vim.keymap.set("n", "lg", function() +-- Snacks.lazygit() +-- end, { noremap = true, silent = true, desc = "Open LazyGit" }) +-- vim.keymap.set("n", "t", function() +-- Snacks.terminal() +-- end, { noremap = true, silent = true, desc = "Open terminal" }) +-- end, +-- }, +-- }) diff --git a/nvim/.config/nvim/lazy-lock.json b/nvim/.config/nvim/lazy-lock.json index dfda7a2..7b4a93b 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -1,41 +1,24 @@ { - "Antonys-macro-repeater": { "branch": "master", "commit": "61784d86b2654f3e261b9cc33360c5197704e266" }, "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, - "barbecue": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "compile-mode.nvim": { "branch": "nightly", "commit": "a2ee3b791436ff61ddc0a3e0c1d04dfabd1cfef4" }, - "conform.nvim": { "branch": "master", "commit": "02fd64fb3d4b18ec029c0e0683c3dc3ec6d2c5b8" }, - "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, + "conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" }, + "fidget.nvim": { "branch": "main", "commit": "9238947645ce17d96f30842e61ba81147185b657" }, "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, - "lazy.nvim": { "branch": "main", "commit": "014d1d6d78df4e58f962158e6e00261d8632612c" }, - "lazydev.nvim": { "branch": "main", "commit": "f59bd14a852ca43db38e3662395354cb2a9b13e0" }, + "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "8e46de9241d3997927af12196bd8faa0ed08c29a" }, - "mason-tool-installer.nvim": { "branch": "main", "commit": "c5e07b8ff54187716334d585db34282e46fa2932" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "mini.nvim": { "branch": "main", "commit": "2435d0de00174a45d6b352fefeaa6008ebe9f23b" }, - "nvim-cmp": { "branch": "main", "commit": "ca4d3330d386e76967e53b85953c170658255ecb" }, + "nvim-cmp": { "branch": "main", "commit": "3403e2e9391ed0a28c3afddd8612701b647c8e26" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "47f236c058f0511702286a21ba53bbf42abbd8a8" }, - "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, - "nvim-treesitter": { "branch": "master", "commit": "3b8dee4293567b0b9a87360842af14669f60dd13" }, - "nvim-web-devicons": { "branch": "master", "commit": "87c34abe5d1dc7c1c0a95aaaf888059c614c68ac" }, - "oil.nvim": { "branch": "master", "commit": "9a59256c8e88b29d2150e99b5960b2f111e51f75" }, + "nvim-lspconfig": { "branch": "master", "commit": "ae8a01bb40848490548e5d07b97ed972ed43c2f9" }, + "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, + "oil.nvim": { "branch": "master", "commit": "dba037598843973b8c54bc5ce0318db4a0da439d" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "scratch.nvim": { "branch": "main", "commit": "6230634669d29bf05ab4e85b3c7df8fd8402dcb4" }, - "snacks.nvim": { "branch": "main", "commit": "9651a931043359fcc094ab5c67ac22554a602745" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, - "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, - "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, - "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, - "vague.nvim": { "branch": "main", "commit": "ceeac4d04faaa83df542992098e01d893a20b5b3" }, - "vim-fugitive": { "branch": "master", "commit": "320b18fba2a4f2fe3c8225c778c687e0d2620384" }, - "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, - "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "which-key.nvim": { "branch": "main", "commit": "9b365a6428a9633e3eeb34dbef1b791511c54f70" } + "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, + "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } } diff --git a/nvim/.config/nvim/lua/vxclutch/compile.lua b/nvim/.config/nvim/lua/vxclutch/compile.lua new file mode 100644 index 0000000..083f68b --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/compile.lua @@ -0,0 +1,11 @@ +return { + "ej-shafran/compile-mode.nvim", + branch = "nightly", + dependencies = { + "nvim-lua/plenary.nvim", + }, + config = function() + ---@type CompileModeOpts + vim.g.compile_mode = {} + end, +} diff --git a/nvim/.config/nvim/lua/vxclutch/init.lua b/nvim/.config/nvim/lua/vxclutch/init.lua new file mode 100644 index 0000000..df0c13b --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/init.lua @@ -0,0 +1,3 @@ +require("vxclutch.set") +require("vxclutch.remap") +require("vxclutch.lazy_init") diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua b/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua new file mode 100644 index 0000000..4f5c5e8 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/appearance.lua @@ -0,0 +1,32 @@ +return { + "nvim-lualine/lualine.nvim", + requires = { "kyazdani42/nvim-web-devicons" }, + dependencies = { + "norcalli/nvim-colorizer.lua", + }, + config = function() + require("lualine").setup({ + options = { + theme = "ayu_mirage", + component_separators = "", + section_separators = "", + }, + sections = { + lualine_a = { "mode" }, + lualine_b = {}, + lualine_c = { "filename" }, + lualine_x = {}, + lualine_y = {}, + lualine_z = { + function() + return "[" .. vim.bo.filetype .. "]" + end, + }, + }, + }) + require("colorizer").setup({ + "*", + css = { rgb_fn = true }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/format.lua b/nvim/.config/nvim/lua/vxclutch/lazy/format.lua new file mode 100644 index 0000000..c602600 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/format.lua @@ -0,0 +1,30 @@ +return { + "stevearc/conform.nvim", + dependencies = { + "tpope/vim-sleuth" + }, + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + "f", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + mode = "", + }, + }, + opts = { + notify_on_error = false, + format_on_save = function(bufnr) + local disable_filetypes = { c = true, cpp = true } + return { + timeout_ms = 500, + lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype], + } + end, + formatters_by_ft = { + lua = { "stylua" }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/gitsigns.lua b/nvim/.config/nvim/lua/vxclutch/lazy/gitsigns.lua new file mode 100644 index 0000000..44a7d98 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/gitsigns.lua @@ -0,0 +1,12 @@ +return { + "lewis6991/gitsigns.nvim", + opts = { + signs = { + add = { text = "+" }, + change = { text = "~" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + }, + }, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/harpoon.lua b/nvim/.config/nvim/lua/vxclutch/lazy/harpoon.lua new file mode 100644 index 0000000..2f96e29 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/harpoon.lua @@ -0,0 +1,40 @@ +return { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") + + -- REQUIRED + harpoon:setup() + -- REQUIRED + + vim.keymap.set("n", "a", function() + harpoon:list():add() + end, { desc = "Append to harpoon" }) + vim.keymap.set("n", "", function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, { desc = "Quick Menu" }) + + vim.keymap.set("n", "", function() + harpoon:list():select(1) + end, { desc = "Select First" }) + vim.keymap.set("n", "", function() + harpoon:list():select(2) + end, { desc = "Select Second" }) + vim.keymap.set("n", "", function() + harpoon:list():select(3) + end, { desc = "Select Third" }) + vim.keymap.set("n", "", function() + harpoon:list():select(4) + end, { desc = "Select Fourth" }) + + -- Toggle previous & next buffers stored within Harpoon list + vim.keymap.set("n", "", function() + harpoon:list():prev() + end, { desc = "Select Previous" }) + vim.keymap.set("n", "", function() + harpoon:list():next() + end, { desc = "Select Next" }) + end, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/lsp.lua b/nvim/.config/nvim/lua/vxclutch/lazy/lsp.lua new file mode 100644 index 0000000..5028802 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/lsp.lua @@ -0,0 +1,95 @@ +return { + "neovim/nvim-lspconfig", + dependencies = { + "stevearc/conform.nvim", + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/nvim-cmp", + "L3MON4D3/LuaSnip", + "saadparwaiz1/cmp_luasnip", + "j-hui/fidget.nvim", + }, + + config = function() + require("conform").setup({ + formatters_by_ft = {}, + }) + 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() + ) + + require("fidget").setup({}) + require("mason").setup() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "clangd", + "gopls", + }, + handlers = { + function(server_name) -- default handler (optional) + require("lspconfig")[server_name].setup({ + capabilities = capabilities, + }) + 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 = { behavior = cmp.SelectBehavior.Select } + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) -- For `luasnip` users. + end, + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.select_prev_item(cmp_select), + [""] = cmp.mapping.select_next_item(cmp_select), + [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping.complete(), + }), + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), + }) + + vim.diagnostic.config({ + -- update_in_insert = true, + float = { + focusable = false, + style = "minimal", + border = "rounded", + source = "always", + header = "", + prefix = "", + }, + }) + end, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua b/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua new file mode 100644 index 0000000..2e26cee --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/oil.lua @@ -0,0 +1,19 @@ +return { + "stevearc/oil.nvim", + opts = {}, + config = function() + require("oil").setup({ + default_file_explorer = true, + delete_to_trash = true, + skip_confirm_for_simple_edits = true, + view_options = { + show_hidden = true, + natural_order = true, + is_always_hidden = function(name, _) + return name == ".." or name == ".git" + end, + }, + }) + end, + dependencies = { "nvim-tree/nvim-web-devicons" }, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua b/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua new file mode 100644 index 0000000..21fe0a3 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/telescope.lua @@ -0,0 +1,36 @@ +return { + "nvim-telescope/telescope.nvim", + + tag = "0.1.5", + + dependencies = { + "nvim-lua/plenary.nvim", + }, + + config = function() + require("telescope").setup({}) + + local builtin = require("telescope.builtin") + vim.keymap.set("n", "sf", builtin.find_files, {}) + vim.keymap.set("n", "", builtin.git_files, {}) + vim.keymap.set("n", "ps", function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end) + vim.keymap.set("n", "vh", builtin.help_tags, {}) + vim.keymap.set("n", "", function() + builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({ + winblend = 10, + previewer = false, + })) + end, { desc = "[/] Fuzzily search in current buffer" }) + vim.keymap.set("n", "s/", function() + builtin.live_grep({ + grep_open_files = true, + prompt_title = "Live Grep in Open Files", + }) + end, { desc = "[S]earch [/] in Open Files" }) + vim.keymap.set("n", "sn", function() + builtin.find_files({ cwd = vim.fn.stdpath("config") }) + end, { desc = "[S]earch [N]eovim files" }) + end, +} diff --git a/nvim/.config/nvim/lua/vxclutch/lazy_init.lua b/nvim/.config/nvim/lua/vxclutch/lazy_init.lua new file mode 100644 index 0000000..a128388 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy_init.lua @@ -0,0 +1,17 @@ +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", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("lazy").setup({ + spec = "vxclutch.lazy", + change_detection = { notify = false }, +}) diff --git a/nvim/.config/nvim/lua/vxclutch/remap.lua b/nvim/.config/nvim/lua/vxclutch/remap.lua new file mode 100644 index 0000000..0b58ec4 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/remap.lua @@ -0,0 +1,26 @@ +vim.keymap.set("n", "", "nohlsearch") + +vim.keymap.set("v", "J", ":m '>+1gv=gv") +vim.keymap.set("v", "K", ":m '>-2gv=gv") +vim.keymap.set("n", "-", "Oil", { noremap = true, silent = true, desc = "Open Oil" }) + +-- Compile +vim.keymap.set("n", "cc", "Compile", { noremap = true, silent = true, desc = "Compile" }) +vim.keymap.set("n", "rc", "Recompile", { noremap = true, silent = true, desc = "Recompile" }) +vim.api.nvim_create_autocmd("FileType", { + pattern = "compilation", + callback = function() + vim.keymap.set("n", "", ":quit", { buffer = true }) + end, +}) + +-- Disable arrow keys in normal mode +vim.keymap.set("n", "", 'echo "Use h to move!!"') +vim.keymap.set("n", "", 'echo "Use l to move!!"') +vim.keymap.set("n", "", 'echo "Use k to move!!"') +vim.keymap.set("n", "", 'echo "Use j to move!!"') +-- Window Controls +vim.keymap.set("n", "", "", { desc = "Move focus to the left window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the right window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the lower window" }) +vim.keymap.set("n", "", "", { desc = "Move focus to the upper window" }) diff --git a/nvim/.config/nvim/lua/vxclutch/set.lua b/nvim/.config/nvim/lua/vxclutch/set.lua new file mode 100644 index 0000000..31e2305 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/set.lua @@ -0,0 +1,31 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " +vim.opt.number = true +vim.opt.mouse = "a" +vim.opt.showmode = false +vim.opt.breakindent = true +vim.opt.undofile = true +vim.opt.ignorecase = true +vim.opt.smartcase = true +vim.opt.signcolumn = "yes" +vim.opt.updatetime = 250 +vim.opt.timeoutlen = 300 +vim.opt.splitright = true +vim.opt.splitbelow = true +vim.opt.inccommand = "split" +vim.opt.cursorline = true +vim.opt.scrolloff = 8 +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.expandtab = true +vim.bo.softtabstop = 2 +vim.opt.termguicolors = true +vim.opt.guicursor = "" +vim.opt.nu = true +vim.opt.relativenumber = true +vim.opt.wrap = false +vim.opt.smartindent = true +vim.opt.swapfile = false +vim.opt.scrolloff = 8 +vim.opt.updatetime = 50 +vim.opt.colorcolumn = "127" diff --git a/nvim/.config/nvim/lua/vxclutch/telescope.lua b/nvim/.config/nvim/lua/vxclutch/telescope.lua new file mode 100644 index 0000000..3b861b9 --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/telescope.lua @@ -0,0 +1,29 @@ +return { + "nvim-telescope/telescope.nvim", + + tag = "0.1.5", + + dependencies = { + "nvim-lua/plenary.nvim" + }, + + config = function() + require('telescope').setup({}) + + local builtin = require('telescope.builtin') + vim.keymap.set('n', 'pf', builtin.find_files, {}) + vim.keymap.set('n', '', builtin.git_files, {}) + vim.keymap.set('n', 'pws', function() + local word = vim.fn.expand("") + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'pWs', function() + local word = vim.fn.expand("") + builtin.grep_string({ search = word }) + end) + vim.keymap.set('n', 'ps', function() + builtin.grep_string({ search = vim.fn.input("Grep > ") }) + end) + vim.keymap.set('n', 'vh', builtin.help_tags, {}) + end +} diff --git a/wezterm/.wezterm.lua b/wezterm/.wezterm.lua index da0fe12..0d0be18 100644 --- a/wezterm/.wezterm.lua +++ b/wezterm/.wezterm.lua @@ -1,79 +1,50 @@ -local wezterm = require("wezterm") +local wezterm = require 'wezterm'; return { - keys = { - { - key = "F11", - mods = "NONE", - action = wezterm.action.ToggleFullScreen, - }, - }, - hide_tab_bar_if_only_one_tab = true, -- Hide tab bar if there's only one tab - scrollback_lines = 10000, - window_decorations = "NONE | RESIZE", + keys = { + { + key = 'F11', + mods = 'NONE', + action = wezterm.action.ToggleFullScreen, + }, + }, + hide_tab_bar_if_only_one_tab = true, -- Hide tab bar if there's only one tab + scrollback_lines = 10000, - -- Vague.nvim-inspired theme colors - color_scheme = "Vague", -- Assuming you have a color scheme named Vague - colors = { - background = "#18191a", - foreground = "#abb2bf", - cursor_bg = "#61afef", - cursor_fg = "#282c34", - cursor_border = "#61afef", + -- Vague.nvim-inspired theme colors + color_scheme = "Vague", -- Assuming you have a color scheme named Vague + colors = { + background = '#18191a', + foreground = '#abb2bf', + cursor_bg = '#61afef', + cursor_fg = '#282c34', + cursor_border = '#61afef', - -- Modify the colors to use valid keys - ansi = { - "#282c34", -- black - "#e06c75", -- red - "#98c379", -- green - "#e5c07b", -- yellow - "#61afef", -- blue - "#c678dd", -- magenta - "#56b6c2", -- cyan - "#ffffff", -- white - }, - brights = { - "#5c6370", -- bright black - "#e06c75", -- bright red - "#98c379", -- bright green - "#e5c07b", -- bright yellow - "#61afef", -- bright blue - "#c678dd", -- bright magenta - "#56b6c2", -- bright cyan - "#ffffff", -- bright white - }, - }, + -- Modify the colors to use valid keys + ansi = { + '#282c34', -- black + '#e06c75', -- red + '#98c379', -- green + '#e5c07b', -- yellow + '#61afef', -- blue + '#c678dd', -- magenta + '#56b6c2', -- cyan + '#ffffff', -- white + }, + brights = { + '#5c6370', -- bright black + '#e06c75', -- bright red + '#98c379', -- bright green + '#e5c07b', -- bright yellow + '#61afef', -- bright blue + '#c678dd', -- bright magenta + '#56b6c2', -- bright cyan + '#ffffff', -- bright white + }, + }, - local default_padding = { left = 10, right = 10, top = 10, bottom = 10 } -local fullscreen_padding = { left = 0, right = 0, top = 0, bottom = 0 } - -wezterm.on("window-config-reloaded", function(window) - window:set_config_overrides({ window_padding = default_padding }) -end) - -wezterm.on("toggle-fullscreen-padding", function(window, pane) - local overrides = window:get_config_overrides() or {} - if overrides.window_padding == nil or overrides.window_padding.left > 0 then - overrides.window_padding = fullscreen_padding - else - overrides.window_padding = default_padding - end - window:set_config_overrides(overrides) -end) - -return { - -- Default configuration - color_scheme = "Vague", - font_size = 12.0, - window_padding = default_padding, - - -- Keybinding to manually toggle padding - keys = { - { key = "p", mods = "ALT", action = wezterm.action.EmitEvent("toggle-fullscreen-padding") }, - }, - }, - -- Font settings (adjust as needed) - font = wezterm.font("JetBrains Mono"), -- Change this to your preferred font - font_size = 12.0, -- Adjust the font size - line_height = 1.2, -- Adjust the line height + -- Font settings (adjust as needed) + font = wezterm.font("JetBrains Mono"), -- Change this to your preferred font + font_size = 12.0, -- Adjust the font size + line_height = 1.2, -- Adjust the line height }