Vim & IdeaVim shortcuts, resources, keystroke combos and commands

My approach is to use WebStorm and the other JetBrains products to get good language support, and IdeaVim to increase my general coding and typing efficiency.

This is a great feature : Mapping IDEA Actions to VIM shortcuts.

These are the Vim-commands I find most useful (except for a few that are merely interesting like g??). In IdeaVim some of the commands, like :r, :e and :b? do not work as in the original Vim, yet.

If you find errors or grave and omissions, please let me know : @andreasoverland

I have included my .vimrc and .ideavimrc in the bottom

Resources for beginning Vim users:

Follow me on Twitter : @andreasoverland

zgrep -i "error" /var/log/syslog.*.gz Search compressed logs
Grep inside .gz logs without unpacking. Pro tip: Use -E for multiple patterns (zgrep -iE "error|warn" ...).
zgrep
zless /var/log/nginx/access.log.2.gz View compressed log
View gzipped files interactively. Pro tip: zcat file.gz | wc -l to count lines quickly.
zcat/zless
zdiff old.log.gz new.log.gz Compare compressed logs
Diff two gzipped files. Works even if one side is plain text.
zdiff
rg -n "TODO" src/ Fast recursive code search
Ripgrep: blazing-fast grep alternative. Pro tip: rg -uu to include hidden/ignored files.
ripgrep
ag "function init" Code-aware grep
Silver Searcher, tuned for code. Pro tip: Respects .gitignore by default.
ag
comm -12 a.txt b.txt Find common lines
Compare two sorted lists. Pro tip: -23 = in A not B; -13 = in B not A.
comm
shuf -n 10 users.txt Random line selection
Randomize or sample lines from a file. Great for quick A/B tests.
shuf
split -b 100M dump.sql dump_ Split large file
Break big files into chunks by size. Pro tip: use csplit to split by regex.
split/csplit
printf "%s\n" *.jpg | xargs -n1 -P4 convert -resize 50% Parallel batch processing
Build commands from input. Pro tip: Use -0 with find -print0 for safety.
xargs
parallel -j8 ping -c1 ::: host1 host2 host3 Run jobs on multiple cores
GNU Parallel: multicore batching. Pro tip: Use --env _ to export environment vars.
parallel
pv big.iso | gzip > big.iso.gz Monitor pipe progress
Show progress of data through pipes. Pro tip: add -pterb for richer stats.
pv
watch -n 1 "df -h /" Auto-refresh command output
Rerun a command periodically. Pro tip: -d highlights changes.
watch
sudo lsof -i :443 Show open files/sockets
List open files and network sockets. Pro tip: +L1 finds deleted-but-open files.
lsof
sudo strace -f -p $(pidof nginx) Trace syscalls
Debug system calls of processes. Pro tip: -e trace=file focuses on file I/O.
strace
sudo iotop Monitor disk I/O
Real-time disk usage per process. Pro tip: requires root for detail.
iotop
sudo iftop -i eth0 Monitor bandwidth
Live network usage per connection. Requires root for full output.
iftop
socat TCP-LISTEN:9000,fork TCP:127.0.0.1:8000 Relay sockets
Swiss-army knife for socket redirection. Pro tip: can bridge serial, sockets, SSL, etc.
socat
nc -vz example.com 443 Check open ports
Netcat: quick TCP/UDP tests. Pro tip: nc -l 1234 to listen and transfer files.
nc
dig +short TXT _acme-challenge.example.com DNS query
Query DNS records. Pro tip: dig +trace example.com shows full delegation path.
dig
curl -s https://api.github.com | jq .current_user_url Fetch API data
Curl: HTTP client. Pro tip: -I for headers; -d @file.json for POST.
curl
rsync -av --delete src/ dest/ Synchronize files
Robust file sync and backup. Pro tip: --partial --progress for big files.
rsync
jq '.items[] | {id,name}' file.json Parse JSON
Slice and dice JSON data. Pro tip: -r outputs raw strings.
jq
sed -n '1,100p' file Stream edit
Sed: regex-driven editing. Pro tip: -i.bak 's/foo/bar/g' edits in place with backup.
sed
awk '{sum+=$2} END{print sum}' data.tsv Column processing
Awk for line-by-line DSL. Pro tip: -F'\t' for TSV.
awk
sort file | sponge file Rewrite safely
sponge (from moreutils) soaks up input then writes. Pro tip: avoids truncation.
sponge
file * Detect file types
Identify file types using magic numbers. Not just by extension.
file
xxd -g1 hello.zip | head Hex dump
Hex view of binary data. Pro tip: xxd -r reverses back to binary.
xxd
stat /var/log/syslog Detailed file info
Show inode, size, blocks, timestamps, etc.
stat
tree -L 2 /etc/nginx Directory tree view
Display directories in a tree structure. Pro tip: -I 'node_modules|dist' to ignore patterns.
tree
This is my .vimrc


set nocompatible
filetype off

filetype plugin indent on

syntax enable
let mapleader = " "
set ignorecase
set ruler
set autoindent
set incsearch
set encoding=utf-8
set noexpandtab
set tabstop=4               " tab size is 4
set number                  " always show line number
set nostartofline
set clipboard^=unnamed,unnamedplus
set showcmd
set showmode
set path+=**
set nowrap
set noswapfile
set nobackup
set noerrorbells
set nu rnu

noremap <Up> <NOP>
noremap <Down> <NOP>
noremap <Left> <NOP>
noremap <Right> <NOP>
inoremap jj <Esc>
xnoremap u <nop>

"Mode Settings

let &t_SI.="\e[1 q" "SI = INSERT mode
let &t_SR.="\e[3 q" "SR = REPLACE mode
let &t_EI.="\e[2 q" "EI = NORMAL mode (ELSE)


"Cursor settings:

"  1 -> blinking block
"  2 -> solid block
"  3 -> blinking underscore
"  4 -> solid underscore
"  5 -> blinking vertical bar
"  6 -> solid vertical bar

			


My .ideavimrc

source .vimrc
set clipboard+=unnamed
set surround
set multiple-cursors
set ideajoin
set surround           " Lets you surround with motion : ysiw" would sourround a word with "
set sneak              " Great plugin for two letter multiline search
set number
set relativenumber

let mapleader = " "

imap jj <Esc>
nnoremap <C-k> :m -2<CR>
nnoremap <C-j> :m +1<CR>
xnoremap u <nop>
nmap <leader>t :action ActivateTerminalToolWindow<CR>
nnoremap <leader>r :action RenameElement<CR>
nnoremap <leader>d :action Debug<CR>
nnoremap <leader>si :source ~/.ideavimrc<CR>
nnoremap <leader>M :action ToggleBookmarkWithMnemonic<CR>
nnoremap <leader>m :action ShowBookmarks<CR>
			
Last update : 2025.08.18

I work here : www.gibson.co.uk