Am 08.05.2009 13:48, Wu, Yue schrieb:
> On Fri, May 08, 2009 at 01:16:36PM +0200, Dennis Benzinger wrote:
>>
>> Am 08.05.2009 12:23, Wu, Yue schrieb:
>> > As title, is it possible to make a whole buffer unmodifiable just the last
>> > line? I think these is at least one way: make all the command that can
>> > change
>> > the buffer to <Nop> in line 1 to line("$")-1, but seems need many work to
>> > do.
>> > I want to know if there are some other better ways to do it?
>> >
>>
>> Why do you want to do this? I think it would be easier to keep the whole
>> buffer unmodifiable and create a command that deletes the last line of
>> the buffer and puts it in a new buffer. Then on deleting the buffer or
>> on exiting the window an autocommand could add the line again to the
>> original buffer. Or just create a command that uses one of the input*
>> functions to edit the last line.
>
> input() lacks vim's most of powerful abilities in insert mode. I want to
> create a shell like mode[1], so comes the question. :) I don't like the first
> way you provided. :(
>
> [1] More exactly, a irc mode, the buffer can't be changed except the last line
> which is for input purpose.
If you don't insist on having everything in on buffer I'd use a
horizontally split window. The upper window can be readonly and display
the conversation and the lower window would be the input window. Then
you can use all powerful abilities Vim has to offer to edit your input
and to send your input you can setup a mapping.
Regards,
Dennis Benzinger
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---