GithubHelp home page GithubHelp logo

nvim-stratus's Introduction

nvim-stratus

A Neovim plugin to attach customisable components to the statusline. Written in Lua.

An example nvim-stratus statusline.

Installation

You can install this plugin with your favourite package manager. As an example, for vim-plug:

Plug 'sam4llis/nvim-stratus'

Usage

Stratus Configuration

Stratus allows the user to split the statusline into multiple components and comes with a multitude of built-in components for easy configuration. To add stratus components to your statusline, you can call Stratus' setup() function. This setup function requires a components table, which tells Stratus which components should be added to the statusline.

My default configuration for Stratus uses colours defined by the Catppuccin colorscheme.

local cp = require('catppuccin.core.color_palette')
local separators = require('nvim-stratus.ui.separators')
local builtins = require('nvim-stratus.builtins')

local components = {
  {
    operation = function ()
      return builtins.current_mode()
    end,
    style = {
      fg = cp.black2,
      bg = cp.gray2,
      gui= 'bold',
    },
    separator = separators.arrow,
  },
  {
    operation = function ()
      return builtins.git_branch()
    end,
    style = {
      fg = cp.black2,
      bg = cp.gray2,
      gui= 'bold',
    },
    separator = separators.arrow,
  },
  {
    operation = function ()
      return builtins.filename()
    end,
    style = {
      fg = cp.black2,
      bg = cp.pink,
      gui= 'bold',
    },
    separator = separators.arrow,
  },
  {
    operation = function ()
      return builtins.modified()
    end,
    style = {
      fg = cp.black2,
      bg = cp.pink,
      gui= 'bold',
    },
    separator = separators.arrow,
  },
  {
    operation = function ()
      return builtins.spell_check()
    end,
    style = {
      fg = cp.black2,
      bg = cp.pink,
      gui= 'bold',
    },
    separator = separators.arrow,
    position = 'right',
  },
  {
    operation = function ()
      return builtins.file_directory()
    end,
    style = {
      fg = cp.black2,
      bg = cp.pink,
      gui= 'bold',
    },
    separator = separators.arrow,
    position = 'right',
  },
  {
    operation = function ()
      return builtins.percentage_line_count()
    end,
    style = {
      fg = cp.black2,
      bg = cp.gray2,
      gui= 'bold',
    },
    separator = separators.arrow,
    position = 'right',
  },
}

require('nvim-stratus').setup(components)

This creates a statusline that looks like the following:

An example nvim-stratus statusline.

nvim-stratus's People

Contributors

sam4llis avatar

Watchers

 avatar  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.