I see some problems:
- You are using a
cnoremap
dangerously e.g. /q
- You are using trying to override vim's native
:quit
function
- Looks like you are trying to force vim into a tab behavior
cnoremap
Do not use cnoremap
to try and create commands, use :command
. If you want to override a command then use a clever cabbrev
expression or plugin. See vim change :x function to delete buffer instead of save & quit
Native quit
There are many ways for quiting a buffer in vim. Some do slightly different things. As vimmers learn more commands they integrate them into their workflow. e.g. <c-w>c
to close a split/window and ZZ
to update and quite the current buffer. If you go down this path you will be overriding many command or you will be disregarding useful commands.
Tabs
Learn to use buffers effectively. Using tabs in Vim is great however they are not the only way and will certainly cause you pain down the road. IMHO it is best to curtail these behaviors and encourage better habits.