diff --git a/lua/configs/options.lua b/lua/configs/options.lua index 16eb9c3..8c46e94 100644 --- a/lua/configs/options.lua +++ b/lua/configs/options.lua @@ -6,35 +6,49 @@ vim.opt.fileencoding = "utf-8" -- vim.opt.foldexpr = "nvim_treesitter#foldexpr()" vim.opt.list = true vim.opt.mouse = "a" -- Enable mouse mode -vim.opt.number = true +vim.opt.number = true -- Print line number vim.opt.numberwidth = 2 vim.opt.showmode = false -- Dont show mode since we have a statusline +vim.opt.scrolloff = 4 +vim.opt.sidescrolloff = 5 +vim.opt.termguicolors = true vim.opt.timeoutlen = 400 vim.opt.undofile = true -vim.opt.updatetime = 250 +vim.opt.updatetime = 250 -- Save swap file and trigger CursorHold vim.opt.wrap = false vim.opt.ignorecase = true vim.opt.pumheight = 13 -vim.opt.smartcase = true +vim.opt.smartcase = true -- Dont ignore case when there is capitals vim.opt.wildignorecase = true vim.opt.wildmenu = false vim.opt.autoindent = true vim.opt.expandtab = true -vim.opt.shiftwidth = 4 vim.opt.smartindent = true -vim.opt.smarttab = true vim.opt.softtabstop = 4 vim.opt.splitbelow = true -- Put new windows below current vim.opt.splitright = true -- Put new windows right of current -vim.opt.tabstop = 4 vim.opt.termguicolors = true +-- Tab and Shift +vim.opt.shiftwidth = 4 +vim.opt.smarttab = true +vim.opt.tabstop = 4 -- Spaces in tab vim.opt.completeopt = "menu,menuone,noinsert" vim.opt.shortmess = "I" - -vim.api.nvim_create_autocmd( - "VimLeave", - { pattern = "*", command = "set guicursor=a:ver20-blinkwait300-blinkon200-blinkoff150" } -) +vim.opt.splitkeep = "screen" +-- Fold +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +vim.opt.foldenable = false +vim.opt.foldlevel = 100 +vim.opt.fillchars = { + fold = " ", +} +function _G.my_foldtext() + local line = vim.fn.getline(vim.v.foldstart) + -- local line_count = vim.v.foldend - vim.v.foldstart + 1 + return line .. " " +end +vim.opt.foldtext = "v:lua.my_foldtext()"