Re: Writing only the selected characters

2011-08-26 Thread Gary Johnson
On 2011-08-25, Bastien Dejean wrote: Hi, How can I write only the selected characters of a line? Suppose I'm selecting the word 'foo' from the line 'foo bar', if I issue :','w ! xclip, the output of xclip -o is going to be 'foo bar' and not 'foo'... I always use Charles Campbell's

preset param value in vimscript func

2011-08-26 Thread niva
Hi, I would like to know , as in C++, how can I set a value by default into the second arg of a vimscript func in order to call the fu with only one arg out of two required; fu bar(arg1, arg2=20) //todo endfu I would like the call looks like that: call bar(foo) -- You received this message

Re: preset param value in vimscript func

2011-08-26 Thread Christian Brabandt
Hi niva! On Do, 25 Aug 2011, niva wrote: I would like to know , as in C++, how can I set a value by default into the second arg of a vimscript func in order to call the fu with only one arg out of two required; fu bar(arg1, arg2=20) //todo endfu I would like the call looks like that:

Re: Syntax errors in shell scripts

2011-08-26 Thread Bastien Dejean
Javier Rojas a écrit : On Thu, Aug 25, 2011 at 10:18:13AM +0200, Bastien Dejean wrote: Any idea why, in the following expression: ${UZBL_URI#*://} the '#*://' part gets highlighted as shDerefWordError? Because, by default, vim uses the sh syntax file. To use the bash syntax

Re: Syntax errors in shell scripts

2011-08-26 Thread Christian Brabandt
Hi Javier! On Do, 25 Aug 2011, Javier Rojas wrote: On Thu, Aug 25, 2011 at 10:18:13AM +0200, Bastien Dejean wrote: Hi, Any idea why, in the following expression: ${UZBL_URI#*://} the '#*://' part gets highlighted as shDerefWordError? Because, by default, vim uses the sh

Re: changing vim cursor shape or color in vim 7.0

2011-08-26 Thread sinbad
On Aug 18, 11:26 am, sinbad sinbad.sin...@gmail.com wrote: On Aug 17, 4:55 pm,sinbadsinbad.sin...@gmail.com wrote: hi, i'm using vim 7.0 inside a gnu screen. i use vim by puttying to the linux server. i want to change the cursor shape or color whenever i want, basically i

Re: #if 0 syntax folding

2011-08-26 Thread benjamin schnitzler
Hi, On Mon, Aug 22, 2011 at 10:35 PM, Christian Brabandt cbli...@256bit.org wrote: Hi Charles! On Mo, 22 Aug 2011, Charles Campbell wrote: The following short C file illustrates this problem: /* abc.c: */ #include stdio.h #if 0 int main() { printf(testing\n); return 0; } #endif

getchar() blocks the output

2011-08-26 Thread sinbad
hi, i've the following function. 1 fun! Dosome() 2 vertical botright new 3 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile 4 setlocal nowrap 5 setlocal nonu 6 7 for m in g:list 8 let txt = printf(%s %-50s %-4d %-50s, m[0], m[1]. (), m[2],

Re: getchar() blocks the output

2011-08-26 Thread Marcin Szamotulski
On 06:50 Fri 26 Aug , sinbad wrote: hi, i've the following function. 1 fun! Dosome() 2 vertical botright new 3 setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile 4 setlocal nowrap 5 setlocal nonu 6 7 for m in g:list 8 let txt

Re: changing vim cursor shape or color in vim 7.0

2011-08-26 Thread Taylor Hedberg
sinbad, Wed 2011-08-17 @ 04:55:19-0700: i'm using vim 7.0 inside a gnu screen. i use vim by puttying to the linux server. i want to change the cursor shape or color whenever i want, basically i would like to set the cursor to a different shape or color when a variable is set. i tried

Re: changing vim cursor shape or color in vim 7.0

2011-08-26 Thread Taylor Hedberg
Taylor Hedberg, Fri 2011-08-26 @ 11:03:33-0400: silent execute '!echo -n ' . t_foo . '' Minor correction: At the very least, that should have been t_foo instead of t_foo in the above. -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text

display faster output of external app

2011-08-26 Thread niva
Hi, I am calling an external app from vim like that : 1/ calling the application let g:output=system(s:cmd) 2/ deleting old returned value and updating with new one call s:OPC.AddValueAtEndOfFile(g:output) Write value at end of line {{{1 fun! s:OPC.AddValueAtEndOfFile(value) exe norm

Re: display faster output of external app

2011-08-26 Thread Gary Johnson
On 2011-08-26, niva wrote: Hi, I am calling an external app from vim like that : 1/ calling the application let g:output=system(s:cmd) 2/ deleting old returned value and updating with new one call s:OPC.AddValueAtEndOfFile(g:output) Write value at end of line {{{1 fun!

Re: display faster output of external app

2011-08-26 Thread niva
In the same way, my RUN loop is moving cursor through the file to process each line. loop cmd or item read while s:lnum = line($) move cursor to the current line exe .s:lnum launch OPC Client call MyMainFunc()

Re: display faster output of external app

2011-08-26 Thread niva
I have modified with your substitute command like that exe 's/value.*\|$/ '.g:output.'/' It works well but in my previous func, I started to write the new ouput at the .s:maxlinelength column number. How can I d the substitute command and at the same time begin to write g:output at the

Re: display faster output of external app

2011-08-26 Thread ZyX
Reply to message «Re: display faster output of external app», sent 23:01:52 26 August 2011, Friday by Gary Johnson: current line with g:output. Therefore you could replace call s:OPC.AddValueAtEndOfFile(g:output) with exe s/ .*/ .g:output./ or even exe s/ .*/

Re: display faster output of external app

2011-08-26 Thread ZyX
Reply to message «Re: display faster output of external app», sent 23:24:27 26 August 2011, Friday by niva: Assuming MyMainFunc does not have range in its definition and initial value of s:lnum is not `1': execute s:lnum.',$call MyMainFunc()' If it is `1' (meaning that you operate on the

Re: display faster output of external app

2011-08-26 Thread Gary Johnson
On 2011-08-26, ZyX wrote: Reply to message «Re: display faster output of external app», sent 23:01:52 26 August 2011, Friday by Gary Johnson: current line with g:output. Therefore you could replace call s:OPC.AddValueAtEndOfFile(g:output) with exe s/ .*/ .g:output./

Re: display faster output of external app

2011-08-26 Thread niva
If it is `1' (meaning that you operate on the whole file):     %call MyMainFunc() I operate on the whole file. In fact I will use your advise with that assumin I have already stored getline('.') into lineArray let line=getline('.') call setline('.', line[:stridx(line, ' ')].g:output) So

Re: display faster output of external app

2011-08-26 Thread ZyX
Reply to message «Re: display faster output of external app», sent 23:29:40 26 August 2011, Friday by niva: I have modified with your substitute command like that exe 's/value.*\|$/ '.g:output.'/' You like code injections? Try my second suggestion: let [d, before, after;

Re: display faster output of external app

2011-08-26 Thread niva
On 26 août, 21:41, ZyX zyx@gmail.com wrote: Reply to message «Re: display faster output of external app», sent 23:29:40 26 August 2011, Friday by niva: I have modified with your substitute command like that exe 's/value.*\|$/ '.g:output.'/' You like code injections? Try my second

Re: display faster output of external app

2011-08-26 Thread ZyX
Reply to message «Re: display faster output of external app», sent 23:40:52 26 August 2011, Friday by niva: In fact I will use your advise with that assumin I have already stored getline('.') into lineArray let line=getline('.') call setline('.', line[:stridx(line, ' ')].g:output) So

Re: display faster output of external app

2011-08-26 Thread ZyX
Reply to message «Re: display faster output of external app», sent 23:44:18 26 August 2011, Friday by niva: I am french and don't now injections but I am trying your second expr even if it is more complex to understand. What injections? Original message: On 26 août, 21:41, ZyX

Re: Syntax errors in shell scripts

2011-08-26 Thread Charles E Campbell Jr
Bastien Dejean wrote: Javier Rojas a écrit : On Thu, Aug 25, 2011 at 10:18:13AM +0200, Bastien Dejean wrote: Any idea why, in the following expression: ${UZBL_URI#*://} the '#*://' part gets highlighted as shDerefWordError? Because, by default, vim uses the sh syntax

Re: display faster output of external app

2011-08-26 Thread niva
Ok Ihave modified my app to return random value and it takes time to process all those lines value:2940 .. x18 lines .. value:2966

Consuming 'filetype' stuff from .vimrc

2011-08-26 Thread Russell Bateman
I would like to know how how to adjust the width (set columns) in gvim based on filetype that, I assume, Vim knows by reason of the file I've launched it on. For example, if it's a Java file (.java), I'd like to make it 120 columns wide, but leave it maybe 80 for all others. I realize that I might

Re: display faster output of external app

2011-08-26 Thread ZyX
Reply to message «Re: display faster output of external app», sent 00:58:15 27 August 2011, Saturday by niva: let g:output=substitute(system(s:cmd),'\n','',g) Then you need variant with setline(): it does not care about possible newlines in g:output,

Re: Consuming 'filetype' stuff from .vimrc

2011-08-26 Thread Simon Nicolussi
Russell Bateman wrote: For example, if it's a Java file (.java), I'd like to make it 120 columns wide, but leave it maybe 80 for all others. autocmd FileType java set columns=120 -- Simon Nicolussi, simon.nicolu...@student.uibk.ac.at http://homepage.uibk.ac.at/~csag9583/ pgp6WU6e78VWd.pgp

Re: Consuming 'filetype' stuff from .vimrc

2011-08-26 Thread Russell Bateman
Thank you very much, Simon! It seems to work perfectly. On Fri, Aug 26, 2011 at 3:27 PM, Simon Nicolussi simon.nicolu...@student.uibk.ac.at wrote: Russell Bateman wrote: For example, if it's a Java file (.java), I'd like to make it 120 columns wide, but leave it maybe 80 for all others.  

Re: display faster output of external app

2011-08-26 Thread ni va
let g:output=substitute(system(s:cmd),'\n','',g) system(s:cmd) produces something like useful message\n like `system('echo useful message')' does, am I right? You need just system(s:cmd)[:-2] then. You're right Your code is a bit strange (I don't get why you need `output' to be

Python indentation script...

2011-08-26 Thread Burnett, Rick
Hello All! I've been looking around to see if it is possible to create a script or add a feature that I would use quite a bit. When editing python code, how much a line is indented sets the scope of the code, as many of you know, however, sometimes with long scopes that are heavily nested, it

Python indentation script...

2011-08-26 Thread Burnett, Rick
Hello All! I've been looking around to see if it is possible to create a script or add a feature that I would use quite a bit. When editing python code, how much a line is indented sets the scope of the code, as many of you know, however, sometimes with long scopes that are heavily nested, it

Python indentation script...

2011-08-26 Thread Rick B
Hello All! I've been looking around to see if it is possible to create a script or add a feature that I would use quite a bit. When editing python code, how much a line is indented sets the scope of the code, as many of you know, however, sometimes with long scopes that are heavily

Re: Consuming 'filetype' stuff from .vimrc

2011-08-26 Thread Gerardo Marset
El 26/08/11 18:07, Russell Bateman escribió: I would like to know how how to adjust the width (set columns) in gvim based on filetype that, I assume, Vim knows by reason of the file I've launched it on. For example, if it's a Java file (.java), I'd like to make it 120 columns wide, but leave it

Check for spaces at the start of the current line

2011-08-26 Thread Gerardo Marset
I'm looking for a way of knowing wether or not all the characters up to the cursor position in the current line are spaces. How would I do that? Thanks! -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to. For more

Re: Autocommand event for new buffers including startup buffer

2011-08-26 Thread Tony Mechelynck
On 25/08/11 23:03, Taylor Hedberg wrote: Ben Fritz, Thu 2011-08-25 @ 13:41:20-0700: Does BufEnter work? autocmd BufEnter * if !exists('b:created') | let b:created = 1 | let b:loaded_delimitMate = 1 | endif Yeah, in retrospect, that would probably do it. But I've fixed it another way now, so

Re: Check for spaces at the start of the current line

2011-08-26 Thread Tony Mechelynck
On 26/08/11 19:24, Gerardo Marset wrote: I'm looking for a way of knowing wether or not all the characters up to the cursor position in the current line are spaces. How would I do that? Thanks! Spaces only, or spaces and tabs, or any whitespace including (or not) no-break spaces and