nvchad/lua/core/options.lua
ahhshm a522cebca8 fix(options): don't set did_load_filetypes in neovim nightly
Lua filetype detection is enabled by default in neovim nightly so we don't need those two options. The reason we can't simply override them in `custom/init.lua` is that setting `did_load_filetypes` to any value, completely disables filetype detection (and therefore syntax highlighting) and this may confuse people that use neovim nightly. I know NvChad doesn't officially support neovim nightly but people may want to try it to see the new features and this PR makes their life easier. Also, you do a similar check in `plugins/configs/lspconfig.lua` so I thought it's ok :)
2022-07-26 12:52:57 +05:30

111 lines
2.1 KiB
Lua

local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
local vim_version = vim.version()
g.nvchad_theme = config.ui.theme
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
g.theme_switcher_loaded = false
-- use filetype.lua instead of filetype.vim. it's enabled by default in neovim 0.8 (nightly)
if vim_version.minor < 8 then
g.did_load_filetypes = 0
g.do_filetype_lua = 1
end
opt.laststatus = 3 -- global statusline
opt.showmode = false
opt.title = true
opt.clipboard = "unnamedplus"
opt.cul = true -- cursor line
-- Indenting
opt.expandtab = true
opt.shiftwidth = 2
opt.smartindent = true
opt.tabstop = 2
opt.softtabstop = 2
opt.fillchars = { eob = " " }
opt.ignorecase = true
opt.smartcase = true
opt.mouse = "a"
-- Numbers
opt.number = true
opt.numberwidth = 2
opt.ruler = false
-- disable nvim intro
opt.shortmess:append "sI"
opt.signcolumn = "yes"
opt.splitbelow = true
opt.splitright = true
opt.termguicolors = true
opt.timeoutlen = 400
opt.undofile = true
-- interval for writing swap file to disk, also used by gitsigns
opt.updatetime = 250
-- go to previous/next line with h,l,left arrow and right arrow
-- when cursor reaches end/beginning of line
opt.whichwrap:append "<>[]hl"
g.mapleader = " "
-- disable some builtin vim plugins
local default_plugins = {
"2html_plugin",
"getscript",
"getscriptPlugin",
"gzip",
"logipat",
"netrw",
"netrwPlugin",
"netrwSettings",
"netrwFileHandlers",
"matchit",
"tar",
"tarPlugin",
"rrhelper",
"spellfile_plugin",
"vimball",
"vimballPlugin",
"zip",
"zipPlugin",
"tutor",
"rplugin",
"syntax",
"synmenu",
"optwin",
"compiler",
"bugreport",
"ftplugin",
}
for _, plugin in pairs(default_plugins) do
g["loaded_" .. plugin] = 1
end
local default_providers = {
"node",
"perl",
"python3",
"ruby",
}
for _, provider in ipairs(default_providers) do
vim.g["loaded_" .. provider .. "_provider"] = 0
end
-- set shada path
vim.schedule(function()
vim.opt.shadafile = vim.fn.expand "$HOME" .. "/.local/share/nvim/shada/main.shada"
vim.cmd [[ silent! rsh ]]
end)