On 11/06/11 19:03, Jussi Hirvi wrote:
> Ok, that helped me along. For some reason the motions (like 1G0 for
> beginning of file, or G$ for last char in file) work, when the script is
> called from command-line with -s flag (vim -s myscript myfile). But they
> don't work when the script is called
On 11.6.2011 19.08, Alain Péan wrote:
> I hope not to begin a flame war, but I would recommend Python. It can do
> the same things as Perl (regexp ansd so on), but is easier and faster to
> learn, and the code is also much more readeable...
In practice, any language you know well enough... This is
Le 11/06/2011 18:22, Les Mikesell a écrit :
> On 6/11/11 11:08 AM, Alain Péan wrote:
So this was my first-ever vim script. So far I am not convinced about
vim scripting (ok, I was warned, too)... Test cycle is slow (modify
script, quit the realfile, open realfile again with vim -s sc
On 6/11/11 11:08 AM, Alain Péan wrote:
>
>>> So this was my first-ever vim script. So far I am not convinced about
>>> vim scripting (ok, I was warned, too)... Test cycle is slow (modify
>>> script, quit the realfile, open realfile again with vim -s script).
>>> Verbal error messages would be usefu
Le 11/06/2011 17:56, Les Mikesell a écrit :
> On 6/11/11 4:03 AM, Jussi Hirvi wrote:
>> So this was my first-ever vim script. So far I am not convinced about
>> vim scripting (ok, I was warned, too)... Test cycle is slow (modify
>> script, quit the realfile, open realfile again with vim -s script).
On 6/11/11 4:03 AM, Jussi Hirvi wrote:
>>
> So this was my first-ever vim script. So far I am not convinced about
> vim scripting (ok, I was warned, too)... Test cycle is slow (modify
> script, quit the realfile, open realfile again with vim -s script).
> Verbal error messages would be useful. Ther
On 10.6.2011 21.42, Les Mikesell wrote:
> I thought the point of using vim instead of something more appropriate
> for scripting was that you already knew how to use it.
I only wrote that I know vim *better* than sed, awk or perl. Obviously
there is a lot about vim that I don't know.
> Why not
Jussi
I tried various ways but it seems the only way to insert a line from a
script is to use the append() function (do help append) specifying the line
number as a parameter.
I tried it on with an example script "moo.vim" as shown below
flapeccino@T4410 ~
$ cat moo.vim
:1,$s/ /,/g
:call appen
On 6/10/2011 1:03 PM, Jussi Hirvi wrote:
> On 10.6.2011 18.39, flapecc...@gmail.com wrote:
>> There is a good article on vimscript here:
>> http://www.ibm.com/developerworks/linux/library/l-vimscript-1/index.html)
>
> Sorry there was a typo, the correct URL is:
> http://www.ibm.com/developerworks/l
On 10.6.2011 18.39, flapecc...@gmail.com wrote:
> There is a good article on vimscript here:
> http://www.ibm.com/developerworks/linux/library/l-vimscript-1/index.html)
Sorry there was a typo, the correct URL is:
http://www.ibm.com/developerworks/linux/library/l-vim-script-1/index.html
Thanks, I
ject: Re: [CentOS] Vim scripting - cursor motion
Jussi
There is a good article on vimscript here:
http://www.ibm.com/developerworks/linux/library/l-vimscript-1/index.html)
Sent via BlackBerry by AT&T
___
CentOS mailing list
CentOS@centos.
Jussi
There is a good article on vimscript here:
http://www.ibm.com/developerworks/linux/library/l-vimscript-1/index.html)
Sent via BlackBerry by AT&T
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
From: Jussi Hirvi
> :% s/\t/","/g
> Then I should add something to the beginning of file (line 1, char 1).
> And append something to the end of the file (last line, last char). But
> I cannot find a way to do this. Should I move the cursor (and how?), or
> what?
echo "First Line" > NEWFILE
On Thu, Jun 9, 2011 at 11:03 AM, CS DBA wrote:
> On 06/09/2011 08:48 AM, Jussi Hirvi wrote:
>> I am working on my first vim script. The script is supposed to do some
>> find/replace on a file, then save the file with a new name and quit vim.
>>
>> I will save the script in a file and then call it
On 06/09/2011 08:48 AM, Jussi Hirvi wrote:
> I am working on my first vim script. The script is supposed to do some
> find/replace on a file, then save the file with a new name and quit vim.
>
> I will save the script in a file and then call it from a bash script
> like this:
>
> vim path-to-
On 06/09/2011 08:37 AM, Les Mikesell wrote:
>
> I'd highly recommend perl for this because it can also do the SQL part
> directly via DBI without all of the intermediate contortions you'll have
> to do in files otherwise. It should take about half a page of your own
> code to connect to the DB, re
On 6/9/2011 10:07 AM, Jussi Hirvi wrote:
> On 9.6.2011 18.01, m.r...@5-cent.us wrote:
>> Why do vim scripting? That's what sed, or awk, or perl, are for. The
>> latter two, of course, are much easier to comprehend the logic, too.
>
> Maybe just because I know vim better than sed, awk or perl, which
Jussi Hirvi wrote:
> On 9.6.2011 18.01, m.r...@5-cent.us wrote:
>> Why do vim scripting? That's what sed, or awk, or perl, are for. The
>> latter two, of course, are much easier to comprehend the logic, too.
>
> Maybe just because I know vim better than sed, awk or perl, which I
> haven't used at a
On 9.6.2011 18.01, m.r...@5-cent.us wrote:
> Why do vim scripting? That's what sed, or awk, or perl, are for. The
> latter two, of course, are much easier to comprehend the logic, too.
Maybe just because I know vim better than sed, awk or perl, which I
haven't used at all. :-)
The practical purp
Jussi Hirvi wrote:
> I am working on my first vim script. The script is supposed to do some
> find/replace on a file, then save the file with a new name and quit vim.
>
> I will save the script in a file and then call it from a bash script
> like this:
>
> vim path-to-the-file -s path-to-my-s
I am working on my first vim script. The script is supposed to do some
find/replace on a file, then save the file with a new name and quit vim.
I will save the script in a file and then call it from a bash script
like this:
vim path-to-the-file -s path-to-my-script
Maybe I have not fou
21 matches
Mail list logo