Is there any way in my .vimrc file to use the command set list!
with a keybind like F3 so it functions like this paste toggle set pastetoggle=
This is the mapping for normal mode, visual+select mode, and operator-pending mode (e.g. after typing d):
noremap :set list!
The nice thing about the function keys (vs.
) is that they can also be mapped in insert mode:
inoremap :set list!
To be complete, you could also create a map for command-line mode:
cnoremap :set list!
Read more about the various mapping modes at :help map-modes