vim.g.mapleader = " "

local o = vim.o
o.number = true
o.relativenumber = true
o.tabstop = 4
o.shiftwidth = 4
o.expandtab = true
o.signcolumn = "yes"
o.swapfile = false
o.winborder = "single"
o.termguicolors = true
o.autoread = true

vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter", "CursorHold", "CursorHoldI" }, {
    command = "if mode() != 'c' | checktime | endif",
})

vim.filetype.add({ extension = { asm = "asm", s = "asm", S = "asm" } })
vim.api.nvim_create_autocmd("FileType", {
    pattern = "asm",
    callback = function()
        vim.bo.tabstop = 8
        vim.bo.shiftwidth = 8
        vim.bo.softtabstop = 8
        vim.bo.expandtab = false
    end,
})

vim.diagnostic.config({
    virtual_text = { prefix = "●", spacing = 2, source = "if_many" },
    severity_sort = true,
})
