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

figlet script

Expand Messages
  • Troy Piggins
    I was looking for some helper commands for using something like figlet from within vim. Searched the vim scripts and closest I could find was the larlet.vim
    Message 1 of 5 , May 2 11:21 PM
    • 0 Attachment
      I was looking for some helper commands for using something like
      'figlet' from within vim.

      Searched the vim scripts and closest I could find was the
      larlet.vim script http://www.vim.org/scripts/script.php?script_id=1357

      At present I have this in my .vimrc:

      map ,f :r!figlet

      I was wondering if anyone has something a little more advanced.
      Perhaps a font chooser?

      --
      Troy Piggins | http://piggo.com/~troy
    • A.J.Mechelynck
      ... - Vim or gvim is meant to display exactly one character per character cell, except in the case of wide East-Asian characters (which occupy two character
      Message 2 of 5 , May 3 8:08 AM
      • 0 Attachment
        Troy Piggins wrote:
        > I was looking for some helper commands for using something like
        > 'figlet' from within vim.
        >
        > Searched the vim scripts and closest I could find was the
        > larlet.vim script http://www.vim.org/scripts/script.php?script_id=1357
        >
        > At present I have this in my .vimrc:
        >
        > map ,f :r!figlet
        >
        > I was wondering if anyone has something a little more advanced.
        > Perhaps a font chooser?
        >

        - Vim or gvim is meant to display exactly one character per character cell,
        except in the case of "wide" East-Asian characters (which occupy two character
        cells), combining characters (which do not occupy a distinct character cell),
        nonprinting or invalid characters (which may be shown as "^P" (two cells),
        "<fffe>" (six cells) etc.); and, of course, hard tabs (which occupy between 1
        and 'tabstop' character cells). There is no provision for ASCII-art characters
        in Vim.

        - You can use figlet as a filter (see ":help filter"). It must of course be
        present on your system (I have it in /usr/games/).

        - A font chooser exists in the Windows, Mac, Photon, GTK1 and GTK2 versions of
        gvim (for system fonts, be they bitmapped, TrueType, OpenType etc.):

        :set guifont=*

        You can set even very large (but monospaced!) fonts there if you want.
        (Actually, GTK2 gvim accepts even non-monospaced fonts, but the result is
        ugly: individual characters get clipped or spaced-out if they are larger or
        narrower, respectively, than the character cell).

        - Console Vim relies on whichever font is used by your terminal (Windows Dos
        Box, xterm, konsole, gnome-terminal, Terminal.app, ...); setting the font in
        the terminal depends on the terminal, not on Vim; how to set them (where it is
        at all possible) varies from terminal to terminal.


        Best regards,
        Tony.
        --
        ... the privileged being which we call human is distinguished from
        other animals only by certain double-edged manifestations which in
        charity we can only call "inhuman."
        -- R. A. Lafferty
      • Troy Piggins
        ... I understand that. Figlet is just arranging single chars into patterns that appear as large (multiple row/column) fonts - similar to ascii art. I know
        Message 3 of 5 , May 3 1:55 PM
        • 0 Attachment
          * A.J.Mechelynck is quoted & my replies are inline below :
          > Troy Piggins wrote:
          > >I was looking for some helper commands for using something like
          > >'figlet' from within vim.
          > >
          > >Searched the vim scripts and closest I could find was the
          > >larlet.vim script http://www.vim.org/scripts/script.php?script_id=1357
          > >
          > >At present I have this in my .vimrc:
          > >map ,f :r!figlet
          > >
          > >I was wondering if anyone has something a little more advanced.
          > >Perhaps a font chooser?
          >
          > - Vim or gvim is meant to display exactly one character per character cell,
          > except in the case of "wide" East-Asian characters (which occupy two
          > character cells), combining characters (which do not occupy a distinct
          > character cell), nonprinting or invalid characters (which may be shown as
          > "^P" (two cells), "<fffe>" (six cells) etc.); and, of course, hard tabs
          > (which occupy between 1 and 'tabstop' character cells). There is no
          > provision for ASCII-art characters in Vim.

          I understand that. Figlet is just arranging single chars into
          patterns that appear as large (multiple row/column) fonts -
          similar to ascii art. I know there is no provision for that
          directly in vim. But there are ways to make it easier to invoke.

          > - You can use figlet as a filter (see ":help filter"). It must of course be
          > present on your system (I have it in /usr/games/).

          Filter looks promising. If you have figlet on your system, how do
          you use it? Do you ever use it within vim? Do you have keys
          mapped, or scripts?

          > - A font chooser exists in the Windows, Mac, Photon, GTK1 and GTK2 versions
          > of gvim (for system fonts, be they bitmapped, TrueType, OpenType etc.):
          >
          > :set guifont=*
          [snip]

          By 'font', I meant figlet fonts. Sorry for not being clearer. So
          a way of choosing a selection of files in
          /usr/local/share/figlet/*.flf files to use as the '-f' option for
          figlet:

          :!figlet -f xxx.flf

          Thanks.

          --
          Troy Piggins | http://piggo.com/~troy
        • A.J.Mechelynck
          Troy Piggins wrote: [...] ... [...] You can replace a range of lines by its figlet representation: Here are a few examples: !figlet or :!figlet
          Message 4 of 5 , May 3 4:14 PM
          • 0 Attachment
            Troy Piggins wrote:
            [...]
            > Filter looks promising. If you have figlet on your system, how do
            > you use it? Do you ever use it within vim? Do you have keys
            > mapped, or scripts?
            [...]

            You can replace a range of lines by its figlet representation: Here are a few
            examples:

            <Visual>!figlet
            or
            <Visual>:!figlet
            which appears as
            :'<,'>!figlet
            replace the (linewise) Visual selection

            :.,.+5!figlet
            or
            6!!figlet
            replace the current line and the 6 lines following it

            :%!figlet
            replace the whole editfile

            :1,3!figlet
            replace the first three lines in the editfile

            :/\<begin\>/+1;/\<end\>/-1!figlet
            from the line after next line containing the word "begin" (after the cursor)
            until, but not including, the first line with the word "end" following it

            see
            :help filter
            :help [range]


            In all the above examples, add after "!figlet" any command-line parameters
            required by the figlet command (which takes its input on stdin and writes its
            output to stdout, Vim takes care of that).

            For instance, after typing the following 4 lines in an empty buffer:

            Mary had a little lamb,
            Its fleece was white as snow,
            And everywhere that Mary went,
            The lamb was sure to go.

            followed by <Esc> (to go back to Normal mode) and ":1,2!figlet" (without the
            quotes) you'll see that the edit buffer now contains (best viewed in a fixed
            font):

            __ __ _ _ _ _ _ _ _
            | \/ | __ _ _ __ _ _ | |__ __ _ __| | __ _ | (_) |_| |_| | ___
            | |\/| |/ _` | '__| | | | | '_ \ / _` |/ _` | / _` | | | | __| __| |/ _ \
            | | | | (_| | | | |_| | | | | | (_| | (_| | | (_| | | | | |_| |_| | __/
            |_| |_|\__,_|_| \__, | |_| |_|\__,_|\__,_| \__,_| |_|_|\__|\__|_|\___|
            |___/
            _ _
            | | __ _ _ __ ___ | |__
            | |/ _` | '_ ` _ \| '_ \
            | | (_| | | | | | | |_) |
            |_|\__,_|_| |_| |_|_.__( )
            |/
            ___ _ __ _
            |_ _| |_ ___ / _| | ___ ___ ___ ___ __ ____ _ ___
            | || __/ __| | |_| |/ _ \/ _ \/ __/ _ \ \ \ /\ / / _` / __|
            | || |_\__ \ | _| | __/ __/ (_| __/ \ V V / (_| \__ \
            |___|\__|___/ |_| |_|\___|\___|\___\___| \_/\_/ \__,_|___/

            _ _ _
            __ _| |__ (_) |_ ___ __ _ ___ ___ _ __ _____ __
            \ \ /\ / / '_ \| | __/ _ \ / _` / __| / __| '_ \ / _ \ \ /\ / /
            \ V V /| | | | | || __/ | (_| \__ \ \__ \ | | | (_) \ V V /
            \_/\_/ |_| |_|_|\__\___| \__,_|___/ |___/_| |_|\___/ \_/\_( )
            |/
            And everywhere that Mary went,
            The lamb was sure to go.



            Best regards,
            Tony.
            --
            hundred-and-one symptoms of being an internet addict:
            211. Your husband leaves you...taking the computer with him and you
            call him crying, and beg him to bring the computer back.
          • Troy Piggins
            ... [snip] ... Got it. And a big ... ____ _ | _ (_) _____ | | | | _ |_____| | |_| | (_) |____/ -- Troy Piggins | http://piggo.com/~troy
            Message 5 of 5 , May 3 4:24 PM
            • 0 Attachment
              * A.J.Mechelynck is quoted & my replies are inline below :
              > Troy Piggins wrote:
              > [...]
              > >Filter looks promising. If you have figlet on your system, how do
              > >you use it? Do you ever use it within vim? Do you have keys
              > >mapped, or scripts?
              > [...]
              >
              > You can replace a range of lines by its figlet representation: Here are a
              > few examples:
              >
              > <Visual>!figlet
              > or
              > <Visual>:!figlet
              > which appears as
              > :'<,'>!figlet
              > replace the (linewise) Visual selection
              [snip]
              > see
              > :help filter
              > :help [range]
              >
              > In all the above examples, add after "!figlet" any command-line parameters
              > required by the figlet command (which takes its input on stdin and writes
              > its output to stdout, Vim takes care of that).

              Got it. And a big

              _____ _ _ _____ _
              |_ _| |__ __ _ _ __ | | ___ _ ___ _ _ |_ _|__ _ __ _ _| |
              | | | '_ \ / _` | '_ \| |/ / | | |/ _ \| | | | | |/ _ \| '_ \| | | | |
              | | | | | | (_| | | | | <| |_| | (_) | |_| | | | (_) | | | | |_| |_|
              |_| |_| |_|\__,_|_| |_|_|\_\\__, |\___/ \__,_| |_|\___/|_| |_|\__, (_)
              |___/ |___/

              ____
              _ | _ \
              (_) _____ | | | |
              _ |_____| | |_| |
              (_) |____/


              --
              Troy Piggins | http://piggo.com/~troy
            Your message has been successfully submitted and would be delivered to recipients shortly.