The :map
command defines a new mapping, while the :unmap
removes them.
If you define a new mapping, it will remain there until you explicitly removes it. Your session file is probably saving it, so when you reload your session it is back. You can inspect the contents of your session file to confirm it.
Thus you probably can continue using your session if you execute the :unmap
to remove the mappings for / and ? (on the command line, it is not necessary on the vimrc). Check :help :unmap
and :help 40.1
for details.
Edit:
But it's still me manually changing one thing that my vimrc file
contains; it can contain other things: autocommands, for example. I
was hoping there'd be some way of saying "forgot the settings as they
were at the point the session was created and use these new settings;
burn these into the session"
If I understood you, you want to restore the settings after changing too many options/mappings/autocmds, thus it would be cumbersome to restore them manually. The 'sessionoptions'
could be useful in this case:
Changes the effect of the |:mksession| command. It is a comma
separated list of words. Each word enables saving and restoring
something:
word save and restore ~
blank empty windows
buffers hidden and unloaded buffers, not just those in windows
curdir the current directory
folds manually created folds, opened/closed folds and local
fold options
globals global variables that start with an uppercase letter
and contain at least one lowercase letter. Only
String and Number types are stored.
help the help window
localoptions options and mappings local to a window or buffer (not
global values for local options)
options all options and mappings (also global values for local
options)
...
Try ':set sessionoptions-=options'
, reload your session and then restore it with ':set sessionoptions+=options'
.
If you need to do this often you should try some session plugin, such as session.vim, which provides the following command:
The *:RestartVim* command
This command saves your current editing session, restarts Vim and restores your
editing session. This can come in handy when you're debugging Vim scripts which
can't be easily/safely reloaded using a more lightweight approach [10]. It
should work fine on Windows and UNIX alike but because of technical limitations
it only works in graphical Vim.
Any commands following the |:RestartVim| command are intercepted and executed
after Vim is restarted and your session has been restored. This makes it easy
to perform manual tests which involve restarting Vim, e.g. ':RestartVim | edit
/path/to/file | call MyTest()'.
Using this plugin you could create a simple mapping that changes 'sessionoptions'
, restarts your session, and restore that option.