Posts Tagged ‘vi’

27 03 2011

升级ubuntu里的vi为vim

bigCat Posted in Linux - 0 Comment
shell> sudo su\r\nshell> apt-get install vim\r\nshell> cd /etc/alternative\r\nshell> rm -f vi\r\nshell> ln -s /usr/bin/vim vi
28 11 2010

vim的复制粘贴(系统粘贴板)

bigCat Posted in Linux - 0 Comment

http://poplaryy.javaeye.com/blog/519457\r\n\r\nvim帮助文档里与粘贴板有关的内容如下:\r\n

    \r\n
  1. vim有12个粘贴板,分别是0、1、2、...、9、a、“、+;用:reg命令可以查看各个粘贴板里的内容。在vim中简单用y只是复制到“(双引号)粘贴板里,同样用p粘贴的也是这个粘贴板里的内容;
  2. \r\n

  3. 要将vim的内容复制到某个粘贴板,需要退出编辑模式,进入正常模式后,选择要复制的内容,然后按"Ny完成复制,其中N为粘贴板号(注意是按一下双引号然后按粘贴板号最后按y),例如要把内容复制到粘贴板a,选中内容后按"ay就可以了,有两点需要说明一下:\r\n
      \r\n
    • “号粘贴板(临时粘贴板)比较特殊,直接按y就复制到这个粘贴板中了,直接按p就粘贴这个粘贴板中的内容;
    • \r\n

    • +号粘贴板是系统粘贴板,用"+y将内容复制到该粘贴板后可以使用Ctrl+V将其粘贴到其他文档(如firefox、gedit)中,同理,要把在其他地方用Ctrl+C或右键复制的内容复制到vim中,需要在正常模式下按"+p;
    • \r\n

    \r\n

  4. \r\n

  5. 要将vim某个粘贴板里的内容粘贴进来,需要退出编辑模式,在正常模式按"Np,其中N为粘贴板号,如上所述,可以按"5p将5号粘贴板里的内容粘贴进来,也可以按"+p将系统全局粘贴板里的内容粘贴进来。
  6. \r\n

\r\n注意:在我这里,只有vim.gtk或vim.gnome才能使用系统全局粘贴板,默认的vim.basic看不到+号寄存器。

17 09 2010

Windows 7 里 .vimrc 应该放在哪里?

bigCat Posted in NoteBook - 0 Comment

From the Vim Wiki.\r\n

在windows系统里,寻找 $HOME 最好的方法就是跑一些命令

\r\n

:version\r\n:echo expand('~')\r\n:echo $HOME\r\n:echo $VIM\r\n:echo $VIMRUNTIME\r\n

\r\n\r\n安装目录有个文件叫 vimrc_example.vim 有兴趣读一下\r\n

11 09 2010

VIM remove BOM

bigCat Posted in Linux - 0 Comment

>I use utf8, and I would like to know how to save a file with BOM\r\n>1. always added\r\n>2. always removed\r\n>3. unchanged\r\n>and what is the default behaviour of vim?\r\n\r\nRarely if ever poke utf8 files (usually find the weirdo chars and turn\r\n'em into named entities instead), but iirr, forcing a BOM is done with\r\n\r\n :set bomb\r\n\r\nforcing it off with\r\n\r\n :set nobomb\r\n\r\nand the default behavior is whatever the file has when you start to edit\r\nit, with or without.\r\n\r\nIirr, any nonascii utf8 char (>1byte) will normally force the BOM to be\r\nturned on. Might be wrong, though, and it might assume/require\r\nlittle-endian multibyte chars per the utf8 spec (ie, a BOM would be\r\nredundant), and iirr the BOM is only really required with utf16/ucs2\r\nencoding.\r\n\r\nTony M's the one to ask, though. :D\r\n\r\n\r\nThen again, there's always\r\n\r\n :help bomb\r\n\r\netc. Lis, haven't poked around with this kind of thing but on rare\r\noccasion.\r\n

Host: (miao) | Word: Press | Code: HTML5