*vital-vim-buffer.txt* Vim's buffer related stuff in general. Maintainers: thinca , ujihisa ============================================================================== CONTENTS *Vital.Vim.Buffer-contents* INTRODUCTION |Vital.Vim.Buffer-introduction| USAGE |Vital.Vim.Buffer-usage| INTERFACE |Vital.Vim.Buffer-interface| FUNCTIONS |Vital.Vim.Buffer-functions| ============================================================================== INTRODUCTION *Vital.Vim.Buffer-introduction* *Vital.Vim.Buffer* is a Vim's buffer library. ============================================================================== USAGE *Vital.Vim.Buffer-usage* > let B = V.import('Vim.Buffer') echo B.is_cmdwin() " 1 if you are in command-line-window. echo B.open('A.txt', 'split') " Open A.txt via split. show 1 if " the A.txt is newly loaded < ============================================================================== INTERFACE *Vital.Vim.Buffer-interface* ------------------------------------------------------------------------------ FUNCTIONS *Vital.Vim.Buffer-functions* is_cmdwin() *Vital.Vim.Buffer.is_cmdwin()* Return a boolean (0/1) which indicate whether a current buffer is in |command-line-window| or not. Note that most of buffer manipulation does not work in the window. get_last_selected() *Vital.Vim.Buffer.get_last_selected()* Get the last selected text in visual mode. This is almost the same as > :normal! gvy < without changing unnamed register. But this function can work even in |textlock|. open({buffer}, {opener}) *Vital.Vim.Buffer.open()* Open a {buffer} with a specified {opener}. Return value is a boolean (0/1) which indicate whether the buffer is newly loaded or not. If 0 or an empty string is specified to {buffer}, the function open a new empty buffer with a specified {opener}. In this case, the return value is always 1. The {opener} can be a |Number|, |String| or |Funcref|. If |Number| is specified, the function will open a exiting buffer which is identified by a buffer number (See |bufnr()|). If |String| is specified, it will open a existing buffer which is identified by a buffer name, otherwise it will open a new buffer and give {buffer} to the buffer as a buffer name (See |bufname()|). If a |Funcref| is specified, the function will be called with the {buffer} as a first argument. ============================================================================== vim:tw=78:fo=tcq2mM:ts=8:ft=help:norl