V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ivanlw
V2EX  ›  Vim

有什么方法自动备份.vimrc 和所有的 plugin, ftdetect……到 dropbox 吗?想在其他电脑上也可以快速配置……

  •  
  •   ivanlw · Apr 25, 2014 · 6493 views
    This topic created in 4394 days ago, the information mentioned may be changed or developed.
    25 replies    2014-04-28 12:47:55 +08:00
    Ken_Adams
        1
    Ken_Adams  
       Apr 25, 2014
    我是這麼做的:
    1) 把 .vim 文件夾 和 .vimrc 文件都放進 Dropbox
    2) ln -s ~/Dropbox/.vim ~/.vim
    ln -s ~/Dropbox/.vimrc ~/.vimrc

    目前使用良好。
    arbipher
        2
    arbipher  
       Apr 25, 2014
    neevek
        3
    neevek  
       Apr 25, 2014
    你应该用github,像这样,一分钟内搞定所有。

    1) cd ~
    2) git clone https://github.com/neevek/vim.git .vim
    3) cd .vim
    4) git submodule update --init
    5) cp .vimrc ../
    sd4399340
        4
    sd4399340  
       Apr 25, 2014
    用git来管理啊,github上有很多.dotfiles的项目
    fork一个别人的过来自己改改就好~
    我现在Mac上用的这个 https://github.com/PinkyJie/dotfiles
    litanwei
        5
    litanwei  
       Apr 25, 2014
    github都是开放的,有一些不想公开的就没有办法了.
    jakwings
        6
    jakwings  
       Apr 25, 2014
    Bitbucket 提供免费私有仓库。
    xdays
        7
    xdays  
       Apr 25, 2014
    推荐个插件vundle
    ivenvd
        8
    ivenvd  
       Apr 25, 2014
    推荐使用 VAM,这样你只需要保存一个 .vimrc 文件就可以了,插件会自动下载。
    y1
        9
    y1  
       Apr 25, 2014
    @Ken_Adams 不需要把 vimrc 放到 dropbox 文件夹。只把 Symlink 放在 dropbox 中也可以同步的。
    dorentus
        10
    dorentus  
       Apr 25, 2014
    github 又不能自动同步……
    ik0r
        11
    ik0r  
       Apr 25, 2014
    我使用github进行管理, 到了新机器上直接make一下,
    自动安装 vim插件, 配置vimrc zshrc sublime gitconfig

    感兴趣的话,可以看看我的项目 https://github.com/jeremial/dotfile
    Tink
        12
    Tink  
    PRO
       Apr 26, 2014
    dotfile
    Tink
        13
    Tink  
    PRO
       Apr 26, 2014
    cloveryume
        14
    cloveryume  
       Apr 26, 2014
    vundle +1
    anheiyouxia
        15
    anheiyouxia  
       Apr 26, 2014 via Android
    一楼的方法是最简单的,以前我也是这么做的。如果目录多的话可以这个s原来的配置hell,下次重装或者换电脑后可以一键设置好关联。
    只有一个要提醒,小心dropbox不小心用你新的电脑的配置覆盖掉你。
    leebo
        16
    leebo  
       Apr 26, 2014 via Android
    覆盖了也没关系有版本的 可以恢复
    qiukun
        17
    qiukun  
       Apr 26, 2014
    自己写了脚本做 ln -s
    hector
        18
    hector  
       Apr 26, 2014
    推荐个我自己的~
    https://github.com/myourys/Vimrc
    darkbill
        19
    darkbill  
       Apr 26, 2014
    我的方式是,有一个专门的dotfiles文件夹,该文件夹和github同步。
    然后,自己把需要同步的文件都放到这里,写一个脚本,把相关的文件/文件夹`ln -s`到相应的位置上。。。
    不想公开同步的部分,则建立一个文件夹,同步到自己加密的dropbox上面。
    再一个类似的脚本,`ln -s`相关文件过去。

    到了新机器上,建立起相关的环境后,分别从不同的地方把文件同步过来,然后执行相应的脚本即可。
    ensonmj
        20
    ensonmj  
       Apr 27, 2014
    @Ken_Adams stow管理链接,谁用谁知道
    ensonmj
        21
    ensonmj  
       Apr 27, 2014   ❤️ 1
    @qiukun linux有专门的工具干这事,stow
    qiukun
        22
    qiukun  
       Apr 27, 2014
    @ensonmj 给点个赞,目前的方案够用,将来看看
    yishanhe
        23
    yishanhe  
       Apr 28, 2014 via iPad
    spf13-vim 帮你配置好基本的插件,你可以fork之后,添加一些自己的配置,里面有win和linux安装脚本 可以试试
    soli
        24
    soli  
       Apr 28, 2014   ❤️ 1
    Dropbox 会丢文件!重要的文件千万别用 Dropbox。

    ps:遇 Dropbox 必黑之。
    wannianchuan
        25
    wannianchuan  
       Apr 28, 2014
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4171 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 79ms · UTC 10:17 · PVG 18:17 · LAX 03:17 · JFK 06:17
    ♥ Do have faith in what you're doing.