VIM: job list! like a switch in .vimrc

Is there any way in my .vimrc file to use the set list! command set list! using keybind of type F3 , so it works like this insert parameter set pastetoggle=<F2> .

+6
source share
3 answers

You can put this in your .vimrc file:

 " F3: Toggle list (display unprintable characters). nnoremap <F3> :set list!<CR> 
+13
source

This display is for normal mode, visual display mode + selection, and operator standby mode (for example, after entering d ):

 noremap <F3> :set list!<CR> 

The good thing about function keys (versus <Leader> ) is that they can also be displayed in insert mode:

 inoremap <F3> <Co>:set list!<CR> 

To be complete, you can also create a map for command line mode:

 cnoremap <F3> <Cc>:set list!<CR> 

Read more about the different display modes in :help map-modes

+2
source

I found the answer on how to switch set number in vim, fooobar.com/questions/280839 / ...

So try to do the same by putting the following line in your vimrc file

 map <F3> :set list! list? <CR> 
+1
source

Source: https://habr.com/ru/post/925941/


All Articles