Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanpetrello/vimwhisperer
A simple VIM plugin for AWS CodeWhisperer code completion support.
https://github.com/ryanpetrello/vimwhisperer
Last synced: 3 days ago
JSON representation
A simple VIM plugin for AWS CodeWhisperer code completion support.
- Host: GitHub
- URL: https://github.com/ryanpetrello/vimwhisperer
- Owner: ryanpetrello
- License: mit
- Created: 2023-08-14T14:43:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-28T18:34:14.000Z (2 months ago)
- Last Synced: 2024-08-28T20:21:48.457Z (2 months ago)
- Language: Python
- Size: 198 KB
- Stars: 17
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- my-awesome-starred - ryanpetrello/vimwhisperer - A simple VIM plugin for AWS CodeWhisperer code completion support. (Python)
README
# vimwhisperer
A simple Vim plugin for AWS CodeWhisperer code completion support.
## Configuration and Authentication
Install this Python package, e.g.,
```
~ pip3 install --user git+https://github.com/ryanpetrello/vimwhisperer.git
```If necessary, set the following environment variables:
```
~ export VIM_AWS_SSO_START_URL='https://my-example-app.awsapps.com/start'
~ export VIM_AWS_SSO_REGION='us-west-2'
```Authenticate for the first time using AWS IAM Identity Center:
```
~ python -m vimwhisperer.login
```An OIDC client and Bearer token will be generated, and will be cached at ``~/.vim/.aws-code-whisperer-auth`` for subsequent API calls:
## Running Code Completion by Hand
```python
~ echo 'def read_from_s3(bucket, key):' | python -m vimwhisperer
import boto3
s3 = boto3.resource('s3')
obj = s3.Object(bucket, key)
return obj.get()['Body'].read().decode('utf-8')
```Target language can be specified via the ``--language`` flag.
```php
~ echo 'function read_from_s3($bucket, $key) {' | python -m vimwhisperer --language php
```## Installing the Vim Plugin
Install ``vimwhisperer.vim`` using your plugin manager, and map to the leader key of your choosing, i.e.,
```
map a :silent! call CodeWhisperer()
```https://github.com/ryanpetrello/vimwhisperer/assets/214912/66442b0f-9006-47da-86b4-53122cd9ea38