Files
nvim/lua/iroddis/set.lua
T
Ian Roddis 25cf1e91e8 Refactoring
2026-05-06 12:20:14 -03:00

66 lines
1.7 KiB
Lua

-- [[ NOTE: ]] Must happen before plugins are required (otherwise wrong leader will be used)
vim.g.mapleader = ','
vim.g.maplocalleader = ','
vim.opt.autocomplete = true
vim.opt.ai = true -- Autoindent
vim.opt.updatetime = 50
vim.opt.mouse = ''
vim.opt.ttimeoutlen = 1000
vim.opt.ttimeout = true
-- vim.opt.ttimeoutlen = 0 -- Leader timeout (default 50)
-- Whitespace
vim.opt.tabstop = 2
vim.opt.softtabstop = 2
vim.opt.shiftwidth = 2
vim.opt.expandtab = true
-- Search
vim.opt.ignorecase = true
vim.opt.incsearch = true
vim.opt.hlsearch = false
vim.opt.smartcase = true
-- Display
vim.opt.nu = true
vim.opt.wrap = false
vim.opt.termguicolors = false
vim.opt.scrolloff = 8
vim.opt.signcolumn = 'yes'
vim.opt.foldlevel = 99
vim.opt.foldmethod = 'expr'
vim.opt.wildmode = 'longest:full'
-- swap
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv 'HOME' .. '/tmp/vim.undo'
vim.opt.undofile = true
-- Sync clipboard between OS and Neovim.
-- Remove this option if you want your OS clipboard to remain independent.
-- See `:help 'clipboard'`
-- vim.o.clipboard = 'unnamedplus'
vim.o.breakindent = true
vim.wo.signcolumn = 'yes'
vim.o.updatetime = 250
vim.o.timeoutlen = 300
vim.o.completeopt = 'menuone,noselect'
vim.o.termguicolors = true
-- Because nvim filetypes are stupid ... need to disable formatoptions for all file types
vim.api.nvim_create_autocmd('FileType', {
pattern = '*',
callback = function()
vim.opt.formatoptions:remove 'r'
vim.opt.formatoptions:remove 'o'
end,
})
-- Disable change-detection if in diff mode. Allows for diffs involving redirects
-- eg nvim -d <(cmd 1) <(cmd 2)
if vim.diff then
vim.opt.autoread = false
end