1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-28 00:50:05 +08:00
SpaceVim/docs/api/vim/buffer.md

34 lines
889 B
Markdown
Raw Normal View History

2019-10-08 22:24:03 +08:00
---
2020-09-14 22:47:49 +08:00
title: "vim#buffer API"
2019-10-08 22:24:03 +08:00
description: "vim#buffer API provides some basic functions for setting and getting config of vim buffer."
---
# [Available APIs](../../) >> vim#buffer
<!-- vim-markdown-toc GFM -->
- [Intro](#intro)
- [Functions](#functions)
<!-- vim-markdown-toc -->
## Intro
2020-09-14 22:47:49 +08:00
`vim#buffer` API provides some basic functions for setting and getting config of vim buffer.
Here is an example for using this API:
2019-10-08 22:24:03 +08:00
```vim
let s:BUFFER = SpaceVim#api#import('vim#buffer')
2020-09-14 22:47:49 +08:00
let br = s:BUFFER.bufadd('')
call s:BUFFER.buf_set_lines(br, 1, -1, 0,['line 1', 'line 2', 'line 3'])
2019-10-08 22:24:03 +08:00
```
## Functions
here is a list of functions implement in this api. When Vim has python or lua support,
some of these functions are better experienced
| function name | description |
| ---------------- | -------------------------- |
| `filter_do(cmd)` | filter buffers and run cmd |