Re: vim 7.3 syntax highlight for c functions

2011-11-12 Thread Ivan S. Freitas
On Sun, Nov 13, 2011 at 2:45 AM, Leiking wrote: > try std_c.vim Also look at http://www.vim.org/scripts/script.php?script_id=3064 To highlight custom function/types, you need to define or link some highlighting groups. I never saw anything about *_t types/structures, but it may not be too dific

Re: vim 7.3 syntax highlight for c functions

2011-11-12 Thread Leiking
try std_c.vim 2011/11/13 sinbad : > On Nov 12, 1:27 pm, sinbad wrote: >> hi, >> >> i am trying to syntax highlight the c function calls. i asked google, >> someone suggested to add >> the following in c.vim. >> >> " Highlight Class and Function names >> syn match    cCustomParen    "(" contains=c

Re: vim 7.3 syntax highlight for c functions

2011-11-12 Thread sinbad
On Nov 12, 1:27 pm, sinbad wrote: > hi, > > i am trying to syntax highlight the c function calls. i asked google, > someone suggested to add > the following in c.vim. > > " Highlight Class and Function names > syn match    cCustomParen    "(" contains=cParen,cCppParen > syn match    cCustomFunc  

Re: can vim show characters inputting when used inoremap

2011-11-12 Thread Ben Fritz
On Nov 12, 9:44 am, jason.桂林 wrote: > hi > > inoremap {%=  {%=  %} > > if I type {% it show % waiting I finish '{%=' it shows the result, can vim > show the chars inputting when I use inoremap? > Sorry, what do you want Vim to tell you? -- You received this message from the "vim_use" maillist

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread AK
On 11/12/2011 08:04 PM, Gelonida N wrote: On 11/13/2011 01:27 AM, AK wrote: On 11/12/2011 06:49 PM, Gelonida N wrote: On 11/12/2011 11:46 PM, AK wrote: Knowing almost nothing about vim scripting, but knowing basic vim commands and knowing python quite well I was looking for the 'basic' commands

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread Gelonida N
On 11/13/2011 01:27 AM, AK wrote: > On 11/12/2011 06:49 PM, Gelonida N wrote: >> On 11/12/2011 11:46 PM, AK wrote: >> Knowing almost nothing about vim scripting, >> but knowing basic vim commands and knowing python quite well >> I was looking for the 'basic' commands, that would allow me to interac

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread AK
On 11/12/2011 06:49 PM, Gelonida N wrote: On 11/12/2011 11:46 PM, AK wrote: def setreg(regname, val): """ sets register regname to string val all it does is replace " with \" and use the 'let' command to set a register """ val = val.replace('"',r'\"')

Re: No 'authochdir' in maemo port of vim[Was: How to copy strings into system's clipboard on n900 (maemo)?]

2011-11-12 Thread Yue Wu
On Fri, Nov 11, 2011 at 11:12:23AM +0100, Tony Mechelynck wrote: > On 11/11/11 09:38, Yue Wu wrote: > > On Fri, 11 Nov 2011 16:20:42 +0800, Yue Wu wrote: > > > >> On Thu, 10 Nov 2011 23:52:44 +0800, Ben Fritz > >> wrote: > >> > >>> > >>> > >>> On Nov 10, 8:21 am, "Yue Wu" wrote: > Hello lis

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread Gelonida N
On 11/12/2011 11:46 PM, AK wrote: >> >> def setreg(regname, val): >> """ sets register regname to string val >> all it does is replace " with \" >> and use the 'let' command to set a register >> """ >> val = val.replace('"',r'\"') >> vim.command('let @%s = "%s"

Re: python scripting: simulate vim key strokes

2011-11-12 Thread Gelonida N
On 11/12/2011 07:25 PM, Jan Christoph Ebersbach wrote: > Hi Gelondia, > > You can use vim.eval to feed keys Actually you can call any function > that vim provides through vim.eval. Have a look at :h functions for > more information. The solution for your problem would look like this: > > vim.eva

python scripting: get visual selection, mdify and replace it

2011-11-12 Thread Gelonida N
What I would like to do is following: Do a visual selection in my text Select a menu entry from my gvim menu which would start a python script. This script should get the active selection and replace it with a new string. For the examples case let's assume I want to replace all 'a' characters w

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread AK
On 11/12/2011 05:39 PM, Gelonida N wrote: On 11/12/2011 11:16 PM, Gelonida N wrote: On 11/12/2011 03:02 PM, AK wrote: If I rephrase my question for non python users: How can I write a vim command, that puts fuloowing five characters in register '0' single_quite, double_quote, escape, carriage

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread Gelonida N
On 11/12/2011 11:16 PM, Gelonida N wrote: > On 11/12/2011 03:02 PM, AK wrote: > > If I rephrase my question for non python users: > > How can I write a vim command, that puts fuloowing five characters in > register '0' > > single_quite, double_quote, escape, carriage_return, tab > > The escaped

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread Gelonida N
On 11/12/2011 03:02 PM, AK wrote: >>> command('let @a = "abc"') -ak >> >> Let's assume I'd like to do something like. >> >> reg = vim.eval('@0') >> reg.replace('a','A') >> vim.command('let @a = "%s"' % reg) >> >> This will fail if reg contains funny characters. >> I think I need something like >>

Re: How to make writefile() keep the new line characters

2011-11-12 Thread Jacobo de Vera
On Fri, Nov 11, 2011 at 23:30, Jean-Rene David wrote: > * Jacobo de Vera [2011.11.11 17:50]: >> So my question is, is there a way to keep those >> new line characters in the output file? > > Split each string which contains a newline in two > list items. > Haha, brilliant, everything I thought of

Re: can I search no backwards?

2011-11-12 Thread Tim Chase
On 11/12/11 13:14, jason.桂林 wrote: I want to find next ')' and insert a comma, I use /)i, but sometimes if there is no ) forward, it goes backward search, not what I want, can I force it search forward? You want to toggle the 'wrapscan' option: :set nowrapscan -tim -- You received this

can I search no backwards?

2011-11-12 Thread jason . 桂林
I want to find next ')' and insert a comma, I use /)i, but sometimes if there is no ) forward, it goes backward search, not what I want, can I force it search forward? -- Best regards, Jason Green 桂林 -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply b

Re: python scripting: simulate vim key strokes

2011-11-12 Thread Jan Christoph Ebersbach
Hi Gelondia, You can use vim.eval to feed keys Actually you can call any function that vim provides through vim.eval. Have a look at :h functions for more information. The solution for your problem would look like this: vim.eval("feedkeys('y', 'n')") Cheers, Jan Christoph On Nov 11, 8:31 pm,

Re: moving line numbers.

2011-11-12 Thread Tim Chase
On 11/12/11 09:57, john Culleton wrote: Tryig to help a lister on another group rename a few thousand files. As the last step I need to line number a text file but then move the line number to the end of each line. In other words go from lines like 1234 mv oldfilenane newprefix to mv oldfilename

moving line numbers.

2011-11-12 Thread john Culleton
Tryig to help a lister on another group rename a few thousand files. As the last step I need to line number a text file but then move the line number to the end of each line. In other words go from lines like 1234 mv oldfilenane newprefix to mv oldfilename newprefix1234 Adding the suffix in a su

can vim show characters inputting when used inoremap

2011-11-12 Thread jason . 桂林
hi inoremap {%= {%= %} if I type {% it show % waiting I finish '{%=' it shows the result, can vim show the chars inputting when I use inoremap? -- Best regards, Jason Green 桂林 -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are

Re: 'paragraphs'

2011-11-12 Thread Taylor Hedberg
Unfortunately, I don't believe you can. The notion of what constitutes a paragraph seems to be hard-coded into Vim. You could, however, create your own mappings for `{` and `}` that work differently. -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread AK
On 11/12/2011 08:57 AM, Gelonida N wrote: On 11/12/2011 02:29 PM, AK wrote: On 11/12/2011 08:15 AM, Gelonida N wrote: Hi, I know how to ge the contents of a register. reg = vim.eval('@0') fetches for example the contents of register 0 However I did not find a way to set a register to a cer

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread Gelonida N
On 11/12/2011 02:29 PM, AK wrote: > On 11/12/2011 08:15 AM, Gelonida N wrote: >> Hi, >> >> I know how to ge the contents of a register. >> >> reg = vim.eval('@0') fetches for example the contents of register 0 >> >> >> >> However I did not find a way to set a register to a certain value (from >> py

Re: python scripting: how to set the contents of a register.

2011-11-12 Thread AK
On 11/12/2011 08:15 AM, Gelonida N wrote: Hi, I know how to ge the contents of a register. reg = vim.eval('@0') fetches for example the contents of register 0 However I did not find a way to set a register to a certain value (from python) What would be the command? Thanks in advance for y

python scripting: how to set the contents of a register.

2011-11-12 Thread Gelonida N
Hi, I know how to ge the contents of a register. reg = vim.eval('@0') fetches for example the contents of register 0 However I did not find a way to set a register to a certain value (from python) What would be the command? Thanks in advance for your help. -- You received this message fro

'paragraphs'

2011-11-12 Thread Marcin Szamotulski
Helo, Dear vim users, how to set 'paragraphs' option so that { and } moves also include lines which are filled with spaces (or tabs) and not just empty lines. Best regards, Marcin -- You received this message from the "vim_use" maillist. Do not top-post! Type your reply below the text you are

Re: Combined commands provide wrong result

2011-11-12 Thread Guido Van Hoecke
> As said under ":help :bar", the :g[lobal] command considers the | as part of > its operands. > > You ought to be able to do it with > >        :exe '%g/0,0,0,0,0/d' | %s/,/;/g | %s/\./,/g > > because wrapping the :g command inside :exe (which does not include the | in > its operands) defines wher

Re: Combined commands provide wrong result

2011-11-12 Thread Tony Mechelynck
On 12/11/11 11:30, Guido Van Hoecke wrote: Hi, I want to edit a csv file with e.g. following content: "tag2",2011/10/31,28250,28208,0,0,0.9985 "tag1",2011/10/31,1591,1583,8,0,1 "tag2",2011/10/30,15046,15008,0,0,0.9975 "tag1",2011/10/30,981,975,6,0,1 "tag2",2011/10/29,13019,12993,0,0,0.998 "tag1

Re: Combined commands provide wrong result

2011-11-12 Thread Guido Van Hoecke
On Sat, Nov 12, 2011 at 11:30, Guido Van Hoecke wrote: > Hi, > > I want to edit a csv file with e.g. following content: > > "tag2",2011/10/31,28250,28208,0,0,0.9985 > "tag1",2011/10/31,1591,1583,8,0,1 > "tag2",2011/10/30,15046,15008,0,0,0.9975 > "tag1",2011/10/30,981,975,6,0,1 > "tag2",2011/10/29,

Combined commands provide wrong result

2011-11-12 Thread Guido Van Hoecke
Hi, I want to edit a csv file with e.g. following content: "tag2",2011/10/31,28250,28208,0,0,0.9985 "tag1",2011/10/31,1591,1583,8,0,1 "tag2",2011/10/30,15046,15008,0,0,0.9975 "tag1",2011/10/30,981,975,6,0,1 "tag2",2011/10/29,13019,12993,0,0,0.998 "tag1",2011/10/29,401,401,0,0,1 "tag2",2011/10/28,

vim 7.3 syntax highlight for c functions

2011-11-12 Thread sinbad
hi, i am trying to syntax highlight the c function calls. i asked google, someone suggested to add the following in c.vim. " Highlight Class and Function names syn matchcCustomParen"(" contains=cParen,cCppParen syn matchcCustomFunc "\w\+\s*(" contains=cCustomParen syn matchcCu