dotfiles/nvim/lua/global.lua

41 lines
1,020 B
Lua
Raw Normal View History

2023-07-10 13:46:48 +02:00
local g = vim.g
local o = vim.o
local opt = vim.opt
2023-07-25 17:53:51 +02:00
2023-08-19 13:00:45 +02:00
-- General
opt.clipboard = "unnamedplus" -- Use system clipboard
opt.swapfile = false -- Don't use swapfiles
2023-07-10 13:46:48 +02:00
2023-08-19 13:00:45 +02:00
-- Indentation
opt.tabstop = 2 -- 1 tab = 2 spaces
opt.smartindent = true -- Autoindent new lines
opt.shiftwidth = 2 -- Shift 2 spaces when tab
opt.expandtab = true -- Use spaces instead of tabs
-- Visual
opt.number = true -- Show current line number
opt.relativenumber = true -- Show relative line numbers
opt.colorcolumn = "80" -- Show soft char limit
opt.list = true -- Show punctuation
opt.listchars = { -- Punctuation marks
2023-07-23 01:34:24 +02:00
trail = '·',
nbsp = '',
2023-08-19 13:00:45 +02:00
tab = '~→',
2023-07-23 01:34:24 +02:00
}
-- Trailing whitespace
vim.api.nvim_create_autocmd("BufWritePre", { command = [[%s/\s\+$//e]] })
2023-08-19 13:00:45 +02:00
-- Additional filetypes
2023-07-10 13:46:48 +02:00
vim.filetype.add({
extension = {
2023-07-12 00:34:27 +02:00
mdx = "mdx",
typ = "typst",
2023-07-10 13:46:48 +02:00
}
})
-- Keymap
vim.keymap.set('n', "<leader>e", vim.diagnostic.open_float, {})