GithubHelp home page GithubHelp logo

crispgm / nvim-tabline Goto Github PK

View Code? Open in Web Editor NEW
67.0 5.0 15.0 89 KB

nvim port of tabline.vim with Lua

License: MIT License

Lua 99.56% Vim Script 0.44%
neovim neovim-plugin neovim-lua tabline nvim-lua

nvim-tabline's Introduction

nvim-tabline

A minimal Tabline plugin for Neovim, written in Lua. It is basically a drop-in replacement for tabline.vim but with a few differences.

nvim-tabline-screenshots

Installation

With lazy.nvim:

{
    'crispgm/nvim-tabline',
    dependencies = { 'nvim-tree/nvim-web-devicons' }, -- optional
    config = true,
}

Configuration

require('tabline').setup({opts})

Defaults

require('tabline').setup({
    show_index = true,           -- show tab index
    show_modify = true,          -- show buffer modification indicator
    show_icon = false,           -- show file extension icon
    fnamemodify = ':t',          -- file name modifier
    modify_indicator = '[+]',    -- modify indicator
    no_name = 'No name',         -- no name buffer name
    brackets = { '[', ']' },     -- file name brackets surrounding
    inactive_tab_max_length = 0  -- max length of inactive tab titles, 0 to ignore
})

Show Tabline

" Only if there are at least two tabs (default)
vim.opt.showtabline = 1

" Always
vim.opt.showtabline = 2

" Never
vim.opt.showtabline = 0

Mappings

Vim's tabpage commands are powerful enough, :help tabpage for details. If you need switch between tabs, here is a great tutorial.

Highlights

The highlighting of the tab pages line follows vim settings. See :help setting-tabline for details.

Differences

nvim-tabline is not exactly a Lua translation. There are some differences for configuration:

  • Control whether to display tab number (show_index) and buffer modification indicator (show_modify).
  • File extension icon with nvim-dev-icons.
  • Customize modify indicator and no name buffer name.
  • Close button (g:tablineclosebutton) is not supported.

nvim-tabline's People

Contributors

crispgm avatar kirameister avatar minghongx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nvim-tabline's Issues

Hide when it's only one tab page

It would be nice to have an option that allows to hide the tab bar when only one tab page is open.
That's the default vim behaviour and I'd prefer it that way.

Plugin not working

Hello,i added it in my init.vim but nothing happen
-Init.vim:

set number
set mouse=a

call plug#begin('C:\Users\Ntanh\AppData\Local\nvim\autoload\plugged')

"-----------------<{FOR_FAST_CODING}>-------------------
Plug 'gosukiwi/vim-smartpairs'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
"-----------------<{FILE_MANAGEMENT}>--------------------
Plug 'preservim/nerdtree'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ryanoasis/vim-devicons'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
"-----------------<{STATUS_BAR}>--------------------
"Plug 'itchyny/lightline.vim'
"Plug 'mengelbrecht/lightline-bufferline'
"Plug 'Ap/vim-buftabline'
Plug 'crispgm/nvim-tabline'
"---------------------<{THEME}>-------------------------
Plug 'tanvirtin/monokai.nvim'

call plug#end()
colorscheme monokai_pro

"---------------------<{COPY_PATE}>-------------------------
vmap "+y

"---------------------<{EXTENDED_SETTINGS}>-------------------------
let nvim_settings_dir = 'C:\Users\Ntanh\AppData\Local\nvim\settings'
execute 'source '.nvim_settings_dir.'_nerdtree.vim'
execute 'source '.nvim_settings_dir.'_airline.vim'

I dont know what im missing.thanks

Doesn't work well with tab overflow

I have for example 7 tabs, and I am on the 7th tab, the 1-2-3 tab is hidden in the view.

But when I focus back to tab#1, it is still hidden. But I would expect it to be visible, and 6-7 should be hidden.

Is there a way to fix this behavior?

Thanks alot!

docu: fix length instead of len

Hi,
I really like this minimal module. Two things I noticed:

  1. The example states the opt inactive_tab_max_len, but in the code it really is inactive_tab_max_length
  2. I think about an option to prepend the title with an abbreviated unique path name, much like some of the zsh prompts, e.g. p/init.lua and c/init.lua to distinguish between two open buffers from the core or plugins directory...

Thanks,

Michael.

brackets in name

Hi, Please add an option to remove brackets in names. Thanks
Note: I added the bracket_character = false, but it did not worked. Then tried bracket_in_name and it failed also. Please fix.
Screenshot at 2022-07-28 03-47-24

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.