44 lines
943 B
Lua
44 lines
943 B
Lua
local augroup = vim.api.nvim_create_augroup
|
|
local aucmd = vim.api.nvim_create_autocmd
|
|
|
|
vim.opt.number = true
|
|
vim.opt.relativenumber = true
|
|
|
|
vim.opt.expandtab = true
|
|
vim.opt.shiftwidth = 4
|
|
vim.opt.smartindent = true
|
|
|
|
vim.opt.wrap = false
|
|
vim.opt.incsearch = true
|
|
vim.opt.termguicolors = true
|
|
vim.opt.scrolloff = 8
|
|
|
|
vim.opt.colorcolumn = "100"
|
|
|
|
vim.opt.foldlevel = 99
|
|
vim.opt.foldlevelstart = 99
|
|
|
|
vim.opt.fillchars:append({ eob = "·" })
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
|
augroup("valeth", { clear = true })
|
|
|
|
-- Temporarily highlight yanked text
|
|
aucmd("TextYankPost", {
|
|
group = "valeth",
|
|
callback = function()
|
|
vim.highlight.on_yank({ timeout = 500 })
|
|
end
|
|
})
|
|
|
|
-- Hide cursor line while in insert mode
|
|
aucmd({ "InsertEnter", "InsertLeave", "BufEnter" }, {
|
|
group = "valeth",
|
|
callback = function(args)
|
|
local entered_insert_mode = args.event == "InsertEnter"
|
|
vim.opt.cursorline = not entered_insert_mode
|
|
end
|
|
})
|