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.

86 lines
1.9 KiB
Lua

-- The character coding used within vim. I don't remember why I set this, to be
-- honest.
vim.opt.encoding = "utf-8"
-- allow backspacing overl ine breaks
vim.opt.backspace = "indent,eol,start"
-- copy indent from current line when starting a new line
vim.opt.autoindent = true
-- automatically add an indent after block-opening symbols like {
vim.opt.smartindent = true
-- tab characters are 4
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
-- indent with 4 spaces when creating automatic indents
vim.opt.shiftwidth = 4
-- expand tab characters to spaces
vim.opt.expandtab = true
-- configure the characters used to show whitespace characters
vim.opt.listchars = {
tab = "",
trail = "·",
precedes = "",
extends = "",
}
-- show whitespace characters by default
vim.opt.list = true
-- perform searches incrementally
vim.opt.incsearch = true
-- use case-insensitive searching unless we see a capital
vim.opt.ignorecase = true
vim.opt.smartcase = true
-- highlight recently searched term
vim.opt.hlsearch = true
-- line numbering on
vim.opt.nu = true
-- wrap long lines
vim.opt.wrap = true
vim.opt.swapfile = false
vim.opt.backup = false
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undoing"
vim.opt.undofile = true
vim.opt.termguicolors = true
vim.opt.scrolloff = 4
vim.opt.updatetime = 50
vim.opt.colorcolumn = "80"
-- Enable mouse mode
vim.opt.mouse = 'a'
-- do not show the mode, it is in the status line
vim.opt.showmode = false
-- use the operating system clipboard for the default yank register
-- vim.opt.clipboard = 'unnamedplus'
-- direction of new open splits
vim.opt.splitright = true
vim.opt.splitbelow = true
vim.opt.completeopt="menu,menuone,preview,noselect,noinsert"
-- double-tap escape to exit terminal mode
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', {
desc = 'Exit terminal mode'
})
-- set the cwd of the buffer to the directory of the buffer's file
-- when entering a buffer.
vim.opt.autochdir = true