LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 09-01-2006, 01:35 PM   #1
z.z!
LQ Newbie
 
Registered: Jul 2006
Posts: 13

Rep: Reputation: 0
how can i use a script to run in vi !


hi all!
what i actually want is to run script containing vi commands (not shell commands)on a text file.
is there any way to do this?
 
Old 09-01-2006, 03:31 PM   #2
ramram29
Member
 
Registered: Jul 2003
Location: Miami, Florida, USA
Distribution: Debian
Posts: 848
Blog Entries: 1

Rep: Reputation: 47
It's called 'ex' command. Run 'man ex'.
 
Old 09-01-2006, 04:00 PM   #3
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Hi
Here is an example:
I wrote a file 'script.vim' containing vim commands:
Quote:
aSome text
another line of text
yet another one^[:wq
To use it run :
Code:
vim text_file_name -s script.vim
To explain a little the script:
the first 'a' is the ex command to append text,
then the text to write in the file,
the ESC character, to write it use <ctrl-v> <ESC> keys,
':wq' to save and quit the editor.
Hope this will help you.
Have a nice day.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to run a shell script in the perl script sharad Linux - General 1 05-24-2006 03:23 AM
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 02:53 AM
Shell script to run pl/sql script. colly Linux - General 1 09-09-2004 06:49 AM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 09:34 AM
can't run a script script from icon in konqueror scottsteibel Linux - Software 1 08-02-2003 07:59 PM


All times are GMT -5. The time now is 11:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration