2023-01-10 02:38:06 +01:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.setup()
|
|
|
|
-- Disable filetype.vim
|
|
|
|
vim.g.do_filetype_lua = true
|
|
|
|
vim.g.did_load_filetypes = false
|
|
|
|
|
|
|
|
-- Basic options
|
|
|
|
vim.opt.joinspaces = false -- No double spaces with join
|
|
|
|
vim.opt.list = true -- Show some invisible characters
|
|
|
|
vim.opt.cmdheight = 0 -- Hide command line when it's not getting used
|
|
|
|
|
2023-03-16 17:39:46 +01:00
|
|
|
-- tcqj are there by default, and "r" automatically continues comments on enter
|
|
|
|
vim.opt.formatoptions = "tcqjr"
|
|
|
|
|
2023-01-10 02:38:06 +01:00
|
|
|
-- Line numbers
|
|
|
|
vim.opt.number = true -- Show line numbers
|
|
|
|
vim.opt.relativenumber = true -- Relative line numbers
|
|
|
|
|
|
|
|
vim.opt.expandtab = true -- Use spaces for the tab char
|
|
|
|
vim.opt.shiftwidth = 2 -- Size of an indent
|
2023-04-17 22:33:56 +02:00
|
|
|
vim.opt.tabstop = 2 -- Size of tab character
|
2023-03-14 20:57:07 +01:00
|
|
|
vim.opt.shiftround = true -- When using < or >, rounds to closest multiple of shiftwidth
|
|
|
|
vim.opt.smartindent = true -- Insert indents automatically
|
|
|
|
|
|
|
|
vim.opt.scrolloff = 4 -- Starts scrolling 4 lines from the edge of the screen
|
2023-01-10 02:38:06 +01:00
|
|
|
vim.opt.termguicolors = true -- True color support
|
|
|
|
|
|
|
|
vim.opt.ignorecase = true -- Ignore case
|
|
|
|
vim.opt.smartcase = true -- Do not ignore case with capitals
|
|
|
|
|
|
|
|
vim.opt.splitbelow = true -- Put new windows below current
|
|
|
|
vim.opt.splitright = true -- Put new windows right of current
|
|
|
|
|
|
|
|
vim.opt.wrap = false -- Disable line wrap (by default)
|
2023-03-16 17:39:46 +01:00
|
|
|
vim.opt.wildmode = { "list", "longest" } -- Command-line completion mode
|
2023-01-10 02:38:06 +01:00
|
|
|
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
|
|
|
|
2023-03-31 18:54:44 +02:00
|
|
|
vim.opt.undofile = true -- persist undos!!
|
|
|
|
|
2023-01-10 02:38:06 +01:00
|
|
|
-- Set leader
|
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
|
|
|
-- Folding
|
2023-12-02 00:46:56 +01:00
|
|
|
vim.opt.foldmethod = "marker" -- use {{{ }}} for folding
|
|
|
|
vim.opt.foldcolumn = "1" -- show column with folds on the left
|
2023-01-10 02:38:06 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|