diff --git a/gitconfig b/gitconfig index e6e2302..bfa89b8 100644 --- a/gitconfig +++ b/gitconfig @@ -21,7 +21,9 @@ d = diff dl = diff HEAD^ HEAD 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 branches = branch -avv staash = stash --all diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua index 4ef67e9..2881519 100644 --- a/nvim/lua/autocmds.lua +++ b/nvim/lua/autocmds.lua @@ -2,7 +2,7 @@ local largefile_group = vim.api.nvim_create_augroup('largefile', { clear = true }) local max_filesize = 4 * (1024 * 1024) -- 4 MB -local old_eventignore = false +local old_eventignore = '' -- Disables syntax, treesitter and folding on larger files vim.api.nvim_create_autocmd({ 'BufReadPre' }, { @@ -30,7 +30,7 @@ vim.api.nvim_create_autocmd({ 'BufWinEnter' }, { callback = function(ev) if old_eventignore ~= false then vim.o.eventignore = old_eventignore -- Restore the old setting - old_eventignore = false + old_eventignore = '' end if vim.b[ev.buf].is_large_file then vim.wo.wrap = false diff --git a/nvim/lua/custom_commands.lua b/nvim/lua/custom_commands.lua index 55f14f9..cc7e064 100644 --- a/nvim/lua/custom_commands.lua +++ b/nvim/lua/custom_commands.lua @@ -1,12 +1,10 @@ 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 - -- 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') end, { nargs = '*' }) -- 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 --- 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) for index, value in ipairs(opts.fargs) do if index > 0 then diff --git a/nvim/lua/keymappings.lua b/nvim/lua/keymappings.lua index 8762d2d..c47d0ec 100644 --- a/nvim/lua/keymappings.lua +++ b/nvim/lua/keymappings.lua @@ -1,8 +1,5 @@ vim.g.mapleader = ',' --- Expose custom functions for binding -local custom_functions = require('custom_functions') - -- Standard keybinding options local options = { noremap = true } @@ -55,6 +52,8 @@ vim.keymap.set('n', 'c', 'gcc', { remap = true }) vim.keymap.set('v', 'c', 'gc', { remap = true }) -- Keymaps for custom functions +local custom_functions = require('custom_functions') + vim.keymap.set('n', 'et', function() custom_functions.execute('test') end) vim.keymap.set('n', 'er', function() custom_functions.execute('run') end) vim.keymap.set('n', 'ec', function() custom_functions.execute('compile') end) @@ -66,10 +65,3 @@ vim.keymap.set('n', 'eo', ':Lexplore', options) -- Allow for leaving Terminal mode using the escape key instead of the odd default vim.keymap.set('t', '', '') - -local sc = require('statuscolumn') -vim.keymap.set('n', 'q', function () - print('woot') - sc.show_both_nums = not sc.show_both_nums - vim.opt.statuscolumn = "%!v:lua.require('statuscolumn').statusColumn()" -end) diff --git a/nvim/lua/plugins/language_support.lua b/nvim/lua/plugins/language_support.lua index 42b68f2..99f9c69 100644 --- a/nvim/lua/plugins/language_support.lua +++ b/nvim/lua/plugins/language_support.lua @@ -25,8 +25,7 @@ vim.diagnostic.config({ } }) --- LSP --- TODO: test out removing the lspconfig plugin and using the built-in enablement +-- Install and enable the language server settings from nvim-lspconfig vim.pack.add({ 'https://github.com/neovim/nvim-lspconfig', }) @@ -35,23 +34,6 @@ vim.pack.add({ vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('my.lsp', {}), 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 bufopts = { noremap = true, silent = true, buffer = bufnr } diff --git a/nvim/lua/settings.lua b/nvim/lua/settings.lua index c4e20ca..97b337d 100644 --- a/nvim/lua/settings.lua +++ b/nvim/lua/settings.lua @@ -1,6 +1,3 @@ --- Experimental --- vim.o.autocomplete = true - 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.completeopt = 'fuzzy,menuone,noinsert,popup' -- Change how the completion menu is interacted with and displays