vim.g.loaded = 1
-- uncomment to disable netrw, but nvim scp://xx will not work:
-- vim.g.loaded_netrwPlugin = 1
vim.g.plug_install = 0
vim.opt.termguicolors = true
vim.opt.startofline = true

vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0

local undodir = vim.fn.expand('~/.cache/nvim/undo')
vim.fn.mkdir(undodir, 'p')
vim.opt.undodir = undodir
vim.opt.undofile = true

vim.opt.conceallevel = 1

--vim.opt.shell = '/bin/bash'

vim.opt.number = true
--vim.o.relativenumber = 1
vim.opt.numberwidth = 2
vim.opt.clipboard = "unnamedplus"

vim.opt.showmode = true
vim.opt.laststatus = 2

vim.opt.background = 'dark'

vim.opt.splitbelow = true
vim.opt.splitright = true

-- gui settings
vim.opt.guifont="IBM Plex Mono Text:h9:e-subpixelantyalias"
vim.g.neovide_cursor_vfx_mode = 'pixiedust'
vim.g.neovide_refresh_rate = 165
vim.g.neovide_refresh_rate_idle = 5
vim.g.neovide_remember_window_size = 0

vim.opt.listchars = { tab = "▸ ", trail = "¬" }
vim.opt.list = true
vim.opt.tabstop=4
vim.opt.shiftwidth=4
vim.opt.softtabstop=4

vim.opt.expandtab = true

vim.opt.ignorecase = true
vim.opt.smartcase = true

vim.opt.gdefault = true

vim.opt.textwidth = 80
vim.opt.colorcolumn = { 80 }
vim.opt.formatoptions:append("tlo/qj")
vim.opt.scrolloff = 10
vim.opt.wrap = false
vim.opt.sidescroll = 5
vim.opt.sidescroll = 5

vim.opt.inccommand = "split"

vim.opt.lazyredraw = true

vim.opt.hidden = true

vim.opt.backup = false
vim.opt.writebackup = false

-- New dynamic window height
--vim.opt.cmdheight = 0
vim.opt.cmdheight = 1

-- Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
-- delays and poor user experience.
vim.opt.updatetime = 300

-- Don't pass messages to |ins-completion-menu|.
vim.opt.shortmess:append('c')
vim.opt.shortmess:remove('F')

vim.opt.signcolumn = "yes"

vim.opt.wildmode = { "longest", "list", "full" }
vim.opt.completeopt = { "menu", "menuone", "noselect" }

vim.opt.mouse = ""

vim.cmd.match([[Error /\s\+$\|DU\cPA/]])

vim.opt.virtualedit = "block"
vim.opt.shiftround = true

vim.opt.wildignorecase = true -- When set case is ignored when completing file names and directories
vim.opt.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,._*
*.log
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]]

vim.g.loaded_perl_provider = 0
