Britton Kerin wrote:
> I just decided to make the switch from emacs after 10+ years and
> quite a pile of elisp.  Its already starting to seem worth it.
> vim's detailed easy control of keys and excellent documentation
> are big wins.  Kudos to the vim community.
>
> I have a few little questions I couldn't sort out though:
>
> 1.  Is it possible to somehow always maintain at least two
>     windows side by side even if :q or :bd happens on the
>     second to last buffer?  I know about :vsplit and such
>     but this makes you open new files a different way depending
>     on how many windows there are.
>   

Perhaps you'll find the tip "Deleting a buffer without changing your 
window layout" of interest;
see http://vim.wikia.com/wiki/VimTip622 .
> 2.  I tried this to make read-only buffers unmodifiable:
>
>         function MakeUnmodifiableIfReadonly()   
>         if &readonly
>             set nomodifiable
>         endif
>         endfunction
>         autocmd BufReadPost * call MakeUnmodifiableIfReadonly()
>
>     but it doesn't seem to work with :q or :bd, it takes a full
>     :bw, which seems not recomended.  And I probably missed some
>     totally easy way to do this (might be a good one for the FAQ)?
>   
First, you don't really need to call a function with the autocmd.  Just

  au BufReadPost * set nomodifiable

would've done what you had did via the function.  However, that setting 
doesn't affect the editing of the buffer, nor does it lock the window.  
Windows aren't lock-able.

Second, :q and :bd didn't modify the buffer -- vim quit editing the 
buffer.  Presumably you hadn't changed the buffer, either, or else vim 
would have nattered at you about "No write since last change...".

If you'd had :set hidden  (or :set bh when the buffer was active), then 
the buffer would've been kept (use  :ls!  to see them).

I think the confusion here is between buffers and windows.  Buffers are 
associated with text, and usually with a file.  They may or may not have 
some portion of them displayed in a window.
> 3.  Incremental search highlighting and folding (vim folding
>     support is *wonderful*) seem to interract badly: the screen
>     state when the current search match is inside a fold seems
>     identical to what you get when the match is failing.  Is 
>     there some option that affects this?  Ideally the fold line
>     would be highlighted, but a little error message at the
>     bottom showing "Failing Isearch" or the like would at least
>     disambiguate the cases.
>
> 4.  Is there a way to always put scrollbars to the right of windows
>     (instead of left of left windows and right of right windows)?
>   
:help guioptions

(in particular, you probably want  :set guioptions+=r)

Regards,
Chip Campbell


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to