Re: locked window

2006-10-19 Thread A.J.Mechelynck

Brecht Machiels wrote:

Hi,


You can clear the 'modifiable' option to disable unintended
modifications to a buffer.

   setlocal nomodifiable


Is is possible to prevent, for example, the project plugin from opening
another file (other than the current) in a window? The nomodifiable
option only applies to the buffer. The window should be locked to the
buffer instead.

Regards,
Brecht




Instead of calling the program vim, call it rview. Then you won't be able 
to write anything, nor to use a shell command. Is that safe enough? Maybe 
:help starting.txt will give you other ideas.



Best regards,
Tony.


Re: locked window

2006-10-19 Thread Andy Wokula

Brecht Machiels schrieb:

Hi,


You can clear the 'modifiable' option to disable unintended
modifications to a buffer.

   setlocal nomodifiable


Is is possible to prevent, for example, the project plugin from opening
another file (other than the current) in a window? The nomodifiable
option only applies to the buffer. The window should be locked to the
buffer instead.

Regards,
Brecht




:help :sandbox

may help (vim7 only I think).

Andy





___ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de


Re: locked window

2006-10-19 Thread Kim Schulz
On Thu, 19 Oct 2006 15:18:12 +0200
A.J.Mechelynck [EMAIL PROTECTED] wrote:

[snip] 
 
 Instead of calling the program vim, call it rview. Then you won't
 be able to write anything, nor to use a shell command. Is that safe
 enough? Maybe :help starting.txt will give you other ideas.


except that this is not what I want. I would like to have a preview
window that shows the position of decleration whenever I move the
cursor on top of a function name, variable etc. It should ofcause use
tags to find the right place. 
Source browsers like Source Insight has a feature like this and I love
the way it gives you a superb overview of the code when reading through
it. 



-- 
Kim Schulz| Private :  http://www.schulz.dk
[EMAIL PROTECTED] | Business:  http://www.devteam.dk
+45 5190 4262 | Sparetime: http://www.fundanemt.com


Re: locked window

2006-10-19 Thread Yegappan Lakshmanan

Hi,

On 10/19/06, Kim Schulz [EMAIL PROTECTED] wrote:

On Thu, 19 Oct 2006 15:18:12 +0200
A.J.Mechelynck [EMAIL PROTECTED] wrote:

[snip]

 Instead of calling the program vim, call it rview. Then you won't
 be able to write anything, nor to use a shell command. Is that safe
 enough? Maybe :help starting.txt will give you other ideas.


except that this is not what I want. I would like to have a preview
window that shows the position of decleration whenever I move the
cursor on top of a function name, variable etc. It should ofcause use
tags to find the right place.
Source browsers like Source Insight has a feature like this and I love
the way it gives you a superb overview of the code when reading through
it.



You can use the detailed example code under :help CursorHold-example.
It uses the :ptag command and the cursorhold autocmd to jump
to the tag under the cursor in the preview window and highlight the
line.

- Yegappan


Re: locked window

2006-10-19 Thread Kim Schulz
On Thu, 19 Oct 2006 12:15:17 -0700
Yegappan Lakshmanan [EMAIL PROTECTED] wrote:


 You can use the detailed example code under :help
 CursorHold-example. It uses the :ptag command and the cursorhold
 autocmd to jump to the tag under the cursor in the preview window and
 highlight the line.

absolutely perfect. this er very close to what I had in mind. Except
that I would really like this window to be locked (hence the question
which started this thread). 


-- 
Kim Schulz| Private :  http://www.schulz.dk
[EMAIL PROTECTED] | Business:  http://www.devteam.dk
+45 5190 4262 | Sparetime: http://www.fundanemt.com


locked window

2006-10-18 Thread Kim Schulz
Hi

I was wondering if there is a way to lock a window such that the
content can only be changed by scripting/commands. Like a preview
window or somthing like that. 

is that possible to make in Vim or should I make a feature request to
get it :-) 



-- 
Kim Schulz| Private :  http://www.schulz.dk
[EMAIL PROTECTED] | Business:  http://www.devteam.dk
+45 5190 4262 | Sparetime: http://www.fundanemt.com


Re: locked window

2006-10-18 Thread Tim Chase

I was wondering if there is a way to lock a window such that the
content can only be changed by scripting/commands. Like a preview
window or somthing like that. 


is that possible to make in Vim or should I make a feature request to
get it :-) 


Well, as an atrocious hack, assuming you have a filename assigned 
to this given window (no_touch.txt), you could do something like


:au WinEnter no_touch.txt wincmd x

(which kinda pushes the locked window out of the way by 
preventing you from entering it) or


:au WinEnter no_touch.txt wincmd p

which simply prevents you from entering the window unless/until 
it's the last window available.


Beware of crazy behavior that might ensue from this.  It would 
serve well for either of these to remember that one can prefix 
window-selection commands with a count, so you can do


^W2k

to move up *two* windows rather than one, so that you can jump 
over the offending locked window if needed.


Just a long day here...experiment, have fun, and hopefully it 
will give you some crazy ideas too. :)


-tim








Re: locked window

2006-10-18 Thread Yegappan Lakshmanan

Hello,

On 10/18/06, Kim Schulz [EMAIL PROTECTED] wrote:

Hi

I was wondering if there is a way to lock a window such that the
content can only be changed by scripting/commands. Like a preview
window or somthing like that.

is that possible to make in Vim or should I make a feature request to
get it :-)



You can clear the 'modifiable' option to disable unintended
modifications to a buffer.

   setlocal nomodifiable

- Yegappan