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

实现了一个自动配置的 Vim,欢迎大家尝试,提意见

  •  
  •   matthewgao · 2015-08-24 09:07:24 +08:00 · 2900 次点击
    这是一个创建于 3173 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近刚刚买了 Mac ,花了点时间配了下 Vim ,想想自己也要经常装各种系统,索性写个脚本自动配置 Vim ,省事了。

    项目地址: https://github.com/matthewgao/MyVim
    支持: Linux 、 OSX

    现在的配置还非常基础,考虑加入一些更 generic 的插件,欢迎大家拍砖

    10 条回复    2015-08-24 21:28:24 +08:00
    airbnber
        1
    airbnber  
       2015-08-24 09:33:18 +08:00
    这样的脚本也叫自动化。。。。。。变量,函数,正则都不用的么?
    matthewgao
        2
    matthewgao  
    OP
       2015-08-24 09:36:48 +08:00
    @airbnber 自动化配置,暂时没有要用这些东西的地方
    evefree2
        3
    evefree2  
       2015-08-24 09:44:59 +08:00
    1 #!/bin/bash
    2 echo "安装将花费一定时间,请耐心等待直到安装完成^_^"
    3 if which apt-get >/dev/null; then
    4 sudo apt-get install -y vim vim-gnome ctags xclip astyle python-setuptools python-dev git
    5 elif which yum >/dev/null; then
    6 sudo yum install -y gcc vim git ctags xclip astyle python-setuptools python-devel
    7 fi
    8
    9 ##Add HomeBrew support on Mac OS
    10 if which brew >/dev/null;then
    11 echo "You are using HomeBrew tool"
    12 brew install vim ctags git astyle
    13 fi
    14
    15 sudo easy_install -ZU autopep8
    16 sudo ln -s /usr/bin/ctags /usr/local/bin/ctags
    17 mv -f ~/vim ~/vim_old
    18 cd ~/ && git clone https://github.com/ma6174/vim.git
    19 mv -f ~/.vim ~/.vim_old
    20 mv -f ~/vim ~/.vim
    21 mv -f ~/.vimrc ~/.vimrc_old
    22 mv -f ~/.vim/.vimrc ~/
    23 git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
    24 echo "ma6174 正在努力为您安装 bundle 程序" > ma6174
    25 echo "安装完毕将自动退出" >> ma6174
    26 echo "请耐心等待" >> ma6174
    27 vim ma6174 -c "BundleInstall" -c "q" -c "q"
    28 rm ma6174
    29 echo "安装完成"


    @ git hub 上的呀,我一般就保存下来,自己用了
    matthewgao
        4
    matthewgao  
    OP
       2015-08-24 09:51:41 +08:00
    @evefree2 这个我也用过,但是觉得装的太多东西都不是我需要的,而且打包了整个 vundle 到 github ,感觉多余,所以就自己重新弄一个更加基础通用的
    deyu260
        5
    deyu260  
       2015-08-24 10:12:37 +08:00
    是要准备做成 ohmyvim 的节奏吗
    kikyous
        6
    kikyous  
       2015-08-24 10:30:52 +08:00
    这估计不会有人用
    tonghuashuai
        7
    tonghuashuai  
       2015-08-24 13:21:41 +08:00
    推荐用 Vundle
    haogefeifei
        8
    haogefeifei  
       2015-08-24 13:39:50 +08:00
    GitHub 上有个 k-vim 的项目可以看看, vim 建议还是自己一点点的装,不然很多插件一下全来你受不了
    s7lx
        9
    s7lx  
       2015-08-24 17:56:36 +08:00
    推荐朋友的 k-vim ,用过都说好 https://github.com/wklken/k-vim
    matthewgao
        10
    matthewgao  
    OP
       2015-08-24 21:28:24 +08:00
    @haogefeifei 是的 毕竟每个人使用习惯不一样,所以我只想提供普适的,然后各自可以配置自己的快捷键等等
    不然就直接用 spf13 的了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1153 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 17:42 · PVG 01:42 · LAX 10:42 · JFK 13:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.