From 574d9c097e4eaea3a78dd5ca0cf8da6a5d933997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andri=20M=C3=B6ll?= Date: Sun, 21 Jul 2013 02:16:46 +0300 Subject: [PATCH] Add a README and LICENSE. --- LICENSE | 20 +++++++++++++ README.md | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..09f74d3 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fed2ffc --- /dev/null +++ b/README.md @@ -0,0 +1,84 @@ +Bbye (Buffer Bye) for Vim +========================== +Bbye allows you to do delete buffers (close files) without messing up your window 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 a `:Bdelete` command that behaves like a well designed citizen: + + - Closes and removes the buffer. + - Shows another file in that window. + - Shows an empty file if you've got no other files open. + - Does not leave useless `[no file]` buffers if you decide to edit another file in that window. + - Works even if a file's open in multiple windows. + +Regain your throne of windows! + + +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 using `:bdelete`, use `:Bdelete`. +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 q :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 +``` + +### 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 +``` + + +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).