Refactor and add more settings.

This commit is contained in:
CronyAkatsuki 2023-12-24 17:10:09 +01:00
parent 4f0da4f6db
commit c379ab0f71

View File

@ -1,54 +1,66 @@
local opt = vim.opt
-- Don't highlight on search -- Don't highlight on search
vim.o.hlsearch = false opt.hlsearch = false
vim.o.incsearch = true opt.incsearch = true
-- Enable line numbers by default -- Enable line numbers by default
vim.o.number = true opt.number = true
vim.o.relativenumber = true opt.relativenumber = true
-- Tab settings -- Tab settings
vim.o.tabstop = 4 opt.tabstop = 4
vim.o.softtabstop = 4 opt.softtabstop = 4
vim.o.shiftwidth = 4 opt.shiftwidth = 4
vim.o.expandtab = true opt.expandtab = true
-- Enable smart indenting -- Enable smart indenting
vim.o.smartindent = true opt.smartindent = true
-- Enable the mouse, just to have it -- Enable the mouse, just to have it
vim.o.mouse = 'a' opt.mouse = 'a'
-- Enable system clipboard -- Enable system clipboard
vim.o.clipboard = 'unnamedplus' opt.clipboard = 'unnamedplus'
-- Enable break indent -- Enable break indent
vim.o.breakindent = true opt.breakindent = true
-- History settings -- History settings
vim.o.undofile = true opt.undofile = true
vim.o.undodir = os.getenv("HOME") .. "/.local/state/nvim" opt.undodir = os.getenv("HOME") .. "/.local/state/nvim"
vim.o.swapfile = true opt.swapfile = true
vim.o.swapfile = true opt.swapfile = true
-- Case-insensitive searching UNLESS \C or capital in search -- Case-insensitive searching UNLESS \C or capital in search
vim.o.ignorecase = true opt.ignorecase = true
vim.o.smartcase = true opt.smartcase = true
-- Keep signcolumn on by default -- Keep signcolumn on by default
vim.o.signcolumn = 'yes' opt.signcolumn = 'yes'
-- Decrease update time -- Decrease update time
vim.o.updatetime = 50 opt.updatetime = 50
vim.o.timeoutlen = 300 opt.timeoutlen = 300
-- Set completeopt to have a better completion experience -- Set completeopt to have a better completion experience
vim.o.completeopt = 'menuone,noselect' opt.completeopt = 'menuone,noselect'
-- Enable true color support -- Enable true color support
vim.o.termguicolors = true opt.termguicolors = true
-- Enable scroll off -- Enable scroll off
vim.o.scrolloff = 8 opt.scrolloff = 8
-- Color the 80 column -- Color the 80 column
vim.o.colorcolumn = "80" opt.colorcolumn = "80"
-- Don't show mode I'm in, already have a nice status line for that
opt.showmode = false
-- Enable global status line
opt.laststatus = 3
-- Better split options
opt.splitbelow = true
opt.splitright = true