You've already forked dotfiles
Merge branch 'main' into development
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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', '<leader>c', 'gcc', { remap = true })
|
||||
vim.keymap.set('v', '<leader>c', 'gc', { remap = true })
|
||||
|
||||
-- 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>er', function() custom_functions.execute('run') 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
|
||||
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)
|
||||
|
||||
@@ -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 }
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user