feat(nvim): global options

This commit is contained in:
Maciej Jur 2023-08-19 13:00:45 +02:00
parent baff603ff8
commit 8ef96893a3
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
2 changed files with 16 additions and 31 deletions

View file

@ -2,52 +2,39 @@ local g = vim.g
local o = vim.o local o = vim.o
local opt = vim.opt local opt = vim.opt
-- Debug
-- vim.lsp.set_log_level('debug') -- General
opt.clipboard = "unnamedplus" -- Use system clipboard
opt.swapfile = false -- Don't use swapfiles
-- Indentation -- Indentation
opt.tabstop = 2 opt.tabstop = 2 -- 1 tab = 2 spaces
opt.smartindent = true opt.smartindent = true -- Autoindent new lines
opt.shiftwidth = 2 opt.shiftwidth = 2 -- Shift 2 spaces when tab
opt.expandtab = true opt.expandtab = true -- Use spaces instead of tabs
-- Line numbers -- Visual
opt.number = true opt.number = true -- Show current line number
opt.relativenumber = true opt.relativenumber = true -- Show relative line numbers
opt.colorcolumn = "80" -- Show soft char limit
-- Clipboard opt.list = true -- Show punctuation
opt.clipboard = "unnamedplus" opt.listchars = { -- Punctuation marks
-- Helper punctuation
opt.list = true
opt.listchars = {
trail = '·', trail = '·',
nbsp = '', nbsp = '',
tab = '', tab = '~→',
} }
-- Trailing whitespace -- Trailing whitespace
-- vim.fn.matchadd("errorMsg", [[\s\+$]])
vim.api.nvim_create_autocmd("BufWritePre", { command = [[%s/\s\+$//e]] }) vim.api.nvim_create_autocmd("BufWritePre", { command = [[%s/\s\+$//e]] })
-- Additional filetypes
vim.filetype.add({ vim.filetype.add({
extension = { extension = {
mdx = "mdx", mdx = "mdx",
typ = "typst", typ = "typst",
purs = "purescript",
} }
}) })
-- Keymap -- Keymap
vim.keymap.set('n', "<leader>e", vim.diagnostic.open_float, {}) vim.keymap.set('n', "<leader>e", vim.diagnostic.open_float, {})
-- Workaround: https://github.com/neovim/neovim/issues/21856
vim.api.nvim_create_autocmd({ "VimLeave" }, {
callback = function()
-- vim.fn.jobstart('notify-send "hello"', {detach=true})
vim.cmd([[sleep 10m]])
end,
})

View file

@ -142,8 +142,6 @@ return {
-- LS configs -- LS configs
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
-- TODO: config here
-- https://github.com/neovim/nvim-lspconfig#suggested-configuration
config = require("configs/lsp"), config = require("configs/lsp"),
}, },