rc/config/nvim/init.lua
2024-04-30 08:30:32 +02:00

54 lines
1.4 KiB
Lua

-- http://vimcasts.org/episodes/meet-neovim/
-- `^=` means prepend
vim.api.nvim_command('set runtimepath^=~/.vim')
vim.opt.runtimepath:append(",~/.vim/after")
vim.api.nvim_command('let &packpath = &runtimepath')
require("plugins")
vim.cmd.source("~/.config/nvim/init.old.vim")
-- Colorscheme --
if vim.fn.has("termguicolors") then
vim.o.termguicolors = true
end
vim.cmd([[colorscheme base16-gruvbox-dark-pale]])
-- Sets how long the cursor needs to wait before showing the diagnostic modal
vim.o.updatetime = 250
vim.diagnostic.config({
virtual_text = false,
signs = true,
underline = true,
update_in_insert = false,
severity_sort = true,
})
-- Show code diagnostics in a floating window instead of inline
-- https://github.com/neovim/nvim-lspconfig/wiki/UI-Customization#show-line-diagnostics-automatically-in-hover-window
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
vim.api.nvim_create_autocmd("CursorHold", {
buffer = bufnr,
callback = function()
local opts = {
focusable = false,
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
border = 'rounded',
source = 'always',
prefix = ' ',
scope = 'cursor',
}
vim.diagnostic.open_float(nil, opts)
end
})
end,
})
require("plugins-config")
require("keys")