This is a short guide for setting up prompt based engineering using neovim on linux mint. If you use windows or osx I think you will find other instructions and IDE integrations but for linux we more limited. If you use Linux but you don't actually enjoy using vi or vim you might have to try a different approach. These instructions will install neovim, elixir syntax highlighting, NERDTree and github co-pilot. I want to use javascript and elixir, javascript syntax is supported by default but Elixir syntax isn't so we need a plugin for that.
install neovim & plug.vim #
sudo apt-get install neovim
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
create an init.vim file #
nvim ~/.config/nvim/init.vim
This installs NERDTree and vim-elixir for elixir syntax highlighting
" Specify where vim-plug should manage the plugins
call plug#begin('~/.config/nvim/plugged')
Plug 'elixir-lang/vim-elixir'
Plug 'preservim/nerdtree'
" End the plugin block
call plug#end()
" Open NERDTree automatically when Neovim is started, even with a file
autocmd VimEnter * NERDTree
" Optionally, ensure the file you opened (if any) is the active window (not NERDTree)
autocmd VimEnter * wincmd p
" Close Neovim if the only window left open is NERDTree
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
:PlugInstall
:PlugUpdate
install github co-pilot #
git clone https://github.com/github/copilot.vim.git \
~/.config/nvim/pack/github/start/copilot.vim
Start Neovim with
nvim
and invoke :Copilot setup
.
alias nvim to vi (optional) #
Add this to your ~/.bashrc
alias vi='vim'
alias vi='nvim' # Uncomment this line if you prefer nvim over vim
finally edit a file #
vi cool_beanz.exs