Refactor back to a more modular configuration

This commit is contained in:
Oliver Davies 2025-04-23 14:19:05 +01:00
parent 19ea08a716
commit 2bedd41d83
178 changed files with 2245 additions and 1847 deletions

View file

@ -0,0 +1,8 @@
vim.opt_local.colorcolumn = "50,72"
vim.opt_local.spell = true
vim.opt_local.textwidth = 72
-- autocmd FileType gitcommit highlight ColorColumn ctermbg=8
-- filetype indent on
-- filetype on
-- filetype plugin on

View file

@ -0,0 +1,5 @@
-- TODO: Interim fix for https://github.com/nvim-treesitter/nvim-treesitter-context/issues/431.
vim.opt_local.spell = true
vim.opt_local.wrap = true
vim.keymap.set("n", "<leader>su", "Bi{{site.url}}/<Esc>")

View file

@ -0,0 +1,5 @@
local opt = vim.opt_local
opt.cursorline = false
opt.number = true
opt.relativenumber = true

View file

@ -0,0 +1,3 @@
vim.keymap.set("v", "<leader>dd", "yodd(['<Esc>pA', <Esc>pA]);<Esc>")
vim.keymap.set("v", "<leader>du", "yodump(['<Esc>pA', <Esc>pA]);<Esc>")
vim.keymap.set("v", "<leader>vd", "yovar_dump(['<Esc>pA', <Esc>pA]);<Esc>")

View file

@ -0,0 +1,13 @@
local opt = vim.opt_local
opt.spell = true
opt.wrap = true
local cmp = require "cmp"
local sources = cmp.get_config().sources
-- TODO: confirm these aren't aleady in the list of sources to avoid duplicate suggestions.
table.insert(sources, { name = "buffer" })
table.insert(sources, { name = "path" })
cmp.setup.buffer { sources = sources }

View file

@ -0,0 +1,4 @@
setlocal norelativenumber
setlocal nonumber
setlocal scrolloff=0

View file

@ -0,0 +1,17 @@
local opt = vim.opt_local
opt.number = false
opt.relativenumber = false
opt.spell = true
opt.wrap = true
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = 0,
callback = function()
local last_line = vim.api.nvim_buf_get_lines(0, -2, -1, false)[1]
if last_line ~= "" then
vim.api.nvim_buf_set_lines(0, -1, -1, false, { "" })
end
end,
})