Giter VIP home page Giter VIP logo

vacuumline.nvim's Introduction

vacuumline.nvim

Airline in the vacuum of space

vacuumline is a prebuilt configuration for galaxyline based on the look and functionality of Airline. It can be further configured to style icons, colors, and segments.

full pane vacuumline vacuumline

split pane vacuumline showing inctive and active styling vacuumline inactive

Features

  • Built on galaxyline
  • Adaptive segments based on pane size (expand/collapse - guarantees vim mode indicator is never hidden)
  • Dynamic theming
  • Active/inactive segment styling
  • Customizable
  • Prebuilt segments:

Install

The goal of vacuumline is just to expose a galaxyline configuration and thus requires galaxyline and its dependencies:

vim-plug

Plug 'konapun/vacuumline.nvim'
Plug 'glepnir/galaxyline.nvim', {'branch': 'main'}
" One of the following is required for showing icons
Plug 'kyazdani42/nvim-web-devicons' " lua
Plug 'ryanoasis/vim-devicons' " vimscript

" Somewhere after plug#end()

lua require('vacuumline').setup()

packer

use {'konapun/vacuumline.nvim', requires = {
  'glepnir/galaxyline.nvim', branch = 'main',
  'kyazdani42/nvim-web-devicons', opt = true
}, config = function() require('vacuumline').setup() end} -- Add this line to use defaults; otherwise, call `setup` with your config as described below wherever you configure your plugins

Want to try out beta features before they make it into master? Use branch next!

Caution: beta features are considered experimental and may introduce breaking changes.

use {'konapun/vacuumline.nvim', branch = 'next', requires = {
  'glepnir/galaxyline.nvim', branch = 'main',
  'kyazdani42/nvim-web-devicons', opt = true
}, config = function() require('vacuumline').setup() end} -- Add this line to use defaults; otherwise, call `setup` with your config as described below wherever you configure your plugins

Collapse Behavior

One of the big advantages of vacuumline over a standard galaxyline config is the builtin responsiveness:

uncollapsed vacuumline uncollapsed

collapse level 1 collapse level 1

collapse level 2 collapse level 2

collapse level 3 collapse level 3

collapse level 4 collapse level 4

Configuration

Theming

For convenience, rather than configuring colors for each segment separately, you may want to apply a theme.

require('vacuumline').setup({
  theme = require('vacuumline.theme.nord')
})

Builtin Themes

The follow themes are built in. If you'd like to contribute a theme, please feel free to submit a PR.

  • gruvbox: theme = require('vacuumline.theme.gruvbox')
  • nord: theme = require('vacuumline.theme.nord')
  • one-dark: theme = require('vacuumline.theme.one-dark')

Custom Theme

You can also use a custom theme:

require('vacuumline').setup({
  theme = {
    line             = {foreground = '#98971a', background = '#282828'},
    segment_odd      = {foreground = '#282828', background = '#b16286'},
    segment_even     = {foreground = '#282828', background = '#98971a'},
    mode_normal      = {foreground = '#b16286'},
    mode_insert      = {foreground = '#98971a'},
    mode_command     = {foreground = '#458588'},
    mode_visual      = {foreground = '#d79921'},
    mode_visual_line = {foreground = '#689d6a'},
    mode_terminal    = {foreground = '#cc241d'},
    warning          = {foreground = '#282828', background = '#fabd2f'},
    error            = {foreground = '#282828', background = '#fb4934'},
    scroll           = {foreground = '#d79921'}
  }
})

Defaults

Here is the full default configuration. Individual pieces are described in more depth below.

{
  separator = {
    segment = {
      left = '',
      right = ''
    },
    section = {
      left = '',
      right = ''
    }
  },
  color = {
    foreground = {line = '#98971a', even = '#282828', odd = '#282828'},
    background = {line = '#282828', even = '#b16286', odd = '#98971a'},
  },
  segment = {
    mode = {
      map = {
        n = {label = '', background = '#b16286'}, -- NORMAL
        i = {label = '', background = '#98971a'}, -- INSERT
        c = {label = '', background = '#458588'}, -- COMMAND
        v = {label = '', background = '#d79921'}, -- VISUAL
        V = {label = '', background = '#fabd2f'}, -- VISUAL LINE
        t = {label = '', background = '#d3869b'}, -- TERMINAL
      }
    },
    file = {},
    vcs = {},
    scroll = {
      accent = '#d79921',
    },
    lines = {},
    diagnostics = {
      background = '#fb4934',
      errors = {
        foreground = '#282828',
        background = '#fb4934'
      },
      warnings = {
        foreground = '#282828',
        background = '#fabd2f'
      }
    },
    search = {},
    lsp = {
      foreground = '#98971a',
      background = '#282828'
    }
  }
}

Global configurations

Global config values are used when no specific value is provided for a segment.

separator = {
  segment = {
    left = '',
    right = ''
  },
  section = {
    left = '',
    right = ''
  }
},
color = {
  foreground = {line = '#98971a', even = '#282828', odd = '#282828'},
  background = {line = '#282828', even = '#b16286', odd = '#98971a'},
}

Separators

Segment separators are used to separate segments, obviously.

Colors

These are colors which are applied to segments depending on their order in the vacuumline.

  • line: default line colors - line foreground and background
  • even: default colors for even-numbered segments - foreground and background
  • odd: default colors for odd-numbered segments - foreground and background

Segments

Mode

Displays the current vim mode as a color indicator and text/icon display

Collapse behavior: None

mode = {
  foreground = '', -- dynamic by default
  background = '', -- dynamic by default
  separator = '', -- dynamic by default
  map = {
    n = {label = '', background = '#b16286'}, -- NORMAL
    i = {label = '', background = '#98971a'}, -- INSERT
    c = {label = '', background = '#458588'}, -- COMMAND
    v = {label = '', background = '#d79921'}, -- VISUAL
    V = {label = '', background = '#fabd2f'}, -- VISUAL LINE
    t = {label = '', background = '#d3869b'}, -- TERMINAL
  }
}

File

Displays an icon for the current filetype, the current file name, edit status, and file size

Collapse behavior:

  • Truncates filename depending on available width
  • Hides filename and file size depending on available width
file = {
  foreground = '', -- dynamic by default
  background = '', -- dynamic by default
  separator = '' -- dynamic by default
}

VCS

Displays current branch name along with additions, changes, and deletions

Collapse behavior:

  • Collapses entire segment depending on available width
vcs = {
  foreground = '', -- dynamic by default
  background = '', -- dynamic by default
  separator = '' -- dynamic by default
}

Scroll

Displays current scroll position in the file as both percentage and visual indicator

Collapse behavior:

  • Hides percent indicator depending on available width
scroll = {
  accent = '', -- used to color the scroll indicator
  foreground = '', -- dynamic by default
  background = '', -- dynamic by default
  separator = '' -- dynamic by default
}

Lines

Displays current line and column along with line endings

Collapse behavior:

  • Hides line endings depending on available width
  • Collapses entire segment depending on available width
lines = {
  foreground = '', -- dynamic by default
  background = '', -- dynamic by default
  separator = '', -- dynamic by default
  section_separator = '', -- dynamic by default
}

Diagnostics

Displays errors, warnings, and info from LSP diagnostics

Collapse behavior: None

diagnostics = {
  separator = '', -- dynamic by default
  errors = {
    foreground = '',
    background = ''
  },
  warnings = {
    foreground = '',
    background = ''
  }
}

Search

Displays current search term, current match, and total matches

Collapse behavior: None

search = {
  foreground = '', -- dynamic by default
  background = '', -- dynamic by default
  separator = '' -- dynamic by default
}

LSP

Displays the active language server

Collapse behavior:

  • Hides depending on available width
lsp = {
  foreground = '', -- dynamic by default
  background = '' -- dynamic by default
}

Developing

Using packer

Link your local vacuumline directory into your packer destination directory

cd <packer plugin directory> # ~/.local/share/nvim/site/pack/packer/start on my config
ln -s <local dev vacuumline> vacuumline.nvim

vacuumline.nvim's People

Contributors

konapun avatar

Stargazers

MatrixDynamo avatar Trần Quang Mạnh avatar kohane27 avatar Yuta Katayama avatar Felipe Risney avatar Roman Fuentes avatar Samuel Ludwig avatar Darshan Suthar avatar Mark avatar Orhan Gurbanov avatar Marcelo Sampaio avatar Phillip Bonhomme avatar  avatar Chris avatar Matt Rogers avatar Shawn Charles avatar ik5 avatar Mohammad Sadegh Khoeini avatar Jordan Cook avatar Ratheesh(ರತೀಶ್) avatar Farzad Majidfayyaz avatar EpiCanard avatar Adelar da Silva Queiróz avatar Carlos Gratacos avatar Antonio Davide avatar Hunter Braun avatar  avatar Logan Wendt avatar

Watchers

 avatar

Forkers

linxgnu coderj001

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.