Skip to content

Instantly share code, notes, and snippets.

View Goberman15's full-sized avatar
🏠
Working from home

Akbar Ramadhan Goberman15

🏠
Working from home
View GitHub Profile
@Goberman15
Goberman15 / gist:b8c34903b0935012c858ad3707ffd088
Created February 21, 2022 07:00 — forked from RRethy/gist:ad8a9a3b1112a48226ec3336fa981224
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).

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database