官术网_书友最值得收藏!

Let’s start a conversation (about modal interfaces)

If you’ve ever edited text before, you are most likely to be familiar with modeless interfaces. It’s the default option chosen by modern mainstream text editors, and that’s how many of us learned to work with text.

The term modeless refers to the fact that the each interface element has only one function. Each button press results in a letter showing up on screen, or some other action being performed. Each key (or a combination of keys) always does the same thing: the application always operates in a single mode.

But it’s not the only way.

Welcome to the modal interface, where each trigger performs a different action based on context. The most common example of a modal interface that we encounter today is a smartphone. Each time we work in different applications or open different menus, a tap on the screen performs a different function.

It’s similar when it comes to text editors. Vim is a modal editor, meaning that a single button press might result in different actions, depending on context. Are you in insert mode (a mode for entering text)? Then hitting o would put the letter o on the screen. But as soon as you switch into a different mode, the letter o will change its function to adding a new line below the cursor.

Working with Vim is like having a conversation with your editor. You tell Vim to delete the next three words by pressing d3w (delete 3 words), and you ask Vim to change text inside quotes by pressing ci" (change inside " [quotes]).

You may hear very frequently that Vim is faster than other editors, but it’s not necessarily the point of Vim. Vim lets you stay in the flow when working with text. You don’t have to break the pace to reach for your mouse, you don’t have to hit a single key exactly 17 times to get to a particular spot on the page. You don’t have to drag your mouse millimeter by millimeter to ensure you capture the right set of words to copy and paste.

When working with a modeless editor, workflow is filled with interruptions.

Working with modal editors, and Vim in particular, is like having a conversation with your editor. You ask the editor to perform actions ("delete three words", "change inside quotes") in a consistent language. With Vim, editing becomes a much more deliberate exercise.

主站蜘蛛池模板: 长乐市| 百色市| 加查县| 陆川县| 宁乡县| 苍溪县| 昭通市| 黔西县| 仁怀市| 长寿区| 灵宝市| 吴川市| 渝北区| 浠水县| 上栗县| 耿马| 西昌市| 湛江市| 温州市| 鹿泉市| 施秉县| 佛山市| 兴海县| 陕西省| 永仁县| 房山区| 于都县| 桦南县| 肥乡县| 吐鲁番市| 桃源县| 介休市| 湘阴县| 大安市| 调兵山市| 龙泉市| 奇台县| 武定县| 额济纳旗| 大理市| 德化县|