From a1c7776c7b3574462771bf6c73f98304400b143f Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 3 Jan 2025 00:58:23 +0100 Subject: [PATCH] chore(neovim): rework indentation --- .../home-manager/cli/neovim/files/options.lua | 23 ++++++++----------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/modules/home-manager/cli/neovim/files/options.lua b/modules/home-manager/cli/neovim/files/options.lua index 755cd91..2dd3332 100644 --- a/modules/home-manager/cli/neovim/files/options.lua +++ b/modules/home-manager/cli/neovim/files/options.lua @@ -30,17 +30,24 @@ vim.opt.signcolumn = "yes" -- alway show sign column vim.opt.number = true vim.opt.relativenumber = true vim.opt.cursorline = true -- highlight current line -vim.opt.shiftwidth = 4 vim.opt.showmatch = true vim.opt.smartcase = true -- search: try :to be smart about cases vim.opt.smartindent = true -vim.opt.tabstop = 4 +vim.opt.tabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.softtabstop = 2 vim.opt.wildmenu = true -- activate enhanced user menu vim.opt.wildmode = 'lastused:full,list' -- enhance menu vim.opt.pumheight = 10 vim.opt.pumwidth = 50 vim.opt.pumblend = 10 +-- manage line break smartly +vim.opt.wrap = true +vim.opt.breakindent = true +vim.opt.linebreak = true +vim.opt.showbreak = string.rep(" ", 3) -- Make it so that long lines wrap smartly + -- need to activate this for cmp vim.opt.completeopt = {'menu', 'menuone', 'noselect'} -- -- Code Fold @@ -48,16 +55,6 @@ vim.opt.completeopt = {'menu', 'menuone', 'noselect'} vim.cmd('au BufWinLeave *.* mkview') vim.cmd('au BufWinEnter *.* silent! loadview') - --- Diagnostic settings --- --- diagnostic windows must be float -vim.diagnostic.config { - virtual_text = false, - signs = true, - underline = true, -} - local signs = { Error = "", Warn = "", Hint = "󰌶", Info = "" } for type, icon in pairs(signs) do local hl = "DiagnosticSign" .. type @@ -70,8 +67,6 @@ vim.o.updatetime = 250 vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]] -- Autotype -vim.cmd('au BufRead,BufNewFile *.md setlocal textwidth=80') -vim.cmd('au BufRead,BufNewFile *.tex setlocal textwidth=80') vim.cmd('au BufRead,BufNewFile *.nix setlocal tabstop=2 shiftwidth=2 ') vim.cmd('au BufNewFile,BufRead /tmp/neomutt* set tw=72 fo=awq comments+=nb:> noautoindent filetype=mail')