V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
wikinee
V2EX  ›  Vim

[一键到底]vim 安装与配置 solarized 主题与 Vundle 插件管理器脚本

  •  
  •   wikinee · 2015-12-16 18:47:57 +08:00 · 5151 次点击
    这是一个创建于 3292 天前的主题,其中的信息可能已经有所发展或是发生改变。
    #!/usr/bash
    # maybe you are using zsh,fix the first line.
    # Program:
    # This program include:
    # - add auto change vim colorscheme to solarized.
    # - install Vundle.vim
    # History:
    # Dec.16, 2015 wikinee First release
    echo "This script need wget, ssh, github-key, and unzip?"
    echo "Sure you have those?Enter continue or quit: "
    read base_env
    if [ ! "$base_env" == "" ]; then
    echo "Please install them and run script again."
    else
    vimrcPath="$HOME/.vimrc"
    vimColorPath="$HOME/.vim/colors"
    vimPluginPath="$HOME/.vim/bundle"
    echo "===============test exist and touch file==============="
    if [ ! -x "$vimrcPath" ]; then
    touch "$vimrcPath"
    fi

    mkdir -p "$vimColorPath"
    wget https://github.com/altercation/vim-colors-solarized/archive/master.zip && unzip master.zip && cp vim-colors-solarized-master/colors/solarized.vim $HOME/.vim/colors
    rm -rf vim-colors-solarized-master
    rm master.zip
    cd $HOME

    echo -e "\" ===============solarized settings=================" >> $vimrcPath
    echo "Chose you scheme? y:light(default),n:dark"
    read chose_scm
    if [ "$chose_scm" == "n" ]; then
    usr_chs_scm="dark"
    fi

    echo -e "syntax on\nset nu\nset t_Co=256\nlet g:solarized_termcolors=256\n\
    set background=${usr_chs_scm:=light}\ncolorscheme solarized" >> $vimrcPath
    fi
    echo "finish solarized, install Vundle?Enter yes or other quit"
    read Install_vundle
    if [ ! "$Install_vundle"=="" ]; then
    exit 0
    else
    echo "==================install Vundle==================="
    mkdir -p "$vimPluginPath"
    git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
    echo "\"==============Vundle Settings============="
    echo -e "\n\
    set nocompatible \" be iMproved, required\n
    filetype off \" required\n
    \" set the runtime path to include Vundle and initialize\n
    set rtp+=~/.vim/bundle/Vundle.vim\n
    call vundle#begin()\n
    \" alternatively, pass a path where Vundle should install plugins\n
    \"call vundle#begin('~/some/path/here')\n

    \" let Vundle manage Vundle, required\n
    Plugin 'gmarik/Vundle.vim'\n

    \" The following are examples of different formats supported.\n
    \" Keep Plugin commands between vundle#begin/end.\n
    \" plugin on GitHub repo\n
    Plugin 'tpope/vim-fugitive'\n
    \" plugin from http://vim-scripts.org/vim/scripts.html\n
    Plugin 'L9'\n
    \" Git plugin not hosted on GitHub\n
    Plugin 'git://git.wincent.com/command-t.git'\n
    \" git repos on your local machine (i.e. when working on your own plugin)\n
    Plugin 'file:///home/gmarik/path/to/plugin'\n
    \" The sparkup vim script is in a subdirectory of this repo called vim.\n
    \" Pass the path to set the runtimepath properly.\n
    Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}\n
    \" Avoid a name conflict with L9\n
    Plugin 'user/L9', {'name': 'newL9'}\n
    \" All of your Plugins must be added before the following line\n
    call vundle#end() \" required\n
    filetype plugin indent on \" required\n
    \" To ignore plugin indent changes, instead use:\n
    \"filetype plugin on
    \"
    \" Brief help
    \" :PluginList - list configured plugins
    \" :PluginInstall(!) - install (update) plugins
    \" :PluginSearch(!) foo - search (or refresh cache first) for foo
    \" :PluginClean(!) - confirm (or auto-approve) removal of unused plugins
    \"
    \" see :h vundle for more details or wiki for FAQ
    \" Put your non-Plugin stuff after this line" >> $vimrcPath

    echo "===================Finish====================="
    fi
    exit 0
    4 条回复    2015-12-16 21:11:04 +08:00
    timothyye
        1
    timothyye  
       2015-12-16 19:14:40 +08:00 via Android
    放 gist 吧, lz
    wikinee
        2
    wikinee  
    OP
       2015-12-16 20:56:22 +08:00 via iPhone
    @timothyye git 节点吗?
    maemual
        3
    maemual  
       2015-12-16 21:02:08 +08:00
    timothyye
        4
    timothyye  
       2015-12-16 21:11:04 +08:00 via Android
    @wikinee 放 gist 上,这样看起来更方便,收藏也方便
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2828 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 06:40 · PVG 14:40 · LAX 22:40 · JFK 01:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.