Difference in operation while using Macrocontent in Normal Mode in VIm/gvim (Delete a Specific Column)

StackOverflow https://stackoverflow.com/questions/10513760

  •  06-06-2021
  •  | 
  •  

Question

Defined a macro

let @a='$F|vF|<80>kr^V5jd'

Sample Input File

+--------------------+---------+---------
|           Name     |   S1    |    S2
+--------------------+---------+---------
|           A        | -4.703  | -2.378  
|           B        | -3283.2 | -3204.5 
|           C        |  8779   |  7302   
|           D        |  22078  |  18018  
+--------------------+---------+---------

When i'm using it as macro, its doing 1 task

:%norm @a

Result 1

+--------------------+---------+---------
|           Name     |    S2
+--------------------+---------
 -2.378  
 -3204.5 
  7302   
  18018  
---------+---------

when try to do the same operation by

:%norm $F|vF|<80>kr^V5jd on the same file

it is doing different task

Result 2

|           D        |  22078  |  18018  
+--------------------+---------+---------

Is there any special care we need to take while handling Visual Block Content Macros In Normal Mode ?

Is there anything wrong.

Actually, what i was trying to do was to remove the S1 Column, can any one help in that way!

Desired Output

+--------------------+---------
|           Name     |   S2    
+--------------------+---------
|           A        | -2.378    
|           B        | -3205.5  
|           C        |  7302      
|           D        |  18018    
+--------------------+---------

Thanks

Was it helpful?

Solution

This is what I got:

gg f+ Ctrl-v Shift-g ;; h d

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top