VundleVim / Vundle.vim

Vundle, the plug-in manager for Vim
http://github.com/VundleVim/Vundle.Vim
MIT License
23.93k stars 2.57k forks source link

set rtp+=~/.vim/bundle/Vundle.vim #887

Open whzh01 opened 5 years ago

whzh01 commented 5 years ago

when I use the set in .vimrc , the vundle couldn't start. if I use set rtp =~/.vim/bundle/Vundle.vim, it works well. But the color of the code in vim is black and white. I want to know why?

environment: ubuntu 18.10 The .vimrc file `1 " YCM 2 " 允许自动加载.ycm_extra_conf.py,不再提示 3 let g:ycm_confirm_extra_conf=0 4 " 补全功能在注释中同样有效 5 let g:ycm_complete_in_comments=1 6 " 开启tags补全引擎 7 let g:ycm_collect_identifiers_from_tags_files=1 8 " 键入第一个字符时就开始列出匹配项 9 let g:ycm_min_num_of_chars_for_completion=1 10 " YCM相关快捷键,分别是\gl, \gf, \gg 11 nnoremap gl :YcmCompleter GoToDeclaration 12 nnoremap gf :YcmCompleter GoToDefinition 13 nnoremap gg :YcmCompleter GoToDefinitionElseDeclaration 14 15 """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 16 " Vundle 17 set nocompatible " be iMproved, required 18 filetype off " required 19 "打开语法高亮 20 syntax on 21 " set the runtime path to include Vundle and initialize 22 set rtp =/.vim/bundle/Vundle.vim 23 call vundle#begin() 24 " alternatively, pass a path where Vundle should install plugins 25 "call vundle#begin('/some/path/here') 26 27 " let Vundle manage Vundle, required 28 Plugin 'VundleVim/Vundle.vim' 29 Plugin 'scrooloose/syntastic' 30 " 下面安装的三个插件是完善代码补全功能的 31 Plugin 'DfrankUtil' 32 Plugin 'Valloric/YouCompleteMe' 33 Plugin 'vimprj' 34 Plugin 'indexer.tar.gz' 35 " The code color file 36 Plugin 'jonathanfilip/vim-lucius' 37 " The following are examples of different formats supported. 38 " Keep Plugin commands between vundle#begin/end. 39 " plugin on GitHub repo 40 "Plugin 'tpope/vim-fugitive' 41 " plugin from http://vim-scripts.org/vim/scripts.html 42 "Plugin 'L9' 43 " Git plugin not hosted on GitHub 44 "Plugin 'git://git.wincent.com/command-t.git' 45 " git repos on your local machine (i.e. when working on your own plugin) 46 "Plugin 'file:///home/gmarik/path/to/plugin' 47 " The sparkup vim script is in a subdirectory of this repo called vim. 48 " Pass the path to set the runtimepath properly. 49 "Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} 50 " Avoid a name conflict with L9 51 "Plugin 'user/L9', {'name': 'newL9'} 53 " All of your Plugins must be added before the following line 54 call vundle#end() " required 55 "务必启用语法 56 syntax enable 57 filetype plugin indent on " required 58 " To ignore plugin indent changes, instead use: 59 "filetype plugin on 60 " 61 " Brief help 62 " :PluginList - lists configured plugins 63 " :PluginInstall - installs plugins; append ! to update or just :PluginUpdate 64 " :PluginSearch foo - searches for foo; append!to refresh local cache 65 " :PluginClean - confirms removal of unused plugins; append!` to auto-approve removal 66 " 67 " see :h vundle for more details or wiki for FAQ 68 " Put your non-Plugin stuff after this line 69 70 "----------------------以下为原配置文件-------------------- 71 72 " This line should not be removed as it ensures that various options are 73 " properly set to work with the Vim-related packages available in Debian. 74 runtime! debian.vim 75 76 " Vim will load $VIMRUNTIME/defaults.vim if the user does not have a vimrc. 77 " This happens after /etc/vim/vimrc(.local) are loaded, so it will override 78 " any settings in these files. 79 " If you don't want that to happen, uncomment the below line to prevent 80 " defaults.vim from being loaded. 81 " let g:skip_defaults_vim = 1 82 " print the line 83 set nu 84 set cindent 85 set autoindent 86 set nocompatible 87 " Uncomment the next line to make Vim more Vi-compatible 88 " NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous 89 " options, so any other options should be set AFTER setting 'compatible'. 90 "set compatible 91 92 " Vim5 and later versions support syntax highlighting. Uncommenting the next 93 " line enables syntax highlighting by default. 94 if has("syntax") 95 syntax on 96 endif 97 98 " If using a dark background within the editing area and syntax highlighting 99 " turn on this option as well 100 "set background=dark 101 102 " Uncomment the following to have Vim jump to the last position when 103 " reopening a file 104 "if has("autocmd") 105 " au BufReadPost * if line("'"") > 1 && line("'"") <= line("$") | exe "normal! g'"" | endif 106 "endif 107 108 " Uncomment the following to have Vim load indentation rules and plugins 109 " according to the detected filetype. 110 "if has("autocmd") 111 " filetype plugin indent on 112 "endif 113 114 " The following are commented out as they cause vim to behave a lot 115 " differently from regular Vi. They are highly recommended though. 116 "set showcmd " Show (partial) command in status line. 117 "set showmatch " Show matching brackets. 118 "set ignorecase " Do case insensitive matching 119 "set smartcase " Do smart case matching 120 "set incsearch " Incremental search 121 "set autowrite " Automatically save before commands like :next and :make 122 "set hidden " Hide buffers when they are abandoned 123 "set mouse=a " Enable mouse usage (all modes) 124 125 " Source a global configuration file if available 126 if filereadable("/etc/vim/vimrc.local") 127 source /etc/vim/vimrc.local 128 endif 129

DiegoBneiNoah commented 5 years ago

I had a similar problem. Actually I still have it. I have followed the instructions to set up my .vimrc, and after setting up my .vimrc I then run the command: PluginInstall inside the vim. The output I get is E492: Not an editor command: PluginInstall. This first time I opened the Vim in the shell terminal of my Arch Linux, and my pwd command shows me that I was in any folder outside ~ / .vim / bundle / Vundle.vim. So I go through the terminal in the ~ / .vim / bundle / Vundle.vim folder and run the PluginInstall command inside of vim (I sempro call vim from the terminal, eg [diego @ Arch-Linux test] $ vim file.name ), and I do not know what the reason the command executes without problems. I'm not sure if the problem is my policy (policykit) in my / etc / sudoers file, but I've been noticing that Arch Linux is already installed natively with Vim, its location is according to the command: set runtimepath? at runtimepath = ~ / .vim, / usr / local / share / vim / vimfiles, / usr / local / share / vim / vim81, /usr/local/share/vim/vimfiles/after/~vv/after ( note: the ~ / .vim folder, I created it during the "git clone https://github.com/VundleVim/Vundle.vim.git ~ / .vim / bundle / Vundle.vim" process. that the version of my vim is vim81 and is located in / root / usr / local / share / vim / as well as the customization files of it (/ usr / local / share / vim / vimfiles / after). I came but anyway would like someone's opinion if these facts are strange or not, I say in regards to the PluginInstall command not being found when I try to run it on the shell terminal outside the ~ / .vim / bundle / Vundle.vim folder (location of my vimrc is /home/diego/.vim/.vimrc, I use .vimrc to follow a pattern)

DiegoBneiNoah commented 5 years ago

it seems I discovered what was the situation that was preventing me from using the command: PluginInstall. Apparently the problem was that I was using Vim from the Shell terminal as "root". I gave the exit command to return to the common user and the PluginInstall command returned to work again. I will try to find in the documentation some warning about not using the command: PluginInstall as root, I think I have read about it but I do not remember.

kscott5 commented 3 years ago

@DiegoBneiNoah I had a similar issue with a Docker container. The creation of a new user with adduser resolved my problem. Thanks. Your comment did help.