Creating signatures of a class in vim -


i have file filled text:

class baz {   void test()   {    }    int sum (int)   {    } } 

and want create buffer text following:

interface ibaz {   void test();   int sum (int); } 

how can edit in vim. plugin or strokes on keyboard

if file follows exact pattern posted, can solve 4 commands:

:%s/^class\s*/interface :%s/^\s\+{\_[^}]*}// :g/^\s*$/d :%s/)\zs$/; 
  1. change class interface i
  2. delete indented blocks
  3. remove blank lines
  4. add ; after ending )

if need use in more 1 file (though recommend if you're going use once) copy , paste text buffer write on file, /tmp/cs. then, while focused on buffer want change, run :so /tmp/cs.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -