vim fechar buffer, não é bem vim

2

Eu sabia que o buffer próximo é :bd , mas às vezes eu abro um monte de arquivos (NERDTree ou ctrl+p ) e eu uso esse comando e, em seguida, saio do meu vim. Mas às vezes eu uso :q , é só fechar meu buffer. Eu não sei porque? Eu preencho um pouco confuso.

Eu acho que o problema é .vimrc , está certo?

Meu .vimrc

   " Note: Skip initialization for vim-tiny or vim-small.
if 0 | endif

if has('vim_starting')
  if &compatible
    set nocompatible               " Be iMproved
  endif

  " Required:
  set runtimepath+=~/.vim/bundle/neobundle.vim/
 endif

" Required:
call neobundle#begin(expand('~/.vim/bundle/'))

" Let NeoBundle manage NeoBundle
" Required:
NeoBundleFetch 'Shougo/neobundle.vim'

" My Bundles here:
" Refer to |:NeoBundle-examples|.
" Note: You don't set neobundle setting in .gvimrc!

" plugin
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'jistr/vim-nerdtree-tabs'
NeoBundle 'kien/ctrlp.vim'
NeoBundle 'bling/vim-airline'
NeoBundle 'Lokaltog/vim-powerline'
NeoBundle 'altercation/vim-colors-solarized'
NeoBundle 'Yggdroot/indentLine' " Line
NeoBundle 'tpope/vim-surround'
NeoBundle 'taglist.vim'
NeoBundle 'shawncplus/phpcomplete.vim'
NeoBundle 'Valloric/YouCompleteMe'
NeoBundle 'airblade/vim-gitgutter'
NeoBundle 'tpope/vim-surround'
NeoBundle 'tpope/vim-rails'
NeoBundle 'easymotion/vim-easymotion'
NeoBundle 'mattn/emmet-vim'
NeoBundle 'terryma/vim-multiple-cursors'
NeoBundle 'haya14busa/incsearch.vim'
NeoBundle 'jiangmiao/auto-pairs'
NeoBundle 'breuckelen/vim-resize'
NeoBundle 'justincampbell/vim-eighties'
NeoBundle 'dkprice/vim-easygrep'

" fix powerline arrow
let g:airline_powerline_fonts = 1
let g:Powerline_symbols = 'fancy'

" airline setting
let g:airline#extensions#tabline#enabled = 1
set laststatus=2
" set left separator
let g:airline#extensions#tabline#left_sep = ' '
" set left separator which are not editting
let g:airline#extensions#tabline#left_alt_sep = '|'
" show buffer number
let g:airline#extensions#tabline#buffer_nr_show = 1

" theme
se t_Co=16
let g:solarized_termcolors=256
syntax enable
set background=dark
colorscheme solarized

" line
let g:indentLine_color_term = 239
" none X terminal
let g:indentLine_color_tty_light = 7 " (default: 4)
let g:indentLine_color_dark = 1 " (default: 2)

set number

set relativenumber
:hi LineNr cterm=bold ctermfg=White ctermbg=LightGreen

set ai
set cursorline    
set cursorcolumn
set enc=utf8    
set expandtab    
set tabstop=4
set shiftwidth=4    

" NERDTree map
map <leader>kb :NERDTreeToggle<CR>
let NERDTreeWinPos="left"

" Taglist
map <f9> :Tlist<CR>
let Tlist_Use_Right_Window = 1
let Tlist_Exit_OnlyWindow = 1

set cursorline
highlight CursorLine cterm=underline ctermfg=NONE ctermbg=NONE

" backspace
set backspace=2

if exists('$TMUX')
    let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\"
    let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\"
else
  let &t_SI = "\<Esc>]50;CursorShape=1\x7"
  let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif

set autoindent

" vim-multiple-cursors
let g:multi_cursor_next_key='<C-d>'
let g:multi_cursor_prev_key='<C-p>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'

" ------ star -----

let mapleader = "\"
:nnoremap <leader>ev :vsplit $MYVIMRC<cr>
:nnoremap <leader>sv :source $MYVIMRC<cr>

" Ctrl + l visual line
:nnoremap <c-l> V<CR>
:inoremap <c-l> <c-c>V<CR>

:inoremap <c-d> <c-c>ddi

:nnoremap <leader>" viw<esc>a"<esc>hbi"<esc>lel
:nnoremap <leader>' viw<esc>a'<esc>hbi'<esc>lel

:inoremap jk <c-c>

:nnoremap <leader>d bve
:inoremap <leader>d <c-c>bve

:nnoremap <leader>w :w<CR>:echo "saved"<CR>
:inoremap <leader>w <c-c>:wi<CR>

:nnoremap <leader>wq :wq<CR>:echo "saved"<CR>
:inoremap <leader>wq <c-c>:wq<CR>

" Tab
:nnoremap <leader>n :bnext<CR>
:nnoremap <leader>p :bprevious<CR>
:nnoremap <leader>bd :bdelete<CR>

" page down
:nnoremap <leader>f <c-f>

" page up
:nnoremap <leader>b <c-b>

autocmd BufWritePre * :%s/\s\+$//e    
set hlsearch    
:nnoremap <leader>] <c-]>    
:nnoremap <leader>t <c-t>

" emmet
let g:user_emmet_mode='a'

set mouse=nicr

" copy to clipboard
map <leader>c "*y<CR>

" ------ end -------

call neobundle#end()

" Required:
filetype plugin indent on

" If there are uninstalled bundles found on startup,
" this will conveniently prompt you to install them.
NeoBundleCheck
    
por lighter 06.10.2016 / 04:36

2 respostas

1

O comando :q não fecha os buffers, fecha a janela atual. Se você tiver mais de uma janela - e isso inclui guias - ela não será encerrada. Se você realmente quiser sair do Vim use :qa . Veja:

:help :quit
:help :qall
    
por 06.10.2016 / 04:54
1

Encontrei o problema no projeto git do NERDTree.

De acordo com esta resposta , modifiquei meu .vimrc . É trabalho para mim.

nnoremap <leader>q :bp<cr>:bd #<cr>
    
por 07.10.2016 / 09:41

Tags