Skip to content

vim-scripts/vim-cloud-buffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-cloud-buffer

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.

Features

  • 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:

vim-cloud-buffer

Note: Did you find this plugin useful? Please star it and share with others.

Usage

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

Requirements

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.

Installation

Plugin managers

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'

Manual installation

Copy the contents of each directory in the respective directories inside ~/.vim.

Ruby gem dependency

Current version uses rest-client ruby gem to handle network communication. To install it just run the following command:

gem install rest-client

Setup

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"

Bugs

Please report any bugs you may find on the GitHub issue tracker.

Contributing

Think you can make CloudBuffer better? Great!, contributions are always welcome.

Fork the project on GitHub and send a pull request.

License

CloudBuffer is licensed under the MIT license. See http://opensource.org/licenses/MIT

Happy hacking!

About

Save your buffers remotely

Resources

License

Stars

Watchers

Forks

Packages

No packages published