Axel wrote:
> I often use the :digraph command to find foreign language characters.
> But looking for a certain character sometines is like finding
> a needle in the haystack. Would it be possible to color-code
> the three colums of :dig's output?

Finding a character is hard. I suppose some clever highlighting
would help. I wondered about this and have come up with a script
to show the :dig output in a scratch buffer. I got lazy and have
not implemented a proper syntax highlighting scheme, but instead
took the opportunity to experiment with the new 'colorcolumn'
feature of Vim 7.3.

Put the following in a file, for example, dig.vim.
In Vim, enter this command to source the file:
    :so dig.vim

" Create a scratch buffer with :dig output, highlighted.
function! s:Dig()
  set nomore
  redir => output
  silent dig
  redir END
  set more
  new
  setlocal buftype=nofile bufhidden=hide noswapfile
  setlocal colorcolumn=4,16,28,40,52,64,76
  put =output
  g/^$/d
endfunction
command! Dig call s:Dig()

When you want to see the :dig output, enter this command:
    :Dig

A command like this can set the colours:
    :hi ColorColumn guifg=snow guibg=seagreen

The column highlighting goes a little weird with some of the
characters, but it seems reasonably ok.

John

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui