Files
dots/.config/nvim/lua/options.lua

31 lines
735 B
Lua

-- sensible settings
vim.opt.autoread = true
vim.opt.clipboard = "unnamedplus"
vim.opt.conceallevel = 0
vim.opt.hlsearch = false
vim.opt.lazyredraw = true
vim.opt.mouse = "a"
vim.opt.nu = true
vim.opt.rnu = true
vim.opt.scrolloff = 10
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
vim.opt.laststatus = 3
-- :jq command using jq
vim.api.nvim_create_autocmd("FileType", {
pattern = "json",
command = ":command! JsonFormat %!jq",
})
-- trigger autoread on file change
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
pattern = "*",
command = "if mode() != 'c' | checktime | endif",
})