From fe4e05b189aba29e1a874705d9f1107c36585601 Mon Sep 17 00:00:00 2001 From: vx-clutch Date: Mon, 16 Dec 2024 19:07:27 -0500 Subject: [PATCH] save --- nvim/.config/nvim/init.lua | 519 ------------------ nvim/.config/nvim/lazy-lock.json | 1 + .../.config/nvim/lua/vxclutch/lazy/snacks.lua | 33 ++ nvim/.config/nvim/lua/vxclutch/remap.lua | 12 +- wezterm/.wezterm.lua | 7 + 5 files changed, 44 insertions(+), 528 deletions(-) create mode 100644 nvim/.config/nvim/lua/vxclutch/lazy/snacks.lua diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index d18c037..2fa9296 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -2,522 +2,3 @@ require("vxclutch") vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) - --- 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 7b4a93b..d93e699 100644 --- a/nvim/.config/nvim/lazy-lock.json +++ b/nvim/.config/nvim/lazy-lock.json @@ -19,6 +19,7 @@ "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, "oil.nvim": { "branch": "master", "commit": "dba037598843973b8c54bc5ce0318db4a0da439d" }, "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, + "snacks.nvim": { "branch": "main", "commit": "bb5754738a3126b5f18c53e9d23a9a1bf57391c3" }, "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" } } diff --git a/nvim/.config/nvim/lua/vxclutch/lazy/snacks.lua b/nvim/.config/nvim/lua/vxclutch/lazy/snacks.lua new file mode 100644 index 0000000..fa4a94f --- /dev/null +++ b/nvim/.config/nvim/lua/vxclutch/lazy/snacks.lua @@ -0,0 +1,33 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + bigfile = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { enabled = true }, + quickfile = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + }, + keys = { + { + "t", + function() + Snacks.terminal() + end, + }, + { + "lg", + function() + Snacks.lazygit() + end, + }, + }, +} diff --git a/nvim/.config/nvim/lua/vxclutch/remap.lua b/nvim/.config/nvim/lua/vxclutch/remap.lua index 0b58ec4..177886a 100644 --- a/nvim/.config/nvim/lua/vxclutch/remap.lua +++ b/nvim/.config/nvim/lua/vxclutch/remap.lua @@ -4,15 +4,9 @@ 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, -}) +vim.keymap.set("n", "m", ":make", { noremap = true, silent = false, desc = "Make" }) +vim.keymap.set("n", "t", ":below termi", { noremap = true, silent = true, desc = "Open Terminal Split" }) +vim.keymap.set("t", "", "", { noremap = true, silent = true, desc = "Go from Terminal mode to Normal mode" }) -- Disable arrow keys in normal mode vim.keymap.set("n", "", 'echo "Use h to move!!"') diff --git a/wezterm/.wezterm.lua b/wezterm/.wezterm.lua index 0d0be18..17801ec 100644 --- a/wezterm/.wezterm.lua +++ b/wezterm/.wezterm.lua @@ -11,6 +11,13 @@ return { hide_tab_bar_if_only_one_tab = true, -- Hide tab bar if there's only one tab scrollback_lines = 10000, + window_padding = { + left = 25, + right = 25, + top = 25, + bottom = 25, + }, + -- Vague.nvim-inspired theme colors color_scheme = "Vague", -- Assuming you have a color scheme named Vague colors = {