Vim colorscheme general attributes? - vim

I'm making a colorscheme for Vim and have a command that allows me to view the 'scope' of a attribute to highlight, but I need some of the general attributes (background, line numbers, etc.) so I can properly create my scheme. Is there any good cheat sheets or lists of some of the attributes? I checked all the Vim documentation and wikis but they don't list many things that affect the editor itself.

Yes, there is such a list. All you need is in Vim's awesomely-exhaustive-but-sometimes-cryptic documentation: :help syntax, more specifically :help highlight-default for a list of default highlight groups. If something is not there it probably means that it can't be done or that it's custom/syntax-dependant.
You could also open a pre-existing colorscheme and see how it's done. It's actually not that complicated to understand how the syntax works.
Good luck and make sure to share your colorscheme with the community when it's ready.

May be you'll find useful this colorscheme: http://www.vim.org/scripts/script.php?script_id=106 .
Here is the description given by author:
The philosophy here is to provide a ready-to-uncomment list of highlight commands for all the important groups. Then you can deviate from the default until you come up with one you like.

Related

vim colorscheme poor syntax support

I have tried well over 15 different colorschemes for vim. I have made all of the correct settings for full color support in terminal. This 'problem' persists in both terminal and gvim. Perhaps it is not a bug and simply the design of the colorschemes themselves, but only one colorscheme I have tried actually has decent highlight support. For example:
In this python class all of the colorschemes will only highlight a couple of things.
wombat only highlights comments and the if.
molokai is extremly dissapointing but at least gets the ints
All of the themes I try are similar to these two except 'Crayon' which compares like so:
Most of the vim color-scheme github pages show previews with highlight support compared to crayon. My question is what might be causing this problem? or is this just the design of the themes themselves?
Syntax highlighting is the combination of two things:
syntax definition, provided by syntax scripts typically found in syntax/ or after/syntax/,
highlighting definition, provided by colorschemes typically found in colors/.
The former defines syntax groups, the latter defines how those groups look.
But those almost never come in pairs so there's no guarantee whatsoever that every possible syntax group is properly handled by every possible colorscheme.
If a colorscheme you like doesn't handle some of the syntax groups you expect it to handle, open an issue or (better) patch it.

Vim plugin causing aggressive highlighting

I have installed spf13-vim plugin and when I set :color molokai the following orange highlighting occurs;
Does anyone know which setting I need to change to disable the highlighting?
It's not the result of a search, that was my first guess! It doesn't seem confined to any one particular object type either as you can see from the picture.
You need to find out which syntax group causes the highlighting. :syn list shows all active groups, but it's easier when you install the SyntaxAttr.vim - Show syntax highlighting attributes of character under cursor plugin. When you have the name of the offending syntax group, you can investigate where it comes from; (the last lines of) :scriptnames may help.
PS: Vim "distributions" like spf-13 and Janus lure you with a quick install and out-of-the-box settings, but you pay the price with increased complexity (you need to understand both Vim's runtime loading scheme and the arbitrary conventions of the distribution) and inflexibility (the distribution may make some things easier, but other things very difficult). Vim is incredibly customizable, using someone else's customization makes no sense.

How do I customize three letter sequences in Vim Latex-Suite?

I installed Latex-Suite for Vim, and I like it very much, but I'd like to be able to customize the environment mappings that came by default, and add new ones. For example I want to edit the equation environment that appears typing EEQ and move around some elements, like the \label{} command. How can I do this? I've been scanning everything inside my /usr/share/vim/vimfiles/ftplugin but I can't find a way to do it (or I just don't understand what those files are).
You want to check out the documentation on Macro Customisation, specifically the Tex_Env_{name} bit.
In short, if you want your theorem snippet to look like
\begin{theorem}
<++>
\end{theorem}<++>
then you want a line like
let g:Tex_Env_theorem = "\\begin{theorem}\<CR><++>\<CR>\\end{theorem}"
in your vimrc.
Note the backslashes to escape carriage-return, and double-backslash for normal backslashes.
The <F5> functionality (press F5 after typing an environment name, i.e. figure<F5>) should work out of the box, but you may need to refresh the three-letter code. This is more hassle than it needs to be, but something like
autocmd BufNewFile,BufRead *.tex call IMAP('EFI', g:Tex_Env_figure,'tex')
will do the job.
The answer to the question you asked comes with a caveat, which is that Latex-Suite is an enormous amount of code that is very hard and annoying to modify, and which does not play nicely with other plugins. This falls into Latex-Suite's philosophy that it's the only plugin you need for editing latex within vim.
That said, you want to look in /path/to/ftplugin/latex-suite/envmacros.vim. Searching for EEQ will lead you on the path to understanding the set of calls that latex-suite performs. I would like to reiterate that many functions are deeply intertwined.
On the other hand, there is a very easy way to have very easily customizable environments, which are snippets. See the UltiSnips page for a good example of how this works. These are designed for customization and extremely easy to write.

Is there a stackoverflow site for vim?

It appears that vim.org supports questions only via mail and/or mail digests, and vim's own internal :help utility doesn't give me what I think I need regarding highlighting, so I'm here to ask my question. General searching via google gives me no good hits, possibly revealing that I'm just not asking with the right search terms.
My question will be: Can I highlight by regex independent of search highlighting?
If there is a stackoverflow site intended for vim questions such as that?
The simplest built-in way is
:mat[ch] {group} /{pattern}/
e.g. :match ErrorMsg /ERROR:/; you have two more slots with :2match and :3match (some plugins use those, too), and programatically an arbitrary number via the matchadd() function.
Differences
Whereas the search pattern is global in scope, the :match applies only to the current window. That can be unexpected. If you would like to have a quick way to define (and also jump to) some additional patterns (and don't mind installing a plugin), I can recommend you my Mark plugin.
There are tons of vim questions here on SO answered by some highly skilled vimmers so I don't see the need for a separate vim-SO-site...
But if you feel like creating one, you can always propose one at http://area51.stackexchange.com/
To answer your vim question: Have a look at this page http://vim.wikia.com/wiki/Highlight_multiple_words
Which describes a method to use multiple highlights.

Configure tab to show list of variants instead of cycling through in VIM

When opening new buffer it VIM, I type:
new /path/to/fi
If I hit "tab" at this point it cycles through files. How to configure VIM to show list of variants instead of going for the first one?
set wildmenu
Is all you need to add to your .vimrc. Read :help wildmenu.
Set your wildmode setting to something different, for example
set wildmode=list:longest
If I misunderstood the question completely, yell ... :)
(This is not a direct answer to your question, but I think it's even better :)
You should check out the Command-T plugin, inspired by TextMate's 'Go To File'. It filters out possible combinations very intelligently, just type a few characters of each subdirectory enough to distinguish it and it 'gets' it, the characters don't have to be at the beginning and can don't have to be sequential. It also shows you a list of options left.
I realize this is a terrible explanation so check out this video to see how it works.
The downside is it requires Vim to be compiled with Ruby support.
Control-P (ctrlp.vim) is a replacement for Command-T written in VimScript, so it doesn't require Ruby.

Resources