This guide covers setup and usage for various editors, primarily focusing on Vim/Neovim with VSCode as an alternative.
sudo yum groups install -y Development\ tools
sudo yum install -y cmake python34-{devel,pip}
sudo pip-3.4 install neovim --upgrade
(
cd "$(mktemp -d)"
git clone https://github.com/neovim/neovim.git
cd neovim
make CMAKE_BUILD_TYPE=Release
sudo make install
)
sudo yum install openssl-devel
wget https://github.com/Kitware/CMake/releases/download/v3.31.4/cmake-3.31.4.tar.gz
tar -xvzf cmake-3.31.4.tar.gz
cd cmake-3.31.4
./bootstrap && make && sudo make install
export PATH="/usr/local/bin:$PATH"
git clone https://github.com/neovim/neovim
cd neovim
git checkout stable
make CMAKE_BUILD_TYPE=RelWithDebInfo
sudo make install
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
Basic ~/.vimrc:
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'kien/ctrlp.vim'
Plugin 'google/vim-colorscheme-primary'
Plugin 'vim-airline/vim-airline'
call vundle#end()
filetype plugin indent on
" Navigation shortcuts
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
nmap <C-n> :NERDTree<CR>
nmap <C-p> :CtrlP<CR>
" Appearance
syntax on
set t_Co=256
set background=dark
colorscheme primary
set number
Add Rust support: run :LazyExtra
Check missed notifications: :messages
Close buffer: <leader>bd (where <leader> is space)
Jump to function: <leader>ss
Navigation: <c-o>, <c-i>, gd
Mode Command Description
Normal i / aInsert before/after cursor
Normal vVisual mode
Any <ESC>Return to normal mode
Command Description
yyCopy whole line
yawCopy all word
2yyCopy next 2 lines
p / PPaste after/before
2ddDelete next 2 lines
"+System clipboard register
Command Description
:lsList buffers
:b NGo to buffer N
C-w s/vSplit window horizontally/vertically
C-w cClose current window
C-w oClose all other windows
C-w =Make all windows equal size
C-w TMove window to new tab
gtNext tab
:tabcClose current tab
Command Description
:e %:h[TAB]Edit from current file's directory
C-o / C-iNavigate jump list backward/forward
:juShow jump list
gdGo to definition (LazyVim)
Update settings.json:
{
"rust-analyzer.server.path": "/Users/lky/.cargo/bin/rust-analyzer"
}
Hit <ESC> when confused
Use i to insert, <ESC> to navigate
Basic workflow: navigate → edit → save → repeat
:h [command] - Show help for command
:q - Quit
:w - Save
:wq - Save and quit