User Tools

Site Tools


pandoc:introduction-to-vsc:03_linux_primer:editors

Editors

General

  • Many different editors
    • Unique (dis-)advantages
    • Different look and feel
  • Editors should provide us with
    1. Simple text editing
    2. Copy and paste
    3. Search and replace
    4. Saving changes
    5. Wide availability

Two editors that satisfy our needs:

  • nano
  • vim

Common starting point

nano filename
vim filename

Nano

Nano explained

This editor is focused on being easy to use, but still providing every feature a user might need.

Interface

The interface consists of four parts, namely from top to bottom:
  • Title bar
  • Text area
  • Command line
  • Key bindings

Usage

Nothing special, key-bindings visible while editing
Feature Usage
Navigation Arrow keys
Actual editing Typing text, as usual
Cut/Paste line <CTRL>+k / <CTRL>+u
explained in key bindings field

Short

Use this editor if you are new to the command line.

It is straight forward, but can be extended on the way.
  • Auto-indentation
  • Syntax highlighting
  • Multi-buffer

Vi(m)

Vi(m) explained

This editor is focused on productivity and efficiency, providing everything a user might need.

Interface

The simple interface consists of two parts:
  • Text area
  • Command line
Since this editor is very easy to extend, after setting up a few plug-ins, it will probably look quite different!

Usage

This is a multi-mode editor, you’ll have to switch modes whenever you change what you want to do.
Feature Usage
Navigation Arrow keys
Writing change to input mode, then write as usual
Commands exit current mode, press :
explained on next slide

Short

Use this editor if you like a challenge.

It is fast and very nice — but you’ll sometimes get hurt on the way.
  • File/Project Management
  • Use a plug-in manager

Vi(m) modes and keys

  • any mode:
    • back to the default mode: <ESC>
  • command mode (followed by <RETURN>):
    • save current file: w [filename]
    • quit the editor
      • after saving: q
      • without confirmation: q!
    • help: h [topic], e.g. h tutorial
    • search and replace: %s/old/new/gc
  • default mode:
    • enter input mode: i
    • enter command mode: : (colon)
    • mark
      • character-wise: v
      • line-wise: <SHIFT>-v
    • delete
      • character-wise: x
      • line-wise: dd
      • marked content: d
    • search: /abc

VI Reference

pandoc/introduction-to-vsc/03_linux_primer/editors.txt · Last modified: 2018/03/15 10:14 by pandoc