I have two files open, each one is in a split.
From file one, how can I get the filename of the file in split two ?
In command mode, I can get the reference of the filename I'm currently editing by using %f
, is there something similar that would return the filename of the file opened in my second split?
Update : Following Christian Brabandt's advice, I ended up doing this, from the first window :
:echo bufname(2)
let @[a-z0-9]=expand(@%)
for each split where@[a-z0-9]
is something like@s
for split one and@w
for split 2. Then you can use the registers as required. Could possibly do a function to set the next variable in a list to the filename on BufEnter or the like