vim-tw / ama

Helping vimmer in Taiwan with any questions.
https://github.com/vim-tw/ama/issues
16 stars 1 forks source link

在 git commit 時出現 Vundle 的套件問題 #2

Closed wildskyf closed 8 years ago

wildskyf commented 8 years ago

如附圖,想問有沒有人有遇過這樣的狀況,以及如何解決。 2015-12-07 12-33-17

我就是一個看到 warning 會不舒服的人…

wildskyf commented 8 years ago

ref: https://github.com/VundleVim/Vundle.vim/issues/675

othree commented 8 years ago

手動升級一下 Vundle

othree commented 8 years ago
cd .vim/bundle/vundle
git pull
wildskyf commented 8 years ago

我的是這個 https://github.com/VundleVim/Vundle.vim 剛剛更新過後還是一樣有問題

othree commented 8 years ago

Follow the readme ~~

call vundle#begin()
wildskyf commented 8 years ago

這個是我目前的設定檔,應該沒錯才對 https://github.com/wi1d5ky/myConfig/blob/master/.vimrc

chusiang commented 8 years ago

我目前在 Debian 8 底下補上 molokai.vim 這個 colorscheme 還有 ctags 後,再設個 vundle 都挺正常的喔!

wildskyf commented 8 years ago

不好意思忘記提供了!

我的環境是這樣 VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 20 2015 09:52:41) Fedora 23

chusiang commented 8 years ago
  1. Cannot find color scheme 'molokai' 是因為 Vim 在 ~/.vim/colors/ 底下找不到 molokai 這個 colorscheme。

    $ mkdir ~/.vim/colors
    $ cp ~/.vim/bundle/Molokai/colors/molokai.vim ~/.vim/colors/
  2. 請附上您的 gitconfig。

    $ cat ~/.gitconfig
wildskyf commented 8 years ago

您一提到 git config 就讓我想起我好像沒有設定 editor 設定過後就沒有了!!!

預設可能是用 vi 所以不認得 vim 的東西 附上修改 editor 的指令:

$ git config --global core.editor vim

感謝 @chusiang !

chusiang commented 8 years ago

@wi1d5ky 在 redhat, fedora, centos 的系統裡,裝好 vim 後是不會取代掉 vi 這個指令。在使用 git commit 時還是會代出 vi 來操作,但因為 vi 不支援寫給 vim 的 plugin 才會造成以上的問題。

解法除了指定 editor 給 git 外,還可以用 bash alias 或 path 來取代 vi。

  1. bash alias.

    $ alias vi='vim'
  2. path.

    $ ln -s /usr/bin/vim /usr/local/bin/vi
wildskyf commented 8 years ago

但我直接在 command line 輸入 vi 時打開的卻是 vim,我記得我好像也沒有做過類似的設定 感謝提供其他方法!!

chusiang commented 8 years ago

試試看在 console 裡輸入 $ \vi 看看。

[root@5d76d90bb044 sandbox]# \vi
Error detected while processing /root/.vimrc:
line   23:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line   26:
E492: Not an editor command: Plugin 'Molokai'
line   27:
E492: Not an editor command: Plugin 'itchyny/lightline.vim'
line   28:
E492: Not an editor command: Plugin 'snipMate'
line   29:
E492: Not an editor command: Plugin 'mattn/emmet-vim'
line   30:
E492: Not an editor command: Plugin 'ap/vim-css-color'
line   31:
E492: Not an editor command: Plugin 'scrooloose/syntastic'
line   32:
E492: Not an editor command: Plugin 'vim-scripts/taglist.vim'
line   33:
E492: Not an editor command: Plugin 'scrooloose/nerdtree'
line   34:
E492: Not an editor command: Plugin 'xolox/vim-misc'
line   35:
E492: Not an editor command: Plugin 'xolox/vim-notes'
line   36:
E492: Not an editor command: Plugin 'cakebaker/scss-syntax.vim'
line  108:
E185: Cannot find color scheme 'molokai'
Press ENTER or type command to continue
wildskyf commented 8 years ago

看起來還是 Vim,不過就像我當時開這個 issue 一樣,出現一堆錯誤訊息。 2015-12-08 14-08-22

chusiang commented 8 years ago

vim 是有分 minimal 跟 enhanced 的,minimal 的話只有基本功能喔!

[root@5d76d90bb044 sandbox]# rpm -qa | grep vim
vim-minimal-7.4.827-1.fc23.x86_64
vim-common-7.4.827-1.fc23.x86_64
vim-filesystem-7.4.827-1.fc23.x86_64
vim-enhanced-7.4.827-1.fc23.x86_64

詳情請自己比對一下 $ vi --version$ vim --version 了。

ps: 在下是使用 docker 建置測試環境的,一般不建議直接使用 root 操作系統。

wildskyf commented 8 years ago

感謝凍仁大大詳細的解說 <( )>

docker 我還沒學,之後有空再來學;P