Can you rename a vim buffer while not renaming the associated content ?
In this particular scenario, I'm running a conqueterm and want the buffer name to be the log file name that I've associated with the buffer, not the buffer name produced by conque term. More typically, this would be to rename the buffer without renaming the associated file.
In general, no. Changing the buffer name changes the name that a file will be written to.
But for buffers that do NOT correspond to files, you can rename the buffer as you see fit. The :file
command lets you do this. See :help :file_f
. However, some plugins may depend on the buffer name of their special buffer to locate that buffer. So you might end up breaking the plugin if you rename the plugin's special buffers willy-nilly.
I think you just want a custom, window-local 'statusline'
setting. This (in its default value) includes the buffer name, but by changing the value for those windows, it'll appear with a more natural name, yet still persist (with :w
etc.) to its original.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With