Porting Vim color schemes to other editors

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Porting Vim color schemes to other editors

egarrulo
Hello,

I'd like to port some Vim color schemes to my editor of choice (I'd
better not tell you which one ;-)

I somewhat understand the syntax of color scheme scripts, however I
don't know where to look for "highlighting groups" (I think they are
called like this). For instance, in some lines like these:

  hi Identifier guifg=#a030a0 guibg=NONE gui=NONE
  hi ModeMsg guifg=fg guibg=#b0b0e0 gui=NONE
  hi VisualNOS guifg=fg guibg=#b0b0e0 gui=NONE

I'd like to know what kind of text Identifier, ModeMsg, VisualNOS
highlight.

Where can I look? Can I query a running Vim for help about that?

Thanks.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Porting Vim color schemes to other editors

Erik Falor
On Fri, Jul 02, 2010 at 07:26:56AM -0700, Elena wrote:

> Hello,
>
> I'd like to port some Vim color schemes to my editor of choice (I'd
> better not tell you which one ;-)
>
> I somewhat understand the syntax of color scheme scripts, however I
> don't know where to look for "highlighting groups" (I think they are
> called like this). For instance, in some lines like these:
>
>   hi Identifier guifg=#a030a0 guibg=NONE gui=NONE
>   hi ModeMsg guifg=fg guibg=#b0b0e0 gui=NONE
>   hi VisualNOS guifg=fg guibg=#b0b0e0 gui=NONE
>
> I'd like to know what kind of text Identifier, ModeMsg, VisualNOS
> highlight.
What Identifier means will depend on the syntax script for the
filetype of the current buffer.

The other highlight groups you mentioned pertain to the editor itself,
and don't change when your buffer's filetype setting changes.

> Where can I look? Can I query a running Vim for help about that?

Try running :syntax to see what highlight groups are defined for the
current buffer, and what regexes each highlight group match.

:highlight works closely with :syntax.  You'll need at least a basic
understanding of each to grok what's going on.

You can start by reading
:help :hi-link
:help :syntax

I hope this helps.

--
Erik Falor
Registered Linux User #445632 http://counter.li.org

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Porting Vim color schemes to other editors

Tony Mechelynck
In reply to this post by egarrulo
On 02/07/10 16:26, Elena wrote:

> Hello,
>
> I'd like to port some Vim color schemes to my editor of choice (I'd
> better not tell you which one ;-)
>
> I somewhat understand the syntax of color scheme scripts, however I
> don't know where to look for "highlighting groups" (I think they are
> called like this). For instance, in some lines like these:
>
>    hi Identifier guifg=#a030a0 guibg=NONE gui=NONE
>    hi ModeMsg guifg=fg guibg=#b0b0e0 gui=NONE
>    hi VisualNOS guifg=fg guibg=#b0b0e0 gui=NONE
>
> I'd like to know what kind of text Identifier, ModeMsg, VisualNOS
> highlight.
>
> Where can I look? Can I query a running Vim for help about that?
>
> Thanks.
>

There are several places to look for.

- For any particular highlight group,
        :verbose :hi <whatever>
will tell you where it was set. If you do that in a Vim instance where
no colour scheme was ever used since startup, it will tell you where (if
anywhere) the default was set.

- For highlight groups specific to one syntax type (~ one filetype),
look into that syntax script
        :view $VIMRUNTIME/syntax/<whatever>.vim
                replacing <whatever> by the result of
        :setlocal syntax?
The syntax of these scripts is described under
        :help syntax.txt

- for global highlight groups: most of them have help tags in the form
hl-<something>
        :help hl-<Ctrl-D>

- Several of these global groups are defined by means of the 'highlight'
option (which I recommend to leave at its default, then use the :hi
command, preferably in a color scheme, if the default setting is not to
your liking).

- Others may be defined by doing ":syntax on",
        :view $VIMRUNTIME/syntax/syncolor.vim
These names are just defined so that syntax scripts may later "link"
their own syntax highlight groups to them, to use the same colors: this
way, a colorscheme will e.g. define only Comment and that will
implicitly set cComment, vimComment, htmlComment, cssComment, etc. etc.
etc.; but if the colorscheme author wants it, he might decide e.g. to
color vimKeyword, perlKeyword, pythonKeyword, schemeKeyword and
rubyKeyword all differently so that embedded scripts in a vim script
will get distinctive colours.

- Some highlight groups might be defined by whatever sets the :match,
:2match or :3match commands, or the matchadd() function. For instance,
the MatchParen highlight is defined via a :3match command in the
matchparen script:
        :view $VIMRUNTIME/plugin/matchparen.vim

In addition, see
        :help :hi
        :help :redir
        :help 'more'
about capturing the current highlight colours


Best regards,
Tony.
--
Rule 46, Oxford Union Society, London:
        Any member introducing a dog into the Society's premises shall
be liable to a fine of one pound.  Any animal leading a blind person
shall be deemed to be a cat.

--
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
Reply | Threaded
Open this post in threaded view
|

Memory leak

Dimitar DIMITROV-12
valgrind --leak-check=full --show-reachable=yes gvim

1. cc, then a,a,a,a,a,a,a,a,a,a,a,
2. /\(\(\s*\w\+\s*\)\+,\)\{1,20}
3. :h\{
4. Close gvim

==3987== LEAK SUMMARY:
==3987==    definitely lost: 12,986 bytes in 47 blocks.
==3987==    indirectly lost: 28,332 bytes in 1,403 blocks.
==3987==      possibly lost: 349,216 bytes in 498 blocks.
==3987==    still reachable: 3,245,978 bytes in 47,532 blocks.
==3987==         suppressed: 0 bytes in 0 blocks.

VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 17 2008 18:04:59)
Included patches: 1-314
Compiled by [hidden email]
Huge version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl
 +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm
+multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python
 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11
-xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/
usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1     -g -O2 -O2 -g -Wall    -D_REENTRANT -D_
GNU_SOURCE -DDEBIAN  -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.10/CORE  -I/u
sr/include/python2.5 -pthread -I/usr/include/tcl8.4  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  -I/us
r/lib/ruby/1.8/i486-linux
Linking: gcc   -L.  -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,--as-needed -L/usr/local/lib -o vim   -lgtk-x11-2.0 -l
gdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
-lXt -lncurses -lselinux  -lacl -lgpm -Wl,-E  -L/usr/local/lib  -L/usr/lib/perl/5.10/CORE -lperl -L/usr/lib/python2.5
/config -lpython2.5 -lutil -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib -ltcl8.4 -lieee -lrub
y1.8 -lm

--
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
Reply | Threaded
Open this post in threaded view
|

Memory leak

Dimitar DIMITROV-12
In reply to this post by Tony Mechelynck
1. <f1>
2. 3yy`]
3. 5yy`]

==4008== LEAK SUMMARY:
==4008==    definitely lost: 37,350 bytes in 116 blocks.
==4008==    indirectly lost: 28,332 bytes in 1,403 blocks.
==4008==      possibly lost: 319,554 bytes in 469 blocks.
==4008==    still reachable: 2,425,077 bytes in 30,351 blocks.
==4008==         suppressed: 0 bytes in 0 blocks.

VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 17 2008 18:04:59)
Included patches: 1-314
Compiled by [hidden email]
Huge version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl
 +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui +diff +digraphs +dnd -ebcdic
+emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() +gettext
-hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap
+menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm
+multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python
 +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax
+tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands
+vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup +X11
-xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/
usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pixman-1     -g -O2 -O2 -g -Wall    -D_REENTRANT -D_
GNU_SOURCE -DDEBIAN  -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.10/CORE  -I/u
sr/include/python2.5 -pthread -I/usr/include/tcl8.4  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  -I/us
r/lib/ruby/1.8/i486-linux
Linking: gcc   -L.  -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,--as-needed -L/usr/local/lib -o vim   -lgtk-x11-2.0 -l
gdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0
-lXt -lncurses -lselinux  -lacl -lgpm -Wl,-E  -L/usr/local/lib  -L/usr/lib/perl/5.10/CORE -lperl -L/usr/lib/python2.5
/config -lpython2.5 -lutil -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib -ltcl8.4 -lieee -lrub
y1.8 -lm

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak

Tony Mechelynck
In reply to this post by Dimitar DIMITROV-12
On 09/07/10 00:26, Dimitar DIMITROV wrote:

> valgrind --leak-check=full --show-reachable=yes gvim
>
> 1. cc, then a,a,a,a,a,a,a,a,a,a,a,
> 2. /\(\(\s*\w\+\s*\)\+,\)\{1,20}
> 3. :h\{
> 4. Close gvim
>
> ==3987== LEAK SUMMARY:
> ==3987== definitely lost: 12,986 bytes in 47 blocks.
> ==3987== indirectly lost: 28,332 bytes in 1,403 blocks.
> ==3987== possibly lost: 349,216 bytes in 498 blocks.
> ==3987== still reachable: 3,245,978 bytes in 47,532 blocks.
> ==3987== suppressed: 0 bytes in 0 blocks.
>
> VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 17 2008 18:04:59)
> Included patches: 1-314
[...]

On 09/07/10 00:29, Dimitar DIMITROV wrote:
 > 1. <f1>
 > 2. 3yy`]
 > 3. 5yy`]
 >
 > ==4008== LEAK SUMMARY:
 > ==4008== definitely lost: 37,350 bytes in 116 blocks.
 > ==4008== indirectly lost: 28,332 bytes in 1,403 blocks.
 > ==4008== possibly lost: 319,554 bytes in 469 blocks.
 > ==4008== still reachable: 2,425,077 bytes in 30,351 blocks.
 > ==4008== suppressed: 0 bytes in 0 blocks.
 >
 > VIM - Vi IMproved 7.1 (2007 May 12, compiled Oct 17 2008 18:04:59)
 > Included patches: 1-314
[...]

7.1, even 7.1.314, is not the latest version. Among the 445 patches
already published for the _next_ version (7.2), more than a few were
leak fixes, see http://ftp.vim.org/pub/vim/patches/7.2/README

If you want to usefully contribute memory leak reports, please use the
latest version, either the latest stable version (currently 7.2.445) or
the bleeding-edge development version (7.3a, available only over
Mercurial, not as a bz2 archive).

See:
http://vim.wikia.com/wiki/Getting_the_Vim_source_with_Mercurial (7.2 or
7.3a)
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm (compiling)

On Debian, you should be able to use apt-get to get the "dependencies"
of the vim-x11 package (or of whatever it is called on that distro).


Best regards,
Tony.
--
For every credibility gap, there is a gullibility fill.
                -- R. Clopton

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Memory leak

Matt Wozniski-2
On Thu, Jul 8, 2010 at 6:55 PM, Tony Mechelynck wrote:
>
> If you want to usefully contribute memory leak reports, please use the
> latest version, either the latest stable version (currently 7.2.445) or the
> bleeding-edge development version (7.3a, available only over Mercurial, not
> as a bz2 archive).
...
> On Debian, you should be able to use apt-get to get the "dependencies" of
> the vim-x11 package (or of whatever it is called on that distro).

Indeed.  apt-get build-dep vim-gnome

~Matt

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