Vi editor: Difference between revisions

From Federal Burro of Information
Jump to navigationJump to search
(New page: ===edit binary file in vi=== :%!xxd ===tai64nlocal file in vi=== :%!tai64nlocal ===set tabs to be the ENGDEV way in vi=== in the file: →‎ex: set tabstop=4 expandtab:: or in ~/.vim...)
 
No edit summary
Line 18: Line 18:
convert:
convert:


  Target[scan-5.trip-5.mem]: `/usr/local/bin/snmp_mem_usage.pl public 172.23.5.5 real`
  Target[server.Real]: `/usr/local/bin/snmp_mem_usage.pl public 172.23.5.5 real`


to  
to  


  Target[job-1.trip-5.Swap]: memTotalSwap.0&memTotalSwap.0:public@172.23.5.129:161::::2 - memAvailSwap.0&memAvailSwap.0:public@172.23.5.129:161::::2
  Target[server.Real]: memTotalSwap.0&memTotalSwap.0:public@172.23.5.129:161::::2 - memAvailSwap.0&memAvailSwap.0:public@172.23.5.129:161::::2


in two (in vi):
in two (in vi):

Revision as of 14:44, 12 January 2009

edit binary file in vi

:%!xxd

tai64nlocal file in vi

:%!tai64nlocal

set tabs to be the ENGDEV way in vi

in the file:

/* ex: set tabstop=4 expandtab: */

or in ~/.vimrc

set tabstop=4
set expandtab

fancy find replace

convert:

Target[server.Real]: `/usr/local/bin/snmp_mem_usage.pl public 172.23.5.5 real`

to

Target[server.Real]: memTotalSwap.0&memTotalSwap.0:public@172.23.5.129:161::::2 - memAvailSwap.0&memAvailSwap.0:public@172.23.5.129:161::::2

in two (in vi):

%s: `/usr/local/bin/snmp_mem_usage.pl public ::g
%s/:\(.\+\) real`/ memTotalReal.0\&memTotalReal.0:public@\1:161::::2 - memAvailReal.0\&memAvailReal.0:public@\1:161::::2/