Sign in to follow this  
Followers 0
ericdexter

simple vim script

3 posts in this topic

#1 ·  Posted (edited)

hopefully this isn't a stupid question.. I have been trying to script vim with several methods all of them have failed.

I would like to use some of the commands such as :e text.file or :r text.file (after a couple of searches). but I can't seem

to get a working script (I wish to ignore the menu on this if I can). It brings gvim up fine but it fails to load the file.

; Script Start - Add your code below here
$gvim = "gvim.exe "
$gvrun = $gvim & $CmdLine[1]
Run($gvrun) 
#  $CmdLine[1] this is the value passed to autoit..
$restofline = "(C:\dex_tracker) - GVIM"
$outline = $cmdline[1] & $restofline
WinWaitActive("")
# WinWaitActive ($outline)
Send(":e c:\dex_tracker\bay-at-night.csd {ENTER}")
#  Send("text to send. {ENTER} 1 2 3 4 5 6 7{ENTER}")

Sleep(500)

sorry if this is a silly question thanks in advance for any help

Edited by ericdexter

Share this post


Link to post
Share on other sites



hopefully this isn't a stupid question.. I have been trying to script vim with several methods all of them have failed.

I would like to use some of the commands such as :e text.file or :r text.file (after a couple of searches). but I can't seem

to get a working script (I wish to ignore the menu on this if I can). It brings gvim up fine but it fails to load the file.

; Script Start - Add your code below here
$gvim = "gvim.exe "
$gvrun = $gvim & $CmdLine[1]
Run($gvrun) 
#  $CmdLine[1] this is the value passed to autoit..
$restofline = "(C:\dex_tracker) - GVIM"
$outline = $cmdline[1] & $restofline
WinWaitActive("")
# WinWaitActive ($outline)
Send(":e c:\dex_tracker\bay-at-night.csd {ENTER}")
#  Send("text to send. {ENTER} 1 2 3 4 5 6 7{ENTER}")

Sleep(500)

sorry if this is a silly question thanks in advance for any help

I'm afraid it all looks a bit silly to me :whistle:

I don't know what gvim is.

What, for example, are these 2 lines for?

$restofline = "(C:\dex_tracker) - GVIM"

$outline = $cmdline[1] & $restofline

I am surpised that

Run($gvrun)

works because I would have expected that you need a space

$gvrun = $gvim & " " & $CmdLine[1]


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

>

>I'm afraid it all looks a bit silly to me :whistle:

>I don't know what gvim is.

gvim is a text editor that expects commands when it starts for example if you want to edit you would hit I and then edit..

>What, for example, are these 2 lines for?

>$restofline = "(C:\dex_tracker) - GVIM"

>$outline = $cmdline[1] & $restofline

what I was trying to do with that is quoted out.... I was trying to match the top of the screen with the file name coming from the command line

>I am surpised that

>Run($gvrun)

>works because I would have expected that you need a space

>gvrun = $gvim & " " & $CmdLine[1]

There is a space if you look at the quotes you will see it

"gvim "

look at the post again

The script is for a program called dex tracker

https://sourceforge.net/projects/dex-tracker

The goal is to load gvim load a csd file (html like) into gvim

search for a tag

look for the end tag

use :r and then the file name of the instrument to load in..

it should be very easy and I have failed using several packages.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0