sponsor Vim development Vim logo Vim Book Ad

deline : A lightweight statusline plugin with construction functionality

 script karma  Rating 12/6, Downloaded by 2581  Comments, bugs, improvements  Vim wiki

created by
Shuhei Kubota
 
script type
utility
 
description
# Features

* A lightweight statusline definition
* With DSL -> statusline-expression library
  * Readable
  * Extensible
  * Dynamic evaluation added


# Examples

## Statusline definition

This is a default definition of statusline by Deline.

    call Deline([
        \ deline#comment("mode (define User2 and change to it by hl(2)"),
        \ deline#modeHL("User2"),
        \ deline#hl(2),
        \ deline#space(),
        \ deline#mode(),
        \ deline#space(),
        \
        \ deline#comment("filepath and mod, readonly flags"),
        \ deline#hl(1), deline#space(),
        \ deline#hl(4),
        \ deline#readonly('[RO] ', ''),
        \ deline#modified('+ ', ''),
        \
        \ deline#comment("v-- expand(%:p:h:t) / expand(%:p:t)"),
        \ deline#comment("deline#file(':p:h:t/:p:t'),"),
        \ deline#hl(3), deline#file(':p:h:t'), "/",
        \ deline#hl(1), deline#file(':p:t'),
        \ deline#space(),
        \ deline#hl(4), deline#notsaved(2),
        \
        \ deline#rightalign(),
        \
        \ deline#comment("\ deline#fileformat(),"),
        \ deline#dynamic#if("&fileformat!='unix'", deline#hl(4), deline#hl(1)),
        \ deline#fileformat(),
        \ deline#hl(1),
        \
        \ deline#comment("v-- separator"),
        \ deline#space(), deline#hl(3), deline#bar(), deline#hl(1), deline#space(),
        \
        \ deline#comment("\ deline#fileencoding(),"),
        \ deline#dynamic#if("&fileencoding!='utf-8'", deline#hl(4), deline#hl(1)),
        \ deline#fileencoding(),
        \ deline#hl(1),
        \
        \ deline#space(), deline#hl(3), deline#bar(), deline#hl(1), deline#space(),
        \
        \ deline#filetype(),
        \
        \ deline#space(), deline#hl(3), deline#bar(), deline#hl(1), deline#space(),
        \
        \ deline#line(), ":", deline#columnv(),
        \
        \ deline#space(),
        \ ])

## Without default definition

To prevent Deline from overwriting statusline with Deline's default definition, add the line below in your vimrc.

    let g:Deline_DefaultDefinitions = 0

## Configuration

Call `DelineConfig`  to configure highlights and literals.

### Mode

This example defines COMMAND mode.

    " "mode_c" is ( "mode_" . mode() ).
    " "" is a string displayed in statusline.
    " "guifg", "guibg", ... is a part of highlight definition.
    augroup Deline_mysetting
        autocmd VimEnter * call DelineConfig({
            \ "mode_c": {
            \ "": " COMMAND ",
            \ "guifg": "#000000",
            \ "guibg": "#ffffff",
            \ },
            \ })
    augroup END

### Using example definition

    " diable Deline's defaults.
    let g:Deline_DefaultDefinitions = 0

    " call an example function.
    augroup Deline_mysetting
        " autocmd VimEnter * call deline#example#powerful()
        autocmd VimEnter * call deline#example#gradient()
    augroup END
 
install details
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
deline.zip 0.12 2019-06-25 7.0 Shuhei Kubota x3 Faster display of file names.
deline.zip 0.11 2019-06-21 7.0 Shuhei Kubota speed tuning for examples (deline#example#xxx). experimental.
deline.zip 0.10 2019-06-20 7.0 Shuhei Kubota speed tuning for examples (deline#example#xxx). experimental.
deline.zip 0.9 2019-06-02 7.0 Shuhei Kubota add slicing in deline#file() ... :p:h:t[:2]
deline.zip 0.8 2019-05-27 7.0 Shuhei Kubota make a good color in defHLAdjFG
deline.zip 0.7 2019-05-27 7.0 Shuhei Kubota improve redrawing on call deline#example#xxx()
deline.zip 0.6 2019-05-26 7.0 Shuhei Kubota add examples (powerline-like, gradient color, ...), highlight manip functions, docs
deline.zip 0.5 2019-05-01 7.0 Shuhei Kubota update document, add deline#extra#weatherhacks(), somefuncs moved from deline#dynamic
deline.zip 0.4 2019-04-17 7.0 Shuhei Kubota change event and method to refresh statusline
deline.zip 0.3 2019-03-06 7.0 Shuhei Kubota improve deline#file over network
deline.zip 0.2 2019-03-04 7.0 Shuhei Kubota update a default definition, add deline#notsaved(), tune for speed of deline#file()
deline.zip 0.1 2019-02-24 7.0 Shuhei Kubota Initial upload
ip used for rating: 142.132.191.50

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github