ºìÁªLinuxÃÅ»§
Linux°ïÖú

ÅäÖÃVI»òVIM

·¢²¼Ê±¼ä:2009-12-21 23:06:27À´Ô´:ºìÁª×÷Õß:mengjie213
1¡¢VI»òVIMµÄÅäÖÃÎļþµÄ·¾¶

¡¡¡¡·¢ÏÖ/usr/share/vim/vimrcºÍ/etc/vim/vimrcÖ¸ÏòÊÇͬһ¸öÎļþ£¬¼´vimrc£¬ÎªviºÍvimµÄÅäÖÃÎļþ£¬ÐÞ¸ÄÕâ¸öÎļþ¼´¿É¡£Õâ¸ö·¾¶ÔÚ²»Í¬µÄLINUX°æ±¾ÖпÉÄܻ᲻ͬ¡£

2¡¢ÅäÖÃÑÕÉ«

¡¡¡¡ÅäÖÃVIºÍVIMµÄÑÕÉ«ÏÔʾ£¬Ê¹ËüÄܹ»¸ßÁÁ¶ÈÏÔʾһЩÌرðµÄµ¥´Ê£¬Õâ¶Ô±àд³ÌÐòºÜÓÐÓ᣺óÀ´´ò¿ªÎļþ·¢ÏÖÀïÃæÆäʵÒѾ­ÓÐÒ»ÐÐÁË£¬Ö»ÊÇÓÃÒýºÅ×¢Ê͵ôÁË£¬Ö»Ð轫syntax on ËùÔÚÐÐÇ°ÃæµÄÒýºÅÈ¥µô¼´¿É¡£»òÕßÁíÍâ¶ÀÁ¢Ìí¼ÓÒ»ÐУºsyntax on Ò²ÐÐ,ÁíÍâ±à¼­/etc/profile Ôö¼ÓÒ»ÐÐalias vi="vim"¾ÍÐÐÁË¡£

3¡¢ÉèÖÃÊó±ê

¡¡¡¡Ê¹ÓÃVI±à¼­Îı¾Ê±£¬Èç¹ûÏëÐÞÎļþÖиÄÀë¹â±ê½ÏÔ¶µÄλÖã¬ÕâʱºòÏëÓÃÊó±ê¶¨Î»£¬¿ÉĬÈÏÇé¿öÏ£¬Êó±êÊDz»¿ÉÓõġ£Èç¹ûÄãÏëʹÓÃÊó±ê£¬Ö»ÐèÁíÆðÒ»ÐУ¬Ð´ÉÏ£ºset mouse=a ¼´¿É

4¡¢ÉèÖÃ×Ô¶¯Ëõ½ø

¡¡¡¡Ä¬ÈÏÇé¿öÏ£¬VIºÍVIM¶¼Ã»ÓÐËõ½øµÄ£¬Ã¿»»Ò»ÐУ¬¹â±ê¾ù¶¨Î»ÔÚ¶¥¸ñ£¬Èç¹ûÄãÏë×Ô¶¯¶ÔÆ룬Ç뽫 set autoindentËùÔÚÐÐÇ°ÃæµÄÒýºÅÈ¥µô£¬»òÕßÁíÍâÌí¼ÓÒ»ÐУºset autoindentÒ²¿É¡£ÕâÓëÅäÖÃÑÕÉ«ÀàËÆ¡£ÕâÑùµÄÉèÖõĽá¹ûÊÇ°´»Ø³µºóÐÂÐÐÓëÉÏÒ»ÐÐ×Ô¶¯¶ÔÆë¡£

5¡¢ÉèÖÃtabµÄËõ½øÁ¿

¡¡¡¡Èç¹ûÓÃpython±àд³ÌÐò£¬ÄÇôÐÐËõ½øÁ¿ÊÇÒ»¸ö¼«ÆäÖØÒªµÄ¸ÅÄͬһ¸ö¿éµÄËõ½øÁ¿±ØÐëÏàͬ¡£Äã¿ÉÄÜϲ»¶ÔÚÐÐÇ°¼Ó¿Õ¸ñÀ´±íʾËõ½ø£¬µ«Ã¿´Î±ØÐëÇöà´Î¿Õ¸ñ¼ü£¬Èç¹ûÄãϲ»¶Óð´ TAB¼üÀ´±íʾËõ½ø£¬Äã¿ÉÄܾõµÃдµÄÎı¾»ò³ÌÐò²»Ì«ºÃ¿´£¬ÒòΪĬÈÏÇé¿öÏ£¬VIºÍVIMµÄTABËõ½øÁ¿±È½Ï´ó£¨ÖÁÉÙÁù£¬Æ߸ö×Ö·û£©¡£ÉèÖÃTAB¼üËõ½øÁ¿µÄ·½·¨£ºset shiftwidth=3 ÄãÒ²¿ÉÒÔÑ¡Ò» ¸öÄã×Ô¼ºÏ²»¶µÄËõ½øÁ¿£¬±ÈÈç2£¬»ò4¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 9 ÌõÆÀÂÛ

  1. xinghuodw ÓÚ 2014-05-22 20:36:13·¢±í:

    vim°²×°Ê§°ÜÁË¡£¡£¡£

  2. chenerhui ÓÚ 2013-06-01 22:39:02·¢±í:

    ²»´í£¬¸ÕºÃÊÇÎÒÒªµÄ¶«Î÷

  3. Tuzki ÓÚ 2010-06-15 17:42:32·¢±í:

    vi

  4. Áõ³å ÓÚ 2010-03-31 20:06:38·¢±í:

    ÒýÓÃ:
    ¶÷£¬ÎÒ¾ÍÓÃÕâ¸ö·Ñ¾¢£¬µÃ¶àѧѧÁË
    linuxcui ·¢±íÓÚ 2010-3-26 15:54

    Ī·Ç´ÞÀÏϲ»¶ÓÃwinµÄnotepad?(()):s

  5. kxzdsj ÓÚ 2010-03-31 17:30:44·¢±í:

    ÐÂÊÖ
    лл·ÖÏíÁË °¢

  6. Áõ³å ÓÚ 2010-03-26 22:21:37·¢±í:

    Vim²»ºÃ,»¹ÊÇEmacs!(()):s

  7. linuxcui ÓÚ 2010-03-26 15:54:04·¢±í:

    ¶÷£¬ÎÒ¾ÍÓÃÕâ¸ö·Ñ¾¢£¬µÃ¶àѧѧÁË

  8. itofly2010 ÓÚ 2010-03-26 15:17:53·¢±í:

    :0)1

  9. miling ÓÚ 2009-12-22 00:10:55·¢±í:

    ѧϰ