您知道任何“最佳实践”吗? 或“什么有效”? 程序员的 vi 教程?

发布于 2024-07-04 01:05:10 字数 428 浏览 2 评论 0 原文

网络上有数千个 vi 教程,其中大多数一般性地列出了所有命令。 YouTube 上甚至还有展示基本功能的视频。

但是有人知道有一个专注于程序员需求的 vi 教程吗?

例如,当我使用 viPerl 中编程时,移动到“下一段”是没有意义的。

我想知道经验丰富的 vi 用户可以组合哪些命令,例如:

  • 复制括号内的所有内容、复制
  • 函数
  • 、复制并粘贴变量(例如 2yw)
  • 等。

我确信有很多函数使用多文件功能,并且映射,宏、读入文件中的模板代码、正则表达式搜索、跳转到函数、可能是最小代码完成或模拟程序员在 Visual Studio 和 Eclipse 中习惯的其他功能等。

There are thousands of vi tutorials on the web, most of them generically listing all the commands. There are even videos on youtube which show basic functionality.

But does anyone know of a vi tutorial which focuses on the needs of programmers?

For example when I program in Perl with vi, moving to the "next paragraph" is meaningless.

I want to know which commands seasoned vi users combine to e.g:

  • copy everything inside of parentheses
  • copy a function
  • copy and paste a variable (e.g. 2yw)
  • etc.

I am sure there are lots of functions using multiple-file capability, and the maps, macros, reading in of files for template code, regular expression search, jumping to functions, perhaps minimal code completion, or other features that emulate what programmers have gotten used to in Visual Studio and Eclipse, etc.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

小梨窩很甜 2024-07-11 01:05:10

vimtips 的一个很好的集合。

还有最好的 Vim cheatsheet

A nice collection of vimtips.

And the best Vim cheatsheet around.

污味仙女 2024-07-11 01:05:10

多年来,我只是读了几次 vim 手册,在每次迭代中都学到了有用的功能。

真正让 vim 作为 Perl IDE 对我有用的一件事是开始使用标签,如下所述: http://www.vim.org/tips/tip.php?tip_id=94。 使用 vim 附带的 pltags 脚本,您可以在模块之间跳转以查找函数、方法等。

I just ended up reading the vim manual a few times, over the years, picking up useful features on each iteration.

One thing that really made vim work for me as a perl IDE was starting to use tags, as explained here: http://www.vim.org/tips/tip.php?tip_id=94. Using the pltags script that ships with vim, you can jump around between modules to find your functions, methods, etc.

沐歌 2024-07-11 01:05:10

如果您是初学者,vimtutor 将是一个很好的起点。 (在 shell 上输入 vimtutor 并开始)。

一旦掌握了 vim 的基础知识,您就可以浏览网络并自己解决问题。

这个可能是一本有趣的读物。

If you are a beginner, vimtutor would be a good way to start with. (Type vimtutor on your shell and get going).

And once you get hold of the basics of vim, you can look around web and figure out things for yourself.

This and this may be an interesting read.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文