nvim: the epic config restructure
This commit is contained in:
38
.config/nvim/lua/config/options.lua
Normal file
38
.config/nvim/lua/config/options.lua
Normal file
@ -0,0 +1,38 @@
|
||||
-- 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,
|
||||
})
|
||||
Reference in New Issue
Block a user