2022-03-09 19:03:04 +01:00
|
|
|
local M = {}
|
|
|
|
|
|
|
|
function M.setup()
|
2022-12-04 07:56:20 +01:00
|
|
|
-- Disable filetype.vim
|
|
|
|
vim.g.do_filetype_lua = true
|
|
|
|
vim.g.did_load_filetypes = false
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-04 07:56:20 +01:00
|
|
|
-- Basic options
|
2022-12-26 20:07:10 +01:00
|
|
|
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
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-04 07:56:20 +01:00
|
|
|
-- Line numbers
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.number = true -- Show line numbers
|
|
|
|
vim.opt.relativenumber = true -- Relative line numbers
|
2022-06-18 23:09:21 +02:00
|
|
|
|
2022-12-04 07:56:20 +01:00
|
|
|
-- TODO: only do this for specific filestypes
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.expandtab = true -- Use spaces for the tab char
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.scrolloff = 4 -- Lines of context
|
|
|
|
vim.opt.shiftround = true -- Round indent
|
|
|
|
vim.opt.shiftwidth = 2 -- Size of an indent
|
|
|
|
vim.opt.termguicolors = true -- True color support
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.ignorecase = true -- Ignore case
|
|
|
|
vim.opt.smartcase = true -- Do not ignore case with capitals
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.smartindent = true -- Insert indents automatically
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.splitbelow = true -- Put new windows below current
|
|
|
|
vim.opt.splitright = true -- Put new windows right of current
|
2022-03-09 19:03:04 +01:00
|
|
|
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.opt.wrap = false -- Disable line wrap (by default)
|
|
|
|
vim.opt.wildmode = { 'list', 'longest' } -- Command-line completion mode
|
|
|
|
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
2022-03-13 15:16:19 +01:00
|
|
|
|
2022-12-04 07:56:20 +01:00
|
|
|
-- Set leader
|
2022-12-26 20:07:10 +01:00
|
|
|
vim.g.mapleader = " "
|
2022-10-09 03:28:51 +02:00
|
|
|
|
2022-12-27 14:02:03 +01:00
|
|
|
-- Folding
|
|
|
|
vim.o.foldmethod = "marker"
|
2022-03-09 19:03:04 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
return M
|