Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Feature Bubble Index #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ Vimrc file, using `let <optiona-name> = <option-value>`:
let g:buffet_show_index = 0
```

* `g:buffet_bubble_index` - If set to `1`, shows bubbled numbers index before each buffer name
* (➊ ➋ ➌ ➍ ➎ instead of 1 2 3 4 5). Requires `g:buffet_show_index` to be set to `1`.

Default:
```viml
let g:buffet_bubble_index = 0
```

* `g:buffet_max_plug` - the maximum number of `<Plug>BuffetSwitch` provided. Mapping
will be disabled if the option is set to `0`.

Expand Down
7 changes: 6 additions & 1 deletion autoload/buffet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ function! s:Render()
let buffer_padding = 1 + (g:buffet_use_devicons ? 1+1 : 0) + 1 + sep_len

let elements = s:GetAllElements(capacity, buffer_padding)
let index_number= ['➊','➋','➌','➍','➎','➏','➐','➑','➒','➓','⓫','⓬','⓭','⓮','⓯','⓰','⓱','⓲','⓳','⓴','㉑', '㉒', '㉓' ,'㉔', '㉕','㉖','㉗','㉘','㉙','㉚','㉛','㉜','㉝','㉞','㉟','㊱','㊲','㊳','㊴','㊵','㊶','㊷','㊸','㊹','㊺','㊻','㊼','㊽','㊾','㊿']

let render = ""
for i in range(0, len(elements) - 2)
Expand All @@ -289,7 +290,11 @@ function! s:Render()
let render = render . highlight

if g:buffet_show_index && s:IsBufferElement(elem)
let render = render . " " . elem.index
if g:buffet_bubble_index
let render = render . " " . index_number[elem.index-1]
else
let render = render . " " . elem.index
endif
endif

let icon = ""
Expand Down
4 changes: 3 additions & 1 deletion plugin/buffet.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ endif

let g:buffet_show_index = get(g:, "buffet_show_index", 0)

let g:buffet_bubble_index = get(g:, "buffet_bubble_index", 0)

let g:buffet_max_plug = get(g:, "buffet_max_plug", 10)

if get(g:, "buffet_use_devicons", 1)
Expand Down Expand Up @@ -109,7 +111,7 @@ endfor
function! s:GetHiAttr(name, attr)
let vim_mode = "cterm"
let attr_suffix = ""
if has("gui") || has('termguicolors')
if has("gui") || has("termguicolors")
let vim_mode = "gui"
let attr_suffix = "#"
endif
Expand Down