Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: how to enter insert-anywhere/canvas mode?

Tags:

vim

vim-plugin

How can you put vim in an insert mode where the entire screen is effectively whitespace i.e. you can type anywhere?

I know it's possible, I just cannot remember the command, unfortunately!

This allows you to draw diagrams and whatnot easily, I hope this rings a bell?


Update: Thanks to @phd I made:

                                                    ┏━━━[ Tasker Radars ]━━━┓
                                                    ┃ 🔴 has 1 mile radius  ┃
                  ,,ggddY''''Ybbgg,,                ┃ 🔵 has 5 mile radius  ┃
             ,agd'''              `''bg,            ┃ 🌕 has 20 mile radius ┃
          ,gdP'                       'Ybg,         ┗━━━━━━━━━━━━━━━━━━━━━━━┛
        ,dP'                             'Yb,
      ,dP'         _,,ddP'''Ybb,,_         'Yb,<━━━━━━ 20 miles
     ,8'         ,dP''         `'Yb,         '8,
    ,8'        ,d'                 'b,<━━━━━━━━━━━━━━━ 5 miles
   ,8'        d'                     'b        `8,
   d'        d'        ,gPPRg,<━━━━━━━━━━━━━━━━━━━━━━━ 1 mile
   8         8        dP'   `Yb        8         8
   8         8        8)     (8    🔴  8    🔵   8    🌕
   8         8        Yb  🔴 dP        8         8
   8         Y,        '8ggg8'        ,P         8
   Y,         Ya                     aP         ,P
   `8,         'Ya        🔵       aP'         ,8'
    `8,          'Yb,_         _,dP'          ,8'
     `8a           `''YbbgggddP'''           a8'
      `Yba                                 adP'
        'Yba              🌕             adY'
          `'Yba,                     ,adP''
             `'Y8ba,             ,ad8P''
                  ``''YYbaaadPP''''
like image 846
Stefan Collier Avatar asked Jul 31 '18 23:07

Stefan Collier


People also ask

How do I switch between insert modes in Vim?

Type i to switch into insert mode so that you can start editing the file. Enter or modify the text with your file. Once you're done, press the escape key Esc to get out of insert mode and back to command mode. Type :wq to save and exit your file.


1 Answers

Set virtualedit option:

set virtualedit=insert

http://vimdoc.sourceforge.net/htmldoc/options.html#%27virtualedit%27

like image 163
phd Avatar answered Oct 19 '22 23:10

phd