This repository provides a Makefile and a Bash script to download and install Neovim on your system. Choose the version (macos, linux64 or windows) according to your platform.
make
should be installed on your system.
-
Clone the repository:
git clone https://github.com/Aguiar575/portable-nvim.git
-
Navigate to the repository:
cd portable-nvim
-
Run the Makefile for macOS:
make ENV=macos all
Or for Linux:
make ENV=linux64 all
curl
andtar
should be available in your Bash environment.
-
Run the Bash script:
bash install_neovim.sh
To clean up the installation and remove downloaded files, you can use the provided scripts:
make clean
bash clean_neovim.sh
The following configuration is designed to keep Neovim and its dependencies contained within the project folder. This approach ensures portability across different environments while maintaining a consistent setup. It prevents interference with the global Neovim installation on the system.
The script begins by obtaining the current working directory using the pwd
command. This directory is then used as the root for the Packer plugin manager and the location where Packer will be installed.
local current_working_dir = vim.fn.system('pwd')
current_working_dir = current_working_dir:gsub('\n', '')
Packer is used as the plugin manager in this configuration. The script defines the root directory for Packer plugins and the path where Packer itself will be installed.
local packer_package_root = current_working_dir..'/packer/site/pack/'
local packer_path = current_working_dir..'/packer/opt/packer.nvim'
vim.o.packpath = packer_path..vim.o.packpath
If Packer is not already installed, the script clones it from the official GitHub repository.
if vim.fn.empty(vim.fn.glob(packer_path)) > 0 then
vim.fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', packer_path})
end
The script initializes and configures Packer with the desired paths for plugin management.
vim.cmd [[packadd packer.nvim]]
require('packer').init({
compile_path = current_working_dir..'/packer/plugin/packer_compiled.lua',
package_root = packer_package_root
})
Certainly! Here's a Markdown documentation for the optional Neovim configuration download feature in the Makefile:
This tool provides functionality to manage Neovim configuration files, allowing users to download their own configuration files.
This feature is optional, and users can provide the repository URL using the REPO_URL
parameter. If no URL is provided, the download will be skipped.
make ENV=your-env REPO_URL=https://github.com/example/nvim-config.git
bash portable-nvim.sh https://github.com/example/nvim-config.git
This command downloads the Neovim configuration files from the specified repository.