~mkelly/config

4dd5477532886ac9c3ff9d5c214a68cc05605571 — Michael Kelly 6 months ago 74ac364
[vi] stop using vim-bufferline
9 files changed, 0 insertions(+), 379 deletions(-)

D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/.gitignore
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/LICENSE
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/README.md
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/autoload/bufferline.vim
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/autoload/bufferline/algos/fixed_position.vim
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/doc/bufferline.txt
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/img/bufferline-command.png
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/img/bufferline-status.png
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/plugin/bufferline.vim
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/.gitignore => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/.gitignore +0 -1
@@ 1,1 0,0 @@
doc/tags

D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/LICENSE => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/LICENSE +0 -21
@@ 1,21 0,0 @@
The MIT License (MIT)

Copyright (C) 2013 Bailey Ling

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/README.md => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/README.md +0 -38
@@ 1,38 0,0 @@
# vim-bufferline

Super simple vim plugin to show the list of buffers in the command bar.

# screenshots

#### in the statusline

![img](img/bufferline-status.png)

#### or the command bar

![img](img/bufferline-command.png)

# configuration

`:help bufferline`

# installation

*  [pathogen](https://github.com/tpope/vim-pathogen)
  *  `git clone https://github.com/bling/vim-bufferline ~/.vim/bundle/vim-bufferline`
*  [neobundle](https://github.com/Shougo/neobundle.vim)
  *  `NeoBundle 'bling/vim-bufferline'`
*  [vundle](https://github.com/gmarik/vundle)
  *  `Plugin 'bling/vim-bufferline'`
*  [vam](https://github.com/MarcWeber/vim-addon-manager)
  *  `call vam#ActivateAddons([ 'vim-bufferline' ])`
*  [vim-plug](https://github.com/junegunn/vim-plug)
  *  `Plug 'bling/vim-bufferline'`

# credits

This was inspired by the [buftabs](http://www.vim.org/scripts/script.php?script_id=1664) script.

# license

MIT License. Copyright (c) 2013 Bailey Ling.

D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/autoload/bufferline.vim => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/autoload/bufferline.vim +0 -130
@@ 1,130 0,0 @@
" keep track of vimrc setting
let s:updatetime = &updatetime

" keep track of scrollinf window start
let s:window_start = 0

function! s:generate_names()
  let names = []
  let i = 1
  let last_buffer = bufnr('$')
  let current_buffer = bufnr('%')
  while i <= last_buffer
    if bufexists(i) && buflisted(i)
      let modified = ' '
      if getbufvar(i, '&mod')
        let modified = g:bufferline_modified
      endif
      let fname = fnamemodify(bufname(i), g:bufferline_fname_mod)
      if g:bufferline_pathshorten != 0
        let fname = pathshorten(fname)
      endif
      let fname = substitute(fname, "%", "%%", "g")

      let skip = 0
      for ex in g:bufferline_excludes
        if match(fname, ex) > -1
          let skip = 1
          break
        endif
      endfor

      if !skip
        let name = ''
        if g:bufferline_show_bufnr != 0 && g:bufferline_status_info.count >= g:bufferline_show_bufnr
          let name =  i . ':'
        endif
        let name .= fname . modified

        if current_buffer == i
          let name = g:bufferline_active_buffer_left . name . g:bufferline_active_buffer_right
          let g:bufferline_status_info.current = name
        else
          let name = g:bufferline_separator . name . g:bufferline_separator
        endif

        call add(names, [i, name])
      endif
    endif
    let i += 1
  endwhile

  if len(names) > 1
    if g:bufferline_rotate == 1
      call bufferline#algos#fixed_position#modify(names)
    endif
  endif

  return names
endfunction

function! bufferline#get_echo_string()
  " check for special cases like help files
  let current = bufnr('%')
  if !bufexists(current) || !buflisted(current)
    return bufname('%')
  endif

  let names = s:generate_names()
  let line = ''
  for val in names
    let line .= val[1]
  endfor

  let index = match(line, '\V'.g:bufferline_status_info.current)
  let g:bufferline_status_info.count = len(names)
  let g:bufferline_status_info.before = strpart(line, 0, index)
  let g:bufferline_status_info.after = strpart(line, index + len(g:bufferline_status_info.current))
  return line
endfunction

function! s:echo()
  if &filetype ==# 'unite'
    return
  endif

  let line = bufferline#get_echo_string()

  " 12 is magical and is the threshold for when it doesn't wrap text anymore
  let width = &columns - 12
  if g:bufferline_rotate == 2
    let current_buffer_start = stridx(line, g:bufferline_active_buffer_left)
    let current_buffer_end = stridx(line, g:bufferline_active_buffer_right)
    if current_buffer_start < s:window_start
      let s:window_start = current_buffer_start
    endif
    if current_buffer_end > (s:window_start + width)
      let s:window_start = current_buffer_end - width + 1
    endif
    let line = strpart(line, s:window_start, width)
  else
    let line = strpart(line, 0, width)
  endif

  echo line

  if &updatetime != s:updatetime
    let &updatetime = s:updatetime
  endif
endfunction

function! s:cursorhold_callback()
  call s:echo()
  autocmd! bufferline CursorHold
endfunction

function! s:refresh(updatetime)
  let &updatetime = a:updatetime
  autocmd bufferline CursorHold * call s:cursorhold_callback()
endfunction

function! bufferline#init_echo()
  augroup bufferline
    au!

    " events which output a message which should be immediately overwritten
    autocmd BufWinEnter,WinEnter,InsertLeave,VimResized * call s:refresh(1)
  augroup END

  autocmd CursorHold * call s:echo()
endfunction

D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/autoload/bufferline/algos/fixed_position.vim => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/autoload/bufferline/algos/fixed_position.vim +0 -9
@@ 1,9 0,0 @@
" pins the active buffer to a specific index in the list
function! bufferline#algos#fixed_position#modify(names)
  let current = bufnr('%')
  while a:names[g:bufferline_fixed_index][0] != current
    let first = remove(a:names, 0)
    call add(a:names, first)
  endwhile
endfunction


D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/doc/bufferline.txt => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/doc/bufferline.txt +0 -119
@@ 1,119 0,0 @@
*bufferline.txt*  Simple plugin for generating buffer list names

==============================================================================
INTRODUCTION                                                    *bufferline*

vim-bufferline is a simple plugin that helps you keep track of all your open
buffers.  It also integrates nicely with vim-airline.

==============================================================================
CONFIGURATION                                     *bufferline-configuration*

There are a couple configuration values available (shown with their default
values):

* denotes whether bufferline should automatically echo to the command bar
>
  let g:bufferline_echo = 1
<

* the separator used on the left side of a buffer
>
  let g:bufferline_active_buffer_left = '['
<

* the separator used on the right side of a buffer
>
  let g:bufferline_active_buffer_right = ']'
<

* the symbol to denote that a buffer is modified
>
  let g:bufferline_modified = '+'
<

* denotes whether buffer numbers should be displayed
>
  let g:bufferline_show_bufnr = 1
<

* denotes whether the bufferline should have rotation applied
>
  " default, no rotate, no scrolling
  let g:bufferline_rotate = 0

  " scrolling with fixed current buffer position
  let g:bufferline_rotate = 1

  " scrolling without fixed current buffer position
  let g:bufferline_rotate = 2
<

* only valid when `g:bufferline_rotate` is set to 1:
>
  let g:bufferline_fixed_index =  0 "always first
  let g:bufferline_fixed_index =  1 "always second (default)
  let g:bufferline_fixed_index = -1 "always last
<

* denotes how to display the filename of a buffer (see |filename-modifiers|
  for more details)
>
  let g:bufferline_fname_mod = ':t'
<

* denotes the highlight group for inactive buffers when used in the
  |statusline|
>
  let g:bufferline_inactive_highlight = 'StatusLineNC'
<

* denotes the highlight group for the active buffer when used in the
  |statusline|
>
  let g:bufferline_active_highlight = 'StatusLine'
<

* denotes whether the active highlight should be used when there is only one
  buffer.
>
  let g:bufferline_solo_highlight = 0
<

* denotes any exclude patterns.
>
  let g:bufferline_excludes = [] "see source for defaults
<

* denotes whether paths in buffer names should be |pathshorten()|-ed.
>
  let g:bufferline_pathshorten = 0
<

==============================================================================
STATUSLINE INTEGRATION                               *bufferline-statusline*

>
  let g:bufferline_echo = 0
  autocmd VimEnter *
    \ let &statusline='%{bufferline#refresh_status()}'
      \ .bufferline#get_status_string()
<

The function refresh_status() returns an empty string and only exists to
populate some global variables.  Since it is inside an %{} block, the
variables will get updated whenever the statusline needs to be drawn.
get_status_string() creates a string which references these variables.

==============================================================================
CONTRIBUTIONS                                     *bufferline-contributions*

Contributions and pull requests are welcome.

==============================================================================
LICENSE                                                 *bufferline-license*

MIT License. Copyright © 2013 Bailey Ling.


 vim:tw=78:ts=8:ft=help:norl:

D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/img/bufferline-command.png => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/img/bufferline-command.png +0 -0
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/img/bufferline-status.png => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/img/bufferline-status.png +0 -0
D .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/plugin/bufferline.vim => .local/share/nvim/site/pack/vim-bufferline/start/vim-bufferline/plugin/bufferline.vim +0 -61
@@ 1,61 0,0 @@
if exists('g:loaded_bufferline')
  finish
endif
let g:loaded_bufferline = 1

function! s:check_defined(variable, default)
  if !exists(a:variable)
    let {a:variable} = a:default
  endif
endfunction

call s:check_defined('g:bufferline_active_buffer_left', '[')
call s:check_defined('g:bufferline_active_buffer_right', ']')
call s:check_defined('g:bufferline_separator', ' ')
call s:check_defined('g:bufferline_modified', '+')
call s:check_defined('g:bufferline_echo', 1)
call s:check_defined('g:bufferline_show_bufnr', 1)
call s:check_defined('g:bufferline_fname_mod', ':t')
call s:check_defined('g:bufferline_inactive_highlight', 'StatusLineNC')
call s:check_defined('g:bufferline_active_highlight', 'StatusLine')
call s:check_defined('g:bufferline_rotate', 0)
call s:check_defined('g:bufferline_fixed_index', 1)
call s:check_defined('g:bufferline_solo_highlight', 0)
call s:check_defined('g:bufferline_excludes', ['\[vimfiler\]'])
call s:check_defined('g:bufferline_pathshorten', 0)

function! bufferline#generate_string()
  return "bufferline#generate_string() is obsolete! Please consult README."
endfunction

let g:bufferline_status_info = {
      \ 'count': 0,
      \ 'before': '',
      \ 'current': '',
      \ 'after': '',
      \ }

function! bufferline#refresh_status()
  if g:bufferline_solo_highlight
    if g:bufferline_status_info.count == 1
      exec printf('highlight! link %s %s', g:bufferline_active_highlight, g:bufferline_inactive_highlight)
    else
      exec printf('highlight! link %s NONE', g:bufferline_active_highlight)
    endif
  endif
  call bufferline#get_echo_string()
  return ''
endfunction
function! bufferline#get_status_string()
  return
        \ '%#'.g:bufferline_inactive_highlight.'#'
        \.'%{g:bufferline_status_info.before}'
        \.'%#'.g:bufferline_active_highlight.'#'
        \.' %{g:bufferline_status_info.current} '
        \.'%#'.g:bufferline_inactive_highlight.'#'
        \.'%{g:bufferline_status_info.after}'
endfunction

if g:bufferline_echo
  call bufferline#init_echo()
endif