local H=require("\099\111\114\101\046\115\101\116\116\105\110\103\115")local P=require("\099\111\114\101\046\117\116\105\108\115\046\102\117\110\099\116\105\111\110\115")local g=vim.opt local B=vim.fn if H.global_statusline then g.laststatus=3 else g.laststatus=2 end if P.isNotEmpty(H.grepprg)then g.grepprg=H.grepprg end g.backup=false g.clipboard=""g.completeopt="\109\101\110\117\044\109\101\110\117\111\110\101\044\110\111\115\101\108\101\099\116"g.conceallevel=0 g.confirm=true g.cursorline=true g.dir=B.stdpath("\100\097\116\097").."\047\115\119\112"g.expandtab=true g.formatoptions="\106\099\114\111\113\108\110\116"g.hidden=true g.history=500 g.ignorecase=true g.inccommand="\110\111\115\112\108\105\116"g.list=H.list g.listchars=H.listchars g.mouse=H.mouse g.number=H.number g.pumblend=10 g.pumheight=10 g.relativenumber=H.relative_number g.scrolloff=3 g.sessionoptions={"\098\117\102\102\101\114\115";"\099\117\114\100\105\114";"\116\097\098\112\097\103\101\115","\119\105\110\115\105\122\101"}g.shiftround=true g.shiftwidth=2 g.shortmess=g.shortmess+"\099"g.showmode=false g.showtabline=H.showtabline g.sidescrolloff=5 g.signcolumn="\121\101\115"g.smartcase=true g.smartindent=true g.splitbelow=true g.splitright=true g.swapfile=true g.tabstop=2 g.termguicolors=true g.timeoutlen=400 g.ttimeoutlen=0 g.undodir=B.stdpath("\100\097\116\097").."\047\117\110\100\111\100\105\114"g.undofile=true g.undolevels=1000 g.updatetime=300 g.wildignorecase=true g.wildmode="\108\111\110\103\101\115\116\058\102\117\108\108\044\102\117\108\108"g.winminwidth=5 g.wildignore="\046\103\105\116\044\046\104\103\044\046\115\118\110\n\042\046\097\117\120\044\042\046\111\117\116\044\042\046\116\111\099\n\042\046\111\044\042\046\111\098\106\044\042\046\101\120\101\044\042\046\100\108\108\044\042\046\109\097\110\105\102\101\115\116\044\042\046\114\098\099\044\042\046\099\108\097\115\115\n\042\046\097\105\044\042\046\098\109\112\044\042\046\103\105\102\044\042\046\105\099\111\044\042\046\106\112\103\044\042\046\106\112\101\103\044\042\046\112\110\103\044\042\046\112\115\100\044\042\046\119\101\098\112\n\042\046\097\118\105\044\042\046\100\105\118\120\044\042\046\109\112\052\044\042\046\119\101\098\109\044\042\046\109\111\118\044\042\046\109\050\116\115\044\042\046\109\107\118\044\042\046\118\111\098\044\042\046\109\112\103\044\042\046\109\112\101\103\n\042\046\109\112\051\044\042\046\111\103\097\044\042\046\111\103\103\044\042\046\119\097\118\044\042\046\102\108\097\099\n\042\046\101\111\116\044\042\046\111\116\102\044\042\046\116\116\102\044\042\046\119\111\102\102\n\042\046\100\111\099\044\042\046\112\100\102\044\042\046\099\098\114\044\042\046\099\098\122\n\042\046\122\105\112\044\042\046\116\097\114\046\103\122\044\042\046\116\097\114\046\098\122\050\044\042\046\114\097\114\044\042\046\116\097\114\046\120\122\044\042\046\107\103\098\n\042\046\115\119\112\044\046\108\111\099\107\044\046\068\083\095\083\116\111\114\101\044\046\095\042\n\042\047\116\109\112\047\042\044\042\046\115\111\044\042\046\115\119\112\044\042\046\122\105\112\044\042\042\047\110\111\100\101\095\109\111\100\117\108\101\115\047\042\042\044\042\042\047\116\097\114\103\101\116\047\042\042\044\042\042\046\116\101\114\114\097\102\111\114\109\047\042\042\"\n"
-- NOTE: To see what an option is set to execute :lua = vim.o.<name>

local settings = require 'core.settings'
local utils = require 'core.utils.functions'
local o = vim.opt
local fn = vim.fn

-- NOTE: spell and spelllang props are configured only
-- to specific files in autocmd.lua file.

-- Configure the status line visibility
if settings.global_statusline then
  o.laststatus = 3 -- always
else
  o.laststatus = 2 -- only if there are at least two windows
end

if utils.isNotEmpty(settings.grepprg) then
  o.grepprg = settings.grepprg
end

o.backup = false -- creates a backup file
o.clipboard = '' --  do not use the system clipboard for normal yank and delete actions
o.completeopt = 'menu,menuone,noselect' -- A comma separated list of options for Insert mode completion
o.conceallevel = 0 -- so that `` is visible in markdown files
o.confirm = true -- confirm to save changes before exiting modified buffer
o.cursorline = true -- highlight the current line
o.dir = fn.stdpath 'data' .. '/swp' -- swap file directory
o.expandtab = true -- use spaces instead of tabs
o.formatoptions = 'jcroqlnt' -- tcqj
o.hidden = true -- Enable modified buffers in background
o.history = 500 -- Use the 'history' option to set the number of lines from command mode that are remembered.
o.ignorecase = true -- ignore case in search patterns
o.inccommand = 'nosplit' -- preview incremental substitute
o.list = settings.list
o.listchars = settings.listchars
o.mouse = settings.mouse
o.number = settings.number
o.pumblend = 10 -- Popup blend
o.pumheight = 10 -- Maximum number of entries in a popup
o.relativenumber = settings.relative_number
o.scrolloff = 3 -- Minimal number of screen lines to keep above and below the cursor
o.sessionoptions = { 'buffers', 'curdir', 'tabpages', 'winsize' }
o.shiftround = true -- Round indent
o.shiftwidth = 2 -- the number of spaces inserted for each indentation
o.shortmess = o.shortmess + 'c' -- prevent "pattern not found" messages
o.showmode = false -- we don't need to see things like -- INSERT -- anymore
o.showtabline = settings.showtabline
o.sidescrolloff = 5 -- The minimal number of columns to scroll horizontally
o.signcolumn = 'yes' -- Always show the signcolumn, otherwise it would shift the text each time
o.smartcase = true -- Don't ignore case with capitals
o.smartindent = true -- Insert indents automatically
o.splitbelow = true -- force all horizontal splits to go below current window
o.splitright = true -- force all vertical splits to go to the right of current window
o.swapfile = true -- enable/disable swap file creation
o.tabstop = 2 -- how many columns a tab counts for
o.termguicolors = true -- set term gui true colors (most terminals support this)
o.timeoutlen = 400 -- time to wait for a mapped sequence to complete (in milliseconds)
o.ttimeoutlen = 0 -- Time in milliseconds to wait for a key code sequence to complete
o.undodir = fn.stdpath 'data' .. '/undodir' -- set undo directory
o.undofile = true -- enable/disable undo file creation
o.undolevels = 1000
o.updatetime = 300 -- faster completion
o.wildignorecase = true -- When set case is ignored when completing file names and directories
o.wildmode = 'longest:full,full' -- Command-line completion mode
o.winminwidth = 5 -- minimum window width
o.wildignore = [[
.git,.hg,.svn
*.aux,*.out,*.toc
*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
*.avi,*.divx,*.mp4,*.webm,*.mov,*.m2ts,*.mkv,*.vob,*.mpg,*.mpeg
*.mp3,*.oga,*.ogg,*.wav,*.flac
*.eot,*.otf,*.ttf,*.woff
*.doc,*.pdf,*.cbr,*.cbz
*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz,*.kgb
*.swp,.lock,.DS_Store,._*
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]]
