dotfiles/.config/nvim/lua/lennartalff/set.lua

44 lines
931 B
Lua

-- vim.opt.guicursor = ''
vim.notify = require('notify')
-- line numbers
vim.opt.nu = true
vim.opt.relativenumber = true
-- highlight current line
vim.opt.cursorline = true
vim.opt.breakindent = true
-- default indentation
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.wrap = false
vim.api.nvim_create_autocmd('FileType', {
pattern = 'Makefile',
callback = function ()
vim.opt_local.expandtab = false
end
})
vim.opt.scrolloff = 8
vim.opt.signcolumn = 'yes'
vim.opt.updatetime = 500
vim.opt.colorcolumn = '80'
vim.api.nvim_create_autocmd('BufReadPost', {
callback = function(args)
local valid_line = vim.fn.line([['"]]) >= 1 and vim.fn.line([['"]]) < vim.fn.line('$')
local not_commit = vim.b[args.buf].filetype ~= 'commit'
if valid_line and not_commit then
vim.cmd([[normal! g`"]])
end
end,
})