VIM 练习图片

http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html

http://coolshell.cn//wp-content/uploads/2011/09/vim_cheat_sheet_for_programmers_print.png


Learning vi or vim is not easy. But it doesn't have to be that difficult, either. It is, in any case, faster, more powerful, and more productive than editing with any other editor, so you would do very well in investing the time and effort to learn it.

Being a vi lover myself, I came up with the idea of providing a graphical cheat sheet for those learning vi or vim, and I also found out it was a very good way to structure a tutorial. Here are the results for your learning enjoyment (or your colleagues').

By the way, I recently published the definitive article explaining why vi/vim editing is so much better than regular editing. It should prove useful if you want to read it yourself, or if you want to point your skeptical friends to a description of why it makes sense, apart from being an entertaining read: Why, oh why, do those #?@! nutheads use vi?.

Graphical cheat sheet

This is a single page describing the full vi/vim input model, the function of all keys, and all major features. You can see it as a compressed vi/vim manual. Click on the image below to access the full-size bitmap image, or download the vector-based, scalableSVG version (zip-compressed - and be sure to view & print the SVG with the open source applicationInkscape or the Adobe plug-in for Internet Explorer, Firefox breaks the layout for some reason, apart from rendering it with no anti-alias!).


Graphical cheat sheet based tutorial

Lesson 1
Lesson 1 (hi)
Lesson 2
Lesson 2 (hi)
Lesson 3
Lesson 3 (hi)
Lesson 4
Lesson 4 (hi)
Lesson 5
Lesson 5 (hi)
Lesson 6
Lesson 6 (hi)
Lesson 7
Lesson 7 (hi)
Zip with all GIFs
Zip with all SVGs

The tutorial above is structured in 7 lessons that cover the major commands in vi/vim. They are structured so that you will learn the simplest and most useful first, and the more advanced ones afterwards. Actually, using just the commands shown in lesson 1, you can already start editing in vi/vim in a similar way to how you would on a regular editor. Lesson 2 introduces the very powerful, and vi/vim-exclusiveoperators, and the rest of the lessons advance from there. Each thumbnail links to a high-resolution bitmap version. You can also download the full tutorial in asingle zip file with all the bitmaps or asingle zip file with all the SVGs (see the note above about incorrect rendering on Firefox).

Notes

vim is an incredible editor by Bram Moolenaar, based on theoriginal vi by Bill Joy, adding a ton of improvements over it. Nowadays, you should choose vim over vi every time you can.

The cheat sheet and tutorial cover most important functions of vi's input model, leaving out the more advanced regular expressions/ex command line material. This should be a very good beginning to becoming a vi/vim wizard.

With the single exception of the external filter feature ("!"), all functions shown are supported by ViEmu, my commercial add-in that provides advanced vi-vim emulation in Visual Studio.

Relevant links

This cheat sheet has proven to be pretty popular. Here are some relevant links:

And of course, the article detailing why vi/vim editing is 'the killerest':


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: Linux中的vim练习题是一种提高用户对vim编辑器使用技巧的方法。这些练习题可以帮助用户熟悉vim的各种命令和操作,提高编辑效率和准确性。练习题的内容包括基本的文本编辑、复制粘贴、搜索替换、文件操作等。通过不断地练习,用户可以逐渐掌握vim的各种技巧,提高自己的工作效率。 ### 回答2: Vim 是一种免费的开源文本编辑器,广泛应用于 Linux 和其他 Unix 系统中。它非常强大而灵活,可以通过不同的插件和定制设置来实现各种不同的用途。为了更好地掌握 Vim 的技能,我们可以通过做一些 Vim 练习题来加强我们对 Vim 的使用技巧和理解能力。 以下是一些 Vim 练习题: 1. 在终端中使用 Vim 打开一个新文件,并输入以下内容: Hello World! 保存并退出。 答案: 按 'i' 键切换到插入模式,输入 'Hello World!', 按 'ESC' 退出插入模式,然后在命令模式下输入 ':wq'。这将保存文件并退出 Vim。 2. 在终端中使用 Vim 打开一个文件,并将光标移到第三行的开头。然后,将下面的文本插入到该位置: Here is some text. 保存并退出。 答案: 输入 ':e file.txt' 打开文件,按 '3G' 进入第三行,按 'i' 进入插入模式,在光标所在位置插入文本,按 'ESC' 退出插入模式,输入 ':wq' 保存并退出。 3. 你最近学习了 Python 编程,想在 Vim 中使用 Python 语法高亮。请说明你需要做什么。 答案: 要在 Vim 中使用 Python 语法高亮,可以在 ~/.vimrc 文件中添加以下行: syntax on filetype plugin indent on au BufRead,BufNewFile *.py set filetype=python 第一行启用语法高亮,第二行启用文件类型插件和自动缩进功能,第三行设置 Vim 识别 .py 文件为 Python 文件类型。保存 ~/.vimrc 文件,并重新启动 Vim。 4. 在 Vim 中打开一个文件,并将第三行的这个单词“apple”替换为这个单词“orange”。 答案: 输入 ':e file.txt' 打开文件,按 '3G' 进入第三行,将光标移到这个单词的开头,按 'cw' 删除并进入插入模式,输入 'orange',按 'ESC' 退出插入模式,然后在命令模式下输入 ':' 并输入 '%s/apple/orange/g',按回车键。这将在整个文件中替换所有出现的“apple”为“orange”。 总之,在 Vim 中每天多做些练习,加强我们的 Vim 技能,可以提高我们的生产力和工作效率。 ### 回答3: vim是一款功能强大的文本编辑器,也是Linux操作系统中最常用的编辑器。通过练习vim,你可以更加熟练地使用它来编辑你的文件。 以下是一些针对vim练习题,可以帮助你更好地掌握vim的使用方法: 1. 命令模式下如何复制、粘贴和剪切文本? 复制:按下y键,然后按下要复制的文本所在的位置。 粘贴:按下p键。 剪切:按下d键,然后按下要剪切的文本所在的位置。 2. 如何在vim中进行文字替换? 在vim中,替换命令是:s/要替换的文本/替换后的文本/g。 例如,如果要将“hello”替换成“world”,则输入:s/hello/world/g。 3. 如何保存并退出vim? 按下“Esc”键,确保处于命令模式下,然后输入“:wq”命令并按下回车键即可保存并退出。 4. 如何在vim中跳转到文件的开头和结尾? 按下“gg”可以跳转到文件的开头,按下“G”可以跳转到文件的结尾。 5. 如何在vim中查找文本? 在命令模式下,按下“/”键,然后输入要查找的文本,按下回车键即可查找。 通过这些练习题,你可以更好地掌握vim的使用方法,并更加高效地处理文本文件。如果你还想了解更多的vim技巧和快捷键,可以搜索相关的网站或书籍进行学习。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值