Skip to content

hongkong3/becho-vim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

becho-vim

REQUIRE: Vim 8.2-later?  MIT License  plugin version 1.00  🍔🍙

This document has been prepared baded on automatic translation.
Please forgive me if there are some strange sentences...

"becho-vim" is the extension :echo command in Vim-script, as Vim-plugin.

This plugin provides Command the following features:

  • Ease colorization of message text.
    If there are specific format in the String, it will be colored as highlight.

    :Becho "Colored as #0{comment}# and #Statement{statement}#."

  • Format and display the values of LIST and DICT variables.
    The default setting is Enabled, but it can be Disabled.

    {
      key: 'value',
      LIST: [
        1, 2, 3, 4,
        'Short contents can also be grouped together'
      ]
    }

  • Displays the Time and Argument prefixes.
    You can chage the contents or hide them by setting options.

    ==== 00:00:00 `argument` ====
    Messages.

  • The same contents as above can be output to buffer.
    To outpt to a buffer, use the :Belog command.

See more -> :help Becho


Installation

Install using your favorite package manager.

  • Vundle:
    Plugin 'hongkong3/becho-vim'
  • NeoBundle:
    NeoBundle 'hongkong3/becho-vim'
  • VimPlug:
    Plug 'hongkong3/becho-vim'
  • Pathgon:
    cd ~/.view/bundle
    git clone https://github.com/hongkong3/becho-vim

Usage

Use it by executing the following Command, or calling the Function.

:Becho[!] {expr} ..

This is almost the same as :echo command.
If there are specific format in the String, it will be colored as highlight.

Depending on the option settings, it automatically displays the formatted contents of DICT and LIST type variables, and prefixes arguments, etc.

If with the bang[!], it will disable them and only do text-coloring.

:Belog[!] {expr} ..

Display the same contents as :Becho, in a specific log-buffer.
This is a substitute command for :echomsg.

Hit the c in log-buffer, will clear messages.
Hit the q in log-buffer, will close the log-buffer window.

CAUTION:

Script local variables (s:var) cannot be used.
If you want to display the value of a script local variable, asign it to temporary variable, etc...

  :let tmp = s:var
  :Becho tmp

OPTION

In this plugin, option values can be set in any Scopes.
Different options can be set for each buffer, tab-page, etc.., according to the displaying contents.

The priority order for each Scope is...
(function({options}) == [!]bang) > b: > w: > t: > g: > s:(default)

Also, when setting each option, please define a DICT variable in advance.

 let g:becho = {}
 let g:becho.format = 1

OPTION LIST

  s:becho.format = 40                         " length of formated LIST/DICT (if 0 then no formated)

  s:becho.prefix = '==== %X `#arg#` ===='     " formatting-text of Prefix

  s:becho.color = [                           "  preset Colors (highlight-group)
      'Comment',
      'Constant',
      'Identifier',
      'Statement',
      'Preproc',
      'Underlined',
      'ErrorMsg',
      'Todo',
      'Pmenu',
  ]

  " below options for log-buffer (:Belog)

  s:becho.reverse = 0                         " new message to  0: add-bottom 1: insert-top
  s:becho.window = 'belowright split'         " window creation command
  s:becho.option = ''                         " additional option -> :setlocal
  s:becho.size = [0, 0]                       " keep to window size [row, col]
  s:becho.buffer = 'becho://log-%x/output'    " buffer name (%x -> tabpagenr)

The "becho-vim" is no relationship with any real person, organization, or name.

Releases

No releases published

Packages

No packages published