refactor: simplify
This commit is contained in:
+21
-22
@@ -1,9 +1,9 @@
|
||||
-- General =====================================================================
|
||||
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
|
||||
vim.o.undofile = true -- Enable persistent undo
|
||||
vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup)
|
||||
-- General
|
||||
vim.g.mapleader = ' ' -- Use `<Space>` as <Leader> key
|
||||
vim.o.undofile = true -- Enable persistent undo
|
||||
vim.o.shada = "'100,<50,s10,:1000,/100,@100,h" -- Limit ShaDa file (for startup)
|
||||
|
||||
-- UI ==========================================================================
|
||||
-- UI
|
||||
vim.o.breakindent = true -- Indent wrapped lines to match line start
|
||||
vim.o.breakindentopt = 'list:-1' -- Add padding for lists (if 'wrap' is set)
|
||||
vim.o.cursorline = true -- Enable current line highlighting
|
||||
@@ -26,33 +26,32 @@ require("vim._core.ui2").enable({ -- Enable new ui (requires nightly)
|
||||
msg = { targets = "msg" }
|
||||
})
|
||||
|
||||
-- Editing =====================================================================
|
||||
vim.o.expandtab = true -- Convert tabs to spaces
|
||||
vim.o.formatoptions = 'rqnl1j' -- Improve comment editing
|
||||
vim.o.ignorecase = true -- Ignore case during search
|
||||
vim.o.infercase = true -- Infer case in built-in completion
|
||||
vim.o.shiftwidth = 2 -- Use this number of spaces for indentation
|
||||
vim.o.smartcase = true -- Respect case if search pattern has upper case
|
||||
vim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate words
|
||||
vim.o.tabstop = 2 -- Show tab as this number of spaces
|
||||
vim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode
|
||||
vim.opt.autoread = true -- Do not prompt to reread files on update
|
||||
-- Editing
|
||||
vim.o.expandtab = true -- Convert tabs to spaces
|
||||
vim.o.formatoptions = 'rqnl1j' -- Improve comment editing
|
||||
vim.o.ignorecase = true -- Ignore case during search
|
||||
vim.o.infercase = true -- Infer case in built-in completion
|
||||
vim.o.shiftwidth = 2 -- Use this number of spaces for indentation
|
||||
vim.o.smartcase = true -- Respect case if search pattern has upper case
|
||||
vim.o.spelloptions = 'camel' -- Treat camelCase word parts as separate words
|
||||
vim.o.tabstop = 2 -- Show tab as this number of spaces
|
||||
vim.o.virtualedit = 'block' -- Allow going past end of line in blockwise mode
|
||||
vim.opt.autoread = true -- Do not prompt to reread files on update
|
||||
|
||||
-- Built-in completion
|
||||
vim.o.complete = '.,w,b,kspell' -- Use less sources
|
||||
vim.o.completeopt = 'menuone,noselect,fuzzy,nosort' -- Use custom behavior
|
||||
vim.o.completetimeout = 100 -- Limit sources delay
|
||||
|
||||
-- Autocommands ================================================================
|
||||
-- Autocommands
|
||||
Config.autocmd('TextYankPost', '*', function() vim.hl.hl_op() end, 'Highlight yanked text')
|
||||
Config.autocmd('TermOpen', '*', function() vim.cmd('startinsert') end, 'Start insert mode when terminal opens')
|
||||
|
||||
-- Diagnostics =================================================================
|
||||
-- Diagnostics
|
||||
Config.later(function()
|
||||
vim.diagnostic.config({
|
||||
signs = {
|
||||
priority = 9999,
|
||||
severity = { min = 'WARN', max = 'ERROR' },
|
||||
severity = { min = vim.diagnostic.severity.WARN, max = vim.diagnostic.severity.ERROR },
|
||||
text = {
|
||||
[vim.diagnostic.severity.ERROR] = '',
|
||||
[vim.diagnostic.severity.WARN] = '',
|
||||
@@ -60,11 +59,11 @@ Config.later(function()
|
||||
[vim.diagnostic.severity.HINT] = '',
|
||||
},
|
||||
},
|
||||
underline = { severity = { min = 'HINT', max = 'ERROR' } },
|
||||
underline = { severity = { min = vim.diagnostic.severity.HINT, max = vim.diagnostic.severity.ERROR } },
|
||||
virtual_lines = false,
|
||||
virtual_text = {
|
||||
current_line = true,
|
||||
severity = { min = 'ERROR', max = 'ERROR' },
|
||||
severity = { min = vim.diagnostic.severity.ERROR, max = vim.diagnostic.severity.ERROR },
|
||||
},
|
||||
update_in_insert = false,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user