日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

vim block vim_我如何学会爱Vim

發(fā)布時間:2023/11/29 编程问答 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vim block vim_我如何学会爱Vim 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

vim block vim

by Sanchit Gera

通過Sanchit Gera

我如何學會愛Vim (How I learned to love Vim)

I’ve had a bitter-sweet relationship with Vim for a long time.

我與Vim有一段苦甜的戀情。

Over the last couple of years, I tried to learn Vim on several occasions. Each time, I ended up abandoning it. Instead, I would resort to my ‘primary’ text editor (usually Atom).

在過去的幾年中,我嘗試過幾次學習Vim。 每次,我最終都放棄了它。 相反,我會求助于我的“主要”文本編輯器(通常 原子 )。

But for a couple of weeks, I found myself unable to use Atom. This was due to an obscure connectivity issue. This made my setup completely useless over remote connections.

但是幾個星期后,我發(fā)現(xiàn)自己無法使用Atom。 這是由于模糊的連接問題 。 這使我的設(shè)置完全無法通過遠程連接使用。

After going through the five stages of grief, I decided to bite the bullet and try (again) to learn Vim. This time I forced myself to use Vim, and Vim alone.

在經(jīng)歷了悲傷的五個階段之后,我決定忍痛忍受,并嘗試(再次)學習Vim。 這次我強迫自己使用Vim,并且單獨使用Vim。

I know — I could have easily switched to a more intuitive editor such as Sublime. Or I could even have used a fully fledged IDE like IntelliJ.

我知道—我可以很容易地切換到更直觀的編輯器,例如Sublime 。 或者我什至可以使用像IntelliJ這樣的成熟IDE。

Instead, I figured “what the hell”. Here are some of the things I learnt.

相反,我想到了“到底是什么”。 這是我學到的一些東西。

學習基礎(chǔ) (Learning the basics)

In case it’s new to you, Vim is a seemingly archaic text editor. Its roots go back to a program call Vi, which appeared during the 1970s.

萬一您不熟悉它,Vim是一個看似古老的文本編輯器。 它的起源可以追溯到1970年代出現(xiàn)的Vi程序。

Part of Vim’s appeal — and annoyance — is due to the fact it is designed to work entirely with your keyboard. After all, point-and-click GUIs weren’t really a thing back when Vi was conceived.

Vim的吸引力之一(也是令人討厭的部分原因)是因為它旨在完全與您的鍵盤一起使用。 畢竟,在構(gòu)思Vi時,點擊式GUI并不是真正的東西。

Vim instead uses modes. There are two main modes that can be used:

Vim改為使用mode 。 可以使用兩種主要模式:

  • Normal mode: this is the mode you use when you are navigating your files, or editing/manipulating them. This is mode for doing anything that does not involve typing new content. Most Vim commands are entered while in this mode.

    普通模式:這是您瀏覽文件或編輯/操作文件時使用的模式。 這是用于執(zhí)行不涉及鍵入新內(nèi)容的任何操作的模式。 在此模式下,大多數(shù)Vim命令都被輸入。
  • Insert mode: insert mode allows the input of new text. In this mode, Vim behaves more like a ‘normal’ text editor, such as Atom or Sublime. Minus the use of a mouse, of course.

    插入模式:插入模式允許輸入新文本。 在這種模式下,Vim的行為更像是“普通”文本編輯器,例如Atom或Sublime。 當然,要減去鼠標的使用。

Other modes exist in Vim too. One example is the visual mode, for selecting large chunks of text. Typically, these modes are used much less frequently.

Vim中也存在其他模式。 一個示例是可視模式,用于選擇大塊文本。 通常,這些模式的使用頻率要低得多。

Vim is normally used inside a Terminal emulator. However, standalone distributions exist. It is available on virtually all Unix and Linux systems. Vim’s grandfather, Vi, is part of the UNIX specification. It therefore comes preinstalled on all conforming systems.

Vim通常在終端仿真器內(nèi)使用。 但是,存在獨立發(fā)行版。 幾乎所有Unix和Linux系統(tǒng)都可以使用它。 Vim的祖父Vi是UNIX規(guī)范的一部分。 因此,它預先安裝在所有符合標準的系統(tǒng)上。

可組合性 (Composability)

‘Composability’ is largely what makes Vim different to other editors. It gives Vim its own special language.

Vim與其他編輯器的不同之處在于“可組合性”。 它為Vim提供了自己的特殊語言。

It introduces the notion of nouns and verbs in the context of text editing and manipulation.

它在文本編輯和操作的上下文中介紹了名詞動詞的概念。

Verbs describe actions that you can take (such as delete, change, move).

動詞描述了您可以執(zhí)行的操作(例如刪除,更改,移動)。

Nouns describe what is being acted upon (usually words, lines or places within the text).

名詞描述所采取的行動(通常是文字中的單詞,線條或位置)。

Some of the nouns/verbs commonly used include:

常用的一些名詞/動詞包括:

Verbs d: deletec: change (overwrite)y: yank (copy)>: indent<: unindentActionsh,j,k,l: left, down, up, rightw: next wordb: previous word0: start of line$: end of linei: inside (excluding the following character)a: around (including the encasing characters)

This list is non-exhaustive. There are tons and tons of key-bindings available. But you can achieve a lot with only the very basic ones. The idea is to chain together combinations of nouns, verbs and occasionally numbers. This allows you to create distinct actions to manipulate the text as needed.

此列表并不詳盡。 有成千上萬的鍵綁定可用。 但是,只有非常基本的內(nèi)容,您才能取得很多成就。 這個想法是將名詞,動詞和偶然的數(shù)字組合在一起。 這使您可以創(chuàng)建不同的動作 根據(jù)需要操縱文本。

For example, to delete a word you type in the key combination dw.

例如,d elete A, ORD您在組合鍵鍵入dw 。

To delete 2 words from the current position, you type in d2w.

d elete2 瓦特從當前位置ORDS,你輸入d2w 。

To delete from the current position all the way to the end of the line, you type in d$.

要從當前位置一直刪除到行尾,請輸入d$ 。

To delete everything inside a pair of parentheses, you would type di(. And on it goes.

d elete一切, n面一對括號,您可以鍵入di( 。而就不言而喻。

This method of working might not seem worth the hassle. But if you force yourself to use the combinations every day, they will become second nature. After a certain point, the speed you gain by reducing the number of keystrokes required to make a certain edit is absolutely thrilling. More on that next.

這種工作方法似乎不值得麻煩。 但是,如果您強迫自己每天使用這些組合,它們將成為第二天性。 在特定的點之后,通過減少進行特定編輯所需的擊鍵次數(shù)而獲得的速度絕對令人興奮。 接下來的更多內(nèi)容。

Vim會上癮 (Vim is addictive)

Yes, I know. It’s a cliché. But bear with me.

是的我知道。 這是陳詞濫調(diào)。 但是,請忍受我。

Vim has a notorious learning curve. But once you get past the stage where you are constantly cursing your computer screen, using Vim is actually quite fun.

Vim有一個臭名昭著的學習曲線。 但是,一旦您走過了不斷咒罵計算機屏幕的階段,使用Vim實際上會很有趣。

Learning to use Vim’s cryptic commands lets you fly through the file editing process. After a while, it almost feels wrong to lift your fingers away from the home row on the keyboard, or even to use the mouse!

學習使用Vim的加密命令可以使您快速完成文件編輯過程。 一段時間后,將手指從鍵盤上的主行上抬起甚至使用鼠標幾乎感覺不對!

After only one month, I find myself missing Vim’s navigation system and other shortcuts while using my computer regularly.

僅一個月后,我發(fā)現(xiàn)自己在定期使用計算機時缺少Vim的導航系統(tǒng)和其他快捷方式。

In fact, at one point I considered experimenting with this extension to enable Vim keybindings while browsing the web. I know!

實際上,我曾經(jīng)考慮過嘗試使用該擴展程序在瀏覽Web時啟用Vim鍵盤綁定。 我知道!

Fortunately, the programming community recognizes this. Most mainstream text editors have some way of enabling Vim keybindings. This puts ‘Vimmers’ out of their misery by giving them the best of both worlds.

幸運的是,編程社區(qū)認識到了這一點。 大多數(shù)主流的文本編輯器都有啟用Vim綁定的某種方式。 通過為他們提供兩全其美的選擇,使“ Vimmers”擺脫了痛苦。

給Vim一個戰(zhàn)斗的機會 (Giving Vim a fighting chance)

The key improving at Vim is to simply not use anything else. Instead, you should force yourself to do everything the Vim way.

Vim的關(guān)鍵改進是根本不使用其他任何東西。 相反,您應(yīng)該強迫自己以Vim方式進行所有操作。

For example — when editing files in Vim, try not to resort to your old habits. Most people, when starting out, try to stay as far away from ‘normal mode’ as possible.

例如,在Vim中編輯文件時,請盡量不要訴諸舊習慣。 大多數(shù)人在開始時都嘗試盡可能遠離“正常模式”。

Instead, they try to spend as much time as they can in ‘insert mode’. In this mode, it is easy to feel more at home. It lets you get away with editing your file without learning anything new. But this is a mistake.

相反,他們嘗試在“插入”上花費盡可能多的時間 模式'。 在這種模式下,很容易有賓至如歸的感覺。 它使您無需學習任何新知識就可以輕松編輯文件。 但這是一個錯誤。

If you are genuinely interested in learning how to make Vim work for you, you have to put in some effort. This means taking the time to figure out the ‘right’ way to do something.

如果您真的有興趣學習如何使Vim為您工作,則必須付出一些努力。 這意味著要花時間找出做事的“正確”方法。

If you find yourself repeating keystrokes over and over again to achieve any task, stop. It is likely there is a better way to do what you are trying to do.

如果發(fā)現(xiàn)自己反復重復擊鍵以完成任何任務(wù),請停止 。 可能有更好的方法來做您想做的事情。

Google it. Memorize it. Add it to your arsenal. It is far easier to learn new commands this way, compared to reading a list of commands and hoping you’ll need to use one of them.

谷歌一下。 記住。 將其添加到您的武器庫。 與閱讀命令列表并希望使用其中一個命令相比,用這種方法學習新命令要容易得多。

After a couple of days, you may develop an intuitive sense of when you are wasting keystrokes. Heed to your intuition.

幾天后,您可能會感覺到浪費按鍵的時間。 注意您的直覺。

欣賞(?)現(xiàn)代編輯 (Appreciate (?) modern editors)

Another big reason many people shy away from Vim is the seemingly ‘barebones’ nature of it all.

許多人都不愿使用Vim的另一個重要原因是這一切看起來像“準系統(tǒng)”。

By default, Vim comes with no plugins or nice-to-have features. And what Vim considers to be a ‘nice-to-have’ feature is probably very different to what programmers used to modern IDEs would consider ‘nice-to-have’.

默認情況下,Vim沒有插件或完善的功能。 Vim認為“必備”功能可能與習慣于現(xiàn)代IDE的程序員所認為的“必備”功能有很大不同。

Vim comes with barebones syntax highlighting (which is disabled by default). There is no line-numbering (again, this needs to be enabled separately).

Vim帶有準系統(tǒng)語法突出顯示(默認情況下處于禁用狀態(tài))。 沒有行號(同樣,需要單獨啟用)。

No surprise, then, that things such as:

那么,諸如此類的事情就不足為奇了:

  • default Git integration

    默認的Git集成
  • ‘complete-as-you-go’ code completion

    “按需完成”代碼完成
  • automatic bracket completion

    自動完成括號
  • code snippets

    代碼段
  • custom color schemes

    自定義配色方案

…do not come pre-installed with Vim.

…不要預裝Vim。

This might seem like huge turn off — especially for programmers used to developing in powerful IDEs that do a lot of heavy lifting. Many come installed with a whole bunch of plugins and extensions designed specifically to make your workflow more efficient.

這似乎是一個巨大的挑戰(zhàn),特別是對于那些習慣于使用功能強大的IDE進行大量繁重開發(fā)工作的程序員而言。 其中許多安裝有大量的插件和擴展程序,這些插件和擴展程序?qū)iT用于使您的工作流程更高效。

And there is some merit to this argument. Vim has its limitations.

這個論點有一些優(yōu)點。 Vim有其局限性。

Yet on the flip-side — even though you appreciate what modern IDEs provide and the work that goes into building them — you also realize that most IDEs (and even modest editors such as Atom) bring with them a lot of bloat.

然而,另一方面,即使您欣賞現(xiàn)代IDE所提供的功能以及構(gòu)建它們所要做的工作,您也意識到大多數(shù)IDE(甚至包括Atom這樣的謙虛編輯器)也給他們帶來了很多膨脹。

Advanced IDEs come jam-packed with features that are hardly used by average users.

高級IDE擠滿了普通用戶幾乎不使用的功能。

Learning to use Vim effectively is partly an exercise in working out which plugins are absolutely critical to your productivity. The key is to build an editor uniquely suited to your needs and workflow.

學習有效地使用Vim在某種程度上是確定哪些插件對您的生產(chǎn)力至關(guān)重要的練習。 關(guān)鍵是要構(gòu)建一個完全適合您的需求和工作流程的編輯器。

In many cases, using a fully-fledged IDE makes perfect sense. The advanced features may far outweigh any benefits you get from using Vim.

在許多情況下,使用成熟的IDE是很有意義的。 高級功能可能遠遠超過使用Vim所帶來的任何好處。

But, this is something for you to figure out yourself.

但是,這是您要弄清楚自己的東西。

Despite its barebones nature, Vim has a thriving plugin ecosystem.

盡管Vim具有準系統(tǒng)性質(zhì),但它具有蓬勃發(fā)展的插件生態(tài)系統(tǒng)。

Vim has plugins for almost everything you can do with other editors. You just have to figure out which you need.

Vim具有幾乎可以與其他編輯器一起使用的所有功能的插件。 您只需要弄清楚您需要什么。

Something that surprised me was how far I can go with just a handful of plugins. My Vim setup currently comprises of around five or six ‘essential’ add-ons. I don’t really feel like I’m missing out on anything.

讓我感到驚訝的是,只有少數(shù)幾個插件我能走多遠。 我的Vim設(shè)置當前包含大約五個或六個“基本”加載項。 我真的不覺得我錯過任何事情。

Vim is not perfect. And it is definitely not for everybody.

Vim并不完美。 絕對不適合所有人。

But at the very least, learn enough of Vim in case you accidentally open it and can’t figure out how to quit…! ;)

但是至少,要對Vim有足夠的了解,以防萬一您不小心打開了它而又不知道該如何退出 ……! ;)

翻譯自: https://www.freecodecamp.org/news/how-i-learned-to-love-vim-ce3e058d57fb/

vim block vim

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結(jié)

以上是生活随笔為你收集整理的vim block vim_我如何学会爱Vim的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产精品亚洲五月天丁香 | 国产人妖在线视频 | 国产一级理论 | 18禁免费观看网站 | 一级黄色大片视频 | 色99视频| 日本一本久久 | 日韩精品久久久久久久电影99爱 | 亚洲精品20p| 日本一级吃奶淫片免费 | 欧美在线视频一区二区三区 | 国产女教师一区二区三区 | 日韩高清一区二区 | 青青草久久伊人 | 国产精品一区二区性色av | 欧美久久精品 | 色偷偷免费费视频在线 | 成人精品在线视频 | 青青草精品| 男生插女生的网站 | 亚洲男同视频 | 久久精品视频免费看 | 女人的黄色片 | 蜜桃视频污在线观看 | 欧美日韩在线免费播放 | 日韩欧美一区在线 | 欧美性猛交xxx乱大交3蜜桃 | 精品久久久久久亚洲综合网站 | 日在线视频 | 国产女主播喷水高潮网红在线 | 色婷婷aⅴ | 国产日韩在线看 | 激情的网站 | 亚洲少妇在线 | 黄色美女免费网站 | 国产91久久婷婷一区二区 | 色婷婷中文字幕 | 青青草精品视频 | 欧美性开放视频 | 一区二区三区亚洲视频 | 91精品视频免费观看 | 最近中文字幕免费mv视频7 | 欧洲精品久久久久毛片完整版 | 亚洲一区不卡在线 | 日本伦理一区二区 | 少妇精品久久久久久久久久 | 日本三级韩国三级美三级91 | 黑人精品一区二区三区不 | a级免费观看| 亚洲综合色一区二区 | 日日摸日日添日日躁av | 少妇又色又紧又爽又刺激视频 | 国产福利在线导航 | 日本a区| 天天干天天碰 | 在线视频观看一区二区 | 东方成人av | 熟女丰满老熟女熟妇 | 情欲超| 国产成人愉拍精品久久 | 欧美性受xxxx黑人xyx性爽 | 中文天堂在线观看 | 精品一二三四区 | 一级片免费在线 | 中国一级特黄毛片大片 | 日韩精品专区 | 中文字幕第15页 | 欧美午夜精品久久久久久孕妇 | 奇米二区| 成人黄色免费 | 国产污污视频 | 九九热这里有精品视频 | 国产精品偷拍 | 6699嫩草久久久精品影院 | 亚洲精品鲁一鲁一区二区三区 | 在线观看视频亚洲 | 久久久久麻豆v国产精华液好用吗 | 97久久久久久久久久 | 国产一区二区精品在线观看 | 怡红院一区| 色妞干网 | 老色鬼在线 | 亚洲成熟毛多妇女av毛片 | 在线看欧美 | 久艹视频在线观看 | www色婷婷| 黄色激情网址 | 91青青青 | 久热伊人 | 最近中文字幕mv免费高清在线 | 免费在线小视频 | 99人妻少妇精品视频一区 | 亚洲吧| 色人阁婷婷 | 亚洲区色| 国产免费久久精品国产传媒 | 日本一区二区三区视频在线 | 国产又粗又黄又爽的视频 | 五月天色婷婷丁香 |