2022-03-31 04:39:47 +01:00
|
|
|
local set = vim.opt
|
2022-10-06 23:21:41 +01:00
|
|
|
local g = vim.g
|
2022-03-31 04:39:47 +01:00
|
|
|
local cmd = vim.cmd
|
2022-10-06 23:21:41 +01:00
|
|
|
|
|
|
|
local data_directory = vim.fn.stdpath("data")
|
|
|
|
local state_directory = vim.fn.stdpath("state")
|
2022-03-31 04:39:47 +01:00
|
|
|
|
|
|
|
g.mapleader = ","
|
|
|
|
|
2022-05-18 05:33:02 +01:00
|
|
|
-- State files
|
2022-10-06 23:21:41 +01:00
|
|
|
set.backup = true
|
2022-03-31 04:39:47 +01:00
|
|
|
set.writebackup = true
|
2022-10-06 23:21:41 +01:00
|
|
|
set.backupdir = state_directory .. "/backup"
|
|
|
|
set.swapfile = true
|
|
|
|
set.directory = state_directory .. "/swap"
|
|
|
|
set.undofile = true
|
|
|
|
set.undodir = state_directory .. "/undo"
|
|
|
|
set.viewdir = state_directory .. "/view"
|
|
|
|
set.spellfile = data_directory .. "/spell/en.utf-8.add"
|
2022-03-31 04:39:47 +01:00
|
|
|
|
|
|
|
-- Searching
|
|
|
|
set.ignorecase = true -- ignore case when searching.
|
2022-10-06 23:21:41 +01:00
|
|
|
set.smartcase = true -- override ignorecase when upper case characters are used when searching.
|
|
|
|
set.incsearch = true -- set incremental searching.
|
2022-03-31 04:39:47 +01:00
|
|
|
|
|
|
|
-- Default tabs and spaces
|
2022-10-06 23:21:41 +01:00
|
|
|
set.expandtab = true -- turn tabs into spaces
|
|
|
|
set.tabstop = 2 -- number of spaces per tab
|
|
|
|
set.softtabstop = 2 -- number of spaces per tab while editing
|
2022-10-07 00:54:33 +01:00
|
|
|
set.shiftwidth = 2 -- specifies the amount of white spaces to insert/remove using indentation commands in normal mode.
|
2022-03-31 04:39:47 +01:00
|
|
|
|
|
|
|
-- File format and encoding
|
2022-10-06 23:21:41 +01:00
|
|
|
set.fileformat = "unix"
|
|
|
|
set.encoding = "utf-8"
|
|
|
|
set.fileencoding = "utf-8"
|
2022-03-31 04:39:47 +01:00
|
|
|
set.fileencodings = "utf-8"
|
|
|
|
|
|
|
|
-- UI and UX
|
2022-10-06 23:21:41 +01:00
|
|
|
set.number = true -- enable line numbers
|
2022-10-07 00:54:33 +01:00
|
|
|
set.relativenumber = true -- enable relative line numbers
|
2022-10-06 23:21:41 +01:00
|
|
|
set.lazyredraw = true -- do not redraw screen when executing macros, registers, etc that have not been typed
|
|
|
|
set.splitright = true -- split vertical windows to the right
|
|
|
|
set.splitbelow = true -- split horizontal windows below
|
|
|
|
set.confirm = true -- raise a dialogue to confirm if you wish to save a file before continuing.
|
|
|
|
set.cmdheight = 2 -- set the height of the command window to 2 lines.
|
2022-10-07 00:54:33 +01:00
|
|
|
set.modelines = 5 -- the first 5 lines are checked for mode lines.
|
2022-10-06 23:21:41 +01:00
|
|
|
set.cursorline = true -- highlight the line that the cursor is on
|
2022-10-07 00:54:33 +01:00
|
|
|
set.smartindent = true -- smart auto-identing
|
|
|
|
set.mouse = "" -- completely disable mouse support :<
|
2022-10-06 23:21:41 +01:00
|
|
|
set.scrolloff = 5
|
|
|
|
set.signcolumn = "number"
|
|
|
|
set.completeopt = "longest,menuone"
|
2022-03-31 04:39:47 +01:00
|
|
|
|
|
|
|
-- Netrw settings
|
2022-10-06 23:27:42 +01:00
|
|
|
g.netrw_banner = 0 -- disable the banner
|
|
|
|
g.netrw_liststyle = 3 -- display files and folders in a tree style
|
|
|
|
g.netrw_browse_split = 2 -- open files in a vertical split by default
|
|
|
|
g.netrw_altv = 1 -- open split to the right
|
|
|
|
g.netrw_winsize = 10 -- set the size of the Explorer window
|
|
|
|
g.netrw_keepdir = 0 -- keep the browsing directory the same as the current directory
|
2022-03-31 04:39:47 +01:00
|
|
|
|
2022-04-15 18:30:28 +01:00
|
|
|
-- Configure Omnifunc to use the LSP client
|
2022-03-31 04:39:47 +01:00
|
|
|
set.omnifunc = "v:lua.vim.lsp.omnifunc"
|
2022-04-15 18:30:28 +01:00
|
|
|
|
2022-10-06 23:21:41 +01:00
|
|
|
-- Spelling
|
2022-10-06 23:27:42 +01:00
|
|
|
set.spell = true
|
2022-10-06 23:21:41 +01:00
|
|
|
set.spelllang = "en_gb"
|
|
|
|
|
2022-10-07 01:49:14 +01:00
|
|
|
-- Disable unwanted providers
|
|
|
|
g.loaded_ruby_provider = 0
|
|
|
|
g.loaded_perl_provider = 0
|
|
|
|
g.loaded_python3_provider = 0
|
2022-10-07 09:48:35 +01:00
|
|
|
g.loaded_node_provider = 0
|
2022-10-07 01:49:14 +01:00
|
|
|
|
2022-04-15 18:30:28 +01:00
|
|
|
-- The Statusline
|
|
|
|
local statusline = require("statusline")
|
2022-10-06 23:21:41 +01:00
|
|
|
set.statusline = statusline.output()
|
|
|
|
set.laststatus = 3
|