简体   繁体   English

Vim 文本中作业编辑的 Crontab 问题

[英]Crontab issues with job editing in Vim text

When I try to modify jobs for the user using cronotab via text editor (vim), I cannot use the command */2 because there is a no string under cursor error, but I don't want to insert anything into the text file itself.当我尝试通过文本编辑器(vim)使用 cronotab 为用户修改作业时,我无法使用命令*/2因为在 cursor 错误下没有字符串,但我不想在文本文件本身中插入任何内容. So how can I use the * symbol as just a character in a command rather than using it as its own command.那么如何将*符号仅用作命令中的一个字符,而不是将其用作自己的命令。

Vim is a modal editor, which means that it has modes dedicated to different kinds of tasks. Vim 是一个模态编辑器,这意味着它具有专用于不同类型任务的模式。 One consequence of this is that pressing a given key in one mode is going to do something different than pressing the same key in another mode.这样做的一个结果是,在一种模式下按下给定的键与在另一种模式下按下相同的键会做不同的事情。

When you start Vim, you are in normal mode, which is dedicated to moving around, copying, deleting, etc. In that mode, * jumps to the next occurrence of the word under the cursor and yells at you if there is nothing to search for under the cursor.当你启动Vim时,你处于普通模式,专门用于移动,复制,删除等。在该模式下, *跳转到cursor下一个单词的下一个出现位置,如果没有什么可以搜索,就会对你大喊大叫适用于 cursor 下。

Does the behaviour described above make sense to you?上述行为对您有意义吗? Is that what you want?那是你要的吗? If not, what do you expect */2 to do and what is your goal?如果不是,您希望*/2做什么,您的目标是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM