1

Regenerate nvim config

This commit is contained in:
2024-06-02 03:29:20 +02:00
parent 75eea0c030
commit ef2e28883d
5576 changed files with 604886 additions and 503 deletions

View File

@ -0,0 +1,7 @@
root = true
[Makefile]
indent_style = tab
[*.vim]
indent_style = tab

View File

@ -0,0 +1,22 @@
## Unreleased
- Adds `:Bwipeout`. Thanks, [Juan Ibiapina](http://juanibiapina.com)!
- Fixes `:Bdelete`ing an already unlisted buffer.
That happens when you close a buffer that itself closes when switched away from.
Thanks, [Samuel Simões](http://blog.samuelsimoes.com), for debugging help!
## 1.0.1 (Jul 23, 2013)
- Fixes `:Bdelete`ing via buffer number. Finally, perfect!
## 1.0.0 (Jul 23, 2013)
- Hides the empty buffer from buffer explorers and tabbars.
- Handles `:Bdelete!`ing buffers which are set to auto-delete via `&bufhidden`.
- Wipes empty buffers after hiding to reduce the amount of unlisted buffers after using Bbye for a while.
- Handles buffer explorers and tabbars better that remove or add windows mid-flight.
- Improves an edge-case where the empty buffer might get listed and show up in buffer explorers.
- Perfect for v1.0.0.
## 0.9.1 (Jul 21, 2013)
- Removes an innocent but forgotten debugging line. Now even more perfect.
## 0.9.0 (Jul 21, 2013)
- First release. It's perfect.

View File

@ -0,0 +1,20 @@
Bbye
Copyright (C) 2013 Andri Möll
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or any later version.
Additional permission under the GNU Affero GPL version 3 section 7:
If you modify this Program, or any covered work, by linking or
combining it with other code, such other code is not for that reason
alone subject to any of the requirements of the GNU Affero GPL version 3.
In summary:
- You can use this program for no cost.
- You can use this program for both personal and commercial reasons.
- You do not have to share your own program's code which uses this program.
- You have to share modifications (e.g bug-fixes) you've made to this program.
For the full copy of the GNU Affero General Public License see:
http://www.gnu.org/licenses.

View File

@ -0,0 +1,17 @@
NAME := bbye
VERSION := 1.0.1
ID := 4664
love:
@echo "Feel like makin' love."
pack:
zip -r "$(NAME)-$(VERSION).zip" * --exclude Makefile --exclude "*.zip"
publish:
open "http://www.vim.org/scripts/add_script_version.php?script_id=$(ID)"
tag:
git tag "v$(VERSION)"
.PHONY: love pack publish tag

View File

@ -0,0 +1,87 @@
Bbye (Buffer Bye) for Vim
==========================
Bbye allows you to do delete buffers (close files) without closing your windows or messing up your layout.
Vim by default closes all windows that have the buffer (file) open when you do `:bdelete`. If you've just got your splits and columns perfectly tuned, having them messed up equals a punch in the face and that's no way to tango.
Bbye gives you `:Bdelete` and `:Bwipeout` commands that behave like well designed citizens:
- Close and remove the buffer.
- Show another file in that window.
- Show an empty file if you've got no other files open.
- Do not leave useless `[no file]` buffers if you decide to edit another file in that window.
- Work even if a file's open in multiple windows.
- Work a-okay with various buffer explorers and tabbars.
Regain your throne as king of buffers!
Installing
----------
The easiest and most modular way is to download Bbye to `~/.vim/bundle`:
```
mkdir -p ~/.vim/bundle/bbye
```
Using Git:
```
git clone https://github.com/moll/vim-bbye.git ~/.vim/bundle/bbye
```
Using Wget:
```
wget https://github.com/moll/vim-bbye/archive/master.tar.gz -O- | tar -xf- --strip-components 1 -C ~/.vim/bundle/bbye
```
Then prepend that directory to Vim's `&runtimepath` (or use [Pathogen](https://github.com/tpope/vim-pathogen)):
```
set runtimepath^=~/.vim/bundle/bbye
```
Using
-----
Instead of `:bdelete` and `:bwipeout`, use `:Bdelete` and `:Bwipeout` respectively. Fortunately autocomplete helps by sorting `:Bdelete` before its lowercase brother.
As it's likely you'll be using `:Bdelete` often, make a shortcut to `\q`, for example, to save time. Throw this to your `vimrc`:
```
:nnoremap <Leader>q :Bdelete<CR>
```
### Buffer delete vs wipeout
Vim has two commands for closing a buffer: `:bdelete` and `:bwipeout`. The former removes the file from the buffer list, clears its options, variables and mappings. However, it remains in the jumplist, so `Ctrl-o` takes you back and reopens the file. If that's not what you want, use `:bwipeout` or Bbye's equivalent `:Bwipeout` where you would've used `:bdelete`.
### Closing all open buffers and files
Occasionally you'll want to close all open buffers and files while leaving your pristine window setup as is. That's easy. Just do:
```
:bufdo :Bdelete
```
For some variations, like closing all-but-one buffer, see [@qiushihe](https://github.com/qiushihe)'s script in https://github.com/moll/vim-bbye/pull/4.
### Aliasing to :Bclose
If you've used any `Bclose.vim` scripts before and for some reason need the `:Bclose` command to exist, you may make an alias:
```
command! -bang -complete=buffer -nargs=? Bclose Bdelete<bang> <args>
```
License
-------
Bbye is released under a *Lesser GNU Affero General Public License*, which in summary means:
- You **can** use this program for **no cost**.
- You **can** use this program for **both personal and commercial reasons**.
- You **do not have to share your own program's code** which uses this program.
- You **have to share modifications** (e.g bug-fixes) you've made to this program.
For more convoluted language, see the `LICENSE` file.
About
-----
**[Andri Möll](http://themoll.com)** authored this in SublemacslipseMate++.
[Monday Calendar](https://mondayapp.com) supported the engineering work.
Inspired by [Bclose.vim](http://vim.wikia.com/wiki/VimTip165), but rewritten to be perfect.
If you find Bbye needs improving or you've got a question, please don't hesitate to email me anytime at andri@dot.ee or [create an issue online](https://github.com/moll/vim-bbye/issues).

View File

@ -0,0 +1,91 @@
if exists("g:loaded_bbye") || &cp | finish | endif
let g:loaded_bbye = 1
function! s:bdelete(action, bang, buffer_name)
let buffer = s:str2bufnr(a:buffer_name)
let w:bbye_back = 1
if buffer < 0
return s:error("E516: No buffers were deleted. No match for ".a:buffer_name)
endif
if getbufvar(buffer, "&modified") && empty(a:bang)
let error = "E89: No write since last change for buffer "
return s:error(error . buffer . " (add ! to override)")
endif
" If the buffer is set to delete and it contains changes, we can't switch
" away from it. Hide it before eventual deleting:
if getbufvar(buffer, "&modified") && !empty(a:bang)
call setbufvar(buffer, "&bufhidden", "hide")
endif
" For cases where adding buffers causes new windows to appear or hiding some
" causes windows to disappear and thereby decrement, loop backwards.
for window in reverse(range(1, winnr("$")))
" For invalid window numbers, winbufnr returns -1.
if winbufnr(window) != buffer | continue | endif
execute window . "wincmd w"
" Bprevious also wraps around the buffer list, if necessary:
try | exe bufnr("#") > 0 && buflisted(bufnr("#")) ? "buffer #" : "bprevious"
catch /^Vim([^)]*):E85:/ " E85: There is no listed buffer
endtry
" If found a new buffer for this window, mission accomplished:
if bufnr("%") != buffer | continue | endif
call s:new(a:bang)
endfor
" Because tabbars and other appearing/disappearing windows change
" the window numbers, find where we were manually:
let back = filter(range(1, winnr("$")), "getwinvar(v:val, 'bbye_back')")[0]
if back | exe back . "wincmd w" | unlet w:bbye_back | endif
" If it hasn't been already deleted by &bufhidden, end its pains now.
" Unless it previously was an unnamed buffer and :enew returned it again.
"
" Using buflisted() over bufexists() because bufhidden=delete causes the
" buffer to still _exist_ even though it won't be :bdelete-able.
if buflisted(buffer) && buffer != bufnr("%")
exe a:action . a:bang . " " . buffer
endif
endfunction
function! s:str2bufnr(buffer)
if empty(a:buffer)
return bufnr("%")
elseif a:buffer =~# '^\d\+$'
return bufnr(str2nr(a:buffer))
else
return bufnr(a:buffer)
endif
endfunction
function! s:new(bang)
exe "enew" . a:bang
setl noswapfile
" If empty and out of sight, delete it right away:
setl bufhidden=wipe
" Regular buftype warns people if they have unsaved text there. Wouldn't
" want to lose someone's data:
setl buftype=
" Hide the buffer from buffer explorers and tabbars:
setl nobuflisted
endfunction
" Using the built-in :echoerr prints a stacktrace, which isn't that nice.
function! s:error(msg)
echohl ErrorMsg
echomsg a:msg
echohl NONE
let v:errmsg = a:msg
endfunction
command! -bang -complete=buffer -nargs=? Bdelete
\ :call s:bdelete("bdelete", <q-bang>, <q-args>)
command! -bang -complete=buffer -nargs=? Bwipeout
\ :call s:bdelete("bwipeout", <q-bang>, <q-args>)