- 自動完成
- 括號匹配
- 編譯快速鍵 (F9編譯、F5編譯並執行)
- 語法檢查
- 邏輯檢查
- 重新排版 (F3)
- 單行/多行註解 (\x)
- 將游標移動到定義 (F12)
- 摺疊/展開code
- 摺疊/展開當前的區塊 (za) (←→方向鍵也可以展開當前的區塊)
- 摺疊全部的區塊 (zM)
- 展開全部的區塊 (zR)
- 展開當前的區塊並摺疊所有其他區塊 (zx)
- 會自動sudo apt-get update
- 會先移除原本安裝的Vim
- 僅限Ubuntu或其他Debian系列的Linux作業系統,強者們可嘗試修改成可在其他Linux發行版運作的Shell Script (完成後歡迎分享!XD)
- Vim的啟動速度會變慢 (+1秒)
- 安裝時間過長、硬碟空間占用過大
wget https://raw.githubusercontent.com/fsps60312/RandomCode/master/InstallVim.sh -O InstallVim.sh
chmod 700 InstallVim.sh
sudo ./InstallVim.sh
- 耐心等待安裝、設定完成
- 估計安裝時間:1小時 (視網路、CPU、硬碟速度而定)
- CPU將會長時間高效能運轉,請確保您的電腦散熱良好並接上電源
- 保險起見,請確保您的硬碟至少有500MB的空間
- 歡迎利用各種方式提出改善建議 (如果您擅長GitHub的話可以看看這裡)
以下是完整示範安裝過程,請參考~^_^
安裝在Windows Subsystem for Linux (WSL):
安裝在Ubuntu 16.04LTS:
Shell Script內容:
#!/bin/sh GetPythonConfigName(){ s=$(ls /usr/lib/ | grep python3.) s=$(ls /usr/lib/$s -N --ignore="*.py" | grep config) echo $s } GetVimInstallPackageName(){ ls ~/vim | grep vim.*\.deb } #echo $(GetPythonConfigName) #return echo "Compiling Vim from source..." echo "Vim removing..." sudo rm -rf vim .vim sudo apt-get remove -y vim vim-runtime gvim vim-tiny vim-common vim-gui-common vim-nox echo "Installing essential tools..." sudo apt-get update sudo apt-get install -y --fix-missing libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev python3-dev ruby-dev lua5.1 lua5.1-dev libperl-dev git checkinstall echo "Vim cloning..." cd ~ git clone https://github.com/vim/vim.git cd vim ./configure --with-features=huge \ --enable-multibyte \ --enable-rubyinterp=yes \ --enable-pythoninterp=yes \ --enable-python3interp=yes \ --with-python3-config-dir=/usr/lib/$(ls /usr/lib/ | grep python3.)/$(GetPythonConfigName) \ --enable-perlinterp=yes \ --enable-luainterp=yes \ --enable-gui=gtk2 \ --enable-cscope \ --prefix=/usr/local make VIMRUNTIMEDIR=/usr/local/share/vim/vim80 echo "Vim installing..." sudo checkinstall -y sudo dpkg -i ~/vim/$(GetVimInstallPackageName) echo "Vim installed" wget https://raw.githubusercontent.com/fsps60312/RandomCode/master/.vimrc -O ~/.vimrc echo "Configuring: \\x to comment/uncomment" sudo apt-get install -y --fix-missing aptitude sudo aptitude install -y vim-addon-manager vim-scripts vim-addons install enhanced-commentify echo "Installing VundleVim..." git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim echo "Configuring: Auto Pairs" wget https://raw.githubusercontent.com/jiangmiao/auto-pairs/master/plugin/auto-pairs.vim -O ~/.vim/plugin/auto-pairs.vim echo "Apply Plugins..." vim +PluginInstall +qall echo "Configuring YCM..." sudo apt-get install --fix-missing -y build-essential cmake python-dev python3-dev cd ~/.vim/bundle/YouCompleteMe sudo ./install.py --clang-completer sudo wget https://raw.githubusercontent.com/Valloric/ycmd/master/cpp/ycm/.ycm_extra_conf.py -O ~/.vim/.ycm_extra_conf.py echo "All Completed!!!"
沒有留言:
張貼留言
歡迎留言或問問題~
若您的留言中包含程式碼,請參考這篇
如果留言不見了請別慌,那是因為被google誤判成垃圾留言,小莫會盡快將其手動還原
注意:只有此網誌的成員可以留言。