Day 3 of my ALX Software Engineering Journey:Twitter frens, Emacs and vi

Twitter Friends

It’s been a busy day, but what’s a busy day without an ALX project? Today's tasks required participants to make about 10 friends on Twitter. Well, I’ve made more than that and they’ve been nothing short of amazing people. Follow me on Twitter I post helpful tech content

Emacs

I was exposed to the versatility of Emacs today. Emacs is a text editor that can be used in the shell command-line interface to edit texts. It’s sometimes considered to be more than a text editor as it performs some functions that other editors don’t. Some examples include playing Tetris games, reading emails, managing files and so many more.

Some basic Emacs commands treated today include:

N.B : C = Ctrl

  1. C-x C-f: this command is used to open a new EMacs document.

  2. C-x C-s: this command is used to save a new document.

  3. C-s: this command is used to search forward.

  4. C-/: this command is used to undo any recent changes you’ve made to a text.

  5. C-w: this command is used to cut text.

  6. C-y: I find this command very funny but it stems from the word yank. Yank means to paste, so this command helps us paste whatever has been cut.

Other commands are available but I’ll be limited to mention these. A manual is available and with the command C-h C-t you can access a whole list of EMacs commands.

It is worthy of note that modifier keys would affect the use of Emacs in a terminal you run on your browser. You could type a modifier key and letter and your browser responds instead of Emacs.

Vi

Is a text editor that comes with the Unix operating system. It is derived from the word visual editor. It has two modes namely Command mode and Insert mode.

Command mode: this mode is represented by a tab below and when commands are entered they appear here

To switch to command mode you hit esc from the insert mode

Insert mode: here documents and text become modifiable. To switch to insert mode from command mode you hit i

Some basic commands in vi include

  1. vi filename: this command is inputted in the terminal to open a file named filename.

  2. i: when vi opens, it’s in command mode. To switch to insert mode type i.

  3. :wq: this command is used to save and quit vi.

  4. u: this command is used to undo changes made.

  5. dd: this command deletes an entire line.

  6. yy: copies current line.

  7. p: pastes copied line.

There are several other commands in vi and they can be accessed using the command man 1 vi in a linux terminal. It opens the vi manual .

Emacs and vi are excellent editors and I see myself tilting towards vi as it has easier commands to memorize and also input.

Did you find this article valuable?

Support Chisom Dillibe Okorie by becoming a sponsor. Any amount is appreciated!