AI Completion In The Shell: Difference between revisions

From Rest of What I Know
No edit summary
Added page description via AutoDescriptor bot
 
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.
{{#seo:|description=Use AI-powered code completion seamlessly in your terminal with Neovim and Copilot. Enhance your programming workflow with this efficient setup.}}


[[Category:Programming]] [[Category:Tips]]
[[Category:Programming]] [[Category:Tips]]

Latest revision as of 07:41, 30 August 2025

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.