chore(neovim): rework indentation
This commit is contained in:
parent
f1b295db43
commit
a1c7776c7b
1 changed files with 9 additions and 14 deletions
|
@ -30,17 +30,24 @@ vim.opt.signcolumn = "yes" -- alway show sign column
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
vim.opt.cursorline = true -- highlight current line
|
vim.opt.cursorline = true -- highlight current line
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.showmatch = true
|
vim.opt.showmatch = true
|
||||||
vim.opt.smartcase = true -- search: try :to be smart about cases
|
vim.opt.smartcase = true -- search: try :to be smart about cases
|
||||||
vim.opt.smartindent = true
|
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.wildmenu = true -- activate enhanced user menu
|
||||||
vim.opt.wildmode = 'lastused:full,list' -- enhance menu
|
vim.opt.wildmode = 'lastused:full,list' -- enhance menu
|
||||||
vim.opt.pumheight = 10
|
vim.opt.pumheight = 10
|
||||||
vim.opt.pumwidth = 50
|
vim.opt.pumwidth = 50
|
||||||
vim.opt.pumblend = 10
|
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
|
-- need to activate this for cmp
|
||||||
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||||
-- -- Code Fold
|
-- -- Code Fold
|
||||||
|
@ -48,16 +55,6 @@ vim.opt.completeopt = {'menu', 'menuone', 'noselect'}
|
||||||
vim.cmd('au BufWinLeave *.* mkview')
|
vim.cmd('au BufWinLeave *.* mkview')
|
||||||
vim.cmd('au BufWinEnter *.* silent! loadview')
|
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 = "" }
|
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
|
||||||
for type, icon in pairs(signs) do
|
for type, icon in pairs(signs) do
|
||||||
local hl = "DiagnosticSign" .. type
|
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})]]
|
vim.cmd [[autocmd! CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {scope='cursor', header = "", prefix = "", focus=false})]]
|
||||||
|
|
||||||
-- Autotype
|
-- 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 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')
|
vim.cmd('au BufNewFile,BufRead /tmp/neomutt* set tw=72 fo=awq comments+=nb:> noautoindent filetype=mail')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue