AI Completion In The Shell: Difference between revisions

From Rest of What I Know
Created page with "LLMs are fantastic for programming. I use ChatGPT, Claude, and Copilot routinely. One place where I didn't have a good workflow was my terminal, but [https://x.com/arjie/status/1575201117595926530 I found a way that I find quite pleasant and I've been using it for a few months]. thumb|alt=A screen recording of Copilot in Neovim helping with an AWS question|See how easy it is == Steps == 1. Install <code>neovim</code> 2. Install Copilot on..."
 
No edit summary
 
Line 31: Line 31:


I also use <code>zsh</code> with <code>oh-my-zsh</code> and [https://starship.rs/ starship.rs] so entering and leaving this is quite easy and pleasant. I can type some at the command-prompt and then go back to <code>nvim</code> and so on because it will expand things like <code>!!</code> and so on.
I also use <code>zsh</code> with <code>oh-my-zsh</code> and [https://starship.rs/ starship.rs] so entering and leaving this is quite easy and pleasant. I can type some at the command-prompt and then go back to <code>nvim</code> and so on because it will expand things like <code>!!</code> and so on.
[[Category:Programming]] [[Category:Tips]]

Latest revision as of 06:04, 16 April 2024

LLMs are fantastic for programming. I use ChatGPT, Claude, and Copilot routinely. One place where I didn't have a good workflow was my terminal, but I found a way that I find quite pleasant and I've been using it for a few months.

See how easy it is

Steps[edit]

1. Install neovim

2. Install Copilot on it using copilot.vim

3. Set EDITOR=nvim

4. Use Ctrl-X Ctrl-E at your command-prompt to enter your Neovim-enabled Copilot

Additional Tips[edit]

Here's my ~/.config/nvim/init.vim for the relevant bits. I use vim-plug which I've found quite useful to manage vim plugins.

call plug#begin()
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
  Plug 'github/copilot.vim'
call plug#end()

" Deoplete
let g:deoplete#enable_at_startup = 1
"" <TAB>: completion.
inoremap <expr><TAB>  pumvisible() ? "\<C-n>" : "\<TAB>"
inoremap <expr><S-TAB>  pumvisible() ? "\<C-p>" : "\<TAB>"

I also use zsh with oh-my-zsh and starship.rs so entering and leaving this is quite easy and pleasant. I can type some at the command-prompt and then go back to nvim and so on because it will expand things like !! and so on.