Solved

HOw to create a function in VIM?

Posted on 2011-03-13
11
495 Views
Last Modified: 2013-12-13
I would like to create a function which will be available for a particular file type. Inside this function I would like to execute ":v/search pattern/d" and ":s/search pattern/substitution/g" commands. How to write such a function in _vimrc file and how to invoke this function when needed?
0
Comment
Question by:zzzy
11 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 35176064

Seems you are too lazy to even Google it.
0
 
LVL 41

Expert Comment

by:graye
ID: 35184993
I'm confused... are you trying to add a function to VIM?  ... or are you trying to perform a VIM-like substitution function within your own program?

Please tell us more about what you're trying to do...
0
 

Author Comment

by:zzzy
ID: 35235227
I'm trying to create a function/macro which would perform combinations of line deletes and substitions. Then I would like to map that function so that I can do this task in one key-stroke.
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 500 total points
ID: 35241708

Check put this example.
0
 

Author Comment

by:zzzy
ID: 35300212
Thanks MikeOM, this should help. I'll let you know how it goes.
0
 

Author Comment

by:zzzy
ID: 35300398
Hi MikeOM,

I'm not lazy. I tired to go through the VIM help files and also tried googling for some samples. I even tried writing some functions. Unfortunately I didn't find what I was looking for. I've learned it a hard way that sometimes it is better to ask for help.

Thanks
SG
0
 
LVL 27

Expert Comment

by:Tolomir
ID: 35810120
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
#Citrix #POC #XenDesktop #vCenter #VMware #ESX
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now