You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NvChad/lua/options.lua

65 lines
1.4 KiB
Lua

3 years ago
local opt = vim.opt
local g = vim.g
3 years ago
opt.ruler = false
opt.hidden = true
opt.ignorecase = true
opt.splitbelow = true
opt.splitright = true
opt.termguicolors = true
opt.cul = true
opt.mouse = "a"
opt.signcolumn = "yes"
opt.cmdheight = 1
opt.updatetime = 250 -- update interval for gitsigns
opt.timeoutlen = 400
3 years ago
opt.clipboard = "unnamedplus"
3 years ago
-- disable nvim intro
opt.shortmess:append("sI")
-- disable tilde on end of buffer: https://github.com/ neovim/neovim/pull/8546#issuecomment-643643758
vim.cmd [[let &fcs='eob: ']]
-- Numbers
3 years ago
opt.number = true
opt.numberwidth = 2
-- opt.relativenumber = true
3 years ago
-- Indenline
3 years ago
opt.expandtab = true
opt.shiftwidth = 2
opt.smartindent = true
g.mapleader = " "
g.auto_save = false
-- disable builtin vim plugins
g.loaded_gzip = 0
g.loaded_tar = 0
g.loaded_tarPlugin = 0
g.loaded_zipPlugin = 0
g.loaded_2html_plugin = 0
g.loaded_netrw = 0
g.loaded_netrwPlugin = 0
g.loaded_matchit = 0
g.loaded_matchparen = 0
g.loaded_spec = 0
3 years ago
local M = {}
function M.is_buffer_empty()
3 years ago
-- Check whether the current buffer is empty
return vim.fn.empty(vim.fn.expand("%:t")) == 1
3 years ago
end
function M.has_width_gt(cols)
3 years ago
-- Check if the windows width is greater than a given number of columns
return vim.fn.winwidth(0) / 2 > cols
3 years ago
end
-- file extension specific tabbing
-- vim.cmd([[autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4 softtabstop=4]])
3 years ago
return M