nvim: reformat options and exclude them from formatting

because of the comments
This commit is contained in:
tastytea 2022-08-17 00:04:47 +02:00
parent 1368924746
commit 647237145c
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM

View File

@ -1,34 +1,42 @@
vim.o.number = true -- line numbers ---@format disable-next
vim.o.list = true -- show whitespace local options = {
vim.o.listchars = 'tab:▸ ,trail:·,nbsp:+' number = true, -- line numbers
vim.o.textwidth = 80 -- default text width list = true, -- show whitespace
vim.o.colorcolumn = tostring(vim.o.textwidth) listchars = 'tab:▸ ,trail:·,nbsp:+',
vim.o.wrap = false -- don't wrap long lines textwidth = 80, -- default text width
vim.o.linebreak = true -- break on word boundaries colorcolumn = tostring(vim.o.textwidth),
vim.o.cursorline = true -- highlight row with cursor wrap = false, -- don't wrap long lines
vim.o.scrolloff = 5 -- show 5 lines below/above cursor linebreak = true, -- break on word boundaries
vim.o.sidescrolloff = 5 -- same for left/right cursorline = true, -- highlight row with cursor
vim.o.expandtab = true -- indent using spaces scrolloff = 5, -- show 5 lines below/above cursor
vim.o.tabstop = 4 -- 1 tab = 4 spaces sidescrolloff = 5, -- same for left/right
vim.o.shiftwidth = 4 -- 1 indentation = 4 spaces expandtab = true, -- indent using spaces
vim.o.completeopt = 'menu,menuone,noselect' -- completion popup tabstop = 4, -- 1 tab = 4 spaces
vim.o.autochdir = true -- change workir to current file dir shiftwidth = 4, -- 1 indentation = 4 spaces
vim.o.updatetime = 500 -- fire CursorHold autocommand event completeopt = 'menu,menuone,noselect', -- completion popup
vim.o.cmdheight = 2 -- message area size autochdir = true, -- change workir to current file dir
vim.o.mouse = '' -- make use of mouse in these modes updatetime = 500, -- fire CursorHold autocommand event
vim.o.pumheight = 10 -- maximum entries in popup menu cmdheight = 2, -- message area size
vim.o.smartindent = true -- indent after { and so on mouse = '', -- make use of mouse in these modes
vim.o.statusline = '%<%f %h%m%r%=%-16.(%l,%c%V (%P)%)%y' pumheight = 10, -- maximum entries in popup menu
vim.o.formatoptions = vim.o.formatoptions .. 'n' smartindent = true, -- indent after { and so on
vim.o.splitright = true -- split vertical window right statusline = '%<%f %h%m%r%=%-16.(%l,%c%V (%P)%)%y',
formatoptions = vim.o.formatoptions .. 'n',
splitright = true, -- split vertical window right
}
for k, v in pairs(options) do
vim.o[k] = v
end
vim.api.nvim_create_user_command('Hv', 'vertical help <args>', { vim.api.nvim_create_user_command('Hv', 'vertical help <args>', {
nargs = 1, complete = 'help' }) nargs = 1, complete = 'help'
})
vim.api.nvim_create_user_command('Ht', 'tab help <args>', { vim.api.nvim_create_user_command('Ht', 'tab help <args>', {
nargs = 1, complete = 'help' }) nargs = 1, complete = 'help'
})
-- theme -- theme
vim.o.termguicolors = true -- 24 bit colours vim.o.termguicolors = true -- 24 bit colours
vim.cmd('colorscheme amora') vim.cmd('colorscheme amora')
---- make comments a bit lighter ---- make comments a bit lighter
vim.api.nvim_set_hl(0, 'AmoraComment', { fg = '#7C4180', ctermfg = 61 }) vim.api.nvim_set_hl(0, 'AmoraComment', { fg = '#7C4180', ctermfg = 61 })