Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,39 @@ moves your original statusline content to tabline.
Wintabs has a handful of configuration options, see `:help wintabs-options` for
details.

## Overriding wq/q/q!

If you want `wq`, `q`, and `q!` to close the current buffer, without closing the
other buffers, add this to your `.vimrc`:

```vim
" Function to replace built in commands
" Taken from: http://vim.wikia.com/wiki/Replace_a_builtin_command_using_cabbrev
function! CommandCabbr(abbreviation, expansion)
execute 'cabbr '
\. a:abbreviation
\. ' <c-r>=getcmdpos() == 1 && getcmdtype() == ":" ? "'
\. a:expansion
\. '" : "'
\. a:abbreviation
\. '"<CR>'
endfunction

function! SaveAndCloseCurrentBuffer()
:w
call wintabs#close()
endfunction

call CommandCabbr('q', 'call wintabs#close()')
call CommandCabbr('q!', 'call wintabs#close()') " NOTE: Still asks for confirmation if not saved
call CommandCabbr('wq', 'call SaveAndCloseCurrentBuffer()')

" Automatically close tabs to make wq/q/q! behave more normally
let g:wintabs_autoclose_vim = 1
let g:wintabs_autoclose_vimtab = 1
let g:wintabs_autoclose = 2
```

# FAQ

Q: Does wintabs support Powerline fonts?
Expand Down