Skip to content

Instantly share code, notes, and snippets.

@RRethy
RRethy / directory_jumper.zsh
Last active May 17, 2021 16:16
A small ZSH script to replace autojump
# Usage: `jd `
# Make after typing j, d, and a space, fzy will pop up offering a fuzzy selector.
# Setup some data a data file to store visited directories
mkdir -p "$XDG_DATA_HOME/zshrc"
JD_DATA_DIR="$XDG_DATA_HOME/zshrc/chpwd.txt"
touch $JD_DATA_DIR
local tmp=$(mktemp)
cat $JD_DATA_DIR | while read dir ; do [[ -d $dir ]] && echo $dir ; done > $tmp
cat $tmp > $JD_DATA_DIR
@RRethy
RRethy / gist:ad8a9a3b1112a48226ec3336fa981224
Last active September 19, 2025 19:33
Seamlessly editing remote files in (Neo)Vim with Netrw and scp

Seamlessly editing remote files in (Neo)Vim with Netrw and scp

Neovim and Vim both come bundled with a standard plugin called Netrw. Netrw acts a file explorer (similar to NERDTree), but more importantly has the ability to work with scp (as well as sftp, rcp, ftp, and lots of others :h netrw-nread) to let you edit files and browse directories that are hosted on a remote machine, inside of your local Vim instance.

This is useful since you are able to use your Vim setup and plugins without copying over your dotfiles to the remote machine. As well, since the file is copied to your local machine, there will be no delay when typing.

Setup

This is optional for Vim, but required for Neovim (check this Neovim issue explaining why).