express_line.nvim icon indicating copy to clipboard operation
express_line.nvim copied to clipboard

Switching from lightline -> express_line

Open smolck opened this issue 5 years ago • 1 comments

Here's my current lightline configuration:

Tabline

20200822_14h44m35s_grim

The main thing to notice here is that I have all open buffers listed. I use buffers instead of tabs, so this is pretty essential to my current workflow (I navigate between them using <leader>bn for the next buffer and <leader>bp for the previous one).

Statusline

20200822_14h44m58s_grim

Configuration (Lua)

    vim.g.lightline = {
        colorscheme = 'gruvbox_material';
        tabline = {
          left = { { 'bufferinfo' },
                    { 'separator' },
                    { 'bufferbefore', 'buffercurrent', 'bufferafter' }, },
          right = { { 'tabs', 'close' }, },
        };
        active = {
            left = { { 'mode', 'paste' },
                    { 'fugitive', 'readonly', 'filename', 'modified' }
            }
        };
        component_expand = {
          buffercurrent = 'lightline#buffer#buffercurrent',
          bufferbefore = 'lightline#buffer#bufferbefore',
          bufferafter = 'lightline#buffer#bufferafter',
        };
        component_type = {
          buffercurrent = 'tabsel',
          bufferbefore = 'raw',
          bufferafter = 'raw',
        };
        component_function = {
          bufferinfo = 'lightline#buffer#bufferinfo',
          readonly = 'LightlineReadonly',
          fugitive = 'LightlineFugitive'
        };
        -- separator = { left = '', right = '' };
        -- subseparator = { left = '', right = '' };
    }
    -- Lightline-buffer UI settings
    vim.g.lightline_buffer_logo                     = ' '
    vim.g.lightline_buffer_readonly_icon            = ''
    vim.g.lightline_buffer_modified_icon            = '✭'
    vim.g.lightline_buffer_git_icon                 = ' '
    vim.g.lightline_buffer_ellipsis_icon            = '..'
    vim.g.lightline_buffer_expand_left_icon         = '◀ '
    vim.g.lightline_buffer_expand_right_icon        = ' ▶'
    vim.g.lightline_buffer_active_buffer_left_icon  = ''
    vim.g.lightline_buffer_active_buffer_right_icon = ''
    vim.g.lightline_buffer_separator_icon           = '  '

    -- Requires <https://github.com/ryanoasis/vim-devicons>
    vim.g.lightline_buffer_enable_devicons          = 1

    vim.g.lightline_buffer_show_bfnr                = 1

    -- See `:help filename-modifiers`
    vim.g.lightline_buffer_fname_mod                = ':t'

    -- Hide buffer list
    vim.g.lightline_buffer_excludes                 = { 'vimfiler' }

    vim.g.lightline_buffer_maxflen                  = 30 -- Max file name length
    vim.g.lightline_buffer_minflen                  = 16 -- Min file name length

    vim.g.lightline_buffer_maxfextlen               = 30 -- Max file extension length
    vim.g.lightline_buffer_minfextlen               = 3  -- Min file extension length

    -- Reserve length for other componenet (e.g. info, close)
    vim.g.lightline_buffer_reservelen               = 20

If I uncomment the separator and subseparator lines, I get almost the same thing, just with the arrows so it looks like this:

Tabline (arrow-separated)

20200822_14h51m40s_grim

Statusline (arrow-separated)

20200822_14h51m50s_grim

How much of that is currently possible with expressline? Some of the configuration I probably don't care much about if it isn't possible, but having the buffers in the tabline and maybe some other small things are necessary for my current workflow.

smolck avatar Aug 22 '20 19:08 smolck

The one I care most was not mentioned: colorscheme configuration.

Lightline supports a custom dictionary structure for coloring each individual component based on its position. Generally, they are divided between left, middle, and right.

https://github.com/itchyny/lightline.vim/blob/f5f870e0ac67542fd83cb6ff99632940fe8795f9/doc/lightline.txt#L570

I infer this would be possible to do ad-hoc by tweaking the output of each function with the low-level 'statusline' syntax, but it should be abstracted away by this plugin through a similar configuration scheme. If this is already possible somehow, I wasn't able to tell from skimming the code or from the README.

resolritter avatar Sep 19 '20 19:09 resolritter