Skip to content

Commit

Permalink
add tabnine chat
Browse files Browse the repository at this point in the history
  • Loading branch information
shuxiao9058 committed Jul 17, 2023
1 parent 719d40c commit 470884f
Show file tree
Hide file tree
Showing 2 changed files with 358 additions and 46 deletions.
41 changes: 27 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
# tabnine

An unofficial TabNine package for Emacs.
An unofficial TabNine(with TabNine Chat supported) package for Emacs.

# Screen Recording

![screenshot-3.gif](./assets/screenshot-3.gif)

## Screenshot

- Snippets displayed with overlay, screenshot:
- Snippets displayed with overlay, screenshot:

![screenshot-1.png](./assets/screenshot-1.png)

- Classic completions displayed with `completion-at-point-functions` screenshot (corfu)

![screenshot-2.png](./assets/screenshot-2.png)
![screenshot-1.png](./assets/screenshot-1.png)

- Classic completions displayed with `completion-at-point-functions` screenshot (corfu)

![screenshot-2.png](./assets/screenshot-2.png)

## Installation

### straight-use-package

Add following code to your configuration.

```emacs
(use-package tabnine
:hook (prog-mode . tabnine-mode)
Expand All @@ -33,6 +32,7 @@ Add following code to your configuration.
```

### manully

1. Install `tabnine`.

Clone or download this repository.
Expand All @@ -45,6 +45,7 @@ Add following code to your configuration.
```

2. Enable `tabnine-mode` in `prog-mode`.

```emacs
(add-to-list 'prog-mode-hook #'tabnine-mode)
```
Expand Down Expand Up @@ -114,6 +115,18 @@ If candidate icons of tabnine displayed unnormally [capf icon error](https://git
(add-to-list 'kind-icon-mapping `(tabnine ,(nerd-icons-codicon "nf-cod-hubot") :face font-lock-warning-face) t)
```

## TabNine Chat

| Command | Note |
| ----------------------------------- | --------------------------------------------- |
| tabnine-chat-explain-code | Explain the selected code |
| tabnine-chat-generate-test-for-code | Write tests for the selected code |
| tabnine-chat-document-code | Add documentation for the selected code |
| tabnine-chat-fix-code | Find errors in the selected code and fix them |
| | |



## Default key bindings

### tabnine-mode-map
Expand All @@ -122,14 +135,14 @@ None.

### tabnine-completion-map

| Key | action |
| ---- | ---- |
| TAB | tabnine-accept-completion |
| C-g | tabnine-clear-overlay |
| M-f | tabnine-accept-completion-by-word |
| Key | action |
| ------------ | --------------------------------- |
| TAB | tabnine-accept-completion |
| C-g | tabnine-clear-overlay |
| M-f | tabnine-accept-completion-by-word |
| M-\<return\> | tabnine-accept-completion-by-line |
| M-[ | tabnine-previous-completion |
| M-] | tabnine-next-completion |
| M-[ | tabnine-previous-completion |
| M-] | tabnine-next-completion |

## Known Issues

Expand Down
Loading

0 comments on commit 470884f

Please sign in to comment.