Loading ...
Sorry, an error occurred while loading the content.

Re: Quit vim ignore certain type of buffers

Expand Messages
  • sc
    ... an easier solution would be to sacrifice an F-key to quit, after all it s something you always do from every session -- due to my history with big iron my
    Message 1 of 5 , Nov 27, 2012
    • 0 Attachment
      On Tue, Nov 27, 2012 at 10:21:12PM +0000, Marcin Szamotulski wrote:
      > On 11:59 Tue 27 Nov , Techlive Zheng wrote:
      > > `:quit` command currently exits vim if it is the last open window, help window will be ignored in this check, is there any way to specify certain type of buffers by '&buftype' or '&filetype' to be ignored during this process?
      > >
      > > --
      > > You received this message from the "vim_dev" maillist.
      > > Do not top-post! Type your reply below the text you are replying to.
      > > For more information, visit http://www.vim.org/maillist.php

      > Hi,

      > This is an answer and a question at the same time ...

      > Unfortunately non of the buftypes works, except help. But the help file
      > discourages to set this buftype. __Can anybody say why?__

      > In one of my plugins I have a table of contents window which could be
      > abandoned nicely, another example is the NERD_Tree window.

      > One always could redefine the command :quit and make a map to ^Wd to
      > close vim when only the window has left, but to overwrite a build-in
      > command one has to use one of the cmdalias plugins:
      > http://www.vim.org/scripts/script.php?script_id=746
      > http://www.vim.org/scripts/script.php?script_id=4250

      an easier solution would be to sacrifice an F-key to quit, after all
      it's something you always do from every session -- due to my history
      with big iron my choice is always to put :bdelete<CR> on F3 and
      :quall<CR> on S-F3

      with those mappings in place you can use the repeat key feature on F3,
      or if you're really in a hurry hit S-F3 and you're out

      sc

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • ZyX
      ... Help contents is displayed in window holding buffer with this buftype if it exists. You don’t need your buffer get hidden when user issues “:h”
      Message 2 of 5 , Nov 28, 2012
      • 0 Attachment
        > Unfortunately non of the buftypes works, except help. But the help file
        > discourages to set this buftype. __Can anybody say why?__

        Help contents is displayed in window holding buffer with this buftype if it exists. You don’t need your buffer get hidden when user issues “:h” command, do you?

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Marcin Szamotulski
        ... I have found the solution. There was added autocommand group QuitPre which can be used to close additional windows. Thanks Zyx for the answer. Cheers,
        Message 3 of 5 , Nov 29, 2012
        • 0 Attachment
          On 09:34 Wed 28 Nov , ZyX wrote:
          > > Unfortunately non of the buftypes works, except help. But the help file
          > > discourages to set this buftype. __Can anybody say why?__
          >
          > Help contents is displayed in window holding buffer with this buftype if it exists. You don’t need your buffer get hidden when user issues “:h” command, do you?
          >
          > --
          > You received this message from the "vim_dev" maillist.
          > Do not top-post! Type your reply below the text you are replying to.
          > For more information, visit http://www.vim.org/maillist.php

          I have found the solution. There was added autocommand group QuitPre
          which can be used to close additional windows. Thanks Zyx for the
          answer.

          Cheers,
          Marcin

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.