feat: add vim manifesto draft

This commit is contained in:
Youwen Wu 2024-04-23 00:52:07 -07:00
parent d5f701a790
commit 60d9d48bdc
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
6 changed files with 74 additions and 3 deletions

View file

View file

@ -0,0 +1,52 @@
## Introduction
The modal editor's fall into obscurity is truly one of the greatest losses in the history of computing.
There's no denying that point-and-click is _easy_, and sure, it's enough for the majority of people using
their computer as a minor tool.
But for those who use a text editor as their natural habitat, there's no reason why text editors should stop at
pointing the mouse where you want to go and typing. This leads to the typical editing session consisting of:
- Scroll around with mouse
- Locate the location where you want to add text
- Move mouse to location, click it
- Finally, move back to the keyboard and make your edit
Then, switch back to your mouse and repeat.
Of course, there are ways in which users seek to streamline this process. Almost everyone who edits text
daily knows at least a few keyboard shortcuts to quickly jump around words and in between lines to move to nearby
points of interest quickly without switching back to the mouse. Other more dedicated power users might learn a slew of
modifier-key based commands to quickly navigate around, removing the need for a mouse entirely when editing within
a file.
All of these, however, are halfway solutions. Namely, they generally utilize a modifier based approach. Hold `ctrl`
(or `option`, on macOS) and use the arrow keys to navigate quickly. Hold `ctrl` and hit `delete` to delete entire words at once.
Hold `shift` to highlight text. `ctrl + c` copies, `ctrl + v` pastes, `ctrl + x` cuts. You get the idea.
A pseudo- medical condition has even been coined for this reliance on modifier keys: the dreaded Emacs pinky, where
users of emacs, which relies heavily on `ctrl`, `meta`, and other modifier based shortcuts, experience RSI due to their
frequent usage of their pinky to stretch down to those keys.
This method of designing and organizing the text editor is wrong. _Moving around text_ (and files) is just as, if not
more prevalent than inserting text itself. So why treat navigation as an afterthought? Why should you _edit by default_,
and hold a modifier key to temporarily enable a different control scheme which handles locomotion? This is where the
genius of the modal editor comes in.
## Vim
In Vim, the editor itself is split into three main "modes", hence the classification of "modal". Instead of treating
navigation as an afterthought, Vim opens in its "normal mode", which provides the user with many keys to move around their
text file: `hjkl` as arrow keys, `b`, `e`, and `w`, to navigate around words, `0`, `$`, and `_` to jump around lines, `{`, `}`,
`z`, and more, for quickly repositioning your cursor and screen vertically. Notice how all of these keys are easily accessible
from the home row. Just as importantly, notice how there's no need for you to hold any modifiers to access these actions.
These keys don't input text in normal mode; they simply handle navigation. Many point-and-click acolytes believe this to be
a failure. "Why wouldn't you want your editor to _edit_ by default?" Of course, this is not a failure, but one of its
greatest strengths. How many times do you open a file and immediately need to start editing? Almost always, you need to first
navigate to a specific location, usually move or change some text, and then begin editing. In Vim, this is streamlined by
default. You can navigate the entire file using just commands found near the home row, without needing to use a mouse or
hit complicated chords. Instead of treating navigation as an afterthought for power-users, it treats it as a primary
feature of the editor itself.
Written on Neovim.

View file

@ -0,0 +1,20 @@
#:schema ../../../post.schema.json
title = "The Vim Manifesto"
[manifest]
date = 2024-04-23T07:49:52+00:00
authors = ["Youwen Wu"]
blurb = "Glory to the one true text editor."
description = "The loss of the modal editor is truly one of the greatest tragedies in the history of computing. Vim is the last bastion of hope in a world of point-and-click."
type = "article"
highlight = true
[manifest.tags]
primary = ["vim", "neovim", "text editor", "ide"]
secondary = []
[cover]
src = "https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/Neovim/NeovimShadowed.png"
alt = "neovim vtuber style logo"
caption = "The One True Text Editor"

2
src/globals.d.ts vendored
View file

@ -7,7 +7,7 @@ interface BlogDocument {
blurb: string; blurb: string;
image: { src: string; alt: string; caption: string }; image: { src: string; alt: string; caption: string };
description: string; description: string;
slug; slug: string;
} }
declare module 'remark-sectionize'; declare module 'remark-sectionize';

View file

@ -20,7 +20,6 @@
import Badge from '../ui/badge/badge.svelte'; import Badge from '../ui/badge/badge.svelte';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime'; import relativeTime from 'dayjs/plugin/relativeTime';
import { onMount } from 'svelte';
dayjs.extend(relativeTime); dayjs.extend(relativeTime);