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
/ a
Insert before/after cursor
Normal v
Visual mode
Any <ESC>
Return to normal mode
Command Description
yy
Copy whole line
yaw
Copy all word
2yy
Copy next 2 lines
p
/ P
Paste after/before
2dd
Delete next 2 lines
"+
System clipboard register
Command Description
:ls
List buffers
:b N
Go to buffer N
C-w s/v
Split window horizontally/vertically
C-w c
Close current window
C-w o
Close all other windows
C-w =
Make all windows equal size
C-w T
Move window to new tab
gt
Next tab
:tabc
Close current tab
Command Description
:e %:h[TAB]
Edit from current file's directory
C-o
/ C-i
Navigate jump list backward/forward
:ju
Show jump list
gd
Go 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