AL2023 doesn't have a distribution for neovim, so you need to build it from source - for more info see here.
Install prerequisites:
sudo yum -y install ninja-build cmake gcc make unzip gettext curl git --allowerasing
Clone repository:
git clone https://github.com/neovim/neovim
Build from source:
cd neovim && git checkout stable && make CMAKE_BUILD_TYPE=RelWithDebInfo
Install:
sudo make install
We are going to use Packer to manage the plugins and use Lua configs.
Create the following folder structure:
~/.config/
└── nvim/
├── init.lua
└── lua
└── plugins.lua
Using:
mkdir -p ~/.config/nvim/lua \
&& touch ~/.config/nvim/init.lua \
&& touch ~/.config/nvim/lua/plugins.lua
Next, open the ~/.config/nvim/lua/plugins.lua
file and replace its content with:
local fn = vim.fn
-- Automatically install packer
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
if fn.empty(fn.glob(install_path)) > 0 then
PACKER_BOOTSTRAP = fn.system({
"git",
"clone",
"--depth",
"1",
"https://github.com/wbthomason/packer.nvim",
install_path,
})
print("Installing packer close and reopen Neovim...")
vim.cmd([[packadd packer.nvim]])
end
-- Autocommand that reloads neovim whenever you save the plugins.lua file
vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | PackerSync
augroup end
]])
-- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, "packer")
if not status_ok then
return
end
-- Have packer use a popup window
packer.init({
display = {
open_fn = function()
return require("packer.util").float({ border = "rounded" })
end,
},
})
-- Install your plugins here
return packer.startup(function(use)
use ("wbthomason/packer.nvim") -- Have packer manage itself
-- Your other plugins go here
if PACKER_BOOTSTRAP then
require("packer").sync()
end
end)
Then, open the ~/.config/nvim/init.lua
file and add the following line at the top of the file:
require("plugins")
Finally, open the plugins.lua
file again (``nvim ~/.config/nvim/lua/plugins.lua) and then save with
:w`, this will prompt packer to install the plugins listed in the file.