CloudBuffer is a plugin developed to store and retrieve buffers in a MongoDB Simple Http Rest endpoint.
Highly inspired by gist-vim, it's indented to be used as a mean to centralise "work in progress" documents in the cloud. If you just want to instantly share code, notes, and snippets, gist-vim will suit you best.
- Lists your most recently updated buffers at the top giving you an immediate context of what are you working on
- Remembers buffer
filetype
and jumps to the last modified position in the buffer upon retrieval - Prevents losing buffer contents by accident by issuing soft deletes
- Allows you to search historical buffers using regular expressions
Let me show you:
Note: Did you find this plugin useful? Please star it and share with others.
Save current buffer remotely:
:CloudBuffer -s
List your remote buffers:
:CloudBuffer
:CloudBuffer -l
" add bang(!) to include deleted buffers
:CloudBuffer!
:CloudBuffer! -l
" Hit enter to retrieve a buffer in the list
:CloudBuffer
also retrieves a specific buffer when issued from a line
containing an embedded buffer id with the following format:
BufferId:56403ab4e4b09256a23f49d8
List buffers matching a criteria:
:CloudBuffer -re regexp
" add bang(!) to include deleted buffers
:CloudBuffer! -re regexp
Delete a buffer
:CloudBuffer -d
" add bang(!) to remove a buffer permanently
:CloudBuffer! -d
Current version needs your Vim to be compiled with +ruby
feature. Most Linux distributions and the official Windows binary you'll have the +ruby
built-in but, please ensure yours is enabled by running :ver
.
The most common plugin managers include vim-plug, NeoBundle, Vundle and pathogen.vim.
With pathogen.vim, just clone this repository inside ~/.vim/bundle
:
git clone https://github.com/jbgutierrez/vim-cloud-buffer.git ~/.vim/bundle/vim-cloud-buffer
With the other plugin managers, just follow the instructions on the homepage of each plugin. In general, you just have to add a line to your ~/.vimrc
:
" vim-plug
Plug 'jbgutierrez/vim-cloud-buffer'
" NeoBundle
NeoBundle 'jbgutierrez/vim-cloud-buffer'
" Vundle
Plugin 'jbgutierrez/vim-cloud-buffer'
Copy the contents of each directory in the respective directories inside
~/.vim
.
Current version uses rest-client
ruby gem to handle network communication. To install it just run the following command:
gem install rest-client
This plugin has been tested using mongolab
hosting service. Sign up for a 500Mb free account and follow these steps if you lack a MongoDB Simple Http Rest endpoint.
Just declare the following two variables in your .vimrc
let g:vim_cloud_buffer_url = "https://api.mongolab.com/api/1/databases/vim-cloud-buffer/collections/buffers"
let g:vim_cloud_buffer_api_key = "SECRET"
If you happen to have your .vimrc
publicly available, just set the following environment variables instead:
export VIM_CLOUD_BUFFER_URL="https://api.mongolab.com/api/1/databases/vim-cloud-buffer/collections/buffers"
export VIM_CLOUD_BUFFER_API_KEY="SECRET"
Please report any bugs you may find on the GitHub issue tracker.
Think you can make CloudBuffer better? Great!, contributions are always welcome.
Fork the project on GitHub and send a pull request.
CloudBuffer is licensed under the MIT license. See http://opensource.org/licenses/MIT
Happy hacking!