Minor fixes throughout nvim config

This commit is contained in:
2025-12-13 02:07:24 +00:00
parent aacfb6d87d
commit ad8ed6069c
3 changed files with 15 additions and 20 deletions

View File

@@ -2,10 +2,10 @@
vim.wo.number = true -- Line numbers
vim.wo.relativenumber = true
vim.opt.wrap = false
vim.opt.mouse = "a" -- enable mouse mode for window resizing
vim.opt.mouse = "a" -- enable mouse mode for window resizing
vim.opt.clipboard = "unnamedplus" -- share system and nvim clipboard
vim.g.have_nerd_font = true
vim.opt.undofile = true -- Save undo history
vim.opt.undofile = true -- Save undo history
-- Add custom commentstring definitions
vim.api.nvim_create_autocmd("FileType", {
pattern = "nix,flake",
@@ -26,19 +26,6 @@ vim.filetype.add({
},
})
vim.api.nvim_create_autocmd("LspAttach", {
callback = function(args)
local bufnr = args.buf
local client = vim.lsp.get_client_by_id(args.data.client_id)
if client.server_capabilities.completionProvider then
vim.bo[bufnr].omnifunc = "v:lua.vim.lsp.omnifunc"
end
if client.server_capabilities.definitionProvider then
vim.bo[bufnr].tagfunc = "v:lua.vim.lsp.tagfunc"
end
end,
})
-- Case-insensitive searching UNLESS \C or capital in search
vim.opt.ignorecase = true
vim.opt.smartcase = true
@@ -60,8 +47,8 @@ vim.opt.smartindent = true
vim.opt.expandtab = true
vim.opt.smarttab = true
vim.opt.inccommand = "split" -- Preview substitutions live, as you type!
vim.opt.cursorline = true -- Show which line your cursor is on
vim.opt.scrolloff = 4 -- Minimal number of screen lines to keep above and below the cursor.
vim.opt.cursorline = true -- Show which line your cursor is on
vim.opt.scrolloff = 4 -- Minimal number of screen lines to keep above and below the cursor.
-- Set highlight on search, but clear on pressing <Esc> in normal mode
vim.opt.hlsearch = true
vim.keymap.set("n", "<Esc>", "<cmd>nohlsearch<CR>")

View File

@@ -26,13 +26,22 @@ return { -- Mini is so varied it's hard to categorise. So i dumped my mini insta
INFO = { duration = 3000 },
})
require("mini.clue").setup() -- For per-project/dynamic plugin loading
require("mini.deps").setup() -- For per-project/dynamic plugin loading
require("mini.pairs").setup({ mappings = { ["`"] = false } })
vim.api.nvim_create_autocmd("FileType", {
pattern = "rust",
callback = function()
vim.b.minipairs_config = vim.tbl_deep_extend("force", require("mini.pairs").config, {
mappings = { ["'"] = false },
})
end,
})
-- Some other mini.nvim plugins that look useful to me
require("mini.clue").setup()
require("mini.visits").setup()
require("mini.sessions").setup()
require("mini.pairs").setup({ mappings = { ["`"] = false } })
require("mini.comment").setup()
require("mini.splitjoin").setup()
require("mini.trailspace").setup()