-*change.txt* For Vim version 9.2. Last change: 2026 May 31
+*change.txt* For Vim version 9.2. Last change: 2026 Jun 18
VIM REFERENCE MANUAL by Bram Moolenaar
feature}
*quote_#* *quote#*
6. Alternate file register "#
-Contains the name of the alternate file for the current window. It will
-change how the |CTRL-^| command works.
-This register is writable, mainly to allow for restoring it after a plugin has
-changed it. It accepts buffer number: >
- let altbuf = bufnr(@#)
- ...
- let @# = altbuf
-It will give error |E86| if you pass buffer number and this buffer does not
-exist.
-It can also accept a match with an existing buffer name: >
+Contains the |alternate-file| name for current window
+This register is writeable and changes which buffer CTRL-^ enters.
+A String is matched against existing buffer names, like |:buffer|: >
let @# = 'buffer_name'
-Error |E93| if there is more than one buffer matching the given name or |E94|
-if none of buffers matches the given name.
+Also supports using buffer number and |file-pattern|.
+
+Throws
+ |E86| when the buffer number does not exist
+ |E93| when more than one buffer matches
+ |E94| when none match
+
+Clear the register with empty String: >
+ let @# = ''
7. Expression register "= *quote_=* *quote=* *@=*
This is not really a register that stores text, but is a way to use an
-*version9.txt* For Vim version 9.2. Last change: 2026 Jun 13
+*version9.txt* For Vim version 9.2. Last change: 2026 Jun 18
VIM REFERENCE MANUAL by Bram Moolenaar
- Rewrite the clientserver socketserver backend to use channels and JSON.
- During |complete()|-triggered completion, CTRL-N and CTRL-P are now subject
to insert-mode mappings.
+- It is possible to clear the alternate file register |quote#|.
*added-9.3*
call assert_equal('Xfile_alt_1', getreg('#'))
call setreg('#', b2)
call assert_equal('Xfile_alt_2', getreg('#'))
+ call setreg('#', '')
+ call assert_equal('', getreg('#'))
+ call setreg('#', 'alt_1')
+ let @# = ''
+ call assert_equal('', getreg('#'))
let ab = 'regwrite'
call setreg('=', '')