googler wrote: > 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. > [snipped]
Instead of right/left window handling -- may I suggest using an autocmd that triggers on the netrw filetype: au Filetype netrw call Googlerize() Unfortunately, since netrw long predates vim's introduction of Lists, its use of them isn't as prevalent as I'd wish -- and there isn't such a list to be passed along. However, especially for local listings, the b:netrw_curdir variable holds the current directory. You can use vim's glob() function with that. However, you could just construct a list of filenames from the buffers' names, using redir @a, ls!, redir END , and manipulate the resulting text into a match/match2/match3 type of command. Use windo and execute that command in all windows having filetype netrw. Using autocmds (BufRead, BufNew, BufLeave, etc) to update the match command and to apply it to the netrw window(s). Regards, Chip Campbell --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
