簡體   English   中英

VIM當前未讀取.vimrc

[英]VIM is not currently reading .vimrc

最近,我在Ubuntu 18.10上安裝了VIM 8.0。 安裝后,我按照以下步驟https://github.com/VundleVim/Vundle.vim准備VIM的插件管理器。

我想將目錄~/.vim和子目錄~/.vim/bundle保存到VIM插件中。 除此之外,還有.vimrc文件( ~/.vim )和vundle.vim( ~/.vim/bundle )。

我對.vimrc做了以下設置

set nocompatible              " be iMproved, required
filetype off                  " required
set number

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

當我嘗試通過:PlugInstall:PluginInstall安裝插件時,vim告訴我沒有這些命令。 我注意到基本設置set number無法正常運行。

經過大量研究,我檢查了:scriptnames

  1: /usr/share/vim/vimrc
  2: /usr/share/vim/vim80/debian.vim
  3: /usr/share/vim/vim80/syntax/syntax.vim
  4: /usr/share/vim/vim80/syntax/synload.vim
  5: /usr/share/vim/vim80/syntax/syncolor.vim
  6: /usr/share/vim/vim80/filetype.vim
  7: ~/.vimrc
  8: /usr/share/vim/vim80/syntax/nosyntax.vim
  9: /usr/share/vim/vim80/plugin/getscriptPlugin.vim
 10: /usr/share/vim/vim80/plugin/gzip.vim
 11: /usr/share/vim/vim80/plugin/logiPat.vim
 12: /usr/share/vim/vim80/plugin/manpager.vim
 13: /usr/share/vim/vim80/plugin/matchparen.vim
 14: /usr/share/vim/vim80/plugin/netrwPlugin.vim
 15: /usr/share/vim/vim80/plugin/rrhelper.vim
 16: /usr/share/vim/vim80/plugin/spellfile.vim
 17: /usr/share/vim/vim80/plugin/tarPlugin.vim
 18: /usr/share/vim/vim80/plugin/tohtml.vim
 19: /usr/share/vim/vim80/plugin/vimballPlugin.vim
 20: /usr/share/vim/vim80/plugin/zipPlugin.vim
 21: /usr/share/vim/vim80/scripts.vim
 22: /usr/share/vim/vim80/syntax/vim.vim
 23: /usr/share/vim/vim80/syntax/lua.vim
 24: /usr/share/vim/vim80/syntax/perl.vim
 25: /usr/share/vim/vim80/syntax/pod.vim
 26: /usr/share/vim/vim80/syntax/ruby.vim
 27: /usr/share/vim/vim80/syntax/python.vim

在我看來vim正在檢查.vimrc

我也嘗試過:set runtimepath

runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

再次顯示出~/.vim的路徑。

我懷疑可能是vundle.vim~/.vim/bundle )或其他問題。

有人可以幫助我嗎?

聽起來您將.vimrc配置放入錯誤的目錄( ~/.vim/ )。

請嘗試將.vimrc文件直接放入您的主目錄。

運行以下命令后,我能夠成功運行:PluginInstall命令:

vim ~/.vimrc          # (Insert vim configuration)
mkdir -p ~/.vim/bundle/
cd ~/.vim/bundle/
git clone https://github.com/VundleVim/Vundle.vim

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM