init.lua/lua/core/options.lua(view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
local u = require "core.utils"
require("core.diagnostic").setup()
vim.opt.shell = "/bin/bash" -- fixes issues with fish shell
-- leader
vim.g.mapleader = " "
vim.g.maplocalleader = "\\"
-- indenting
vim.o.smartindent = true
vim.o.expandtab = true
vim.o.cursorline = true
vim.o.shiftwidth = 4
vim.o.softtabstop = 4
vim.o.tabstop = 4
-- other cool stuff
vim.g.editorconfig = true
vim.o.spell = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.number = false
vim.o.relativenumber = false
vim.o.termguicolors = true
vim.o.mousemodel = "extend"
vim.o.completeopt = "menuone,noselect"
vim.o.clipboard = "unnamedplus"
vim.o.fileencoding = "utf-8"
vim.o.mouse = "a"
vim.o.showmode = false
vim.o.splitbelow = true
vim.o.splitright = true
vim.o.pumheight = 8
vim.o.numberwidth = 4
vim.o.scrolloff = 8
vim.o.sidescrolloff = 12
vim.o.signcolumn = "yes"
vim.o.hidden = true
vim.o.title = true
vim.o.linebreak = true
vim.o.wrap = false
-- listchars
vim.o.list = true
vim.opt.listchars:append {
space = "·",
trail = "~",
tab = "│·",
}
-- swap files
vim.o.undofile = true
vim.o.swapfile = false
vim.o.writebackup = false
-- 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,
})
|