2 files changed,
24 insertions(+),
10 deletions(-)
Author:
Smirnov Oleksandr
ss2316544@gmail.com
Committed at:
2024-10-30 00:01:08 +0200
Parent:
f34d205
jump to
| M | lua/core/autocmd.lua |
| M | lua/core/options.lua |
M
lua/core/autocmd.lua
@@ -16,13 +16,6 @@ end,
}) u.aucmd("FileType", { - group = u.augroup "comments", - callback = function() - vim.cmd "set formatoptions-=cro" - end, -}) - -u.aucmd("FileType", { group = u.augroup "help", pattern = { "help", "man" }, command = "wincmd L",
M
lua/core/options.lua
@@ -1,3 +1,4 @@
+local u = require "core.utils" require("core.diagnostic").setup() -- stylua: ignore@@ -27,8 +28,8 @@ -- other cool stuff
vim.o.spell = true vim.o.ignorecase = true vim.o.smartcase = true -vim.o.number = true -vim.o.relativenumber = true +vim.o.number = false +vim.o.relativenumber = false vim.o.termguicolors = true vim.o.mousemodel = "extend" vim.o.completeopt = "menuone,noselect"@@ -61,8 +62,28 @@ vim.o.undofile = true
vim.o.swapfile = false vim.o.writebackup = false --- disable build-in modules +-- disable builtin modules vim.g.loaded_perl_provider = 0 vim.g.loaded_ruby_provider = 0 vim.g.loaded_node_provider = 0 vim.g.loaded_python3_provider = 0 + +-- format options +-- +u.aucmd("FileType", { + group = u.augroup "formatoptions", + callback = function() + vim.opt.formatoptions:remove { + "c", -- autowrap comments using textwidth with leader + "r", -- don't auto-insert comment leader on enter in insert + "o", -- don't auto-insert comment leader on o/O in normal + "n", -- don't recognized numbered lists + "2", -- don't use the indent of second paragraph line + } + + vim.opt.formatoptions:append { + "l", -- long lines not broken in insert mode + "1", -- don't break a line after a one-letter word + } + end, +})