Skip to content

Commit

Permalink
配合minibuffer实现数字+B切换到某个buff的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
Leeiio committed Oct 15, 2010
1 parent 7edde5f commit 79ab240
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,23 @@ map <leader>jt <Esc>:%!json_xs -f json -t json-pretty<CR>
" 搭配minibuffer切换buffer
noremap <leader><leader> <C-^>
" 基本完美解决buffer切换,用buffer号加B 键
function! BufPos_ActivateBuffer(num)
if a:num == 0
echo "No buffer " . a:num "!"
return
endif
if a:num > bufnr("$")
echo "No buffer " . a:num "!"
else
if buflisted(a:num) && getbufvar(a:num, "&modifiable")
exe "buffer " . a:num
endif
endif
endfunction
nmap b :<C-U>call BufPos_ActivateBuffer(v:count)<CR>

" =====================
" 插件配置
" =====================
Expand Down

0 comments on commit 79ab240

Please sign in to comment.