rc/config/nvim/init.lua
nemirwen b275d74db5 Transition setup to modern neovim
Abandon common config for both vim and neovim, as the neovim ecosystem
is just diverging more and more. For now the goals is to have an
IDE-like neovim config, with a fallback minimal vimrc.

As of this config, only the first part has been started
2024-04-29 10:41:02 +02:00

52 lines
1.3 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 --
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")