Files
dots/.config/nvim/lua/options.lua
2022-11-05 00:35:33 +02:00

39 lines
992 B
Lua

-- sensible settings
vim.opt.autoread = true
vim.opt.clipboard = "unnamedplus"
vim.opt.conceallevel = 0
vim.opt.hlsearch = false
vim.opt.laststatus = 3
vim.opt.lazyredraw = true
vim.opt.mouse = "a"
vim.opt.nu = true
vim.opt.rnu = true
vim.opt.scrolloff = 10
vim.opt.shortmess = "aoOtI"
vim.opt.shortmess = "c"
vim.opt.showcmd = true
vim.opt.showmode = false
vim.opt.sw = 4
vim.opt.swapfile = false
vim.opt.timeoutlen = 500
vim.opt.ts = 4
-- trigger autoread on file change
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
pattern = "*",
command = "if mode() != 'c' | checktime | endif",
})
-- org agenda command so I can do nvim +Agenda to open agenda
vim.api.nvim_create_user_command("Agenda", function()
require("orgmode").action("agenda.prompt")
end, {})
-- highlight selected area on yank
vim.api.nvim_create_autocmd("TextYankPost", {
pattern = "*",
callback = function()
require("vim.highlight").on_yank({ "IncSearch", 1000 })
end,
})