I want to write a vim script that involves netrw and buffers.
Unfortunately, I do not have any experience in writing vim scripts, so
I need a bit of help to get started.

I have a vim session, where the left split window is the directory
listing and the right window has an open file (opened by clicking on a
file name on the left window or through some other way, like :e). The
right window may have multiple buffers (files) loaded (but displaying
only one). What I want the script to do --- whenever I have an active
buffer on the right window that is listed in the left window, I want
that file name to be highlighted on the left window.

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?
2. I have the variable that has the file name for the active buffer on
the right window ==> this should be %, correct?
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.
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?

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.

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

Reply via email to