Skip to content

Commit

Permalink
docs: update vim documentation (TabbyML#453)
Browse files Browse the repository at this point in the history
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* fix: apply suggestions from code review

Co-authored-by: Meng Zhang <[email protected]>

---------

Co-authored-by: Meng Zhang <[email protected]>
  • Loading branch information
samsja and wsxiaoys authored Sep 18, 2023
1 parent fad8432 commit eec351f
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion clients/vim/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
# Tabby VIM extension

Tabby is compatible with both Vim and NeoVim text editor via a plugin.

## Requirements

Before installing the plugin you will need to have installed:

1. VIM 9.0+ with `+job` and `+textprop` features enabled, or NeoVIM 0.6.0+.
2. Node.js 16.0+.

## Getting started

You can either install TabbyML vim extension using [Vim-Plug](https://github.com/junegunn/vim-plug), [Packer](https://github.com/wbthomason/packer.nvim) or [Lazy](https://github.com/folke/lazy.nvim).

### 🔌 Vim-Plug

[Vim-Plug](https://github.com/junegunn/vim-plug) is a minimalist Vim plugin manager that you can use to install TabbyML plugin.
You can install Vim-Plug by following these [intructions](https://github.com/junegunn/vim-plug#installation).



You will need to edit your vim config file (`~/.vimrc` for vim and `~/.config/nvim/init.vim` for neovim) and copy paste the following lines in it (between the `plug#begin` and `plug#end` lines)


```
" Make sure that the filetype plugin has been enabled.
filetype plugin on
Expand All @@ -18,12 +33,27 @@ Plug 'TabbyML/tabby', {'rtp': 'clients/vim'}
" Set URL of Tabby server
let g:tabby_server_url = 'http://127.0.0.1:8080'
```

Note that you can change the tabby server url here.


You then need to actually install the plugin, to do so you need to type in your vim command.

```
:PlugInstall
```
You should see the tabbyML plugin beeing installed.


### 📦 Packer and Lazy
You first need to install either [Packer](https://github.com/wbthomason/packer.nvim) or [Lazy](https://github.com/folke/lazy.nvim).

In this case, you first need to clone the repo in your machine
```
git clone https://github.com/TabbyML/tabby.git ~/tabby
```
Then on the config file:
You will need to edit `~/.config/nvim/init.vim` for and copy paste the following lines in it.

```
" For lazy
return { name = "tabby", dir = '~/tabby/clients/vim', enabled = true }
Expand All @@ -41,6 +71,21 @@ let g:tabby_server_url = 'http://127.0.0.1:8080'
```
> In the future, the ideal would be to export the Vim extension to a separate Git repository. This would simplify the installation process [#252](https://github.com/TabbyML/tabby/issues/252).
## Checking the installation

Once the plugin is installed you can check if the install was done sucessfully by doing in your vim command

```
:Tabby status
```

You should see
```
Tabby is online
```

If you se `Tabby cannot connect to the server` it means that you need to start the tabby server first. Refer to this [documentation](https://tabby.tabbyml.com/docs/installation/)

## Usage

1. In insert mode, Tabby will show code suggestion when you stop typing. Press `<Tab>` to accpet the current suggestion, `<M-]>` to see the next suggestion, `<M-[>` to see previous suggestion, or `<C-]>` to dismiss.
Expand Down

0 comments on commit eec351f

Please sign in to comment.