2021-07-03 17:33:54 +02:00
--- HELPERS ---
local cmd = vim.cmd
local opt = vim.opt
--- VIM ONLY COMMANDS ---
2021-07-05 03:14:01 +02:00
cmd " filetype plugin on "
cmd ( ' let &titleold=" ' .. TERMINAL .. ' " ' )
cmd " set inccommand=split "
cmd " set iskeyword+=- "
cmd " set whichwrap+=<,>,[,],h,l "
2021-07-03 19:52:07 +02:00
if O.transparent_window then
2021-07-09 14:07:25 +02:00
cmd " au ColorScheme * hi Normal ctermbg=none guibg=none "
cmd " au ColorScheme * hi SignColumn ctermbg=none guibg=none "
2021-07-05 03:14:01 +02:00
end
2021-07-03 17:33:54 +02:00
2021-07-04 18:43:54 +02:00
--- SETTINGS ---
2021-07-03 17:33:54 +02:00
2021-07-05 03:14:01 +02:00
opt.backup = false -- creates a backup file
2021-07-08 13:07:51 +02:00
opt.clipboard = O.clipboard -- allows neovim to access the system clipboard
2021-07-07 19:49:28 +02:00
opt.cmdheight = O.cmdheight -- more space in the neovim command line for displaying messages
2021-07-09 16:04:01 +02:00
opt.colorcolumn = O.colorcolumn
2021-07-09 14:07:25 +02:00
opt.completeopt = { " menuone " , " noselect " }
2021-07-05 03:14:01 +02:00
opt.conceallevel = 0 -- so that `` is visible in markdown files
opt.fileencoding = " utf-8 " -- the encoding written to a file
opt.guifont = " monospace:h17 " -- the font used in graphical neovim applications
opt.hidden = O.hidden_files -- required to keep multiple buffers and open multiple buffers
opt.hlsearch = O.hl_search -- highlight all matches on previous search pattern
opt.ignorecase = O.ignore_case -- ignore case in search patterns
opt.mouse = " a " -- allow the mouse to be used in neovim
opt.pumheight = 10 -- pop up menu height
2021-07-08 17:09:43 +02:00
opt.scrolloff = O.scrolloff -- minimal number of screen lines to keep above and below the cursor
2021-07-05 03:14:01 +02:00
opt.showmode = false -- we don't need to see things like -- INSERT -- anymore
opt.showtabline = 2 -- always show tabs
opt.smartcase = O.smart_case -- smart case
opt.smartindent = true -- make indenting smarter again
opt.splitbelow = true -- force all horizontal splits to go below current window
opt.splitright = true -- force all vertical splits to go to the right of current window
opt.swapfile = false -- creates a swapfile
opt.termguicolors = true -- set term gui colors (most terminals support this)
opt.timeoutlen = O.timeoutlen -- time to wait for a mapped sequence to complete (in milliseconds)
opt.title = true -- set the title of window to the value of the titlestring
2021-07-09 23:03:22 +02:00
-- opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to
2021-07-05 03:14:01 +02:00
opt.undodir = CACHE_PATH .. " /undo " -- set an undo directory
opt.undofile = true -- enable persisten undo
opt.updatetime = 300 -- faster completion
opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited
opt.expandtab = true -- convert tabs to spaces
2021-07-09 20:26:42 +02:00
opt.shiftwidth = O.shift_width -- the number of spaces inserted for each indentation
2021-07-05 03:14:01 +02:00
opt.shortmess : append " c "
2021-07-09 20:26:42 +02:00
opt.tabstop = O.tab_stop -- insert 4 spaces for a tab
2021-07-05 03:14:01 +02:00
opt.cursorline = O.cursorline -- highlight the current line
opt.number = O.number -- set numbered lines
opt.relativenumber = O.relative_number -- set relative numbered lines
2021-07-07 19:49:28 +02:00
opt.numberwidth = O.number_width -- set number column width to 2 {default 4}
2021-07-05 03:14:01 +02:00
opt.signcolumn = " yes " -- always show the sign column, otherwise it would shift the text each time
opt.wrap = O.wrap_lines -- display lines as one long line
2021-07-09 17:13:34 +02:00
opt.spell = O.spell
opt.spelllang = O.spelllang