Coder Social home page Coder Social logo

becho-vim's Introduction

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.

becho-vim's People

Contributors

hongkong3 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.