Why lowercase [i] does not work in visual block mode?

后端 未结 2 518
小鲜肉
小鲜肉 2021-01-13 21:34

I often forget how to insert in visual block mode and read again the answer Shift+i.

As Honghe.Wu wonders in his comment:

Why lowercase i

2条回答
  •  星月不相逢
    2021-01-13 22:19

    The reason because i and a are not behave like in normal mode in all visual modes is that i and a are used to extend the selection to text objects. As you can see in :help visual-operators:

    4. Operating on the Visual area
    
    The operators that can be used are:
        ~   switch case                 
        d   delete                      
        c   change (4)                  
        y   yank                        
        >   shift right (4)                 
        <   shift left (4)                  
        !   filter through external command (1)     
        =   filter through 'equalprg' option command (1)    
        gq  format lines to 'textwidth' length (1)      
    
    The objects that can be used are:
        aw  a word (with white space)           
        iw  inner word                  
        aW  a WORD (with white space)           
        iW  inner WORD                  
        as  a sentence (with white space)           
        is  inner sentence                  
        ap  a paragraph (with white space)          
        ip  inner paragraph                 
        ab  a () block (with parenthesis)           
        ib  inner () block                  
        aB  a {} block (with braces)            
        iB  inner {} block                  
        at  a   block (with tags)        
        it  inner   block            
        a<  a <> block (with <>)                
        i<  inner <> block                  
        a[  a [] block (with [])                
        i[  inner [] block                  
        a"  a double quoted string (with quotes)        
        i"  inner double quoted string          
        a'  a single quoted string (with quotes)        
        i'  inner simple quoted string          
        a`  a string in backticks (with backticks)      
        i`  inner string in backticks           
    
    Additionally the following commands can be used:
        :   start Ex command for highlighted lines (1)  
        r   change (4)                  
        s   change                      
        C   change (2)(4)                   
        S   change (2)                  
        R   change (2)                  
        x   delete                      
        D   delete (3)                  
        X   delete (2)                  
        Y   yank (2)                    
        p   put                     
        J   join (1)                    
        U   make uppercase                  
        u   make lowercase                  
        ^]  find tag                    
        I   block insert                    
        A   block append                    
    

    So just use the block insert uppercase I or the the block append uppercase A commands in visual block mode.

提交回复
热议问题