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

Re: Firefox CTRL-+ for changing the guifont size map

Expand Messages
  • David Fishburn
    ... http://vim.wikia.com/wiki/Increase/decrease_fontsize_using_a_map_ala_FireFox My only issue with it currently is the dreaded Hit ENTER or type command to
    Message 1 of 10 , Oct 1, 2007
    • 0 Attachment
      > I will add this as a new Vim Tip, once I figure out how to use the new
      > system with login's and all.

      http://vim.wikia.com/wiki/Increase/decrease_fontsize_using_a_map_ala_FireFox

      My only issue with it currently is the dreaded "Hit ENTER or type
      command to continue" in some cases. The font has to get _pretty_ big
      or _very_ small to trigger it, but it is there.

      I tried adding let saved_more = &more \| set nomore ... \| let &more =
      saved_more around it but that just made the command longer which
      trigger the prompt sooner. I could put it in a function, but that
      seems overkill.

      Enjoy.
      Dave

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • John Beckett
      ... Good work. Here are a couple of comments on the wikitext (the text you typed in). ... However, the leading : causes an indent (and :: would give more
      Message 2 of 10 , Oct 1, 2007
      • 0 Attachment
        David Fishburn wrote:
        >> I will add this as a new Vim Tip, once I figure out how to
        >> use the new system with login's and all.
        >
        > http://vim.wikia.com/wiki/Increase/decrease_fontsize_using_a_m
        > ap_ala_FireFox

        Good work. Here are a couple of comments on the wikitext (the text you typed
        in).

        You have the line:
        :echo &guifont

        However, the leading ':' causes an indent (and '::' would give more indent).

        The simplest fix is to insert a space before the ':'. A leading space causes
        the line to be treated as if it were in <pre>...</pre> tags.

        You used multiple spaces to align some text. That won't work unless in a
        <pre> block. I would not bother trying to align (it is possible to enter
        some magic to get a table, but the effort is often not worthwhile).

        However, you might like to add '<br>' to lines where you want to force a
        line break. In html, you might put <br />, but just <br> is fine in
        wikitext. For example, you might want:

        Indicates:<br>

        If you edit the tip, please put a short comment in the Summary box
        ("Improved formatting"), and use the 'Show preview' button to check before
        saving.

        John


        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • key.vim@googlemail.com
        Hi, thanks for the nice macros to increase and decrease the font-size. I use them, but encounter the following problem: I use 7.1.132 on ubuntu with a gnome
        Message 3 of 10 , Oct 3, 2007
        • 0 Attachment
          Hi,

          thanks for the nice macros to increase and decrease the font-size.
          I use them, but encounter the following problem:

          I use 7.1.132 on ubuntu with a gnome desktop and devilspie to
          place and resize my applications as i wish. gvim is
          automatically made fullscreen with no decoration
          (menubar, windowtitle, etc). when i now resize the
          font obviously there is a mismatch in the current
          gvim-window-size. if i reduce the font size, the right
          hand side, and the lower part of the vim window are
          gray. if i increase the fontsize, i will not be able to read
          the status or command line.

          Is there an automatic way to "redraw" gvim to match the
          current window size?

          cheers,
          Keyan


          On Oct 1, 10:48 pm, "David Fishburn" <dfishburn....@...> wrote:
          > My most used feature ofFireFoxis the ability to quickly and easily
          > change the fontsize of the text I am reading.
          >
          > So you can hit CTRL+ and CTRL- repeatedly to get the text the size you want.
          >
          > I was trying to do the same with Vim 7.1 (on WinXP) using a substitute command.
          >
          > :echo &guifont
          > Bitstream_Vera_Sans_Mono:h11:b:cANSI
          >
          > So I tried some variations of this substitue command:
          > echo substitute(&guifont, '\(.*:h\)\(\d\+\)\(.*\)', '\1\2\3', '')
          > echo substitute(&guifont, '\(.*:h\)\(\d\+\)\(.*\)', '\1\=submatch(2)\3', '')
          > echo substitute(&guifont, '\(.*:h\)\(\d\+\)\(.*\)', '\1'.submatch(2).'\3', '')
          >
          > With the end goal of doing this and hoping I could do arithmetic in
          > the submatch without it ending up as string concatentation:
          > echo substitute(&guifont, '\(.*:h\)\(\d\+\)\(.*\)', '\1'.
          > (submatch(2)+1) .'\3', '')
          >
          > Anyway, I can't get any of these to work and I was wondering if
          > someone might have some suggestions. The submatches always end up as
          > "submatch" literals added instead of the contents of the match.
          >
          > So final result would be something like this:
          > :nnoremap + :let &guifont=substitute(&guifont,
          > '\(.*:h\)\(\d\+\)\(.*\)', '\1'. (submatch(2)+1) .'\3', '')
          > :nnoremap - :let &guifont=substitute(&guifont,
          > '\(.*:h\)\(\d\+\)\(.*\)', '\1'. (submatch(2)-1) .'\3', '')
          >
          > TIA,
          > Dave


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Tony Mechelynck
          ... Instead of making gvim fullscreen by means of some external application Vim knows nothing about, do it by Vim means, just after setting the guifont : a)
          Message 4 of 10 , Oct 3, 2007
          • 0 Attachment
            key.vim@... wrote:
            > Hi,
            >
            > thanks for the nice macros to increase and decrease the font-size.
            > I use them, but encounter the following problem:
            >
            > I use 7.1.132 on ubuntu with a gnome desktop and devilspie to
            > place and resize my applications as i wish. gvim is
            > automatically made fullscreen with no decoration
            > (menubar, windowtitle, etc). when i now resize the
            > font obviously there is a mismatch in the current
            > gvim-window-size. if i reduce the font size, the right
            > hand side, and the lower part of the vim window are
            > gray. if i increase the fontsize, i will not be able to read
            > the status or command line.
            >
            > Is there an automatic way to "redraw" gvim to match the
            > current window size?
            >
            > cheers,
            > Keyan

            Instead of making gvim fullscreen by means of some external application Vim
            knows nothing about, do it by Vim means, just after setting the 'guifont':

            a) in the vimrc:

            if has('gui_running')
            " detect which 'guifont' format is required by the current gvim
            if has('gui_gtk2')
            set gfn=Courier\ New\ 9
            elseif has('gui_photon')
            set gfn=Courier\ New:s9
            elseif has('gui_kde')
            set gfn=Courier\ New/9/-1/5/50/0/0/0/1/0
            elseif has('x11')
            set gfn=*-courier-medium-r-normal-*-*-90-*-*-m-*-*
            else
            set gfn=Courier_New:h9:cDEFAULT
            endif
            " make sure the gvim window starts at top left
            if exists(':winpos') == 2
            winpos 0 0
            endif
            " maximize the gvim window
            set lines=99999 columns=99999
            endif

            b) Doing it manually (e.g. for GTK2):

            :set gfn=Andale\ Mono\ 8 lines=99999 columns=99999

            Note: When changing the 'guifont' manually, you should already know (or find
            out) which of the 5 possible mutually incompatible formats your version requires.

            c) when changing the font in a user command or function:

            if has('gui_running')
            call FontResize()
            set lines=99999 columns=99999
            endif


            Best regards,
            Tony.
            --
            Cynic, n.:
            A blackguard whose faulty vision sees things as they are, not
            as they ought to be. Hence the custom among the Scythians of plucking
            out a cynic's eyes to improve his vision.
            -- Ambrose Bierce, "The Devil's Dictionary"

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Zbikow
            This might not work as it did not for me. After invoking font selection window by set guifont=* i saw that that by default i m using a font (fixedsys) which
            Message 5 of 10 , Oct 4, 2007
            • 0 Attachment
              This might not work as it did not for me. After invoking font
              selection window by "set guifont=*" i saw that that by default i'm
              using a font (fixedsys) which is not scalable (the size list contains
              only one size). After changing the fonts to scalable everything works.

              HTH others if they have the same problem

              regards
              Zbikow


              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.