CentOSã«Vim7.4ãã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«
ããã¯å人ã®ä½æ¥ãã°ã§ãããç°å¢æ§ç¯æ¹æ³ã説æããæ å ±ã¨ãã¦ã¯æ´åããããã®ã§ã¯ããã¾ããã
æè¿ã®ããã°ã©ãã¼ã«ã¯ã¤ã³ãã©æ§ç¯ã¹ãã«ãæ±ããããããã ã
CodeZineãè¨ã£ã¦ããã ããééããªãã
ï¼ã½ã¼ã¹ã¯2015å¹´11æ9æ¥ã®ã¡ã«ãã¬ï¼
ãã¦ãä¹ ãã¶ãã«æ¸ãæ¥è¨ã®ãã¨ãæããã¦ãæ¥ã ã®è¨é²ãå³ã¡ãæ¥è¨ãã¨å¼ãã§è¯ãã®ãã©ããã¯ãã¦ãããæè¿ãã¨ãããµã¼ãã¼ã«CentOSãæ°è¦ã«ã¤ã³ã¹ãã¼ã«ãããã¨ããã£ããCentOSãã¤ã³ã¹ãã¼ã«ããã®ã¯ç§ã®äººçã«ããã¦ãããã§4度ç®ãããã§ãããã¤ã³ãã©ãã¼ã ã®Yããã«æ¯ã¹ãã°ãã¾ã åå¿è ã®åã ããããå¶æ¥é¨ã®Yããã«æ¯ã¹ãã°ãããã®é åã§ãããã¡ãªã¿ã«Windows 95ã¯20åãããã¤ã³ã¹ãã¼ã«ãããã¨ãããããç¦ç ã«ã¯5åãããæåãããã¨ãããã
OSãã¤ã³ã¹ãã¼ã«ããç´å¾ã«ãããªããã°ãªããªããã¨ã¨ããã®ã¯ãMacã ãããWindowsã ãããLinuxã ããã決ã¾ã£ã¦ããã
ã¾ãã¯ããã¹ãã¨ãã£ã¿ã¼ãã»ããã¢ãããããã¨ã§ããã*1 *2
ãããããªããã¨ã«ã¯ä½ãå§ã¾ããªãã
OSãã¤ã³ã¹ãã¼ã«ããç´å¾ã«ã¤ã³ã¿ã¼ãããã¨ã¯ã¹ããã¼ã©ã¼ãéããã¨ãããããªå¥´ã¯ITã¨ã³ã¸ãã¢ã§ã¯ãªãã¨æè¨ãã¦ãè¯ãã
ããã¦ããã¹ãã¨ãã£ã¿ã¼ã¨ã¯ãã¡ããVimã®ãã¨ã§ããããã¯ããããã¹ãã¨ãã£ã¿ã¼ã¨ããã¯ã¼ããä¸ã®ä¸ããå»æ¢ãã¦ããããVimã¨ããåèªã«ç½®ãæããã¨ãã¦ãä½ãåé¡ã¯ãªãã¨è¨ã£ã¦ãã¾ã£ã¦ãéè¨ã§ã¯ãªããããããããå®éã®ã¨ãããç§ã®å± ããªãã£ã¹ã§Vimã使ã£ã¦ããã®ãç§ã ãã¨ããäºå®ãç¡è¦ããããã«ããããããã¯ãããã¯éè¨ã¨è¦ãã¹ãã§ã¯ããããã¨ãããä»åã®ãã¼ãã¯CentOSã«Vimã¨ããããã¹ãã¨ãã£ã¿ã¼ãã¤ã³ã¹ãã¼ã«ããã¨ãããã¨ã«ããã
ãã®åº¦ç§ã¯ãCentOSãMinimalã¤ã³ã¹ãã¼ã«ããã¨ããã®ã¾ã¾ã§ã¯Vimãã¤ã³ã¹ãã¼ã«ãããªãã¨ããé©æã®äºå®ãç¥ããã¨ã¨ãªã£ãã
ãããå³å¯ã«ã¯å ¥ã£ã¦ããããã«ãè¦ããã
$ which vim /usr/bin/which: no vim in (/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/myname/bin) $ yum list installed | grep vim vim-minimal.x86_64 2:7.2.411-1.8.el6
ã³ãã³ã表è¨æ³¨æ*3
ããããã«ã
å°ãã°ã°ã£ã¦ã¿ãã¨ãyumã§ã¯Vim 7.2ã¾ã§ããã¤ã³ã¹ãã¼ã«ã§ããªãã¿ããã ãï½ï½ï½
yumã¨ããã®ã¯ã©ãããã¾ãè¯ããã¼ã«ã§ã¯ãªãæ°ãããã
大æµã®å ´åã¯åé¡ãªãã¨ãããã欲ãããã®ãæã«å
¥ãã®ã ããææ°ã®ãã®ã¨ãããã¤ãã¼ãªãã®ã¨ããæã«å
¥ããªããã¨ããã°ãã°ãããããã¯å½¢å®¹ãããªããå°éåºã§ã¯ãªãã³ã³ããã¨ãããã¥ã¢ã³ã¹ã§ãããã¤ã³ã¿ã¼ãããä¸ã§ã¯è·é¢ã«å¯¾ãããªã¹ã¯ã¨ããã®ãã»ã¼ãªãã«çãããããOSSã使ãç¯å²å
ã«ããã¦ãã³ã³ãããå°éåºã«åã¦ãè¦ç´ ã¨ããã®ãã¾ã£ããåå¨ããªãããã®ä¸ãããã¤èªèº«ãself-updateã§ããã®ããæªãããï¼ã¹ãã³ç§ãç¥ããªãã ãã§å¤åã§ãã¦ãï¼ãä¸æãæã¤ã¨ã¢ãããã¼ãããããªããã®ã¾ã§ã¢ãããã¼ããã¦ãã¾ãããã«ãªããã¨ãããã
ã¾ãããããã«ããã7.2ãªãã¦ããå¤èããã®ã使ããããªãã®ã§ãã½ã¼ã¹ã³ã¼ããã7.4ãã¤ã³ã¹ãã¼ã«ãããã¨ã«ããã
ããã§ã7.4ãã½ã¼ã¹ã³ã¼ãããã¤ã³ã¹ãã¼ã«ããããã¨ãã£ã¦ãã¤ã³ã¹ãã¼ã«æ¸ã¿ã®vim-minimal 7.2ãã¢ã³ã¤ã³ã¹ãã¼ã«ãããã¨ã¯ãããæ¹ãè¯ããç§ã¯ãã£ã¦ãã¾ã£ãããåããããããã¤ãåé¤ããã¨ãsudoãã§ããªããªãã
以ä¸ãVimãã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«
$ yum list installed | grep mercurial $ yum list installed | grep ncurses-devel $ yum list installed | grep make make.x86_64 1:3.81-20.el6 @anaconda-CentOS-201311272149.x86_64/6.5 $ yum list installed | grep gcc libgcc.x86_64 4.4.7-4.el6 @anaconda-CentOS-201311272149.x86_64/6.5 $ sudo yum update make libgcc $ sudo yum install gcc mercurial ncurses-devel $ cd /usr/local/src $ sudo hg clone https://vim.googlecode.com/hg/ vim $ cd vim $ sudo hg pull pulling from https://vim.googlecode.com/hg/ searching for changes no changes found $ sudo ./configure --with-features=huge --enable-multibyte --disable-selinux $ sudo make $ sudo make install $ vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Oct 28 2015 12:36:45) # 以ä¸ç¥ # rootã®.bash_profileã§vimã®ãã¹ãéãããã«ãã $ su - $ vim .bash_profile PATH=$PATH:$HOME/bin:/usr/local/bin $ exit # sudoæã«vimã使ããããã«ãã¹è¨å® $ sudo visudo # secure_pathã«/usr/local/binã追å Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
ãåèã
http://qiita.com/SOJO/items/9d6a65f3da941c49da36
Vimãã³ã³ãã¤ã«ããããã«å¿ è¦ãªãmake, gcc, mercurial, ncurses-devel ããããyumã§ã¤ã³ã¹ãã¼ã«ãã¦ããã¨ããã®ããã¤ã³ãã£ã½ããmakeãããã¨ã㯠-j ãªãã·ã§ã³ã§ãã³ã¢ãè¤æ°ä½¿ããã¦ããã¨è¯ãããããªãã¨é ãã
ããã¨ãç§ã¯ãsudo vim filename ã¨ãããã¨ãããããã®ã ããsudoæã«éããã¹ã¨ããã®ã¯ /etc/sudoers å ã® secure_path ã§æ±ºãããã¦ããããã§ãããã§ãã¹ãéã£ã¦ãªãã¨ãsudo vim ãã§ããªãã¿ãããã¾ãããããæ¸ãæããªãã§ãã/bin ã«ã§ãã·ã³ããªãã¯ãªã³ã¯ãç½®ãã¦ããã°è¯ãã®ãããããªãã
ãã¦ãã²ã¨ã¾ãããã§Vimã使ããããã«ã¯ãªã£ãã®ã ããã·ã³ã¿ãã¯ã¹ãã¤ã©ã¤ããå¹ãã¦ããªãã®ã§ããã®ã¾ã¾ã§ã¯httpd.confãéãæ°ã«ãããªããªããããã¾ããã¾ã Apacheãã¤ã³ã¹ãã¼ã«ãããã¦ããªããã ãã©ãã
ã¾ããvimrcãä½ã£ã¦ãã©ããããåºæ¬çãªè¨å®ãã³ãã£ã¦ããã°ããã ããã¨æã£ãã®ã ãâ¦ããã§æãæ¢ã¾ã£ã¦ãã¾ã£ãã
ã¦ã¼ã¶ã¼ãã¨ã®Vimè¨å®ã¯ãåèªã®ãã¼ã ã®ä¸ã« .vimrc ãä½ãã°è¯ãã®ã¯ããã£ã¦ããã®ã ããä»ã®ã¾ã¾ã§ã¯å ±éã§ä½¿ãããè¨å®ãæããã«è¶³ããªãã
ã·ã¹ãã ã® vimrc ã¯ãã£ããã©ãããèªã¿è¾¼ã¾ããã®ã ãããï¼
ç§ã¯ç²ç®çã«ã/etc/vimrc ããèªã¿è¾¼ã¾ããããã ã¨ã°ããæã£ã¦ããã®ã ããããã«ç½®ãã¦ãèªã¿è¾¼ãã§ãããªãã£ãã
ãåèã
http://askubuntu.com/questions/60041/why-isnt-vim-reading-my-global-configuration-file
ãªããã»ã©ã
Vimä¸ã§ :help system-vimrc ã¨æã¦ã°ãã·ã¹ãã vimrcã®å ´æã表示ãããã¨ã®ãã¨ã
ãã£ã¦ã¿ããã$VIM/vimrc ã ãã¨æ¸ãã¦ãã£ãã
ããã $VIM ãªãã¦å®ç¾©ãã¦ããªãã
ãã«ãå
ãããè¦ã㨠:version ã¨æã¦ã°è¡¨ç¤ºããããã¨æ¸ãã¦ãã£ãã
ãªãã ãçµå±ã®ã¨ãã vim --version ã§ããã£ãã®ãã
system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" fall-back for $VIM: "/usr/local/share/vim"
ã¨ãããã¨ã§ã/etc/vimrcã/usr/local/share/vim/vimrcã«ç§»åããã
ä»ã«ãã«ã©ã¼è¨å®ããè²ã
足ããªãã£ãããæ¢ã«æ§ç¯æ¸ã¿ã®ç°å¢ãããåæ§ã®æé 㧠$VIM ã®å ´æãç¹å®ããè¨å®ãã¡ã¤ã«ãtarãã¦scpãã¦ä¸¸ãã¨æã£ã¦ããããã¹ã¦ãã¾ããã£ãã
ãã¨ã¯ãã¦ã¼ã¶ã¼ãã¨ã«ãèªåã®ãªããã® .vimrc ãä½ãã°è¯ãã ãã
ããã§ããããApacheã¨Postfixã¨Dovecotãã¤ã³ã¹ãã¼ã«ããæ°åã湧ãã¦ãããï¼ããã«ããã¨ã¯è¨ã£ã¦ããªãï¼
ãã§ãããã§ããã
*1:ãã ããããã¹ããã¨ãªãã¨è©±ãã¡ãã£ã¨éã£ã¦ãã¦ããã®å ´åãã¾ããããªããã°ãªããªããã¨ã¯ã¢ãã¬ã¹å¸³ãã¯ã©ã¦ãã¨åæãããã¨ã§ããã
*2:ã¨ããã§ãããæ¬é¡ããé¸ããä¸ã«ãããã«è±ç·ãããã¨ãæ¥ã«æãåºãããããã¦ããã¯ç§ã®æ¥è¨å¸³ãªã®ã ãããèªãã®ã¿ã¤ãã³ã°ã®æ´èµ°ãæãå¿ è¦ããªãããã ããããä½ãã¨ããã¨ãæºå¸¯é»è©±ã¨ã¹ããããããã¨åºå¥ããããå®æãããããã ããã¹ããã«ãé»è©±ã®æ©è½ãã¤ãã¦ããä¸ã«ãå¤ãã®å ´å身ã«ã¤ãã¦æã¡éã¶ãã®ãªã®ã ãããã¹ããããã±ã¼ã¿ã¤ãã¨å¼ç§°ãããã¨ã«ãªãã®åé¡ããªãã¨ç§ã¯æãã®ã ãã¨ãããã¨ã ããããªãã®æºå¸¯é»è©±ãã¹ãã¼ããã©ã³ãã¾ãã¯iPhoneã®é»æºããåããã ããããªã©ã¨åããã©ãè¨ãæ¹ããããã¨ã«ä¸ä½ãªãã®æå³ãããã®ã ãããã¹ããã¨ã±ã¼ã¿ã¤ãåºå¥ããã®ã¯Auã·ã§ããã®åºå¡ã ãã§è¯ãã
*3:ä¸è¬çã«ã¯ãrootã®ããã³ããã"#"ãä¸è¬ã¦ã¼ã¶ã¼ã®ããã³ããã"$"ã§è¨è¿°ããã¿ããã ããç§ã¯"#"ãã³ã¡ã³ãã¨ãã¦ä½¿ãããã®ã§ãããã³ããã¯rootã ããã"$"ã使ããã¨ã«ãã¦ããã