首先说个题外话: Vim发布7.3了..
在翻看Vim插件的时候, 发现了一个比较有意思的应用(非插件): 把PHP的手册融如Vim中, 在Vim中, 按”K”, 就可以跳转到光标下函数的手册说明…
1. 首先, 下载特殊定制的PHP手册(包含PHP5.3的所有函数) : vim-php-manual.tar.gz
2. 把下载的文件解压缩, 放置到一个目录, 比如/tmp/phpmuanul(windows下比如:”d:/phpmanual”).
3. 配置vimrc(linux下是.vimrc,windows下是_vimrc), 把phpmanual目录添加到runtimepath(稍后解释为什么).
4. 配置vimrc, 使得keywordprg=”help”. 在我的机器上, keywordprg默认是!man, 大多数时候, 我还是希望可以直接man到linux下的标准函数库, 所以我使用(在vimrc文件中):
autocmd BufNewFile,Bufread *.ros,*.inc,*.php set keywordprg="help"
或者也可以写在vim目录下的ftplugin下的php.vim(如果没有新建), 这样在ft为php的时候,这个配置脚本就会被加载.
至于说, 为什么要把phpmanual目录添加到runtimepath, 是因为:
When no argument is given to :help the file given with the 'helpfile' optionwill be opened. Otherwise the specified tag is searched for in all "doc/tags"files in the directories specified in the 'runtimepath' option.
意思就是说, 在vim中, 调用help的时候, help会去所有的runtimpath下的doc目录中寻找tags文件, 来寻找要查找的帮助关键字.
在我们下载的vim-php-manual.tar.gz文件中, 就包含了doc/tags这样的文件目录结构, 所以只要把phpmanual目录加入runtimepath, 并且设置keywordprg为vim的help, 就可以实现在光标处按”K”跳转到函数手册了.
使用截图
最后,补充一点, 如果在使用的时候,Vim提示你:
tags file not sorted
那你就用vim打开phpmanual/doc/tags, 然后%sort一下就可以了…

如何在iPad键盘上将CapsLock重新映射为ESC准备好让CapsLock成为iPad上的ESC键了吗?这是您需要做的所有事情:在iPad上打开“设置”应用转到“常规”,然后转到“键盘”转到“硬件键盘”选择“修改键”选择“CapsLockKey”并选择“Escape”作为修饰键现在您已准备好通过按CapsLock在iPad上试用新的硬件ESC键。转到任何使用Escape键的应用程序,您可以立即对其进行测试,例如vi/vim。现在您可以使用物理键盘从

删除偶数行的方法如下::g/^/+1d上面用到了:gbobal命令,gbobal命令格式如下::[range]global/{pattern}/{command}global命令实际上是分成两步执行:首先扫描[range]指定范围内的所有行,给匹配{pattern}的行打上标记;然后依次对打有标记的行执行{command}命令,如果被标记的行在对之前匹配行的命令操作中被删除、移动或合并,则其标记自动消失,而不对该行执行{command}命令。{command}可以是一个ex命令,也可以是用|分隔

在 PHP 开发中,使用 Vim 是非常普遍的。然而,在 Alpine Linux 中安装 Vim 可能会遇到一些问题。本篇文章将分享如何在 Alpine Linux 上安装 Vim。

前言vim是个强大的文本编辑的工具,在Linux端得到极大的使用热度。最近在另外一台服务器上使用vim时,遇到了一个奇怪的问题:当我将本地编写好的脚本复制并粘贴到服务器中的空白文件时,出现了自动缩进的情况。用个简单的例子来说,就是我在本地写的脚本如下:aaabbbcccddd当我将上述内容复制后,粘贴到服务器中的空白文件后得到的却是:aabbbcccddd很明显,这是vim给我们自动进行了格式缩进。但是,这个自动有点不智能。这里记录下解决方案。解决方案:设置.vimrc配置文件我们在家目录下,新

在CentOS操作系统中,smbclient和vim是两个非常常用的工具,smbclient是一个用于与SMB/CIFS服务器进行通信的客户端工具,而vim是一款强大的文本编辑器,本文将详细介绍如何在CentOS上安装smbclient和vim,并提供一些相关的使用技巧。1.打开终端并以root用户身份登录。2.运行以下命令以更新系统软件包列表:```yumupdate3.运行以下命令以安装smbclient:yuminstallsmbclient4.系统将提示您确认安装,按下y键并按下回车键以

Vim分屏功能是通过分割窗口来实现的,这是提高工作效率的一大利器。无论我们想同时显示两个文件,或者同时显示一个文件的两个不同的位置,又或者并排比较两个文件,等等,这些都能通过分屏来实现,这样子很方便代码的比对和复制粘贴。

CentOS用vim/vi给文件加密和解密一、利用vim/vi加密:优点:加密后,如果不知道密码,就看不到明文,包括root用户也看不了;缺点:很明显让别人知道加密了,容易让别人把加密的文件破坏掉,包括内容破坏和删除;vi编辑器相信大家都很熟悉了吧,vi里有一个命令是给文件加密的,举个例子吧:1)首先在root主目录/root/下建立一个实验文件text.txt:[root@www~]#vim/vitext.txt2)进到编辑模式,输入完内容后按ESC,然后输入:X(注意是大写的X),回车;3)


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver CS6
Visual web development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software
