dotfiles/modules/programs/nvim/options.lua

44 lines
1.3 KiB
Lua

vim.g.mapleader = " "
vim.g.maplocalleader = ","
vim.opt.autoindent = true
vim.opt.backupdir = { vim.fn.stdpath("state") .. "/backup/" } -- don't store backup in files dir
vim.opt.clipboard = "unnamedplus" -- sync with system clipboard
vim.opt.conceallevel = 2
vim.opt.expandtab = true -- spaces instead of tabs
vim.opt.ignorecase = true
vim.opt.mouse = "a" -- mouse for all modes
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.scrolloff = 4 -- lines of context
vim.opt.shiftround = true -- round indent
vim.opt.shiftwidth = 0 -- use tabstop value
vim.opt.shortmess:append({ c = true })
vim.opt.signcolumn = "yes"
vim.opt.smartcase = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.tabstop = 2
vim.opt.termguicolors = true
vim.opt.undofile = true
vim.opt.undolevels = 10000
vim.opt.updatetime = 300
vim.opt_local.spell = true
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
-- Abbreviations for common typos
vim.cmd("cnoreabbrev W! w!")
vim.cmd("cnoreabbrev Q! q!")
vim.cmd("cnoreabbrev Qall! qall!")
vim.cmd("cnoreabbrev Wq wq")
vim.cmd("cnoreabbrev Wa wa")
vim.cmd("cnoreabbrev wQ wq")
vim.cmd("cnoreabbrev WQ wq")
vim.cmd("cnoreabbrev W w")
vim.cmd("cnoreabbrev Q q")
if vim.g.neovide then
vim.opt.guifont = "Fira Code Nerd Font:h10"
vim.g.neovide_scale_factor = 0.7
end