Files
dotfiles/config/linux-dev/nvim/lua/config/options.lua
2025-03-11 19:56:30 +01:00

97 lines
2.3 KiB
Lua

-- Map Leader
vim.g.mapleader = " "
vim.g.maplocalleader = " "
-- Use Nerd Font
vim.g.have_nerd_font = true
-- Add vertical line
-- vim.opt.colorcolumn = "100"
vim.opt.signcolumn = "no"
-- Enable TrueColor
vim.opt.termguicolors = true
-- Disable Neovim background
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
-- Scroll lines/columns
vim.opt.mousescroll = "hor:1,ver:1"
-- Set indentation preferences
vim.opt.expandtab = true -- Convert tabs to spaces
vim.opt.shiftwidth = 2 -- Number of spaces for auto-indent
vim.opt.tabstop = 2 -- Number of spaces a tab counts for
vim.opt.softtabstop = 2 -- Number of spaces a tab counts for when editing
vim.opt.autoindent = true -- Copy indent from current line when starting new line
vim.opt.smartindent = true -- Do smart autoindenting when starting a new line
-- Disable line wrapping
vim.opt.wrap = false
-- Enable break indent
vim.opt.breakindent = true
-- Make line numbers default
vim.opt.number = true
vim.opt.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example
vim.opt.mouse = "a"
-- Full path on status line
vim.opt.statusline = "%F%m%r%h%w%=%l,%c %P"
-- Sync clipboard between OS and Neovim
vim.schedule(function()
vim.opt.clipboard = "unnamedplus"
end)
-- Save undo history
vim.opt.undofile = true
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- Decrease update time
vim.opt.updatetime = 250
-- Decrease mapped sequence wait time
-- Displays which-key popup sooner
vim.opt.timeoutlen = 300
-- Configure how new splits should be opened
vim.opt.splitright = true
vim.opt.splitbelow = true
-- Preview substitutions live, as you type
vim.opt.inccommand = "split"
-- Show which line your cursor is on
vim.opt.cursorline = true
vim.opt.guicursor = "n-v-i-c:block"
-- Minimal number of screen lines to keep above and below the cursor
vim.opt.scrolloff = 10
-- Highlight when yanking (copying) text
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})
vim.diagnostic.config({
severity_sort = true,
severities = {
[vim.diagnostic.severity.ERROR] = 4,
[vim.diagnostic.severity.WARN] = 3,
[vim.diagnostic.severity.INFO] = 2,
[vim.diagnostic.severity.HINT] = 1,
}
})