diff --git a/docs/extensions-plugins/neovim/commands.mdx b/docs/extensions-plugins/neovim/commands.mdx new file mode 100644 index 000000000..189a263bc --- /dev/null +++ b/docs/extensions-plugins/neovim/commands.mdx @@ -0,0 +1,157 @@ +--- +title: Pieces Neovim Plugin Commands +description: Learn how to use the Pieces Neovim Plugin commands to streamline your workflow and boost productivity. +--- + +# Commands + +The Pieces Neovim plugin provides several commands to interact with Pieces OS. Here's a list of available commands: + +## General Commands + +### `:PiecesHealth` + +Check the health of Pieces OS. + +```vim +:PiecesHealth +``` + +### `:PiecesOSVersion` + +Display the version of Pieces OS. + +```vim +:PiecesOSVersion +``` +### `:PiecesPluginVersion` + +Display the current version of the Pieces Neovim plugin. + +```vim +:PiecesPluginVersion +``` + +## Copilot Commands + +### `:PiecesCopilot` + +Open the Pieces Copilot window in a split view. + +```vim +:PiecesCopilot +``` + +#### Using the Copilot Chat + +1. Press `i` to enter insert mode and type your message. +2. Press `` to exit insert mode. +3. Press `` to send the message to Pieces Copilot and see the response. + +#### Copilot Chat Commands + +In the Copilot chat input, you can use slash commands to perform specific actions: + +#### `/change_model` + +Change the current LLM model. + +### `:PiecesConversations` + +Open a list of Pieces Copilot conversations to choose from. + +```vim +:PiecesConversations +``` +Navigation and actions: +- Press `` on the selected conversation to delete it +- Use `` and `` arrow keys to navigate the conversation list +- Press `` to open the selected conversation in the Copilot + +## Asset Management Commands + +### `:PiecesSnippets` + +List all of the saved snippets. + +```vim +:PiecesSnippets +``` +Navigation and actions: +- Use `` and `` arrow keys to navigate the snippet list. +- Press `` to open the selected snippet for editing. +- Press `` on the selected snippet to delete it. +- When editing a snippet: + 1. Press `i` to enter insert mode and make changes. + 2. Press `` to exit insert mode. + 3. Type `:w` and press `` to save the edited snippet. + 4. Type `:q` and press `` to exit the snippet editor. + + +### `:PiecesCreateSnippet` + +Create a snippet from the selected text in the visual mode. + +```vim +:PiecesCreateSnippet +``` + +1. Enter visual mode by pressing `v` in normal mode. +2. Select the desired text using arrow keys or Vim motions. +3. Type `:PiecesCreateSnippet` and press ``. + +## Auth Commands + +### `:PiecesAccount` + +Shows your Pieces account information such as Username, Email, Personal Cloud Status and Personal Domain in a new window. + +```vim +:PiecesAccount +``` +You can also logout from your account by going to the `Logout` option in the Auth status menu and then press `enter`. You will be logged out of your Pieces account. + +### `:PiecesLogin` + +Login to your Pieces account. + +```vim +:PiecesLogin +``` + +### `:PiecesLogout` + +Logout of your Pieces account. + +```vim +:PiecesLogout +``` + +### `:PiecesConnectCloud` + +Connect to your Personal Pieces Cloud. + +```vim +:PiecesConnectCloud +``` + +### `:PiecesDisconnectCloud` + +Disconnect from your Personal Pieces Cloud. + +```vim +:PiecesDisconnectCloud +``` + +:::info + + Note: In order to use the Personal Pieces Cloud commands, you must have an account connected to Pieces OS. + +::: +## Tips + +- When editing a snippet opened with `:PiecesSnippets`, remember to save your changes using the `:w` command. +- Use visual mode to select text before running `:PiecesCreateSnippet` to create a new snippet. + + + diff --git a/docs/extensions-plugins/neovim/index.mdx b/docs/extensions-plugins/neovim/index.mdx new file mode 100644 index 000000000..2812103d8 --- /dev/null +++ b/docs/extensions-plugins/neovim/index.mdx @@ -0,0 +1,28 @@ +--- +title: Pieces Neovim Plugin +description: Understand the benefits and importance of using the Pieces Neovim Plugin, and get started with Quickstart and Commands. +--- + +import { CardWithCTA } from "/src/components/Card"; +import Grid from "/src/components/Grid"; +import Video from "/src/components/Video"; + +The Pieces Neovim plugin is your gateway to managing your saved materials and interacting with Pieces Copilot in Pieces directly from within Neovim. Seamlessly interact with Pieces OS and enhance your workflow like never before. + +## Get Started + + + + + + + +## Need Help? + +If you encounter any issues or have questions, you can create an issue on the [Pieces Neovim Plugin GitHub repository](https://github.com/pieces-app/plugin_neo_vim/issues) and we will get back to you as soon as possible. + +For additional support, feel free to [reach out through any of our support channels](/support) consult the [FAQs](/faq). + +## Want To Contribute? + +The Pieces Neovim Plugin is completely open-source and we welcome contributions. If you'd like to contribute, check out the [GitHub repository](https://github.com/pieces-app/plugin_neo_vim) to get started. \ No newline at end of file diff --git a/docs/extensions-plugins/neovim/quickstart.mdx b/docs/extensions-plugins/neovim/quickstart.mdx new file mode 100644 index 000000000..be3d10638 --- /dev/null +++ b/docs/extensions-plugins/neovim/quickstart.mdx @@ -0,0 +1,121 @@ +--- +title: Pieces for Developers Neovim Plugin Quickstart +description: Learn how to set up and start using the Pieces Neovim Plugin. +--- + +import CTAButton from "/src/components/CTAButton"; +import { pieces_app } from "/src/lib/const"; + +# Quickstart + +In this tutorial, we'll walk you through the process of setting up and using the Pieces for Neovim Plugin. We'll cover the installation process and basic usage to help you get up and running quickly. + + + +## Prerequisites + +- [Pieces OS](/installation-getting-started/what-am-i-installing) installed on your machine. +- [Neovim](https://neovim.io/) installed on your machine. +- [Python](https://www.python.org/downloads/) 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: + + ```bash + pip install pynvim + ``` + +- Ensure that you have at least one Neovim package manager installed. For instance, you can install `vim-plug`. + In order to install `vim-plug`, run the following command in your terminal: + + ```bash + 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: + + ```bash + mkdir -p ~/.config/nvim + touch ~/.config/nvim/init.vim + ``` + + Note: Your Neovim configuration file can either be `init.vim` or `init.lua`. If you are using `init.lua`, you will need to add the following line to your configuration file: + + ```lua + vim.cmd [[packadd pieces.nvim]] + ``` + +## Steps + +### Step 1: Install the Pieces Neovim Plugin +1. Ensure Pieces OS is installed and running on your system +1. Open the `init.vim` file with a text editor (you can use Neovim itself): + ```shell + nvim ~/.config/nvim/init.vim + ``` +1. Add the following lines to the `init.vim` file: + ```vim + " init.vim + call plug#begin('~/.vim/plugged') + + Plug 'kyazdani42/nvim-web-devicons' + Plug 'MunifTanjim/nui.nvim' + Plug 'hrsh7th/nvim-cmp' + Plug 'pieces-app/plugin_neovim' + + call plug#end() + ``` + If you're using Neovim to edit, press ``, then type `:wq` and press `` to save and quit. + +1. Install the plugins: Open Neovim again and run the following command: + ```vim + :PlugInstall + ``` + This will install all the plugins specified. + +1. After the installation is complete, add the Pieces configuration to your `init.vim`: + ```vim + lua << EOF + require("pieces.config").host = "http://localhost:1000" + EOF + ``` +1. Save and exit (`:wq` in Neovim). Now run the following command inside Neovim to update the remote plugins: + ```vim + :UpdateRemotePlugins + ``` + +### Step 2: Use the Neovim Plugin +1. Open Neovim using the `nvim` command in your terminal. + +1. Run the following command to verify the installation: + ```vim + :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. + +:::info + +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: + +```bash +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. + +- [Commands](/extensions-plugins/neovim/commands) +- [Pieces Neovim Plugin GitHub Repository](https://github.com/pieces-app/plugin_neo_vim) + + diff --git a/docs/extensions-plugins/neovim/troubleshooting.mdx b/docs/extensions-plugins/neovim/troubleshooting.mdx new file mode 100644 index 000000000..25116c304 --- /dev/null +++ b/docs/extensions-plugins/neovim/troubleshooting.mdx @@ -0,0 +1,28 @@ +--- +title: Pieces for Developers Neovim Plugin Troubleshooting +description: Learn how to troubleshoot common issues with the Pieces for Neovim Plugin. +--- + +# Troubleshooting + +If you encounter any issues while installing or using the Pieces for Neovim Plugin, refer to the following troubleshooting guide for solutions. + +## Common Issues + +### Issue with Python Dependencies + +#### Problem + +When you try to run a Python based Neovim plugin, you may encounter an error related to Python dependencies missing. This error may occur when you run the plugin for the first time or after updating the plugin. + +#### Solution + +Ensure that you have installed the `pynvim` package. You can do this by running the following command: + +```bash +pip install pynvim +``` + +## Contact Support + +If you continue to experience issues after trying our solutions, please to [reach out to our support team](/support) for further assistance. \ No newline at end of file diff --git a/docs/extensions-plugins/raycast/troubleshooting.mdx b/docs/extensions-plugins/raycast/troubleshooting.mdx index 238c04d83..36810140f 100644 --- a/docs/extensions-plugins/raycast/troubleshooting.mdx +++ b/docs/extensions-plugins/raycast/troubleshooting.mdx @@ -30,4 +30,4 @@ When you try to run a command in Raycast for the first time, you may encounter a ## Contact Support -If you continue to experience issues after trying our solutions, please [reach out to our support team](/support) for further assistance. \ No newline at end of file +If you continue to experience issues after trying our solutions, please [reach out to our support team](/support) for further assistance. diff --git a/docs/index.mdx b/docs/index.mdx index 671a82b79..031d64d2e 100644 --- a/docs/index.mdx +++ b/docs/index.mdx @@ -26,6 +26,7 @@ Get started with the Pieces for Developers platform and show you how to best use + ## Web Browsers diff --git a/sidebars.ts b/sidebars.ts index 4a7a94b87..34233aa60 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -73,6 +73,11 @@ const sidebars: SidebarsConfig = { id: 'extensions-plugins/raycast/index', label: 'Raycast Plugin', }, + { + type: 'doc', + id: 'extensions-plugins/neovim/index', + label: 'Neovim Plugin', + }, { type: 'doc', id: 'extensions-plugins/sublime', @@ -754,6 +759,35 @@ const sidebars: SidebarsConfig = { }, ], + // Neovim Sidebar + neovimSidebar: [ + { + type: 'ref', + id: 'installation-getting-started/what-am-i-installing', + label: '← Back to Learn', + }, + { + type: 'doc', + id: 'extensions-plugins/neovim/index', + label: 'Overview', + }, + { + type: 'doc', + id: 'extensions-plugins/neovim/quickstart', + label: 'Quickstart', + }, + { + type: 'doc', + id: 'extensions-plugins/neovim/commands', + label: 'Commands', + }, + { + type: 'doc', + id: 'extensions-plugins/neovim/troubleshooting', + label: 'Troubleshooting', + } + ], + // Generates sidebar for each active SDK ...generatedSDKSidebars, }; diff --git a/src/lib/const.ts b/src/lib/const.ts index be3cbc6c0..15799842f 100644 --- a/src/lib/const.ts +++ b/src/lib/const.ts @@ -24,6 +24,7 @@ export const pieces_app = { // obsidian: "obsidian://show-plugin?id=pieces-for-developers", cli:"https://pypi.org/project/pieces-cli/", sublime: "https://packagecontrol.io/packages/Pieces", + neovim: "https://github.com/pieces-app/plugin_neo_vim", edge: "https://microsoftedge.microsoft.com/addons/detail/pieces-save-code-snippet/hglfimcdgonaeeobjckfdabcldfidmim", teams: "https://teams.microsoft.com/dl/launcher/launcher.html?url=%2F_%23%2Fl%2Fapp%2F789f23b3-d882-45ca-b3a3-de7f850656ea%3Fsource%3Dapp-details-dialog&type=app&deeplinkId=a5fe0a60-b3a1-42a2-9a57-a5ec71696573&directDl=true&msLaunch=true&enableMobilePage=true&suppressPrompt=true", firefox: "https://addons.mozilla.org/en-US/firefox/addon/pieces-save-code-from-the-web/", diff --git a/static/assets/neovim_logo.png b/static/assets/neovim_logo.png new file mode 100644 index 000000000..1dde98dbc Binary files /dev/null and b/static/assets/neovim_logo.png differ