你妈妈从未告诉你的 Vim 的哪些黑暗角落? [英] What are the dark corners of Vim your mom never told you about?

查看:13
本文介绍了你妈妈从未告诉你的 Vim 的哪些黑暗角落?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

人们谈论常见技巧的问题太多了,特别是Vim+ctags 技巧和窍门".

There are a plethora of questions where people talk about common tricks, notably "Vim+ctags tips and tricks".

然而,我并不是指 Vim 新手会觉得很酷的常用快捷方式.我说的是一个经验丰富的 Unix 用户(无论他们是开发人员、管理员,还是两者,等等),他认为他们知道我们 99% 的人从未听说过或梦想过的东西.不仅让他们的工作更轻松,而且很酷和hackish的东西.毕竟,Vim 驻留在世界上最黑暗角落的操作系统中,因此它应该具有只有少数特权知道并想与我们分享的错综复杂.

However, I don't refer to commonly used shortcuts that someone new to Vim would find cool. I am talking about a seasoned Unix user (be they a developer, administrator, both, etc.), who thinks they know something 99% of us never heard or dreamed about. Something that not only makes their work easier, but also is COOL and hackish. After all, Vim resides in the most dark-corner-rich OS in the world, thus it should have intricacies that only a few privileged know about and want to share with us.

推荐答案

:![command] 在 Vim 中执行外部命令.

:! [command] executes an external command while you're in Vim.

但是在冒号后加一个点,:.![command],它会将命令的输出转储到您当前的窗口中.那是 : .!

But add a dot after the colon, :.! [command], and it'll dump the output of the command into your current window. That's : . !

例如:

:.! ls

我经常使用它来将当前日期添加到我正在输入的文档中:

I use this a lot for things like adding the current date into a document I'm typing:

:.! date

这篇关于你妈妈从未告诉你的 Vim 的哪些黑暗角落?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆