Use a variable as a pattern in a substitution

2010-05-18 Thread Thibaut
Hello, I am trying to do a substitution where the pattern is the text a visually selected before. I have looked in the archives and in the tips but I do not find the right way to do it. the command I first thought was: :s/@*/bar/ but it won't work. Does anybody have an idea to do it? Thanks

Javascript indent script

2010-05-18 Thread John Beckett
There is (I think) no official indent/javascript.vim file. A new tip has been uploaded that may fix this: http://vim.wikia.com/wiki/Improved_Javascript_Indent_script_for_Vim We do not really want pure scripts on the wiki (they are usually unmaintained and undocumented and unhelpful). I'm hoping

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread robert song
Thank you very much, Ephraim, I like to just :set hidden, which keeps all buffers in memory even when they are not visible. I tend to think the default, which doesn't do this is a holdover from when memory was much more expensive. yes, it's very helpful if I can take care not to use :q!

Re: Javascript indent script

2010-05-18 Thread Bram Moolenaar
John Beckett wrote: There is (I think) no official indent/javascript.vim file. A new tip has been uploaded that may fix this: http://vim.wikia.com/wiki/Improved_Javascript_Indent_script_for_Vim We do not really want pure scripts on the wiki (they are usually unmaintained and

RE: Use a variable as a pattern in a substitution

2010-05-18 Thread John Beckett
Thibaut wrote: I am trying to do a substitution where the pattern is the text a visually selected before. I think you have an answer, but the really useful procedure is to use the tip I recently mentioned: http://vim.wikia.com/wiki/Search_for_visually_selected_text Standard procedure: - Select

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread Tony Mechelynck
On 18/05/10 11:39, Efraim Yawitz wrote: On Tue, May 18, 2010 at 12:36 PM, robert song robertsong.ja...@gmail.com mailto:robertsong.ja...@gmail.com wrote: Hi, everyone. If I in a C file, and try to jump to the definition of one function with CTRL-] key, but if the file is

Re: Javascript indent script

2010-05-18 Thread David Fishburn
On 18/05/2010 5:01 AM, John Beckett wrote: There is (I think) no official indent/javascript.vim file. A new tip has been uploaded that may fix this: http://vim.wikia.com/wiki/Improved_Javascript_Indent_script_for_Vim We do not really want pure scripts on the wiki (they are usually unmaintained

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread tyru
Hi. On May 18, 8:25 pm, robert song robertsong.ja...@gmail.com wrote: Thank you very much, Ephraim, I like to just :set hidden, which keeps all buffers in memory even when they are not visible.  I tend to think the default, which doesn't do this is a holdover from when memory was much

Unintended paste

2010-05-18 Thread timezone
I am using GVIM 7.2 on XP. I can open up a file in VIM and without doing anything yet to the file have an item paste to a line just by scrolling the page. Continual scrolling can paste the item multiple times. Obviously on a large file this can be a problem because I don't necessarily know

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread Gary Johnson
On 2010-05-18, Tony Mechelynck wrote: On Tue, May 18, 2010 at 12:36 PM, robert song wrote: Hi, everyone. If I in a C file, and try to jump to the definition of one function with CTRL-] key, but if the file is modified, I must save the file at first, is there any way to

Re: Unintended paste

2010-05-18 Thread Christian Brabandt
On Tue, May 18, 2010 3:27 pm, timezone wrote: I am using GVIM 7.2 on XP. I can open up a file in VIM and without doing anything yet to the file have an item paste to a line just by scrolling the page. Continual scrolling can paste the item multiple times. Obviously on a large file this

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread robert song
thank you, gary, Another alternative is to use Ctrl-W } to see the source of the tag in a preview window.  That will leave the cursor in the original window, which is useful if you just want to see the definition and not edit it. I tried Ctrl-W }, but it works just like Ctrl-W ] in C source

!history with no result

2010-05-18 Thread robert song
Hi, everyone. I executed :!history in vim to execute the external history command, but find that no result is outputted. Does anybody know the reason ? Best Regards, robert -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are

Re: !history with no result

2010-05-18 Thread Shawn H Corey
On 10-05-18 11:58 AM, robert song wrote: Hi, everyone. I executed :!history in vim to execute the external history command, but find that no result is outputted. Does anybody know the reason ? Best Regards, robert Yes, :! will start a new shell to run the command in. Since it's new, it

Re: !history with no result

2010-05-18 Thread robert song
Yes, :! will start a new shell to run the command in. Since it's new, it has no history. Try: :!echo I haz history;history Shawn, thank you for your reply, so is there any way to read the history result to current window ? just like the other command :r!date. If this can be done, it's

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread Gary Johnson
On 2010-05-19, robert song wrote: thank you, gary, Another alternative is to use Ctrl-W } to see the source of the tag in a preview window.  That will leave the cursor in the original window, which is useful if you just want to see the definition and not edit it. I tried Ctrl-W },

Re: !history with no result

2010-05-18 Thread Gary Johnson
On 2010-05-19, robert song wrote: Yes, :! will start a new shell to run the command in. Since it's new, it has no history. Try: :!echo I haz history;history Shawn, thank you for your reply, so is there any way to read the history result to current window ? just like the other

Re: .vimrc mutually exclusive settings

2010-05-18 Thread Ben Fritz
On May 17, 1:10 am, Bee 200...@calcentral.com wrote: I use the same .vimrc on several platforms with versions: vim 6x 7x and now vim.tiny 7x (deb) But... there is one case I can not make automatic. The following are valid in vim 7x and vim.tiny 7x but not vim 6x set showtabline=2        

Re: !history with no result

2010-05-18 Thread robert song
Hi, Gary, This behavior depends on the shell you're using and how it's configured.  For example, on one Linux system running some version of ksh, I get the results you describe.  On another Linux system running a different version of ksh, executing :!history lists the last 16 commands. I'd

Re: !history with no result

2010-05-18 Thread robert song
Try this... !bash -ic 'set -o history; history' Brett, thank you very much. It works. Best Regards, robert -- 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 information, visit

Regex problem

2010-05-18 Thread Jeremiah Martell
I cant figure out how to search for newline followed by non-newline using vim. So if I have a file like this: a b c d e f g h i j k l m n o p q I want to find the newlines after c, f, j, and o, but not after g or l. What's the regular expression look like for this? Thanks, - Jeremiah --

Re: Regex problem

2010-05-18 Thread AK
On 05/18/2010 02:23 PM, Jeremiah Martell wrote: I cant figure out how to search for newline followed by non-newline using vim. So if I have a file like this: a b c d e f g h i j k l m n o p q I want to find the newlines after c, f, j, and o, but not after g or l. What's the

Re: Regex problem

2010-05-18 Thread Charles Campbell
Jeremiah Martell wrote: I cant figure out how to search for newline followed by non-newline using vim. So if I have a file like this: a b c d e f g h i j k l m n o p q I want to find the newlines after c, f, j, and o, but not after g or l. What's the regular expression look like for this?

Re: Regex problem

2010-05-18 Thread Benjamin R. Haskell
On Tue, 18 May 2010, Jeremiah Martell wrote: I cant figure out how to search for newline followed by non-newline using vim. So if I have a file like this: a b c d e f g h i j k l m n o p q I want to find the newlines after c, f, j, and o, but not after g or l. What's the

Re: Regex problem

2010-05-18 Thread Shawn H Corey
On 10-05-18 02:33 PM, AK wrote: On 05/18/2010 02:23 PM, Jeremiah Martell wrote: I cant figure out how to search for newline followed by non-newline using vim. So if I have a file like this: a b c d e f g h i j k l m n o p q I want to find the newlines after c, f, j, and o, but not after g

Get rid off 1 char gutter

2010-05-18 Thread David Woodfall
Is there a way of getting rid of the 1 character width gutter on the left? Reason is when I need to read/edit a file where a long url wraps over to line under it the gutter splits the url and consequently urxvt url matching breaks. -- Don't look back, the lemmings are gaining on you.

Re: Get rid off 1 char gutter

2010-05-18 Thread Tim Chase
On 05/18/2010 02:05 PM, David Woodfall wrote: Is there a way of getting rid of the 1 character width gutter on the left? Reason is when I need to read/edit a file where a long url wraps over to line under it the gutter splits the url and consequently urxvt url matching breaks. Short answer:

Re: Regex problem

2010-05-18 Thread Gary Johnson
On 2010-05-18, Shawn H Corey wrote: On 10-05-18 02:33 PM, AK wrote: On 05/18/2010 02:23 PM, Jeremiah Martell wrote: I cant figure out how to search for newline followed by non-newline using vim. So if I have a file like this: a b c d e f g h i j k l m n o p q I want to

Re: Regex problem

2010-05-18 Thread Jeremiah Martell
Thanks everyone! I got plenty of options that work. :-) - Jeremiah -- 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 information, visit http://www.vim.org/maillist.php

Re: Re: Get rid off 1 char gutter

2010-05-18 Thread David Woodfall
On (14:23 18/05/10), Tim Chase v...@tim.thechases.com put forth the proposition: On 05/18/2010 02:05 PM, David Woodfall wrote: Is there a way of getting rid of the 1 character width gutter on the left? Reason is when I need to read/edit a file where a long url wraps over to line under it the

How to suppress a message

2010-05-18 Thread Tim Johnson
Using vim 7.2 on slack 13.0 32-bit. Example: : bdelete 54 result E516: No buffers were deleted How may I suppress the message above? Note: I have tried using 'silent', it doesn't stop the message. The goal is to use this in script. As in exe :silent bdelete i or whatever is correct

Re: How to suppress a message

2010-05-18 Thread Bryan Venteicher
- Original Message - From: Tim Johnson t...@johnsons-web.com To: vim use vim_use@googlegroups.com Sent: Tuesday, May 18, 2010 4:55:17 PM Subject: How to suppress a message Using vim 7.2 on slack 13.0 32-bit. Example: : bdelete 54 result E516: No buffers were deleted How may I

Re: How to suppress a message

2010-05-18 Thread Gary Johnson
On 2010-05-18, Tim Johnson t...@johnsons-web.com wrote: Using vim 7.2 on slack 13.0 32-bit. Example: : bdelete 54 result E516: No buffers were deleted How may I suppress the message above? Note: I have tried using 'silent', it doesn't stop the message. The goal is to use this

Re: How to suppress a message

2010-05-18 Thread Tim Johnson
* Bryan Venteicher bry...@daemoninthecloset.org [100518 14:39]: As in exe :silent bdelete i or whatever is correct Try 'exe :silent! bdelete i' Thanks to Bryan and Gary. -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com -- You received this message from the

Get current word from Python script

2010-05-18 Thread Yang Zhang
How do I get the current word from a Python script? I can get vim.current.window.cursor which is row,col, and I can get vim.current.line, but which character we're in is a computation that considers the tabstop and all the tabs on the line...is there an easier way? -- Yang Zhang

Re: Get current word from Python script

2010-05-18 Thread winterTTr
On Wed, May 19, 2010 at 10:15 AM, Yang Zhang yanghates...@gmail.com wrote: How do I get the current word from a Python script? I can get vim.current.window.cursor which is row,col, and I can get vim.current.line, but which character we're in is a computation that considers the tabstop and all

Re: Get rid off 1 char gutter

2010-05-18 Thread Tony Mechelynck
On 18/05/10 22:11, David Woodfall wrote: [...] Yep, foldcolumn it is. Hmm though in mutt the urls are still broken, which was one of the original problems. Thanks [...] It could be that your line got broken by auto-reformatting at the right margin, and that mutt (or Vim in mutt) doesn't know

Re: How to suppress a message

2010-05-18 Thread Ben Fritz
On May 18, 5:33 pm, Gary Johnson garyj...@spocom.com wrote: On 2010-05-18, Tim Johnson t...@johnsons-web.com wrote: Example: : bdelete 54   result E516: No buffers were deleted   How may I suppress the message above? Note: I have tried using 'silent', it doesn't stop the

Re: Regex problem

2010-05-18 Thread Ben Fritz
On May 18, 2:42 pm, Gary Johnson garyj...@spocom.com wrote: It doesn't matter whether or not he's using Windows provided that the file uses only NL line terminators or only CR-NL line terminators.  As long as the line terminators are purely one type or the other, Vim sets 'fileformat'

Re: How to keep the buffer unsaved while jumping to other file

2010-05-18 Thread Ben Fritz
On May 18, 4:36 am, robert song robertsong.ja...@gmail.com wrote: Hi, everyone. If I in a C file, and try to jump to the definition of one function with CTRL-] key, but if the file is modified, I must save the file at first, is there any way to avoid saving file? Yet another option (which