-- Numbers
vim.opt.relativenumber = true			-- Relative numbers
vim.opt.number = true                   -- Normal numbers

-- Tabs
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.autoindent = true
vim.opt.expandtab = true			    -- Converts tabs to spaces

vim.opt.cb = unnamedplus				-- Clipboard
vim.opt.mouse = "a"						-- Mouse enable
vim.opt.fileencoding = "utf-8"			-- File encoding
vim.opt.showtabline = 2					-- The top tabs
vim.opt.cursorline = true               -- Underline
vim.opt.termguicolors = true
vim.opt.undofile = true                 -- UNLIMITED UNDOS!!!

-- Folds
vim.opt.foldmethod = "expr"
vim.cmd "set foldexpr=nvim_treesitter#foldexpr()"
--vim.cmd([[
--    set foldexpr=GetPotionFold(v:lnum)
--
--    function! IndentLevel(lnum)
--        return indent(a:lnum) / &shiftwidth
--    endfunction
--
--    function! GetPotionFold(lnum)
--        if getline(a:lnum + 1) =~? "^\s*\{\s*$"
--            return ">"..IndentLevel(a:lnum + 2)
--        elseif getline(a:lnum) =~? "^\s*\}\s*$"
--            return "<"..IndentLevel(a:lnum - 1)
--        endif
--        return "="
--    endfunction
--]])

vim.opt.foldlevel = 0

