Navigation

vim

vim中调出历史命令用 q:

in

vim中调出历史命令用 q:

在你查找替换的时候或者发布了一个很长命令,而中间又用命令被打断的情况下非常有用。

印着vim快捷键的衣服

in

印着vim快捷键的衣服

vim快捷键的衣服
http://www.douban.com/photos/photo/1...

确实如评论所说,印在后面更方便别人查看。
印在前面,自己也看不了呵。:)

vim自带的帮助文件中文翻译已经全部完成了

in

vim自带的帮助文件中文翻译已经全部完成了

help.txt For Vim version 7.1. 最近更新:2006年12月
http://vimcdoc.sourceforge.net/doc/h...

这是不错。

我打印出英文看了。当时连不上sourceforge。

帮助文件很长,但粗读收获非常大。我感觉比o’reilly出的learning vi/学习vi要好得多!

vim中用 :digraph 查看可以输入什么特殊字符

in

vim中用 :digraph 查看可以输入什么特殊字符

输入的时候,在insert mode,用 ctrl-k字符。ctrl-k和字符不要按空格。
字符是区分大小写的!

有很多特殊字符和图像啊。

大家常用的可能用 ctrl-kCo 就是 ©

我很喜欢一个向播放键的图形 ctrl-kPR 就是 ▶

» 和 « 分别是ctrl-k>>和ctrlk<<

有意思。

vim中翻页的命令

in

vim中翻页的命令

老是记不住。
整页翻页 ctrl-f ctrl-b
f就是forword b就是backward

翻半页
ctrl-d ctlr-u
d=down u=up

滚一行
ctrl-e ctrl-y
这没有什么方便记忆的 :)

zz 让光标所杂的行居屏幕中央
zt 让光标所杂的行居屏幕最上一行 t=top
zb 让光标所杂的行居屏幕最下一行 b=bottom

vim中实现多个tab/标签窗口

in

vim中实现多个tab/标签窗口

多个标签页会显示在屏幕顶端,方便你在文件中跳转。

如果你在编辑“一个文件,txt”现在想打开另一个,但是在新的标签页中编辑,用:

 :tabedit 另一个文件.txt

屏幕上面就会有2个tab,“一个文件.txt”和“另一个文件.txt”。

gt 在多个tab之间切换。也可以用鼠标点某个tab,
:tabonly 关掉除了当前标签之外所有标签

vim和emacs的有趣评价:vi编辑器之神;emacs神的编辑器

in

vim和emacs的有趣评价:vi编辑器之神;emacs神的编辑器

2008-06-29 21:55:51 流浪五天
vi编辑器之神
emacs神的编辑器
http://www.douban.com/group/topic/27...

哈哈。

当谈到vim或emacs之类编辑器上手/入门那么难为什么还要浪费时间学。下面这段文字很好地表达了我的想法

in

当谈到vim或emacs之类编辑器上手/入门那么难为什么还要浪费时间学。下面这段文字很好地表达了我的想法

当谈到vim或emacs之类编辑器上手/入门那么难为什么还要浪费时间学。下面这段文字很好地表达了我的想法

2008-06-30 21:23:31 wdd1101

我也是新手,也有这样的疑问。

后来我是这样想的:如果走1米的距离,那么,步行显然优于开车子;但是如果是1000米呢,开车的优势就出来了;如果是10000米,那么除非是是特殊的目的,应该没有人选择步行吧。

http://www.douban.com/group/topic/27...

我看这个说法可以更广泛地应用到其他难上手的技能。

emacs中插入一列连续数字

in

emacs中插入一列连续数字

用下面的函数,xahlee写的。原文在这里: http://xahlee.org/emacs/elisp_exampl...

  (defun insert-counter-column (n)
  ;;"Insert a sequence of integers vertically.
  ;;Example:
  ;;do this 1 times
  ;;do this 2 times
  ;;do this 3 times
  ;;...
  ;;
  ;;If there are not enough existing lines after the cursor
  ;;when this function is called, it aborts at the last line.
  ;;
  ;;See also: `kill-rectangle' and `string-rectangle'."
    (interactive "nEnter the max integer: ")
    (let ((i 1) colpos)
      (setq colpos (- (point) (point-at-bol)))
      (while (<= i n)
        (insert (number-to-string i))
        (next-line) (beginning-of-line) (forward-char colpos)
        (setq i (1+ i))
        )))

把它存在你的.emacs中吧。

需要插入的时候 M-x insert-counter-column
会提示你插入数字最后一个是多少,如果你输入10,就插入1-10。下面是样子

一些文字 1 又一些文字
一些文字 2 又一些文字
一些文字 3 又一些文字
一些文字 4 又一些文字
一些文字 5 又一些文字
一些文字 6 又一些文字
一些文字 7 又一些文字
一些文字 8 又一些文字
一些文字 9 又一些文字
一些文字 10 又一些文字

xahlee at google grups: http://groups.google.com/groups/prof...

谁能进一步修改这个脚本让我能定义数字格式

用户能够选择带0或者不带0。

比如,我想插入的是 01-20, 001 - 100,0001-2234

有几个0由最大的数字的位数决定。

问题,在vim和emacs中如何插入一列递加数字如

vim vs ue

问题,在vim和emacs中如何插入一列递加数字如

1
2
3
4

001
002
003
004

年初约定和lvcha比到底是vim快还是ultraedit快

没想到lvcha出的第一题我用vim根本无法解决! :(

我查了一下,有的脚本能解决这个问题,但我没用出来。

第一次较量败了下来。:)

下面是临时记录

# /bin/bash
sed ‘s/,/\n/g’ source -i
sed “s/^/insert into table Student (‘id’,’name’) values (001, ‘/” -i
;; 这里要用双引号,因为替换文字中有单音号了
sed “s/$/’);/” -i

http://learn.tsinghua.edu.cn:8080/20...
递增数字的emacs插件

incrementing numbers
:.,$g/^d/exe “norm! ” : 增加在BOL(beginning of line)处的数字
译注:.,$ 指明命令从当前行执行到最后一行
如果没有 .,$ 限定范围,那么g//就会对整个文件进行操作
exe 是执行后面的命令组合
http://hi.baidu.com/needyu/blog/item...

4.在特定列后插入递增数字

a1bcdefghijklmnopqrstuvwxyz
a2bcdef ghijklmnopqrstuvwxyz
a3bcdefgh ijklmnopqrstuvwxyz

1:光标移动到 f 后,M-x set-mark-command,下移三行,C-x r t ### RET。

2:用宏。光标置于第一行,F3,C-e,###,C-n,F4,F4。

3:同1

4:光标置于第一行,C-x C-k C-c 1 RET,F3,C-a,C-s,a,RET,F3,C-n,F4,F4。
http://winsphinx.blogspot.com/2007/0...

很笨的方法,我一个一个递增数字:光标到数字上后按ctrl-a,在命令模式下 ctrl-x是递减
via http://www.vim.org/tips/tip.php?tip_...
You don’t even need to be on the number itself. Vim search automaticaly for the next number before incrementing / decrementing
光标无须在本行的数字上就可以按那个快捷键

.. and if you have Perl, you can do tons with the s command, eg:

:%!perl -e ‘s/(\d+)/$1 + 1/ge’

will increment every number by one. the “e” at the end makes the right side of the substitution an expression. I find this handy for converting data to/from one-based to zero-based.

http://www.vim.org/scripts/script.ph...

** vim中的$vim在哪里

in

** vim中的$vim在哪里

I have downloaded a Vim plugin or a syntax file or a indent file, or
a color scheme or a filetype plugin from the web. Where should I copy
these files so that Vim will find them?

You can place the Vim runtime files (plugins, syntax files, indent files,
color schemes, filetype plugins, etc) under one of the directories
specified in the ‘runtimepath’ option. To determine the current value of
the ‘runtimepath’ option, use the following command:

:set runtimepath

For Unix systems, this is usally the “$HOME/.vim” directory. For MS-Windows
systems, this is usually the $VIM\vimfiles or $HOME\vimfiles directory.
Depending on the type of the runtime file, you have to place it under a
specific directory under the above runtime directory. The names of the
directories are listed below:

http://vimdoc.sourceforge.net/vimfaq...

我机器装vim时因为没有创建.vim这个目录,所以我自己建了一个把我要用的东西放进去就好了。

vim还是比较发方便的。就是在命令模式,老要把中文输法调整为英文的否则命令模式不起作用这点麻烦。但这也是必须的。况且,即使这样,也比绝大多数文本处理器要快和省力。:)

** vim的markdown-mode

in

** made with vi

in

** made with vi

** vim中全文查找替换别忘了加百分号 :%s/查找文字/替换文字/

in

** vim中全文查找替换别忘了加百分号 :%s/查找文字/替换文字/

刚才忘了加%,老报没找到要查找到文字。

vi 手势

in

** vi 手势



http://blog.ngedit.com/2007/11/19/th...
http://www.homebrew.net/visign/

all you vi gangsterz~ report here :)

比如输入 黄金 隐私 等词语搜索










搜索本站
搜索WWW

Powered by Drupal, an open source content management system