From feefcdff751d8f59add07a824ab07808513313f1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 11 Jun 2026 09:30:05 -0300 Subject: [PATCH] =?UTF-8?q?add=20chapter=205:=20Vim=20=E2=80=94=20edit=20a?= =?UTF-8?q?nd=20read=20files=20on=20your=20agent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ssh-for-agents.html | 67 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/ssh-for-agents.html b/ssh-for-agents.html index 5492747..b651978 100644 --- a/ssh-for-agents.html +++ b/ssh-for-agents.html @@ -160,6 +160,7 @@
  • Copying Files In and Out — Derez Sync
  • Tmux — Persistent Terminal Sessions
  • Midnight Commander — File Management with a UI
  • +
  • Vim — Edit and Read Files on Your Agent
  • @@ -292,6 +293,72 @@

    Pro Tip: Enable mouse support in MC by pressing F9 → Options → Display → check "Mouse support". Now you can click to navigate, select files, and press function keys with your mouse — a full GUI feel over SSH.

    + +

    5 Vim — Edit and Read Files on Your Agent

    + +

    Vim is the default terminal editor on virtually every Linux system — including your agent. It's lightweight, runs entirely in the terminal, and once you learn the basics, it's the fastest way to edit configs, write scripts, or inspect log files on your agent.

    + +

    Open a File

    +
    vim /path/to/file
    +

    If the file exists, Vim opens it for editing. If it doesn't, Vim creates a new file when you save.

    + +

    Vim Modes — The Key Concept

    +

    Vim has several modes. You'll spend most of your time in two of them:

    + + +

    Essential Navigation (Normal Mode)

    + + +

    Essential Editing (Normal Mode)

    + + +

    Search and Replace

    + + +

    Save and Quit

    + + +

    Read Files Without Editing

    +

    If you just want to read a file — logs, configs, output — without risking accidental edits:

    +
    view /path/to/file
    +

    This opens Vim in read-only mode. You can navigate with all the same keys (j, k, gg, G, /search) but you can't make changes. Press :q to exit.

    + +
    +

    Pro Tip: Run vimtutor on your agent for an interactive 30-minute tutorial that teaches Vim hands-on. It's installed by default and walks you through every command at your own pace.

    +
    +