48 lines
1.7 KiB
Lua
48 lines
1.7 KiB
Lua
vim.o.number = true -- line numbers
|
|
vim.o.list = true -- show whitespace
|
|
vim.o.listchars = 'tab:▸ ,trail:·,nbsp:+'
|
|
vim.o.textwidth = 80 -- default text width
|
|
vim.o.colorcolumn = tostring(vim.o.textwidth)
|
|
vim.o.wrap = false
|
|
vim.o.cursorline = true -- highlight row with cursor
|
|
vim.o.scrolloff = 5 -- show 5 lines below/above cursor
|
|
|
|
vim.o.expandtab = true -- indent using spaces
|
|
vim.o.tabstop = 4 -- 1 tab = 4 spaces
|
|
vim.o.shiftwidth = 4 -- 1 indentation = 4 spaces
|
|
|
|
vim.o.completeopt = 'menu,menuone,noselect' -- completion popup
|
|
vim.o.autochdir = true -- change workir to current file dir
|
|
vim.opt.conceallevel = 2 -- hidden stuff, needed for org
|
|
vim.opt.concealcursor = 'nc'
|
|
vim.o.updatetime = 500 -- fire CursorHold autocommand event
|
|
|
|
-- theme
|
|
vim.o.termguicolors = true -- 24 bit colours
|
|
vim.o.background = 'dark'
|
|
packer.use {
|
|
'https://github.com/owozsh/amora',
|
|
config = function()
|
|
vim.cmd('colorscheme amora')
|
|
end
|
|
}
|
|
|
|
packer.use 'https://github.com/editorconfig/editorconfig-vim'
|
|
|
|
-- set colorcolumn to textwidth after buffer is displayed or option is changed
|
|
vim.api.nvim_create_augroup('config_settings', { clear = true })
|
|
vim.api.nvim_create_autocmd(
|
|
{ 'OptionSet' },
|
|
{
|
|
group = 'config_settings',
|
|
pattern = { 'textwidth' },
|
|
callback = function()
|
|
if vim.o.textwidth > 0 then
|
|
vim.opt_local.colorcolumn = tostring(vim.o.textwidth)
|
|
else
|
|
vim.opt_local.colorcolumn = ''
|
|
end
|
|
end
|
|
}
|
|
)
|