vim

Ubuntu下VIM的安装和基本用法

一世执手 提交于 2019-12-29 13:54:47
1.用root账户登录Ubuntu,命令行中输入vim,如果未安装会得到下面的提示: 程序“vim”已包含在下列软件包中: * vim * vim-gnome * vim-tiny * vim-gtk * vim-nox 请尝试:apt-get install <选定的软件包> 按照提示输入apt-get install vim安装。 2.安装完成后,输入vim会进入vim的标准模式,这时按键盘的i进入插入模式,在里面写点什么吧。 3.按Esc推出插入模式,进入标准模式,在这个模式下有几个基本命令要掌握。 :wq 保存推出 i 进入插入模式 x 删除当前光标的字符 dd 删除当前行,并且保存当前行到剪切板 p 粘贴 :help <command> 查看命令的帮助 上下左右移动光标 4.输入:w filename 保存文件到当前目录。 5.:q退出vim页面。 6.下次输入vim filename就可以编辑或者查看这个文件了。 来源: https://www.cnblogs.com/nucdy/p/5235791.html

Vim XDebug调试PHP php远程调试

若如初见. 提交于 2019-12-29 11:58:02
xdebug 配置 xdebug 安装 原文地址: http://xiaobin.net/201007/using-vim-and-xdebug-to-debug-php-code/ 原理上,这种调试方式主要依靠Vim的插件“ remote PHP debugger ”来实现,该插件实现了一个 DBGP 服务端。调试的时候Xdebug将会与服务端建立一个连接进行通信,接收服务端的调试指令并返回调试结果。 安装和配置 XDebug 安装: ubuntu 下直接 apt-get install php5-xdebug 安装 到 /usr/lib/php5/20090626+lfs 即可看到xdebug.so 可拷贝到你指定的模块地址 配置:( php.ini 文件) 加载Xdebug扩展: zend_extension=/ <extension_dir> /xdebug.so #<extension_dir>为你拷贝到的目录 配置xdebug开启dbgp远程调试 xdebug.remote_enable=on xdebug.remote_handler=dbgp Vim的Debugger插件 这个简单,只需要将插件下载回来,解压放到~/.vim/plugin目录 调试过程 用Vim打开要调试的PHP文件,按 <F5> 进入调试状态。请移步《 PHP调试指南 》,上面写的详细一些。

How can I emulate Vim's * search in GNU Emacs?

孤人 提交于 2019-12-29 11:46:17
问题 In Vim the * key in normal mode searches for the word under the cursor. In GNU Emacs the closest native equivalent would be: C-s C-w But that isn't quite the same. It opens up the incremental search mini buffer and copies from the cursor in the current buffer to the end of the word. In Vim you'd search for the whole word, even if you are in the middle of the word when you press *. I've cooked up a bit of elisp to do something similar: (defun find-word-under-cursor (arg) (interactive "p") (if

gvim设置使用

我的未来我决定 提交于 2019-12-29 11:12:51
最近有一款编辑器叫sublimeText 2比较流行,我也下载用了一下,确实很好看,自动完成,缩进功能什么的也比较齐全,插件也十分丰富。但用起来不是很顺手,最后还是回到了Gvim(Vim的GUI版本,除了一些GUI可以额外设置,颜色支持更多外基本与Vim没有区别)的怀抱,我并没有花很多时间去把玩ST2,没法评论那个更好,不过也许Gvim会更适合我。所以想写几篇博文记录下一路学习Gvim的过程。   写在前面:   (1)我用的是Gvim7.3_46,系统是win7   (2)这一系列文章不会详细的介绍Vim的每一个命令的用法   (3)我会尽量的配图,千言万语有时候真的没有一张图片来得直观   (4)Gvim下载地址 Gvim 需要爬墙   什么叫有感觉呢?最近看了很多相亲的帖子(没错,楼主也是大龄苦逼单身屌丝码农T-T)。经常某某会这样说:“我的要求不高,对方有感觉就好。”,这其实是一个很高的要求,类似于你希望微软为了让你写程序有感觉而推出一个量身打造的VS-For-You,当然你有足够的金钱也不是不可能的(这点和某些相亲情况类似)。话扯远了,我想说的是也许这辈子我们都无法找到一个真正有感觉的人,但这阵子我们完全就可以打造一个有感觉的Vim。   顺眼的外表:     按照上面的下载地址路安装完成之后,来看看我们素颜的Gvim姑娘         

VIM: simple steps to create syntax highlight file - for logfiles

跟風遠走 提交于 2019-12-29 10:16:41
问题 I have some (log4j generated) logfiles to go through; I know their format pretty well (I mean I have already got off-the-peg regexes etc I can use). I want to automatically highlight them in VIM when I load them up (*.log). A logfile entry looks something like this: YYYY-MM-DD HH:MM:ss,SSS [...] #LOG-LEVEL# [...] Message Where #LOG-LEVEL# is one of the standard 'ERROR', 'INFO', 'DEBUG', 'FATAL'....and the 'YYYY-MM...' represents the date/time to millisecond resolution. To get me started ,

Renaming the current file in Vim

廉价感情. 提交于 2019-12-29 10:08:41
问题 How should I rename my current file in Vim? For example: I am editing person.html_erb_spec.rb I would like it renamed to person.haml_spec.rb I would like to continue editing person.haml_spec.rb How would I go about doing this, elegantly? 回答1: There's a little plugin that let's you do this. 回答2: The command is called :saveas , but unfortunately it will not delete your old file, you'll have to do that manually. see :help saveas for more info. EDIT: Most vim installations have an integrated file

Vim: Move cursor to its last position

僤鯓⒐⒋嵵緔 提交于 2019-12-29 10:08:33
问题 Is it possible in (g)Vim to move the cursor to its previous position (while in normal mode)? Something to cycle back and forth in the list of previous cursor positions would be ideal. But also just to switch to the last location would suffice (something like cd - in bash with directories). Here's a little demonstration: line |1| <- cursor position line 2 line 3 line 4 And suppose I did 2j , here's how it is now: line 1 line 2 line |3| <- cursor position line 4 Now I'd like to press something

How do I exit from the text window in Git?

让人想犯罪 __ 提交于 2019-12-29 10:08:26
问题 I am using Windows and before committing, Git wants me to enter a text message and a new text window appears. How can I exit from this? I am trying to learn Git. So, a little help will be highly appreciated. 回答1: Since you are learning Git, know that this has little to do with git but with the text editor configured for use. In vim, you can press i to start entering text and save by pressing esc and :wq and enter , this will commit with the message you typed. In your current state, to just

Syntax highlighting causes terrible lag in Vim

可紊 提交于 2019-12-29 10:07:33
问题 I love Vim. But its giving me hard times right now. I use a lot of plugins and during the last 6 months, I've found a lot of awesome ones. But my Vim got really sluggish too. I do constant cleanups, but it doesn't help much. I'm at the point, where Vim is completely unusable. It feels like it renders at 2-5 frames per second, switching tabs/buffers takes about a second, scrolling with hjkl is awfully terrible, the lag is so bad, even typing a sentence in insert mode is confusing (due to lag).

Using Vim for Lisp development

时光怂恿深爱的人放手 提交于 2019-12-29 10:06:07
问题 I've been using Lisp on and off for a while but I'm starting to get more serious about doing some "real" work in Lisp. I'm a huge Vim fan and was wondering how I can be most productive using Vim as my editor for Lisp development. Plugins, work flow suggestions, etc. are all welcome. Please don't say "use emacs" as I've already ramped up on Vim and I'm really enjoying it as an editor. 回答1: Limp aims to be a fully featured Common Lisp IDE for Vim. It defaults to SBCL, but can be changed to