ubuntu,debian,redhat,fedora,centos
标签类目:vi

在vim/vi中快速执行php或c/c++的方法

分类:C/C++如果使用VIM来编写代码,可能很多朋友就会想了,有没有什么方法来建立一个快捷键,能快速的运行我们所编写的代码呢?!!答案当然是肯定了的,不然也不会写这篇日志来讨论这个问题了。

在介绍方法之前,先来谈一下自己以前的执行方式吧!

先拿PHP来讲吧,最传统的方式就是将编写好的代码放在apache的根目录,然后通过浏览器来运行,或者使用php命令来运行php.可以使用php的r参数

  1. linuxany@~$ php -r "echo 'hqlong';"

来快速测试,或者使用q参数

  1. linuxany@~$ php -q test.php

来运行。

继续阅读 »

How to hide comments

分类:DebianIntroduction
————

Although comments can be a blessing in the configuration file of an unfamiliar
system, they eventually become annoying if one is already very familiar with
the file. In some extreme cases, they can actually be an obstruction to
clarity.

Here are two methods for viewing files without hash (#) comments, one for the
command line and one for VIM, and a bit of advice for Debian administrators.

继续阅读 »

vi 用法

1.6.1  vi 的工作模式

Vi 在初始启动后首先进入编辑模式,当用户在编辑模式下键入 i, a, o 等命令之后,可进入插入模式;键入 : 可进入命名模式。在插入模式下,用户随后输入的,除 Esc 之外的任何字符均将被看成是插入到编辑缓冲区中的字符。按 Esc 之后,从插入模式切换到编辑模式。 继续阅读 »

返回顶部