Skip to content

Commit

Permalink
add vim-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
chxuan committed Jun 4, 2018
1 parent 4b724e4 commit d189f2a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
14 changes: 7 additions & 7 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ Plug 'Valloric/YouCompleteMe'
Plug 'chxuan/cppfun'
Plug 'chxuan/change-colorscheme'
Plug 'chxuan/prepare-code'
Plug 'chxuan/vim-buffer'
Plug 'chxuan/vimplus-startify'
Plug 'Yggdroot/LeaderF'
Plug 'mileszs/ack.vim'
Expand All @@ -118,7 +119,6 @@ Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'vim-scripts/a.vim'
Plug 'vim-scripts/txt.vim'
Plug 'vim-scripts/BufOnly.vim'
Plug 'ryanoasis/vim-devicons'
Plug 'junegunn/vim-slash'
Plug 'junegunn/gv.vim'
Expand Down Expand Up @@ -156,12 +156,6 @@ nnoremap <leader><leader>i :PlugInstall<cr>
nnoremap <leader><leader>u :PlugUpdate<cr>
nnoremap <leader><leader>c :PlugClean<cr>
" buffer切换
nnoremap <c-n> :bn<cr>
nnoremap <c-p> :bp<cr>
nnoremap <leader>d :bd<cr>
nnoremap <leader>D :BufOnly<cr>
" 主题
set background=dark
let g:onedark_termcolors=256
Expand Down Expand Up @@ -199,6 +193,12 @@ inoremap <silent> <F12> <esc> :ShowColorScheme<cr>
" prepare-code
let g:prepare_code_plugin_path = expand($HOME . "/.vim/plugged/prepare-code")

" vim-buffer
nnoremap <c-p> :PreviousBuffer<cr>
nnoremap <c-n> :NextBuffer<cr>
nnoremap <leader>d :CloseCurrentBuffer<cr>
nnoremap <leader>D :BufOnly<cr>
" nerdtree
nnoremap <silent> <leader>n :NERDTreeToggle<cr>
inoremap <silent> <leader>n <esc> :NERDTreeToggle<cr>
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ An automatic configuration program for vim
| [cppfun][58] | 提供生成函数实现、函数声明/实现跳转等功能(I'm author:smile:) |
| [change-colorscheme][27] | 随心所欲切换主题(I'm author:smile:) |
| [prepare-code][67] | 新建文件时,生成预定义代码片段(I'm author:smile:) |
| [vim-buffer][70] | vim缓存操作(I'm author:smile:) |
| [vimplus-startify][66] | vimplus开始页面(修改自[mhinz/vim-startify][25]) |
| [vim-plug][4] | 比[Vundle][54]下载更快的插件管理软件 |
| [YouCompleteMe][5] | 史上最强大的基于语义的自动补全插件,支持C/C++、C#、Python、PHP等语言 |
Expand Down Expand Up @@ -131,6 +132,8 @@ An automatic configuration program for vim
| `<leader>G` | 显示当前文件提交记录 |
| `<leader>gg` | 显示当前文件在某个commit下的完整内容 |
| `<leader>ff` | 语法错误自动修复(FixIt) |
| `<c-p>` | 切换到上一个buffer |
| `<c-n>` | 切换到下一个buffer |
| `<leader>d` | 删除当前buffer |
| `<leader>D` | 删除当前buffer外的所有buffer |
| `vi` | 运行vi编辑器时,默认启动开始页面 |
Expand Down Expand Up @@ -296,3 +299,4 @@ Q & A
[67]: https://github.com/chxuan/prepare-code
[68]: https://github.com/rhysd/clever-f.vim
[69]: https://github.com/rhysd/github-complete.vim
[70]: https://github.com/chxuan/vim-buffer
8 changes: 5 additions & 3 deletions help.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
| `<leader>G` | 显示当前文件提交记录 |
| `<leader>gg` | 显示当前文件在某个commit下的完整内容 |
| `<leader>ff` | 语法错误自动修复(FixIt) |
| `<c-p>` | 切换到上一个buffer |
| `<c-n>` | 切换到下一个buffer |
| `<leader>d` | 删除当前buffer |
| `<leader>D` | 删除当前buffer外的所有buffer |
| `vi` | 运行vi编辑器时,默认启动开始页面 |
Expand Down Expand Up @@ -65,9 +67,9 @@
| 快捷键 | 说明 |
| ------- | ----- |
| `:e <filename>` | 新建buffer打开文件 |
| `<c-p>` | 切换到上一个buffer |
| `<c-n>` | 切换到下一个buffer |
| `<leader>d` | 删除当前buffer |
| `:bp` | 切换到上一个buffer |
| `:bn` | 切换到下一个buffer |
| `:bd` | 删除当前buffer |


窗口操作
Expand Down

0 comments on commit d189f2a

Please sign in to comment.