Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread pansz
bill lam 写道: > I guess under linux if you choose utf-8 in locale, everything should > already assume to be utf8. And I don't think any command tools (such > as head sort) will generate bomb on output or expect bomb in > stdin/stdout. That being said, I guess utf-8 bomb would be more > relevant i

Re: refers to the same inode/file

2009-03-16 Thread John Little
:h resolve() Regards, John --~--~-~--~~~---~--~~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~--~~~~--~~--~--~---

Re: Window splits when using ftp

2009-03-16 Thread Charles E. Campbell, Jr.
b4d wrote: > Hi, how could I prevent vim from opening this upper split window with > connection info at every ftp transaction? > http://www.shrani.si/f/40/HT/4DzeYI3Z/vim.png > It appears that somehow the ftp commands window isn't closing for you. That's the first I've heard of that problem;

RE: how to search multiple patterns and move to end

2009-03-16 Thread vimlover
Thank you all for reply. Thanks again. Gene Kwiecinski wrote: > > >>alter table a1 enable constraints xxx; >>alter table b1 enable constraints xxx; >>alter table c1 enable constraints xxx; >>I know if I want to search pattern "a1", and, move the line (with this >>pattern) to end of file by u

Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread bill lam
On Tue, 17 Mar 2009, pansz wrote: > > Tony Mechelynck 写道: > > > > Personally, I use "setglobal bomb" in my ~/.vimrc. Not sure if it's > > "good practice", > > As far as I know gcc will not compile any file with a utf-8 bomb. so I > don't think :setglobal bomb is a good practice unless you ne

Re: Modifying my favourite colour scheme to correctly detect light Vs dark background for cterm displays

2009-03-16 Thread pansz
Marco Ippolito 写道: > Hi! I use this colour scheme: > http://www.vim.org/scripts/script.php?script_id=2480 as my favourite > for both GUI and cterm mode. Have a simple check of the script, I think you can open the script, then remove the line with FIXME and have it recognize the settings of vim.

Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread pansz
Tony Mechelynck 写道: > > Personally, I use "setglobal bomb" in my ~/.vimrc. Not sure if it's > "good practice", As far as I know gcc will not compile any file with a utf-8 bomb. so I don't think :setglobal bomb is a good practice unless you never use gcc to compile your C source code. Please

Re: Modifying my favourite colour scheme to correctly detect light Vs dark background for cterm displays

2009-03-16 Thread pansz
Marco Ippolito 写道: > Could anybody please help me modify the > above-mentioned script (currently at ver. 0.2.7) so that it > successfully detects "light-coloured-background-sessions" and switches > to the alternative colour set? That would be really appreciated, I > spent a bit of time on this and

Re: how to disable ctrl-a

2009-03-16 Thread pansz
Tim Chase 写道: > > You'll hear me mutter under my > breath if I'm remoted into a machine where I don't have this set > up, and accidentaly pull up the help. :) > > -tim I use subversion to maintain my ~/.vim folder, so a simple svn update could sync all my machines with the same configuration

Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Ben Fritz
On Mar 16, 3:07 pm, Maxim Kim wrote: > > Unix-like systems have a "patch" utility that does the opposite of > > "diff" so that you can take the difference between two files, apply it > > to one, and get the other. > > I was hoping vim could do it. :) Well, Vim has the :diffpatch command, but

Re: How to catch interrupts when block in input()?

2009-03-16 Thread Bram Moolenaar
Dasn wrote: > :h catch-interrupt > shows an example of catching interrupts, but it works not as it was > described. The document says: > > > If you press CTRL-C at the prompt, the script is terminated. > > But the problem is: when I press CTRL-C at the prompt, the script is not > terminated,

refers to the same inode/file

2009-03-16 Thread Yakov
In vimscript, how do I compare whether two pathnames refer to same file (does "../../symlink1" and "/home/joe/file1" refer to same inode ?) This is what's normally done with stat() and comparing inode & device in unix, or what 'test x -ef y' in bash/shell does; ignores differences in abolute vs

Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Maxim Kim
On 16 мар, 22:57, Ben Fritz wrote: > On Mar 16, 12:00 pm, Maxim Kim wrote: > > > On 16 мар, 19:12, Ben Fritz wrote: > > Unix-like systems have a "patch" utility that does the opposite of > "diff" so that you can take the difference between two files, apply it > to one, and get the other. I was

Re: subst in vimscript

2009-03-16 Thread Ben Fritz
On Mar 16, 10:30 am, Tim Chase wrote: > It can be hacked using the exec() command: > >    exec '%s/'.from1.'/'.to1.'/g' >    exec '%s/'.from2.'/'.to2.'/g' > I'd even say, it SHOULD be hacked using the exec command. No reason to script running on ranges of lines when ex commands can handle thi

Re: vim highlight overrided

2009-03-16 Thread Ben Fritz
On Mar 16, 5:28 am, Yu Huang wrote: > The highlight scheme of the theme I use is not clear, so I want to change > it. > However, when I set it in my .vimrc file by "hi ... guifg=..." Rather than setting this in your .vimrc, why not just modify the colorscheme directly? This generally is much

Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Ben Fritz
On Mar 16, 12:00 pm, Maxim Kim wrote: > On 16 мар, 19:12, Ben Fritz wrote: > > > Here's the thread on vim_dev with the patch: > > >http://groups.google.com/group/vim_dev/browse_thread/thread/84bcdc1a7... > > > I haven't checked in a while, it might not apply cleanly to the latest > > version.

Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Maxim Kim
On 16 мар, 19:12, Ben Fritz wrote: > Here's the thread on vim_dev with the patch: > > http://groups.google.com/group/vim_dev/browse_thread/thread/84bcdc1a7... > > I haven't checked in a while, it might not apply cleanly to the latest > version. Let me know if you have problems. It's a bit lame,

Re: vim highlight overrided

2009-03-16 Thread Yu Huang
Thanks, Gary Yu Huang On Mon, Mar 16, 2009 at 9:25 AM, Gary Johnson wrote: > > On 2009-03-16, Yu Huang wrote: > > Hi, > > > > The highlight scheme of the theme I use is not clear, so I want to change > > it. > > However, when I set it in my .vimrc file by "hi ... guifg=..." > > After vim starts

RE: how to search multiple patterns and move to end

2009-03-16 Thread Gene Kwiecinski
>alter table a1 enable constraints xxx; >alter table b1 enable constraints xxx; >alter table c1 enable constraints xxx; >I know if I want to search pattern "a1", and, move the line (with this >pattern) to end of file by using >:g/a1/m$ >but if if want to search a couple of patterns, for example,li

Re: vim highlight overrided

2009-03-16 Thread Gary Johnson
On 2009-03-16, Yu Huang wrote: > Hi, > > The highlight scheme of the theme I use is not clear, so I want to change > it. > However, when I set it in my .vimrc file by "hi ... guifg=..." > After vim starts the hi group "SEARCH" is still the same as before I set "hi > ... guifg=" > > My setting se

Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Ben Fritz
By the way, this is one of the many uses I could see for my dynamic folding patch to the 2hmtl.vim script. Using it, you could define all your folds like you want, then run :TOhtml with the appropriate options, and you will have an html version of your document with all the same folding capabilit

Re: How to sort according to the folded text, and not intervene the text that has folded in.

2009-03-16 Thread Ben Fritz
On Mar 15, 5:22 am, "Yue Wu" wrote: > As title, I have a file that has the foldings like this: > > Folded text 3. > Folded text 1. > Folded text 2. > > Now I want to sort them, so it becomes: > > Folded text 1. > Fo

Modifying my favourite colour scheme to correctly detect light Vs dark background for cterm displays

2009-03-16 Thread Marco Ippolito
Hi! I use this colour scheme: http://www.vim.org/scripts/script.php?script_id=2480 as my favourite for both GUI and cterm mode. It has colour definitions for dark as well as light cterms yet I never get the "light" version of it, no matter how "light" my terminal session is. My usual sessions are:

Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread Tony Mechelynck
On 16/03/09 14:49, Maxim Kim wrote: > > > On 16 мар, 16:20, Tony Mechelynck > wrote: >> ... >> Note that altering any of these three options in an undo_ftplugin line >> is courting disaster: Vim has a separate mechanism to detect these >> options' values when opening an existing file, and the resu

Re: subst in vimscript

2009-03-16 Thread Tim Chase
> " file begin - lots_of_replace.vim > let from1 = "x" " more specific string > let to1 = "y" > let from2 = "xxx" " less specific string > let to2 = "\x79yy" " or \u0079 (=y) > > "for l in range(line('$')+1) > " call setline(l, substitute(getline(l), from1, to1, 'g') ) > " call se

Re: Folding should not display the first line and ... should be appended in the last unfolded line

2009-03-16 Thread Ben Fritz
On Mar 15, 1:21 pm, Foss User wrote: > With these settings, a text like the following: > > 1.1 Introduction > >     In this chapter we will cover all the important concepts in brief. >     The concepts covered in this chapter are: > >         a) Groups >         b) Fields >         c) Real ana

Re: vim doesn't source ~/.vimrc

2009-03-16 Thread Ben Fritz
On Mar 15, 10:16 pm, Harry Putnam wrote: > > If I do `vim .bashrc'  I see no syntax highlighting.  Yet if I > manually source ~/.vimrc then my syntax highlight appears. > What if you edit another filetype? Do you see syntax highlighting in C code for example, or does Vim disable syntax highli

Re: Getpid()

2009-03-16 Thread Christian Ebert
* Buckley, Bryan (GE EntSol, Intelligent Platforms) on Monday, March 16, 2009 at 11:08:25 -0400 > Does that work for you? Yes. > For me I have > > E117: Unknown function: getpid > E15: Invalid expression: getpid() > > Vim 7.1 Ah. 7.2 with latest patches here. version7.txt says: |Patch 7.

Re: subst in vimscript

2009-03-16 Thread Horvath Adam
Thanks for the ideas! I run script below on this text file: xxx y xxx yyy x yyy yyy x yyy xxx y xx :source lots_of_replace.vim " file begin - lots_of_replace.vim let from1 = "x" " more specific string let to1 = "y" let from2 = "xxx" " less specific string let to2 = "\x

RE: Getpid()

2009-03-16 Thread Buckley, Bryan (GE EntSol, Intelligent Platforms)
Does that work for you? For me I have E117: Unknown function: getpid E15: Invalid expression: getpid() Vim 7.1 -Original Message- From: vim_use@googlegroups.com [mailto:vim_...@googlegroups.com] On Behalf Of Christian Ebert Sent: Monday, March 16, 2009 9:53 AM To: vim_use@googlegroup

Re: Getpid()

2009-03-16 Thread Christian Ebert
* Buckley, Bryan (GE EntSol, Intelligent Platforms) on Monday, March 16, 2009 at 09:34:00 -0400 > Can someone show me a usage of getpid() inside of vim? Currently to get > the pid from inside vim i have to do something like: > > !ps | echo $PPID I'm not sure I understand, but how about: :echo

Re: How to delete all marks in current line?

2009-03-16 Thread 张书瀚
This solution is quit smiple and intuitive, but it can not be used to delete marks in read-only files. I think the best solution is Matt's solution adding check of the buffer numbe.^_^ I modify DelMarkInLine() and use this EVERYDAY: function! ToggleMark(lineNum) " All possible marks let ma

Re: how to disable ctrl-a

2009-03-16 Thread Tim Chase
bill lam wrote: >> nmap > > Thank for everybody! I can blindly press ctrl-a now. ;-) I do similarly, mapping to / because on my laptops, it's s close to the key, I often end up missing or mashing both. You'll hear me mutter under my breath if I'm remoted into a machine where I don't

Re: how to disable ctrl-a

2009-03-16 Thread bill lam
> nmap Thank for everybody! I can blindly press ctrl-a now. ;-) -- regards, GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 唐詩097 王灣 次北固山下 客路青山外 行舟綠水前 潮平兩岸闊 風正一帆懸 海日生殘夜 江春入舊年 鄉書何處達 歸雁洛陽邊

Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread Maxim Kim
On 16 мар, 16:20, Tony Mechelynck wrote: > ... > Note that altering any of these three options in an undo_ftplugin line > is courting disaster: Vim has a separate mechanism to detect these > options' values when opening an existing file, and the results are > usually correct; for new files, you

Getpid()

2009-03-16 Thread Buckley, Bryan (GE EntSol, Intelligent Platforms)
Can someone show me a usage of getpid() inside of vim? Currently to get the pid from inside vim i have to do something like: !ps | echo $PPID The documentation doesn't have an example >_< Thanks. --~--~-~--~~~---~--~~ You received this message from the "vim_us

Re: Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread Tony Mechelynck
On 16/03/09 13:55, Maxim Kim wrote: > > Hi, > > I have a (ft)plugin that overrides filetype of .wiki extension from > flexwiki to vimwiki. Everything seems quite good except for a state of > just opened buffer that is in 'changed' one. > As far as I can see FlexWiki ftplugin does :setlocal bomb co

Is it a good practice to setlocal bomb in ftplugin?

2009-03-16 Thread Maxim Kim
Hi, I have a (ft)plugin that overrides filetype of .wiki extension from flexwiki to vimwiki. Everything seems quite good except for a state of just opened buffer that is in 'changed' one. As far as I can see FlexWiki ftplugin does :setlocal bomb command that puts vim's buffer in a 'changed' state

Re: Anomaly in behavior when map! jj

2009-03-16 Thread Andy Wokula
Foss User schrieb: > I launch vi. Then I type :map (i.e. I type : m a p and then > press the key). I return from command mode to normal mode as > soon as I press . you probably launched Vim in fact, check with :ver > Now I map the 'jj' to with the following command: map! jj > > Now, I ty

vim highlight overrided

2009-03-16 Thread Yu Huang
Hi, The highlight scheme of the theme I use is not clear, so I want to change it. However, when I set it in my .vimrc file by "hi ... guifg=..." After vim starts the hi group "SEARCH" is still the same as before I set "hi ... guifg=" My setting seems to be overrided by some other files sourced af

Re: vim doesn't source ~/.vimrc

2009-03-16 Thread Stahlman Family
Harry Putnam wrote: > Harry Putnam writes: > >> Setup: >> OS=Opensolaris 2008.11 >> vim=See full `:version output at the end > > I think parts of this thread stayed on gmane.editors.vim or at least I > thought I saw a post here somewhere that asked me to post my vimrc. > > In case anyone is

Re: vim leaves zombies behind

2009-03-16 Thread Tony Mechelynck
On 16/03/09 03:20, John Little wrote: > > On Mar 16, 12:58 am, Spiros wrote: :%! some_executable the executable becomes a zombie after it terminates and remains a zombie until I exit vim. >> >> Ubuntu GNU/Linux. >> The version from the /var/lib/dpkg/status file is >> Version: 1:7.0-

Re: subst in vimscript

2009-03-16 Thread A. S. Budden
2009/3/16 Tim Chase : > > A. S. Budden wrote: >> 2009/3/16 Horvath Adam : >>> Dear List Members! >>> >>> I need to correct sql dump files: >>> >>> Question 1: >>> >>> I like to this with vimscript: >>> :%s/xxx/yyy/g >>> For all line in buffer and all occurencies in line >>> >>> How can it be done

Re: subst in vimscript

2009-03-16 Thread Tim Chase
A. S. Budden wrote: > 2009/3/16 Horvath Adam : >> Dear List Members! >> >> I need to correct sql dump files: >> >> Question 1: >> >> I like to this with vimscript: >> :%s/xxx/yyy/g >> For all line in buffer and all occurencies in line >> >> How can it be done wiht script? > > There may be better

Re: subst in vimscript

2009-03-16 Thread A. S. Budden
2009/3/16 Horvath Adam : > > Dear List Members! > > I need to correct sql dump files: > > Question 1: > > I like to this with vimscript: > :%s/xxx/yyy/g > For all line in buffer and all occurencies in line > > How can it be done wiht script? There may be better ways, but here's one possibility:

subst in vimscript

2009-03-16 Thread Horvath Adam
Dear List Members! I need to correct sql dump files: Question 1: I like to this with vimscript: :%s/xxx/yyy/g For all line in buffer and all occurencies in line How can it be done wiht script? Question 2: In ex-mode I can enter nonreadeble characters with hexa code this way: "CTRL+Q" and "x"

Re: how to disable ctrl-a

2009-03-16 Thread pansz
bill lam 写道: > Related to a recent thread about screen and ctrl-a. I have an exactly > opposite problem in that pressing ctrl-a for switching screen become > my second nature. Even in sessions not under screen, I often press > ctrl-a to switch screen. In vim this ctrl-a will be mistaken to > incr

Re: How to delete all marks in current line?

2009-03-16 Thread Tony Mechelynck
On 14/03/09 18:23, 书瀚张 wrote: > Hi everyone, > I am trying to write a function to delete all mark in current line. > I want to have something like this: > > function DelMark() > > endfunction > > map call DelMark():DoShowMarks > > DoShowMarks is a command from ShowMarks >

Re: how to disable ctrl-a

2009-03-16 Thread Markus Heidelberg
Dennis Benzinger, 16.03.2009: > > Am 16.03.2009 09:01, bill lam schrieb: > > Related to a recent thread about screen and ctrl-a. I have an exactly > > opposite problem in that pressing ctrl-a for switching screen become > > my second nature. Even in sessions not under screen, I often press > > c

Re: how to disable ctrl-a

2009-03-16 Thread Dennis Benzinger
Am 16.03.2009 09:01, bill lam schrieb: > Related to a recent thread about screen and ctrl-a. I have an exactly > opposite problem in that pressing ctrl-a for switching screen become > my second nature. Even in sessions not under screen, I often press > ctrl-a to switch screen. In vim this ctrl-a

how to disable ctrl-a

2009-03-16 Thread bill lam
Related to a recent thread about screen and ctrl-a. I have an exactly opposite problem in that pressing ctrl-a for switching screen become my second nature. Even in sessions not under screen, I often press ctrl-a to switch screen. In vim this ctrl-a will be mistaken to increment number under curso