Quickstart
In this tutorial, we'll walk you through the process of setting up and using the Pieces Neovim Plugin. We'll cover the installation process and basic usage to help you get up and running quickly.
Install via GitHubPrerequisites
- Pieces OS installed on your machine.
- Neovim installed on your machine.
- Python installed on your machine because Python is required to run Python based Neovim plugins.
A few things to note before you start installing the Pieces Neovim Plugin:
-
The Python based Neovim plugins requires the
pynvim
Python package, which is not included in the default Neovim installation. You can install it by running the following command:pip install pynvim
-
Ensure that you have at least one Neovim package manager installed. For instance, you can install
vim-plug
. In order to installvim-plug
, run the following command in your terminal:sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim \
--create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' -
Create a Neovim configuration file if you haven't already done that. It's usually located at
~/.config/nvim/init.vim
. If it doesn't exist, create it using:mkdir -p ~/.config/nvim
touch ~/.config/nvim/init.vimNote: Your Neovim configuration file can either be
init.vim
orinit.lua
. If you are usinginit.lua
, you will need to add the following line to your configuration file:vim.cmd [[packadd pieces.nvim]]
Steps
Step 1: Install the Pieces Neovim Plugin
-
Ensure Pieces OS is installed and running on your system
-
Open the
init.vim
file with a text editor (you can use Neovim itself):nvim ~/.config/nvim/init.vim
-
Add the following lines to the
init.vim
file:" init.vim
call plug#begin('~/.vim/plugged')
Plug 'kyazdani42/nvim-web-devicons'
Plug 'MunifTanjim/nui.nvim'
Plug 'hrsh7th/nvim-cmp'
Plug 'pieces-app/plugin_neo_vim'
call plug#end()If you're using Neovim to edit, press
<Esc>
, then type:wq
and press<Enter>
to save and quit. -
Install the plugins: Open Neovim again and run the following command:
:PlugInstall
This will install all the plugins specified.
-
After the installation is complete, add the Pieces configuration to your
init.vim
:lua << EOF
require("pieces_config").host = "http://localhost:1000"
EOF -
Save and exit (
:wq
in Neovim). Now run the following command inside Neovim to update the remote plugins::UpdateRemotePlugins
Step 2: Use the Neovim Plugin
-
Open Neovim using the
nvim
command in your terminal. -
Run the following command to verify the installation:
:PiecesOSVersion
If the installation was successful, you should see the version of the Pieces OS.
Congratulations! You have successfully set up and started using the Pieces Neovim Plugin.
Whenever there's an update available for the Pieces Neovim Plugin, you will receive the following notification "A new update for the Pieces Plugin is now available!". You can update the plugin in your respective Neovim plugin manager. For example, if you are using vim-plug
, you can run the following command:
nvim +PlugUpdate
Next Steps
Now that you have setup the Pieces Neovim Plugin, you can explore more features and commands to streamline your workflow and boost productivity.