Vim vundle colorschemes - vimrc - vim

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.

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 :)

Vundle doesn't load plugin

This is my .vimrc located under $HOME/.vimrc. I've installed Vundle.
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()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'dracula/dracula-theme'
call vundle#end() " required
filetype plugin indent on " required
" Put your non-Plugin stuff after this line
I'm able to execute :PluginInstall successfully installing dracula-theme. Unfortunately the theme is not applied and the style remains unchanged? Any clues?
Adding Plugin 'dracula/dracula-theme' to your vimrc and using :PluginInstall make the colorscheme available to Vim but it doesn't say to Vim to use it.
As #dNitro said in the comment you have to use the command colorscheme to set the desired colorscheme. Thus you need to add a line colorscheme dracula to your vimrc after the line " Put your non-Plugin stuff after this line.

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

A few JSHint/Syntastic questions for Vim

I'm using Vim with Syntastic and JSHint, and there are a few bits of glitchy behavior that I'd like to fix.
Whenever I modify the last character on a line of text and save (:w), I momentarily see "^M" flash after the text before (sometimes) vanishing. Sometimes it sticks around and I have to manually delete it. What's the deal with this and how do I prevent it?
When there is an error in the quickfix view, how do I toggle focus between the quickfix view and the Vim editor window?
Vim crashes maybe once per minute, and I haven't the slightest clue as to why, but it's extremely annoying. The error typically reads "Vim: Caught deadly signal ABRT Vim: Finished. [1]6099 abort vi gulpfile.js" How do I prevent this?
Here is my .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/'}
" Avoid a name conflict with L9
"Plugin 'user/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
" React.js/JSX syntax highlighting
"Plugin 'mxw/vim-jsx'
"
"JSHint
Plugin 'wookiehangover/jshint.vim'
"Syntastic
Plugin 'scrooloose/syntastic'
"Syntastic configuration
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_html_tidy_exec = 'tidy5'
let g:syntastic_javascript_checkers = ['jshint']
let g:JSHintHighlightErrorLine = 0
syntax on
set t_Co=256
set ai
set shiftwidth=4
set tabstop=4
set number
"colorscheme monokai
colorscheme skittles_berry
Thanks for any help you can provide.
I have no idea where your ^M issue and your crashing issue come from but you don't need such a huge plugin for such a simple task.
Create ~/.vim/after/ftplugin/javascript.vim if it doesn't exist and paste the lines below:
errorformat for jshint
setlocal errorformat=%f:\ line\ %l\\,\ col\ %c\\,\ %m,%-G%.%#
tell Vim to use jshint for the :make command
setlocal makeprg=jshint
add an autocommand to run :make on the current file upon write, the | silent wincmd p at the end switches the focus back to the editing window once the quickfix window is opened
autocmd! BufWritePost <buffer> silent make % | silent redraw! | silent wincmd p
I've never experienced a single crash with that simple setup, or that ^M issue.
With that in place you should get something like that after :w:
To move the focus from/to the quickfix window, use <C-w>p.
To jump to the previous/next error without using the quickfix window, use :cprevious/:cnext.
Reference:
:help 'errorformat'
:help 'makeprg'
:help autocmd
:help bufwritepost
:help :silent
:help :redraw
:help :wincmd
:help quickfix
Also, check out this great post: The Power of Vim

Resources