vim.g.mapleader = " "
vim.g.maplocalleader = " "

vim.opt.backspace = "2"
vim.opt.termguicolors = true

-- title
vim.opt.title = true
vim.opt.titlestring = "nvim - %f"

-- indentation
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.shiftround = true
vim.opt.expandtab = true
vim.opt.breakindent = true
vim.opt.linebreak = true

-- folding
vim.wo.foldmethod = "expr"
vim.wo.foldexpr = "v:lua.vim.treesitter.foldexpr()"

-- line numbers
vim.wo.number = true
vim.wo.cursorline = true
vim.wo.relativenumber = false
vim.opt.signcolumn = "yes" -- reserve space for diagnostics

-- search options
vim.opt.ignorecase = true
vim.opt.smartcase = true

-- swap and undo directories
vim.opt.undofile = true
vim.opt.undodir = vim.fn.expand("~/.cache/vim/undodir")
vim.opt.directory = vim.fn.expand("~/.cache/vim/swapfiles")

-- add hyprlang filetype
vim.filetype.add({
    pattern = { [".*/hypr.*%.conf"] = "hyprlang" },
})
