neovim 2: electric boogaloo

This commit is contained in:
2024-12-16 17:13:36 -05:00
parent 1a254af887
commit 3cb62eeef0
16 changed files with 956 additions and 690 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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" }
}

View File

@@ -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,
}

View File

@@ -0,0 +1,3 @@
require("vxclutch.set")
require("vxclutch.remap")
require("vxclutch.lazy_init")

View File

@@ -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,
}

View File

@@ -0,0 +1,30 @@
return {
"stevearc/conform.nvim",
dependencies = {
"tpope/vim-sleuth"
},
event = { "BufWritePre" },
cmd = { "ConformInfo" },
keys = {
{
"<leader>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" },
},
},
}

View File

@@ -0,0 +1,12 @@
return {
"lewis6991/gitsigns.nvim",
opts = {
signs = {
add = { text = "+" },
change = { text = "~" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
},
}

View File

@@ -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", "<leader>a", function()
harpoon:list():add()
end, { desc = "Append to harpoon" })
vim.keymap.set("n", "<C-e>", function()
harpoon.ui:toggle_quick_menu(harpoon:list())
end, { desc = "Quick Menu" })
vim.keymap.set("n", "<C-w>", function()
harpoon:list():select(1)
end, { desc = "Select First" })
vim.keymap.set("n", "<C-t>", function()
harpoon:list():select(2)
end, { desc = "Select Second" })
vim.keymap.set("n", "<C-n>", function()
harpoon:list():select(3)
end, { desc = "Select Third" })
vim.keymap.set("n", "<C-s>", function()
harpoon:list():select(4)
end, { desc = "Select Fourth" })
-- Toggle previous & next buffers stored within Harpoon list
vim.keymap.set("n", "<C-S-P>", function()
harpoon:list():prev()
end, { desc = "Select Previous" })
vim.keymap.set("n", "<C-S-N>", function()
harpoon:list():next()
end, { desc = "Select Next" })
end,
}

View File

@@ -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({
["<C-p>"] = cmp.mapping.select_prev_item(cmp_select),
["<C-n>"] = cmp.mapping.select_next_item(cmp_select),
["<C-y>"] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = 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,
}

View File

@@ -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" },
}

View File

@@ -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", "<leader>sf", builtin.find_files, {})
vim.keymap.set("n", "<C-p>", builtin.git_files, {})
vim.keymap.set("n", "<leader>ps", function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
vim.keymap.set("n", "<leader>vh", builtin.help_tags, {})
vim.keymap.set("n", "<leader><leader>", 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", "<leader>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", "<leader>sn", function()
builtin.find_files({ cwd = vim.fn.stdpath("config") })
end, { desc = "[S]earch [N]eovim files" })
end,
}

View File

@@ -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 },
})

View File

@@ -0,0 +1,26 @@
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "K", ":m '>-2<CR>gv=gv")
vim.keymap.set("n", "-", "<cmd>Oil<CR>", { noremap = true, silent = true, desc = "Open Oil" })
-- Compile
vim.keymap.set("n", "<leader>cc", "<cmd>Compile<CR>", { noremap = true, silent = true, desc = "Compile" })
vim.keymap.set("n", "<leader>rc", "<cmd>Recompile<CR>", { noremap = true, silent = true, desc = "Recompile" })
vim.api.nvim_create_autocmd("FileType", {
pattern = "compilation",
callback = function()
vim.keymap.set("n", "<C-c>", ":quit<CR>", { buffer = true })
end,
})
-- Disable arrow keys in normal mode
vim.keymap.set("n", "<left>", '<cmd>echo "Use h to move!!"<CR>')
vim.keymap.set("n", "<right>", '<cmd>echo "Use l to move!!"<CR>')
vim.keymap.set("n", "<up>", '<cmd>echo "Use k to move!!"<CR>')
vim.keymap.set("n", "<down>", '<cmd>echo "Use j to move!!"<CR>')
-- Window Controls
vim.keymap.set("n", "<C-h>", "<C-w><C-h>", { desc = "Move focus to the left window" })
vim.keymap.set("n", "<C-l>", "<C-w><C-l>", { desc = "Move focus to the right window" })
vim.keymap.set("n", "<C-j>", "<C-w><C-j>", { desc = "Move focus to the lower window" })
vim.keymap.set("n", "<C-k>", "<C-w><C-k>", { desc = "Move focus to the upper window" })

View File

@@ -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"

View File

@@ -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', '<leader>pf', builtin.find_files, {})
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
vim.keymap.set('n', '<leader>pws', function()
local word = vim.fn.expand("<cword>")
builtin.grep_string({ search = word })
end)
vim.keymap.set('n', '<leader>pWs', function()
local word = vim.fn.expand("<cWORD>")
builtin.grep_string({ search = word })
end)
vim.keymap.set('n', '<leader>ps', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") })
end)
vim.keymap.set('n', '<leader>vh', builtin.help_tags, {})
end
}

View File

@@ -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
}