This repository has been archived on 2024-10-06. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/lua/settings.lua
2024-09-24 19:08:44 +02:00

52 lines
1.4 KiB
Lua

local indent = 4
vim.opt.shiftwidth = indent
vim.opt.tabstop = indent
vim.opt.softtabstop = indent
vim.opt.scrolloff = indent
vim.opt.wildmode = 'list:longest,list:full'
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.hidden = true
vim.opt.ignorecase = true
vim.opt.shiftround = true
vim.opt.smartcase = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.number = true
vim.opt.clipboard = 'unnamed,unnamedplus'
vim.opt.autoindent = false
vim.opt.smartindent = false
vim.opt.errorformat:prepend('%f|%l col %c|%m')
vim.opt.fileformat = 'unix'
vim.opt.undofile = true
vim.opt.background = 'light'
-- Enable vimrc files per project and disable unsafe commands in project vimrc
vim.opt.exrc = true
vim.opt.secure = true
vim.api.nvim_create_autocmd('InsertEnter', {
callback = function()
vim.cmd.hi('clear RedundantSpaces')
end,
pattern = '*',
})
vim.api.nvim_create_autocmd({'InsertLeave', 'BufEnter'}, {
callback = function()
vim.cmd.hi('RedundantSpaces ctermbg=red guibg=red')
end,
pattern = '*',
})
vim.cmd([[
set noautoread
autocmd CursorHold * checktime
autocmd TextYankPost * lua vim.highlight.on_yank {on_visual = false}
autocmd BufRead,BufNewFile *.bu,*.yml.example,*.yaml.example set filetype=yaml
autocmd BufRead,BufNewFile *.ign set filetype=json
match RedundantSpaces /\s\+$/
let g:airline_theme='papercolor'
]])