Merge branch 'main' into development

This commit is contained in:
2026-08-12 11:08:14 -05:00
6 changed files with 8 additions and 37 deletions

View File

@@ -21,7 +21,9 @@
d = diff d = diff
dl = diff HEAD^ HEAD dl = diff HEAD^ HEAD
ds = diff --staged ds = diff --staged
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit l = log --graph --pretty=format:'%Cred%h -%C(yellow)%d %Cgreen(%cr) %C(bold blue)<%an>%Creset %s' --abbrev-commit
la = log --graph --all --pretty=format:'%Cred%h -%C(yellow)%d %Cgreen(%cr) %C(bold blue)<%an>%Creset %s' --abbrev-commit
lt = log --graph --all --pretty=format:'%Cred%h -%C(yellow)%d %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
s = status s = status
branches = branch -avv branches = branch -avv
staash = stash --all staash = stash --all

View File

@@ -2,7 +2,7 @@
local largefile_group = vim.api.nvim_create_augroup('largefile', { clear = true }) local largefile_group = vim.api.nvim_create_augroup('largefile', { clear = true })
local max_filesize = 4 * (1024 * 1024) -- 4 MB local max_filesize = 4 * (1024 * 1024) -- 4 MB
local old_eventignore = false local old_eventignore = ''
-- Disables syntax, treesitter and folding on larger files -- Disables syntax, treesitter and folding on larger files
vim.api.nvim_create_autocmd({ 'BufReadPre' }, { vim.api.nvim_create_autocmd({ 'BufReadPre' }, {
@@ -30,7 +30,7 @@ vim.api.nvim_create_autocmd({ 'BufWinEnter' }, {
callback = function(ev) callback = function(ev)
if old_eventignore ~= false then if old_eventignore ~= false then
vim.o.eventignore = old_eventignore -- Restore the old setting vim.o.eventignore = old_eventignore -- Restore the old setting
old_eventignore = false old_eventignore = ''
end end
if vim.b[ev.buf].is_large_file then if vim.b[ev.buf].is_large_file then
vim.wo.wrap = false vim.wo.wrap = false

View File

@@ -1,12 +1,10 @@
vim.api.nvim_create_user_command('FindAndReplace', function(opts) vim.api.nvim_create_user_command('FindAndReplace', function(opts)
-- Update each quickfix location using substitute, update the files to save changes, close the opened buffers and close the quickfix window -- Update each quickfix location using substitute, update the files to save changes, close the opened buffers and close the quickfix window
-- TODO: Does not close the buffers opened through changes
vim.api.nvim_command(string.format('cfdo s/%s/%s/gc', opts.fargs[1], opts.fargs[2]) .. '| update | cclose') vim.api.nvim_command(string.format('cfdo s/%s/%s/gc', opts.fargs[1], opts.fargs[2]) .. '| update | cclose')
end, { nargs = '*' }) end, { nargs = '*' })
-- Installs tree-sitter plugins for languages from the luarocks repo -- Installs tree-sitter plugins for languages from the luarocks repo
-- Takes a space separated list of arguments of language names, tacks them onto the tree-sitter- package names and runs the install -- Takes a space separated list of arguments of language names, tacks them onto the tree-sitter- package names and runs the install
-- NOTE: luarocks does not take a list of package ("rock") names and requires this setup to install one at a time
vim.api.nvim_create_user_command('TreeSitterInstall', function(opts) vim.api.nvim_create_user_command('TreeSitterInstall', function(opts)
for index, value in ipairs(opts.fargs) do for index, value in ipairs(opts.fargs) do
if index > 0 then if index > 0 then

View File

@@ -1,8 +1,5 @@
vim.g.mapleader = ',' vim.g.mapleader = ','
-- Expose custom functions for binding
local custom_functions = require('custom_functions')
-- Standard keybinding options -- Standard keybinding options
local options = { noremap = true } local options = { noremap = true }
@@ -55,6 +52,8 @@ vim.keymap.set('n', '<leader>c', 'gcc', { remap = true })
vim.keymap.set('v', '<leader>c', 'gc', { remap = true }) vim.keymap.set('v', '<leader>c', 'gc', { remap = true })
-- Keymaps for custom functions -- Keymaps for custom functions
local custom_functions = require('custom_functions')
vim.keymap.set('n', '<leader>et', function() custom_functions.execute('test') end) vim.keymap.set('n', '<leader>et', function() custom_functions.execute('test') end)
vim.keymap.set('n', '<leader>er', function() custom_functions.execute('run') end) vim.keymap.set('n', '<leader>er', function() custom_functions.execute('run') end)
vim.keymap.set('n', '<leader>ec', function() custom_functions.execute('compile') end) vim.keymap.set('n', '<leader>ec', function() custom_functions.execute('compile') end)
@@ -66,10 +65,3 @@ vim.keymap.set('n', '<leader>eo', ':Lexplore<CR>', options)
-- Allow for leaving Terminal mode using the escape key instead of the odd default -- Allow for leaving Terminal mode using the escape key instead of the odd default
vim.keymap.set('t', '<Esc>', '<C-\\><C-n>') vim.keymap.set('t', '<Esc>', '<C-\\><C-n>')
local sc = require('statuscolumn')
vim.keymap.set('n', '<leader>q', function ()
print('woot')
sc.show_both_nums = not sc.show_both_nums
vim.opt.statuscolumn = "%!v:lua.require('statuscolumn').statusColumn()"
end)

View File

@@ -25,8 +25,7 @@ vim.diagnostic.config({
} }
}) })
-- LSP -- Install and enable the language server settings from nvim-lspconfig
-- TODO: test out removing the lspconfig plugin and using the built-in enablement
vim.pack.add({ vim.pack.add({
'https://github.com/neovim/nvim-lspconfig', 'https://github.com/neovim/nvim-lspconfig',
}) })
@@ -35,23 +34,6 @@ vim.pack.add({
vim.api.nvim_create_autocmd('LspAttach', { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup('my.lsp', {}), group = vim.api.nvim_create_augroup('my.lsp', {}),
callback = function(args) callback = function(args)
-- Native completion
-- local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
-- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
-- client.server_capabilities.completionProvider.triggerCharacters = chars
--
-- vim.lsp.completion.enable(true, args.data.client_id, args.buf, {
-- autotrigger = true,
-- convert = function(item)
-- local abbr = item.label
-- abbr = abbr:gsub("%b()", ""):gsub("%b{}", "")
-- abbr = abbr:match("[%w_.]+.*") or abbr
-- abbr = #abbr > 20 and abbr:sub(1, 19) .. "..." or abbr
--
-- return { abbr = abbr }
-- end,
-- })
local bufnr = args.buf local bufnr = args.buf
local bufopts = { noremap = true, silent = true, buffer = bufnr } local bufopts = { noremap = true, silent = true, buffer = bufnr }

View File

@@ -1,6 +1,3 @@
-- Experimental
-- vim.o.autocomplete = true
vim.opt.background = 'dark' -- Force a dark background for the colorscheme vim.opt.background = 'dark' -- Force a dark background for the colorscheme
vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard) vim.opt.clipboard = 'unnamed,unnamedplus' -- Use both the "*" and "+" registers for yanks and deletes (puts things in the system clipboard)
vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays vim.opt.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays