style(nvim): organize the variables.lua file

This commit is contained in:
Afonso Franco 2025-06-04 12:12:41 +01:00
parent 98422d6f94
commit 3c7012a65e
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4

View file

@ -1,53 +1,41 @@
--Leader
-- Set the leader key
vim.g.mapleader = " "
--termguicolors
vim.opt.termguicolors = true
--Relative line numbers
vim.wo.number = true
vim.wo.relativenumber = true
--Remove search highlight
vim.opt.hlsearch = false
vim.opt.incsearch = true
vim.opt.smartindent = true
-- Make searches case insensitive (except when using uppercase)
vim.opt.smartcase = true
--Change word definition
vim.opt.iskeyword:append("_")
--Remove Wrap
vim.opt.wrap = false
--Not let cursor go bellow 10 chars.
vim.opt.scrolloff = 10
--4 space indent
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
--Undo dir
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir"
vim.opt.undofile = true
--Backup dir
vim.opt.backup = true
vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir"
--Org mode hide links
vim.opt.conceallevel = 2
vim.opt.concealcursor = 'nc'
--Jupyter notebooks
vim.g.jukit_convert_overwrite_default = 1
vim.g.jukit_convert_open_default = 0
vim.g.jukit_shell_cmd = 'ipython3'
vim.g.jukit_terminal = 'nvimterm'
vim.g.jukit_show_prompt = 1
vim.g.jukit_pdf_viewer = 'zathura'
vim.g.jukit_mappings = 0
--Format Options
vim.opt.formatoptions:remove("ro")
--Sign gutter always on
vim.opt.signcolumn = "yes"
-- sync buffers automatically
vim.opt.autoread = true
-- disable swapfile
vim.opt.swapfile = false
-- disable statusline
vim.o.laststatus = 1
-- border on floating windows
vim.o.winborder = nil
-- Appearance
vim.opt.termguicolors = true -- Enable 24-bit colors
vim.opt.number = true -- Show line numbers
vim.opt.relativenumber = true -- Show relative line numbers
vim.opt.wrap = false -- Disable line wrapping
vim.opt.conceallevel = 2 -- Hide Org mode links (assuming you use Org mode)
vim.opt.concealcursor = 'nc' -- Conceal text in normal mode only
vim.opt.signcolumn = "yes" -- Always show the sign column
vim.o.laststatus = 1 -- Always show the status line (Note: original had '1', consider '2' for always visible)
vim.o.winborder = nil -- Use default border for floating windows
-- Indentation
vim.opt.tabstop = 4 -- Number of spaces a tab represents
vim.opt.softtabstop = 4 -- Number of spaces a <Tab> in Insert mode equals
vim.opt.shiftwidth = 4 -- Number of spaces to use for autoindent
vim.opt.expandtab = true -- Use spaces instead of tabs
vim.opt.smartindent = true -- Smart auto-indenting
-- Searching
vim.opt.hlsearch = false -- Disable highlighting of search matches
vim.opt.incsearch = true -- Show partial matches while typing
-- Behavior and Navigation
vim.opt.iskeyword:append("_") -- Add '_' to the list of keyword characters
vim.opt.scrolloff = 10 -- Keep 10 lines above/below cursor when scrolling
vim.opt.sidescrolloff = 10
vim.opt.smoothscroll = true
-- File Management
vim.opt.undodir = os.getenv("XDG_STATE_HOME") .. "/nvim/undodir" -- Directory for undo files
vim.opt.undofile = true -- Save undo history
vim.opt.backup = true -- Create backup files
vim.opt.backupdir = os.getenv("XDG_STATE_HOME") .. "/nvim/backupdir" -- Directory for backup files
vim.opt.autoread = true -- Automatically reload changed files
vim.opt.swapfile = false -- Disable swap files
-- Formatting
vim.opt.formatoptions:remove("ro") -- Remove 'ro' from formatoptions (assuming you don't want auto-wrapping comments)