Loading ...
Sorry, an error occurred while loading the content.

Porting Vim color schemes to other editors

Expand Messages
  • Elena
    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
    Message 1 of 9 , Jul 2, 2010
    • 0 Attachment
      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
    • Erik Falor
      ... 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
      Message 2 of 9 , Jul 2, 2010
      • 0 Attachment
        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
      • Tony Mechelynck
        ... There are several places to look for. - For any particular highlight group, ... will tell you where it was set. If you do that in a Vim instance where no
        Message 3 of 9 , Jul 2, 2010
        • 0 Attachment
          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
        • Dimitar DIMITROV
          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
          Message 4 of 9 , Jul 8, 2010
          • 0 Attachment
            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 jamessan@...
            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
          • Dimitar DIMITROV
            1. 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
            Message 5 of 9 , Jul 8, 2010
            • 0 Attachment
              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 jamessan@...
              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
            • Tony Mechelynck
              ... [...] ... [...] 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
              Message 6 of 9 , Jul 8, 2010
              • 0 Attachment
                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
              • Matt Wozniski
                ... 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
                Message 7 of 9 , Jul 8, 2010
                • 0 Attachment
                  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
                • Dimitar DIMITROV
                  1. valgrind --leak-check=full --show-reachable=yes ./vim -u NONE -U NONE 2. ZQ ==14191== LEAK SUMMARY: ==14191== definitely lost: 36 bytes in 1 blocks.
                  Message 8 of 9 , Jul 13, 2010
                  • 0 Attachment
                    1. valgrind --leak-check=full --show-reachable=yes ./vim -u NONE -U NONE

                    2. ZQ

                    ==14191== LEAK SUMMARY:
                    ==14191==    definitely lost: 36 bytes in 1 blocks.
                    ==14191==    indirectly lost: 120 bytes in 10 blocks.
                    ==14191==      possibly lost: 0 bytes in 0 blocks.
                    ==14191==    still reachable: 40,689 bytes in 261 blocks.
                    ==14191==         suppressed: 0 bytes in 0 blocks.

                    VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul 13 2010 20:27:14)
                    Included patches: 1-446
                    Compiled by mitko@debian
                    Normal version without 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 +diff +digraphs -dnd -ebcdic
                    -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +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_sysmouse +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
                    +startuptime +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 -xterm_clipboard -xterm_save
                       system vimrc file: "$VIM/vimrc"
                         user vimrc file: "$HOME/.vimrc"
                          user exrc file: "$HOME/.exrc"
                      fall-back for $VIM: "/usr/local/share/vim"
                    Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -fno-strength-reduce -Wall -D_FORTIFY_SOURCE=1
                    Linking: gcc   -L/usr/local/lib -o vim       -lm -lncurses

                    --
                    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
                  • Bram Moolenaar
                    ... [...] Please check where the leaks are. At least some of them will be in libraries. Those can t be avoided. And you need to compile Vim with EXITFREE
                    Message 9 of 9 , Jul 13, 2010
                    • 0 Attachment
                      Dimitar wrote:

                      > 1. valgrind --leak-check=full --show-reachable=yes ./vim -u NONE -U NONE
                      >
                      > 2. ZQ
                      >
                      > ==14191== LEAK SUMMARY:
                      > ==14191== definitely lost: 36 bytes in 1 blocks.
                      > ==14191== indirectly lost: 120 bytes in 10 blocks.
                      > ==14191== possibly lost: 0 bytes in 0 blocks.
                      > ==14191== still reachable: 40,689 bytes in 261 blocks.
                      > ==14191== suppressed: 0 bytes in 0 blocks.
                      >
                      > VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jul 13 2010 20:27:14)
                      > Included patches: 1-446
                      [...]

                      Please check where the leaks are. At least some of them will be in
                      libraries. Those can't be avoided. And you need to compile Vim with
                      EXITFREE defined, otherwise it won't clean up.

                      --
                      A real patriot is the fellow who gets a parking ticket and rejoices
                      that the system works.


                      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
                      /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
                      \\\ download, build and distribute -- http://www.A-A-P.org ///
                      \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

                      --
                      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
                    Your message has been successfully submitted and would be delivered to recipients shortly.