Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 554
  • Last Modified:

HOw to create a function in VIM?

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
zzzy
Asked:
zzzy
1 Solution
 
MikeOM_DBACommented:

Seems you are too lazy to even Google it.
0
 
grayeCommented:
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
 
zzzyAuthor Commented:
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
Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

 
MikeOM_DBACommented:

Check put this example.
0
 
zzzyAuthor Commented:
Thanks MikeOM, this should help. I'll let you know how it goes.
0
 
zzzyAuthor Commented:
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
 
TolomirAdministratorCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now