Hi googler!
On Mi, 29 Jul 2009, googler wrote:
> I'm thinking to solve it this way.
> 1. I have a list of all the files that are listed on the left window
> (with their full path name) ==> is there a way to get such a list?
Tricky. I do not use netrw a lot, so there might be easier ways. Dr.
Chip may correct me, if I am saying something wrong.
I think the directory displayed is always in NETRW_HISTDIR_0. So I
would do basically something like this:
If the filetype is netrw, Read in the whole buffer into a list. Then
filter all rows by lines that start with ^" and at last prepend
NETRW_HISTDIR_0 to each row, excep maybe ../
(see help getline(), filter(), help map(), etc.)
> 2. I have the variable that has the file name for the active buffer on
> the right window ==> this should be %, correct?
Probably it is the alternate buffer #
> 3. I check if file in (2) is part of the list in (1). If it is, then I
> highlight the corresponding line in the left window.
Use :match
> 4. This script/function will be called as part of an auto command,
> whenever we click (or press 'enter') on the left window or refresh it
> by <C-L>.
>
> Does this sound good? Or is there a better approach? Also, how do I
> qualify the left and right split windows? For example, if I want the
> name of the file in the right window, the file name is stored in %,
> but how do I tell vim which window?
Not sure. Look at the window and buffer functions (see :h
function-list)
> I was reading the chapters on netrw and buffers on vim help. They do
> not list the kind of variables that I'm looking for. Can someone
> provide me with pointers on where to look? I'm not asking for you to
> write the script, but just some hints and pointers. Thanks.
Also take a look at :h eval.txt. All the stuff for writing scripts is
in there.
Mit freundlichen Grüßen
Christian
--
Achtung nutzt sich ab wie Liebe.
-- Luc de Clapiers Vauvenargues (Reflexionen und Maximen)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---