source % is not an editor command in vim? - vim

Error detected while processing /home/USER/.vimrc:
line 31:
E492: Not an editor command: bundle ‘vim-ruby/vim-ruby'
I need help. I switched to vim and its been hell as of now. I dont even know whats going on since morning trying to find out what am i doing wrong.
1 set number
2
3 set nocompatible " be iMproved, required
4 filetype off " required
5
6 " set the runtime path to include Vundle and initialize
7 set rtp+=~/.vim/bundle/Vundle.vim
8 call vundle#begin()
9 " alternatively, pass a path where Vundle should install plugins
10 "call vundle#begin('~/some/path/here')
11
12 " let Vundle manage Vundle, required
13 Plugin 'VundleVim/Vundle.vim'
14
15 " The following are examples of different formats supported.
16 " Keep Plugin commands between vundle#begin/end.
17 " plugin on GitHub repo
18 Plugin 'tpope/vim-fugitive'
19 " plugin from http://vim-scripts.org/vim/scripts.html
20 " Plugin 'L9'
21 " Git plugin not hosted on GitHub
22 Plugin 'https://github.com/wincent/Command-T.git'
23 " git repos on your local machine (i.e. when working on your own plugin)
24 " The sparkup vim script is in a subdirectory of this repo called vim.
25 " Pass the path to set the runtimepath properly.
26 Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
27 " Install L9 and avoid a Naming conflict if you've already installed a
28 " different version somewhere else.
29 " Plugin 'ascenator/L9', {'name': 'newL9'}
30
31 bundle ‘vim-ruby/vim-ruby'
32 " All of your Plugins must be added before the following line
33 call vundle#end() " required
34 filetype plugin indent on " required
35 " To ignore plugin indent changes, instead use:
36 "filetype plugin on
37 "
38 " Brief help
39 " :PluginList - lists configured plugins
40 " :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
41 " :PluginSearch foo - searches for foo; append `!` to refresh local cache
42 " :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
43 "
44 " see :h vundle for more details or wiki for FAQ
45 " Put your non-Plugin stuff after this line

You are using the wrong command to install the vim-ruby plugin. You can refer to the project's documentation for more details. As for your .vimrc, the correct installation with Vundle should be like this:
call vundle#begin()
Plugin 'vim-ruby/vim-ruby'
call vundle#end()
After modifying your .vimrc, run the :PluginInstall command from within vim.

Related

Easy way to get syntax highlighting for Julia in Vim

I am trying to get Julia to have syntax highlighting in Vim. Unfortunately, at the moment, I there is no syntax highlighting (here is a small snippet of my code so you can see what it currently looks like). I tried installing julia-vim and putting it in the .vimrc file and installing it, but it doesn't actually change the highlighting. Below is the .vimrc file:
set nocompatible " be iMproved, required
filetype off " required
" 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
"
Plugin 'JuliaEditorSupport/julia-vim'
"
"
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
I'm also note sure how to fix it after reading the julia-vim documentation. Am I doing anything incorrectly, or is there another way to add some syntax highlighting to Julia?
I have seen from one of the answers to this question asked by #Thomas that it might be how I have set up my terminal, but I'd prefer to keep the terminal with the present color scheme if possible. See here for my current settings.
EDIT: Thanks to #axwr, I was able to get some syntax highlighting by putting
syntax on
at the end of the .vimrc file and then running
:so %
while editing the .vimrc file. However, as you can see here, the color coding seems to be less than ideal. Only certain packages come up as yellow, the majority is still green, and random things (usually numbers) come up as purple. Is this how julia-vim colors things, or am I doing something wrong?
Okay, so.
There are two steps to syntax highlighting in Vim; actually turning it on, and, having the ability to highlight the specific language you want to work in. For most languages vim can do this by default, however some languages, like Julia, require a little help. In this case you have done step two by using vundle to install a Julia plugin.
To acheive step one, you just need the line: syntax on in your vimrc file.
A minimal example vimrc for you, might look like:
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'JuliaEditorSupport/julia-vim'
call vundle#end()
set nocompatible
set backspace=indent,eol,start
set number
set hidden
syntax on
filetype plugin indent on
Given the above settings, and a terminal that has the "solarised" colorscheme, a julia file looks like:
Here is the little fizzbuzz julia snippet so you can compare against your highlighting:
for i in 1:100
if i % 15 == 0
println("FizzBuzz")
elseif i % 3 == 0
println("Fizz")
elseif i % 5 == 0
println("Buzz")
else
println(i)
end
end
So, Step by step:
Add syntax on to your .vimrc
Add filetype plugin indent on to your .vimrc
Install the relevant plugin
Source your .vimrc or close vim.
open a file with the correct extension, i.e: test.jl

How to Keep Syntax Color but Disable Highlighting in Vim?

I recently activated auto-complete and syntax color in Vim. However, a red highlighting color appeared.
I tried to disable syntax color with syntax off, but this highlighting color is still there.
Here's my ~/.vimrc
syntax on
set nocompatible " be iMproved, required
filetype on " required
" 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'
Plugin 'ycm-core/YouCompleteMe'
" 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
:set number
It's hard to see my code with color highlights. I want to keep the syntax color, but without the highlighting. I couldn't find the setting in ~/.vimrc. How do I disable this ?
Apparently, this is from auto-completion. As mentioned in YouCompleteMe github about Diagnostic UI,
This turns on YCM's diagnostic display features including like the gutter signs, text highlighting, diagnostic echo and auto location list population. To disable this, I put :
let g:ycm_show_diagnostics_ui = 1
and the highlights are gone.
Have you tried googling first? Highlighting can be turned off easily with :noh, alternatively you can use :let #/="", as mentioned here, one of the first google search results... You can map these commands to some shortcuts in your .vimrc (I personally use ,/ combination to disable highlighting)
:noh command does not affect syntax colouring. Is this what you need?
EDIT:
I am sorry, I didn't see the pictures, as they are blocked on network I am currently connected to. This looks more like the syntax check. Try :set nospell instead :)

Vim shows "Press ENTER or type command to continue” when start

VIM starts with a message "Press ENTER or type command to continue", it happens for VIM, but not GVIM, GVIM starts without showing "Press ENTER or type command to continue”.
The Vundle settings in my .vimrc file, OS is windows 7.
"""""""""""""""""""""""""""Vundle start"""""""""""""""""""""""""""""""""
" set the runtime path to include Vundle and initialize
set rtp+=C:/Users/penpan/.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'
" 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/'}
" Avoid a name conflict with L9
Plugin 'user/L9', {'name': 'newL9'}
"NERDTree
Plugin 'https://github.com/scrooloose/nerdtree.git'
"color scheme molokai
Plugin 'tomasr/molokai'
"Match Tag
Plugin 'Valloric/MatchTagAlways'
"ctags
Plugin 'szw/vim-tags'
" 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
""""""""""""""""""""""""""""End Vundle"""""""""""""""""""""""""""""""""
I comment this line:
call vundle#end() " required
Then it is ok! VIM starts without showing press enter prompt. so I believe this call makes the prompt happening. I add silent! in front of it as below:
silent! call vundle#end()
but no use, VIM still show the prompt.
and add below in .vimrc:
set shortmess+=T
set cmdheight=2
does not work.
I tried to find answer in google, fine many suggestions, but none of them work :(
Vundle is a common plugin, has anyone have the same question with me?
Appreciate if you can help.
only if I remove below, the press enter prompt disappears:
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
""""""""""""""""""""""""""""End Vundle"""""""""""""""""""""""""""""""""
colorscheme molokai "because molokai is installed by Vundle, so it only work after Vundle is lunched!
=================================fixed====================================
after I remove plugin MatchTagAlways in vundle config, issue fixed.below is the steps I find the issue:
firstly, you need to know what config area cause the issue, for me, it is the config of Vundle.
add :redraw! after call vundle#begin() and call vundle#end()
open vim, it will show the error message above the press enter message
before:
Press ENTER or type command to continue
after:
MatchTagAlways unavailable: requires python.
Press ENTER or type command to continue
now we get the root cause. fix it, or remove the plugin.
ps: gvim has +python3/dyn support, but vim haven't. so vim have the error if plugin MatchTagAlways installed.
set shortmess=a in your .vimrc should stop that.
This wiki appears to be the authority on the issue:
http://vim.wikia.com/wiki/Avoiding_the_%22Hit_ENTER_to_continue%22_prompts

Vim Color Scheme Plugin Not Working

I am trying to setup Vim with Vundle and I am right now trying to use the color scheme plugin for Vundle. However, whenever I try to source and save my ~/.vimrc file, it tells me that the color scheme that I am trying to use is not a valid color scheme. Note: when I source my ~/.vimrc file, the color scheme works but I get an error that:
Vundle error: Name collision for Plugin VundleVim/Vundle.vim.
Plugin VundleVim/Vundle.vim previously used the name "Vundle.vim".
Skipping Plugin VundleVim/Vundle.vim.
and an error that:
Error detected while processing function vundle#config#bundle..<SNR>8_check_bundle_name
My ~/.vimrc file:
1 set nocompatible " be iMproved, required
2 filetype off " required
3
4 " set the runtime path to include Vundle and initialize
5 " set rtp+=~/.vim/bundle/Vundle.vim
6 " call vundle#begin()
7 " " alternatively, pass a path where Vundle should install plugins
8 " "call vundle#begin('~/some/path/here')
9 "
10 " " let Vundle manage Vundle, required
11 Plugin 'VundleVim/Vundle.vim'
12 Plugin 'flazz/vim-colorschemes'
13 "
14 " " All of your Plugins must be added before the following line
15 " call vundle#end() " required
16 " filetype plugin indent on " required
17 "
18
19 " Some settings to enable the theme:
20 set number
21 syntax enable
22 set background=dark
23 colorscheme molokai

Vim vundle colorschemes - vimrc

Hi I have been trying to configure vim on ubuntu.
All the packages seem to install fine. However if installing a colorscheme via vundle and then using colorscheme name it doesn't appear to find the scheme.
I have attempted to install railscasts, solarized and desert-warm but all have failed to load.
This is my .vimrc am I doing something wrong?
set nocompatible " be iMproved
filetype off " required!
colorscheme desert-warm
" next tab
map <F7> :tabn
" previous tab
map <F8> :tabp
" Close Tab abd save
map <F9> ZZ
" open and edit file
map <F6> :tabedit
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
" My Bundles here:
"
" original repos on github
Bundle 'tpope/vim-fugitive'
Bundle 'Lokaltog/vim-easymotion'
Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
Bundle 'tpope/vim-rails.git'
Bundle 'desert-warm-256'
" vim-scripts repos
Bundle 'L9'
Bundle 'FuzzyFinder'
" non github repos
Bundle 'git://git.wincent.com/command-t.git'
Bundle 'https://github.com/vim-scripts/perl-support.vim.git'
Bundle 'https://github.com/Raimondi/delimitMate.git'
Bundle 'https://github.com/altercation/vim-colors-solarized.git'
Bundle 'https://github.com/jpo/vim-railscasts-theme.git'
" ...
filetype plugin indent on " required!
"
" Brief help
" :BundleList - list configured bundles
" :BundleInstall(!) - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed..
Try moving the colorscheme call to the end of the file.
Also, the color scheme name from your example doesn't work for me—it should be colorscheme desert-warm-256. To see a list of color schemes currently installed, try entering :colorscheme <TAB> interactively.
I think the answer to this question is that there is no call vundle#end() or syntax on in the original poster's .vimrc.
Adding these two lines and for example the colorscheme solarized line anywhere after the call vundle#end() would have solved the issue.
colorscheme desert-warm must come after Bundle 'desert-warm-256' since it is the Bundle command that adds things to the path:
Bundle 'desert-warm-256'
colorscheme desert-warm
Source: same question on GitHub issue.
Note: Vundle has recently (2014-03-18) swapped to using Plugin instead of Bundle, so after you git pull it will be:
Plugin 'desert-warm-256'
colorscheme desert-warm
You should write your "colorsheme desert bla bla" line AFTER the Plugin line. Because Vundle first needs to install this color plugin, and after than it can use it. Sorry my tiresome English.

Resources