neovim-confs/lua/core/init.lua

80 lines
2.1 KiB
Lua
Raw Normal View History

2023-03-09 13:37:58 +01:00
local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
-------------------------------------- globals -----------------------------------------
g.nvchad_theme = config.ui.theme
g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
2023-03-09 13:37:58 +01:00
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
-------------------------------------- options ------------------------------------------
opt.laststatus = 3 -- global statusline
opt.showmode = false
opt.clipboard = "unnamedplus"
opt.cursorline = true
-- 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 default providers
for _, provider in ipairs { "node", "perl", "python3", "ruby" } do
vim.g["loaded_" .. provider .. "_provider"] = 0
end
-- add binaries installed by mason.nvim to path
local is_windows = vim.loop.os_uname().sysname == "Windows_NT"
vim.env.PATH = vim.fn.stdpath "data" .. "/mason/bin" .. (is_windows and ";" or ":") .. vim.env.PATH
2023-03-09 13:37:58 +01:00
-------------------------------------- autocmds ------------------------------------------
local autocmd = vim.api.nvim_create_autocmd
2022-07-08 15:50:57 +02:00
-- dont list quickfix buffers
autocmd("FileType", {
pattern = "qf",
callback = function()
vim.opt_local.buflisted = false
end,
2022-07-08 15:50:57 +02:00
})
2023-03-09 13:37:58 +01:00
-------------------------------------- commands ------------------------------------------
local new_cmd = vim.api.nvim_create_user_command
new_cmd("NvChadUpdate", function()
2023-08-09 16:52:46 +02:00
require "nvchad.updater"()
2023-03-09 13:37:58 +01:00
end, {})