bottom custom oh-my-zsh like statusbars for vim - vim

I saw this picture in one of the CodeSchool's Screencast. #GreggPollack has customised his vim to look like one in the bottom picture.
I really like this bottom strip and that syntax highlighting for insert and other stuff on bottom command strip. I have the same strips for $prompts for my terminal with oh-my-zsh agnoster theme. How would I do that for vim?

The "bottom strip" is called statusline and its customization options are described in the following help page :help 'statusline'.
But most people prefer to use plugins for this purpose, which already include extensions that automatically fill in the statusline with extra information related with the currently opened file. The information displayed typically depend on the plugins under use.
The two most famous plugins for statusline configuration are:
Powerline
Airline

Related

Vim/YCM - change warning highlight color

I'm using the YouCompleteMe plugin for vim on Mac OSX, primarily for C++. Right now it highlights both errors and warnings in a pinkish color, but I want warnings to be highlighted in a yellow-ish sort of color. I think I'm supposed to place these 3 lines somewhere:
highlight YcmWarningLine guibg=#ffffcc
highlight YcmWarningSign guibg=#ffffcc
highlight YcmWarningSection guibg=#ffffcc
Problem is I don't know which file to place them in. Where do I place them, and in general am I going about this the right way?
Highlight groups are global, only the syntax definitions that parse individual filetypes are specific. Syntax scripts canonically use :hi def to avoid overriding group definitions already customized by the user. Therefore, it is sufficient to place those commands into your ~/.vimrc, but after any :colorscheme command.
If you switch colorschemes on the fly (without restarting Vim), you'll notice that your custom highlightings will disappear. To keep them, you additionally need to reinstall them. Duplicate the :hi commands and prepend
:autocmd ColorScheme *
to them.
Those and other vim configuration settings should be added to your ~/.vimrc.

GVIM : in /root/.vimrc i have ":colorscheme desert" which worked, but where would i have found this value if someone hadn't told me?

So in GVIM i changed the color-scheme to
desert
but i never understood how to find this line
:colorscheme desert
so i could place it in
/root/.vimrc
file.
where would i have found out about " :colorscheme desert " ?
You could read the help (it is quite long and very detailed)
:h
Opens up to the main help for vim. Under getting started you will see the following. You might have to scroll down a bit (Use Control+f to page down)
usr_toc.txt Table Of Contents
Getting Started
usr_01.txt About the manuals
usr_02.txt The first steps in Vim
usr_03.txt Moving around
usr_04.txt Making small changes
usr_05.txt Set your settings
usr_06.txt Using syntax highlighting
usr_07.txt Editing more than one file
usr_08.txt Splitting windows
usr_09.txt Using the GUI
usr_10.txt Making big changes
usr_11.txt Recovering from a crash
usr_12.txt Clever tricks
It seems the that usr_06.txt is related to syntax highlighting so that might be worth reading. So type :h usr_06.txt or <c-]> (Control+]) to jump to that file when your cursor is on top of it.
Once you are in there you can look at the table of contents again.
06.1 Switching it on
06.2 No or wrong colors?
06.3 Different colors
06.4 With colors or without colors
06.5 Printing with colors
06.6 Further reading
Different colors seems to be what you want. So type :h 06.3 (or <c-]>) and the first paragraph talks about changing the colorscheme.
Control+] jumps to a tag and is talked about in :h tagsrch.txt (And on the line "Jump to a subject" immediately as you open :h)
The help have an auto completion feature.
So you can type, :help color followed by Ctrl+d. You won't necessary find the good entry right of the bat but it should put you on the right track. It would have shown you a colorscheme option.
An alternative is to use :helpgrep. :helpgrep color should give you a list of help file wich contains the string color.
On Debian Linux, it's part of the the vim-runtime package and sits in /usr/share/vim/vim73/colors/desert.vim. You can list contents of this direcory for more options. I don't think they have hard-coded color schemes in vim itself, so vim help will not list them for you.
I suppose like most other vim plugins, customized color schemes can also be put in ~/.vim directory.

Mac OSX Terminal Vim displays javascript code with weird and horrid shade

I develop javascript and just recently I found that I still love to use Terminal Vim instead of MacVim. Then I was totally annoyed when I opened my usual javascript file in the Terminal Vim: the statements of the code are irregularly highlighted with a mysterious color.
Just to clarify that other file types I have opened (e.g. c, html etc.) do not have the problem. I have scoured website but I could not find an answer. This is just so unacceptable, could someone help me out. A million thanks!
My .vimrc screen shot:
You appear to be using Syntastic.
The first line with the red background seems to be marked as an error.
The Error highlight group is very often set to use a red background.
My conclusion is that what you see is exactly what you should see. It is ugly on purpose and designed to look like that: you don't want to miss errors, do you?
However, Syntastic can be set to not use the Error highlighting to mark errors but the "signs" feature instead which is a lot less ugly.
You should have read the Syntastic documentation as it is all explained in plain english:
:help syntastic-error-signs
Also, set background=dark is not very useful (it doesn't change the background color, if that's what you want) and can be removed safely from your ~/.vimrc.
I found out that it was this plugin jslint.vim that caused the text to be highlighted. The problem is that this plugin could not be disabled properly which I thought I did. Thanks to the hint of #romaini, syntactic is a better plugin to check code errors and make proper configuration.
As a side note, for those who would like to use vim solarized color scheme, please use the solarized terminal color scheme first. Otherwise the color scheme won't be displayed properly.
Thank you for all of your comments and answers! Really appreciated.
Try changing your colorscheme. Open the file in Vim, then do
:colorscheme blink
To cycle through all possible colourschemes, type :colorscheme, then a space, then press Tab. When you reach a colorscheme that sounds promising, press Enter, and see if the text looks OK. Keep doing this until you find a colorscheme that you like.
Once you have found a colorscheme that you like, copy its name, and put the following in your .vimrc:
colorscheme name
(name is the name of the colorscheme you like.)
My favourite colorscheme is blink, but there are many good ones. You can even go online and download new ones if the defaults are not good enough.
Seems the syntax are not recognized correctly. Could you try:
:set filetype=javascript
One other thing to look at to make things look better (will change colors not highlighting). Make sure that your terminal reports itself as xterm-256colors. You can check this by typing echo $TERM.
If it doesn't return xterm-256colors go to Preferences -> Settings -> Advanced (tab) on the profile you are using.
Change the drop down at the top to xterm-256colors.

Codefolding / Indent guides in Vim?

During a research for useful vim plugins I found a screenshot of a vim window showing some kind of dotted guides highlighting either indentation or folds. I'm not sure about what they highlight actually.
Does anyone know which plugin generates these guides and what their purpose is?
You can find the screenshot right here: http://oi54.tinypic.com/2yysefm.jpg
If you use tabs to indent your code, you can use the 'list' option to make your tabs visible.
In your ~/.vimrc:
set list
set listchars=tab:┊\ <-- don't forget the trailing space.
Obviously, this will work only if Vim supports utf-8.

How to set manualy color of params[] and redirect_to in Vim?

This is my colorscheme -> https://gist.github.com/1973544
But in example screenshot of sexy-railscasts: https://github.com/oguzbilgic/sexy-railscasts-theme
params[] and redirect_to are colored.
How to achieve this?
EDIT: Problem is with filetypes. Releated -> Ultisnips break rails syntax. How to setup correctly?
This colorscheme is, as specified in its header, "A GUI Only port of the RailsCasts TextMate theme to Vim.".
GUI colorschemes (for GVim or MacVim) can make use of thousands of colors. If you want to make Vim look like in the official screenshot you'll need to use GVim.
But you appear to be using it in a terminal emulator which can only display a maximum of 256 colors. For this "GUI Only" colorscheme to even work in your terminal, you probably have a color conversion plugin like CSApprox, do you? Such plugins will do their best to match your GUI colors to their closest equivalent in the X11 set but this task is obviously not foolproof. Some colors may be frankly off and I'm almost certain that's what's happening here.
EDIT
First, I don't do Ruby, even on Rails.
Second, the syntax group of params in params[:comment] depends on the filetype:
if I have :set ft=ruby.rails:
rubyBlock, rubyMethodBlock, rubyLocalVariableOrMethod
if I have :set ft=ruby:
rubyBlock, rubyMethodBlock, rubyRailsMethod
The problem is that rubyLocalVariableOrMethod, as defined in the default ruby syntax file appears to not being linked to Function unlike rubyRailsMethod, from the rails plugin.
So I think that it's the rubyLocalVariableOrMethod that is causing problems. I've been looking around on my machine and can't seem to find how, why and by whom it is set instead of rubyRailsMethod when ft=ruby.rails.
While waiting for a real solution, there is a global setting for using rails completion when :set ft=ruby, I think it should help: let g:rubycomplete_rails = 1.
I believe that is from the rails.vim plugin.

Resources