Recreate neovim configuration

This commit is contained in:
Matthew Roland
2025-08-24 22:33:05 -05:00
parent 3dc574a056
commit ae8de91f72
25 changed files with 551 additions and 1091 deletions

View File

@@ -1,24 +0,0 @@
local highlight = {
"RainbowRed",
"RainbowYellow",
"RainbowBlue",
"RainbowOrange",
"RainbowGreen",
"RainbowViolet",
"RainbowCyan",
}
local hooks = require "ibl.hooks"
-- create the highlight groups in the highlight setup hook, so they are reset
-- every time the colorscheme changes
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
end)
require("ibl").setup { indent = { highlight = highlight } }

View File

@@ -1,2 +0,0 @@
require 'config.lsp'
require 'config.colorful_indent'

View File

@@ -0,0 +1,50 @@
vim.keymap.set('n', '<C-s>', '<cmd>w<CR>', { silent = true })
vim.keymap.set('i', '<C-s>', '<cmd>w<CR>', { silent = true })
vim.keymap.set('n', '<leader>qa', '<cmd>qa!<CR>', { desc = 'Force quit without saving'})
vim.keymap.set('n', '<leader>qx', '<cmd>xa!<CR>', { desc = 'Write to all then force quit'})
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
vim.keymap.set('v', 'R', 's')
-- Faster Window Navigation
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { silent=true, desc = 'Move focus to the left window' })
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { silent=true, desc = 'Move focus to the right window' })
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { silent=true, desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { silent=true, desc = 'Move focus to the upper window' })
-- Terminal
-- or just use <C-\><C-n> to exit terminal mode
vim.keymap.set('t', '<C-x>', '<C-\\><C-n>', { silent=true, desc = 'Exit terminal mode' })
-- Skipping Sections
vim.keymap.set('n', '<C-Up>', 'zz20kzz', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('n', '<C-Down>', 'zz20jzz', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('i', '<C-Up>', '<C-o>2k', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('i', '<C-Down>', '<C-o>2j', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('n', '<A-k>', 'zz20kzz', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('n', '<A-j>', 'zz20jzz', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('n', '<A-h>', '10h', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('n', '<A-l>', '10l', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('i', '<A-k>', '<C-o>2k', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('i', '<A-j>', '<C-o>2j', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('i', '<A-l>', '<C-o>10l', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('i', '<A-h>', '<C-o>10h', { silent=true, desc = 'Skip Large Sections' })
vim.keymap.set('n', '<C-q>', '<CMD>q<CR>', { silent=true, desc='Close Window' })
vim.keymap.set('n', 's', '', {desc="[S]urround"}) -- Dunno but this is needed to stop some weird substitution thing
vim.keymap.set('n', 'm', 'q', {desc="Macro"})
vim.keymap.set('n', 'q', '') -- Record fights me so often
-- Highlight when yanking
vim.api.nvim_create_autocmd('TextYankPost', {
desc = 'Highlight when yanking (copying) text',
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})

View File

@@ -1,65 +0,0 @@
-- Disable Virtual Text Warnings and Errors
vim.diagnostic.config({
-- virtual_text = false,
signs = true,
float = { border = "single" },
})
local lsp = vim.lsp
local handlers = lsp.handlers
-- Hover doc popup
local pop_opts = { border = "rounded", max_width = 80 }
handlers["textDocument/hover"] = lsp.with(handlers.hover, pop_opts)
handlers["textDocument/signatureHelp"] = lsp.with(handlers.signature_help, pop_opts)
-- Quick Keybinds via g
vim.keymap.set('n', 'gr', "<cmd>Lspsaga rename<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Rename'})
vim.keymap.set('n', 'gx', "<cmd>Lspsaga code_action<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Code Action'})
vim.keymap.set('n', 'gs', "<cmd>Lspsaga finder<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Usage Finder' })
vim.keymap.set('n', 'gg', "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Hover Doc' })
vim.keymap.set('n', 'go', "<cmd>Lspsaga outline<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Outline' })
-- Diagnostic Specific Keybinds with Leader
vim.keymap.set('n', '<leader>dr', "<cmd>Lspsaga rename<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Rename'})
vim.keymap.set('n', '<leader>dx', "<cmd>Lspsaga code_action<cr>", {silent = true, noremap = true, desc = 'Lsp Saga Code Action'})
vim.keymap.set('n', '<leader>ds', "<cmd>Lspsaga finder<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Usage Finder' })
vim.keymap.set('n', '<leader>dg', "<cmd>Lspsaga hover_doc<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Hover Doc' })
vim.keymap.set('n', '<leader>do', "<cmd>Lspsaga outline<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Outline' })
vim.keymap.set('n', '<leader>da', "<cmd>Lspsaga show_workspace_diagnostics<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Show Workspace Diagnostic' })
vim.keymap.set('n', '<leader>dd', "<cmd>Lspsaga show_line_diagnostics<cr>", { silent = true, noremap = true, desc = 'Lsp Saga Show Line Diagnostic' })
for _, method in ipairs({ 'textDocument/diagnostic', 'workspace/diagnostic' }) do
local default_diagnostic_handler = vim.lsp.handlers[method]
vim.lsp.handlers[method] = function(err, result, context, config)
if err ~= nil and err.code == -32802 then
return
end
return default_diagnostic_handler(err, result, context, config)
end
end
require('lspconfig').jsonls.setup {
settings = {
json = {
schemas = require('schemastore').json.schemas(),
validate = { enable = true },
},
},
}
require('lspconfig').yamlls.setup {
settings = {
yaml = {
schemaStore = {
-- You must disable built-in schemaStore support if you want to use
-- this plugin and its advanced options like `ignore`.
enable = false,
-- Avoid TypeError: Cannot read properties of undefined (reading 'length')
url = "",
},
schemas = require('schemastore').yaml.schemas(),
},
},
}