Skip to content

Commit a50e362

Browse files
Augment Vim v0.14.1
1 parent fb29a9f commit a50e362

File tree

6 files changed

+139
-49
lines changed

6 files changed

+139
-49
lines changed

README.md

Lines changed: 104 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Augment Vim & Neovim Plugin
22

3-
> [!WARNING]
4-
> This plugin is in early alpha development stage. Features may be incomplete,
5-
> unstable, or change without notice. While basic functionality is available,
6-
> you may encounter bugs, performance issues, or unexpected behavior. Current
7-
> platform support is limited to MacOS and Linux, with Windows to be added at a
8-
> later date.
3+
## A Quick Tour
4+
5+
Augment's Vim/Neovim plugin provides inline code completions and multi-turn
6+
chat conversations specially tailored to your codebase. The plugin is designed
7+
to work with any modern Vim or Neovim setup, and features the same underlying
8+
context engine that powers our VSCode and IntelliJ plugins.
9+
10+
Once you've installed the plugin, tell Augment about your project by adding
11+
[workspace folders](#workspace-folders) to your config file, and then sign-in
12+
to the Augment service. You can now open a source file in your project, begin
13+
typing, and you should receive context-aware code completions. Use tab to
14+
accept a suggestion, or keep typing to refine the suggestions. To ask questions
15+
about your codebase or request specific changes, use the `:Augment chat` command
16+
to start a chat conversation.
917

1018
## Installation
1119

@@ -48,6 +56,8 @@
4856
{ 'augmentcode/augment.vim' },
4957
```
5058
59+
1. Add workspace folders to your config file. This is really essential to getting the most out of augment! See the [Workspace Folders](#workspace-folders) section for more information.
60+
5161
1. Open Vim and sign in to Augment with the `:Augment signin` command.
5262
5363
## Basic Usage
@@ -69,10 +79,53 @@ The following commands are provided:
6979
:Augment chat-toggle " Toggle the chat panel visibility
7080
```
7181
82+
## Workspace Folders
83+
84+
Workspace folders help Augment understand your codebase better by providing
85+
additional context. Adding your project's root directory as a workspace folder
86+
allows Augment to take advantage of context from across your project, rather
87+
than just the currently open file, improving the accuracy and style of
88+
completions and chat.
89+
90+
You can configure workspace folders by setting
91+
`g:augment_workspace_folders` in your vimrc:
92+
93+
```vim
94+
let g:augment_workspace_folders = ['/path/to/project', '~/another-project']
95+
```
96+
97+
Workspace folders can be specified using absolute paths or paths relative to
98+
your home directory (~). Adding your project's root directory as a workspace
99+
folder helps Augment generate completions that match your codebase's patterns
100+
and conventions.
101+
102+
Note: This option must be set before the plugin is loaded.
103+
104+
After adding a workspace folder and restarting vim, the output of the
105+
`:Augment status` command will include the syncing progress for the added
106+
folder.
107+
108+
If you want to ignore particular files or directories from your workspace, you
109+
can create a `.augmentignore` file in the root of your workspace folder. This
110+
file is treated similar to a `.gitignore` file. For example, to ignore all
111+
files within the `node_modules` directory, you can add
112+
the following lines to your `.augmentignore` file:
113+
114+
```
115+
node_modules/
116+
```
117+
118+
For more information on how to use the `.augmentignore` file, see the [documentation](https://docs.augmentcode.com/setup-augment/sync).
119+
120+
72121
## Chat
73122
74-
The chat command allows you to interact with Augment AI in a conversational
75-
manner. You can use it in two ways:
123+
Augment chat supports multi-turn conversations using your project's full
124+
context. Once a conversation is started, subsequent chat exchanges will include
125+
the history from the previous exchanges. This is useful for asking follow-up
126+
questions or getting context-specific help.
127+
128+
You can interact with chat in two ways:
76129
77130
1. Direct command with message:
78131
@@ -86,32 +139,20 @@ manner. You can use it in two ways:
86139
87140
- Type `:Augment chat` followed by your question about the selection
88141
89-
The response will appear in a new buffer with markdown formatting. Note that
90-
chat is currently limited to single-turn conversations - each chat command
91-
starts a new conversation.
92-
93-
## Workspace Folders
142+
The response will appear in a separate chat buffer with markdown formatting.
94143
95-
Workspace folders help Augment understand your codebase better by providing
96-
additional context. You can configure workspace folders by setting
97-
`g:augment_workspace_folders` in your vimrc:
98-
99-
```vim
100-
let g:augment_workspace_folders = ['/path/to/project', '~/another-project']
101-
```
102-
103-
Workspace folders can be specified using absolute paths or paths relative to
104-
your home directory (~). Adding your project's root directory as a workspace
105-
folder helps Augment generate completions that match your codebase's patterns
106-
and conventions.
144+
To start a new conversation, use the `:Augment chat-new` command. This will
145+
clear the chat history from your context.
107146
108-
Note: This option must be set before the plugin is loaded.
147+
Use the `:Augment chat-toggle` command to open and close the chat panel. When
148+
the chat panel is closed, the chat conversation will be preserved and can be
149+
reopened with the same command.
109150
110151
## Alternate Keybinds
111152
112153
By default, tab is used to accept a suggestion. If you want to use a
113154
different key, create a mapping that calls `augment#Accept()`. The function
114-
takes an optional arugment used to specify the fallback text to insert if no
155+
takes an optional argument used to specify the fallback text to insert if no
115156
suggestion is available.
116157
117158
```vim
@@ -131,6 +172,42 @@ overridden depending on the order in which the plugins are loaded. If tab isn't
131172
working for you, the `imap <tab>` command can be used to check if the mapping is
132173
present.
133174
175+
## FAQ
176+
177+
**Q: I'm not seeing any completions. Is the plugin working?**
178+
179+
A: You may want to first check the output of the `:Augment status` command.
180+
This command will show the current status of the plugin, including whether
181+
you're signed in and whether your workspace folders are synced. If you're not
182+
signed in, you'll need to sign in using the `:Augment signin` command. If those
183+
are not indicating a problem, you can check the plugin log using the `:Augment
184+
log` command. This will show any errors that may have occurred.
185+
186+
**Q: Can I create shortcuts for the Augment commands?**
187+
188+
A: Absolutely! You can create mappings for any of the Augment commands. For
189+
example, to create a shortcut for the `:Augment chat*` commands, you can add the
190+
following to your vimrc:
191+
192+
```vim
193+
nnoremap <leader>ac :Augment chat<CR>
194+
vnoremap <leader>ac :Augment chat<CR>
195+
nnoremap <leader>an :Augment chat-new<CR>
196+
nnoremap <leader>at :Augment chat-toggle<CR>
197+
```
198+
199+
**Q: My workspace is taking a long time to sync. What should I do?**
200+
201+
A: It may take a while to sync if you have a very large codebase that has not
202+
been synced before. It's also not uncommon to inadvertenly include a large
203+
directory like `node_modules/`. You can use `:Augment status` to see the
204+
progress of the sync. If the sync is making progress but just slow, it may be
205+
worth checking if you have a large directory that you don't need to sync. You
206+
can add these directories to your `.augmentignore` file to exclude it from the
207+
sync. If you're still having trouble, please file a github issue with a
208+
description of the problem and include the output of `:Augment log`.
209+
210+
134211
## Licensing and Distribution
135212
136213
This repository includes two main components:

autoload/augment/chat.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function! s:ResetChatContents() abort
1111
endif
1212

1313
call setbufvar(chat_buf, '&modifiable', v:true)
14-
call deletebufline(chat_buf, 1, '$')
14+
silent call deletebufline(chat_buf, 1, '$')
1515
call augment#chat#AppendText('# Augment Chat History'
1616
\ . "\n\n"
1717
\ . '`:Augment chat` Send a chat message in the current conversation'

autoload/augment/client.vim

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ function! s:HandleCompletion(client, params, result, err) abort
9292
return
9393
endif
9494

95+
" If the user has exited insert mode, ignore the response
96+
if mode() !=# 'i'
97+
return
98+
endif
99+
95100
" Show the completion
96101
let text = a:result[0].insertText
97102
let request_id = a:result[0].label
@@ -198,7 +203,7 @@ function! s:HandlePluginVersion(client, params, result, err) abort
198203
let current_version = augment#version#Version()
199204
if latest_version !=# current_version
200205
let is_prerelease = a:result.isPrerelease
201-
let warning_message = printf('Your plugin version %s is lower than the latest %s version %s. Please update your plugin to receive the latest features and bug fixes.',
206+
let warning_message = printf('Your plugin version v%s is lower than the latest %s version v%s. Please update your plugin to receive the latest features and bug fixes.',
202207
\ current_version,
203208
\ is_prerelease ? 'prerelease' : 'stable',
204209
\ latest_version)

autoload/augment/version.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
" MIT License - See LICENSE.md for full terms
33

44
function! augment#version#Version() abort
5-
return '0.10.1'
5+
return '0.14.1'
66
endfunction

0 commit comments

Comments
 (0)