36

Unified answer: If you are using tabs I'd try using listchars: :set listchars=tab:\|\ :set list note: there is a space after the last \ above. This method is good because it uses Vim's built-in support for showing this kind of thing. Example output: | if (1) { | | func(); | } However, this doesn't work for leading spaces. As ...


27

What happens when you :set background The basic mechanism by which :set background works is actually pretty simple, and it is documented (although not particularly clearly) in :help 'background'. When 'background' is set Vim will adjust the default color groups for the new value. But the colors used for syntax highlighting will not change. ...


21

You can change it in your vimrc. The currently focused window is highlight group Statusline, other windows are StatuslineNC. Example for terminal Vim: hi StatusLine ctermfg=8 ctermbg=2 cterm=NONE hi StatusLineNC ctermfg=2 ctermbg=8 cterm=NONE For the GUI, use guifg and guibg.


17

The easiest way is to use :help c_Ctrl-d after :colorscheme. So, :colorschemeCtrl-d will output the colorschemes you have available to you.


17

For the sake of completeness, there is also the Indent Guides plugin, which shows the indentation levels by alternating the colors of white spaces. It requires version 7.2 or later. Since it uses the tabstop and shiftwidth variables, it will probably work for your indentation settings right away. Once the plugin is installed, you can simply use:...


16

Another option I use, which isn't exactly what you asked for, but accomplishes the same purpose of making it easier to see what is in the same column, is to set the following in your vimrc: set cursorcolumn set cursorline This has the trade off that you have to move your cursor to the column you want to see, but you get less visual clutter. Usually when I ...


14

Colorscheme locations First, Vim looks in its runtime folders for a colors directory. Here is where all the colorschemes should be stored (:help 'runtimepath') This means you will need one file that lives in the ~/.vim/colors folder. Default colorschemes are located in $VIMRUNTIME/colors, where $VIMRUNTIME is usually /usr/share/vim/vim74 or the /usr/local/...


14

Lets fail with Style! silent! colorscheme evening silent! colorscheme solarized The :silent! will ignore the errors at start up. Just put color schemes in reverse order of what you really want. For more help see: :h :silent


13

I use this snippet from Damian Conway's fantastic talk, More Instantly Better Vim (at 4m 59s). It causes the entire highlight to blink briefly when you leap between search results. " Damian Conway's Die Blinkënmatchen: highlight matches nnoremap <silent> n n:call HLNext(0.1)<cr> nnoremap <silent> N N:call HLNext(0.1)<cr> function! ...


13

It's certainly possible to use a different background colour for syntax-highlighted elements. Just define the guibg and ctermbg colours in your hilight command. The former sets the background colour for GUI Vim, and the latter for terminal Vim. However, this has the important limitation that it can only set the background colours for characters that ...


13

Since Vim 8 there is the EndOfBuffer highlight group for this; from :help hl-EndOfBuffer: EndOfBuffer filler lines (~) after the last line in the buffer. By default, this is highlighted like hl-NonText. For earlier Vim versions it's NonText. From :help hl-NonText: NonText '~' and '@' at the end of the window, characters from ...


13

The colors are controlled by these four highlight groups (:help hl-DiffAdd): DiffAdd diff mode: Added line DiffChange diff mode: Changed line DiffDelete diff mode: Deleted line DiffText diff mode: Changed text within a changed line These are typically defined by a color scheme, but you can customize them in your ~/.vimrc (after the :colorscheme ...


10

There's two reasons why I think this may be happening: The solarized color scheme you are using does not declare ctermfg and ctermbg for any of the features you want to highlight. Try out this color scheme, should look essentially the same both inside your terminal and gvim, if this is the case then you may need to look into using a color scheme that ...


10

PuTTY, like other high-color terminals, only supports a fixed color palette of 256 colors. GVIM can use the full 24-bit RGB color space; that's why you see "finer" nuances there. As for attributes, GVIM offers undercurl, which is not present in any terminal, and free mixture of bold (depending on configuration shown with lighter color instead) and italic (...


10

Main Issue The main problem you are experiencing is caused by the ordering of the commands in your .vimrc. You set the g:impact_transbg variable after you load the colorscheme, and so the variable does not exist when checked by the colorscheme's if statement, and the second version of the colorscheme (in the else block) is used. To fix, you simply need to ...


9

I've found the indentLine plugin to be the best for this. You do need a font with the appropriate symbols though, I find Consolas on Windows and Menlo on Mac OS X work well. As is pointed out in the unified answer above, it works by (ab)using vim's conceal feature to put vertical bars (from the font used) in the right place. I'm pretty happy with this ...


9

Because I was curious how well this would work, I've hacked something together that sort of works. As mentioned in the comments on the earlier answer, the only way to do this is to fill up regions with spaces; which is exactly what we do; before write, we remove these spaces, so you shouldn't be bothering anyone else with it. Note that this example is very ...


9

Try this function : function! SignKeyword() silent! sign undefine todo sign define todo text=>> texthl=Search g/\v\C(<TODO>|<FIXME>)/execute "sign place 9999 line=" . line('.') \ . " name=todo buffer=" . bufnr('') nohlsearch endfunction Now call the function on the command line : :call SignKeyword() Or add a ...


9

One quick fix is to disable syntax highlighting. Sometimes the code syntax highlighting will cause the foreground text to be the same color as the vimdiff background color, making the text "invisible". :syntax off If you want to automatically do this for vimdiff, then add this to the end of your ~/.vimrc: if &diff syntax off endif


8

The elflord colorscheme does set background=dark. Since it is sourced after your set bg=light it will override it. set t_Co=256 is pointless. It doesn't do anything in GVim and you should set your terminal emulator up properly instead. Also, elflord only uses basic ANSI colors in color terminals so it doesn't really matter if you force Vim to see 256 colors ...


8

Another way to show the list is by set wildmenu. With this, after :colorscheme + space + tab, a list of completion is displayed and also selectable with arrow key or Ctrl-N and Ctrl-P. This is not only work on colorscheme, but also on other cmdline completion. The behavior is affected by wildmode and better set to the default value full.


8

When you run vim with sudo, you are running as user root, so you are using root's vimrc and .vim. Your colorscheme and other customizations set in your ~/.vimrc are not being used. You can see this by executing :scriptnames


8

The default syntax script for vim doesn't have lightyellow listed for vimHiCtermColor. You could patch it and submit your change to the vim_dev mailing list. Or, better, ask them if that is intentional. Error as a lower priority than CursorLine but you can force it with this simple hack: hi Error cterm=reverse ctermbg=white ctermfg=red Instead of white ...


8

I've been struggling with that behavior for a long time. Basically, the foreground color of SpecialKey on the current line is changed to the foreground color of Normal if: the cursorline option is enabled, the CursorLine highlight group has a background color set. I've never been able to fix that behavior, no matter what I tried. The problem lies ...


8

I had this issue as well because I had switched to the "evening" color scheme in my ~/.vimrc file so that my comments were easier to read on a dark background: :colorscheme evening To restore visual mode highlighting I had to also add this: :highlight Visual cterm=reverse ctermbg=NONE


7

Cygwin terminal limitations The default Cygwin terminal is based on the Windows console and inherits its limitations (very few colors, no font styles like bold or italic). You can find out how many colors are available to Vim via :set t_Co? For me, that gives a meager 8. To get 256 colors, you need to use a terminal emulator that support high colors, e.g. ...


7

Check out sites like Vivify and Villustrator. They basically let you graphically create or tweak a scheme and then download the necessary files.


7

In the case of Neovim, t_Co and TERM make no difference. You are calling set background=darkbefore and after the call to colorscheme impact3. Move set background=dark to the bottom of the colorscheme, and remove the other call from your vimrc. From :help 'background': When 'background' is set Vim will adjust the default color groups for the new value. ......


7

Assuming your terminal emulator doesn't claim to support 256 colors ($ echo $TERM should output a string that doesn't contain 256color) and you didn't lie to Vim about that (:echo &t_Co should output 8 or 16), Vim should honor the "ANSI" colors you defined in your terminal emulator. The built-in colorschemes all use those "ANSI" colors — either by name ...


6

Here's a different solution which may be of help: put the current function name in the statusline: Vim doesn't really have a concept of a "dynamic" statusline; but we can work around that by setting a new statusline on certain autocmd events and/or key mappings. First, let us define a statusline: set statusline= let &statusline .= '%<%f ' " ...


Only top voted, non community-wiki answers of a minimum length are eligible