Re: Python 2.5 support
Sumner Hayes wrote: Python 2.5 has tightened up the way it handles memory allocation, and there's a mis-match in the way that if_python.c handles memory allocation which worked with earlier Python versions but causes vim to seg-fault with 2.5. Essentially, PyMem_DEL shouldn't be paired with PyObject allocations--they should use Py_DECREF. Since every PyMem_DEL in if_python.c is on a PyObject *, they should all be replaced with Py_DECREF. This should be safe with earlier python versions as well as with 2.5 (I've tested with 2.3 and 2.5). Patch attached, though a simple %s/PyMem_DEL/Py_DECREF/ is fine. Makes sense to me. If nobody objects then I'll include this change. -- It is illegal to take more than three sips of beer at a time while standing. [real standing law in Texas, United States of America] /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
syntax. Contained items should not contribute to highlight outside of a containing keepend item highlighting area
Hello. I'm continuing my investigation on Vim's syntax highlight for the following syntax rules: :syn cluster Top contains=Block,String,Identifier :syn region Block start=+{+ end=+}+ keepend extend [EMAIL PROTECTED] :syn region String start=++ end=++ contains=Identifier :syn region Identifier start=+\${+ end=+}+ extend and I've found that this code { block string } extra is highlighted not exactly as I want it to be. Highlight is as follows: { block string } extra S The problem is that closing brace '}' is highlighted as a String because Block does not have any kind of highlight and contained String region is forcefully terminated at the same character as enclosing Block is. So, I thought, that it would be logical that if I would limit Block highlight to be completely inside braces then String would not highlight brace character itself. It appears to be not the case. Here is a new matching rule for Block: :syn region Block start=+{+hs=e end=+}+he=s-1 keepend extend [EMAIL PROTECTED] Problem is that when a region is terminated because an enclosing keepend region is terminated, then the contained region highlight end is at the same point as the keepend region match end is, while, from my point of view, it should be where the keepend region highlight end is. Here is a patch that makes Vim do as I want. Version 1 is for an original syntax.c as it is in CVS now. Version 2 is for syntax.c that was modified by my previous patch from extend inside normal inside keepend e-mail. Ilya Bobir Index: syntax.c === RCS file: /cvsroot/vim/vim7/src/syntax.c,v retrieving revision 1.62 diff -c -r1.62 syntax.c *** syntax.c26 Apr 2006 23:58:59 - 1.62 --- syntax.c22 Sep 2006 19:38:24 - *** *** 2564,2569 --- 2564,2570 { int i; lpos_Tmaxpos; + lpos_Tmaxpos_h; stateitem_T *sip; /* *** *** 2583,2595 break; maxpos.lnum = 0; for ( ; i current_state.ga_len; ++i) { sip = CUR_STATE(i); if (maxpos.lnum != 0) { limit_pos_zero(sip-si_m_endpos, maxpos); ! limit_pos_zero(sip-si_h_endpos, maxpos); limit_pos_zero(sip-si_eoe_pos, maxpos); sip-si_ends = TRUE; } --- 2584,2597 break; maxpos.lnum = 0; + maxpos_h.lnum = 0; for ( ; i current_state.ga_len; ++i) { sip = CUR_STATE(i); if (maxpos.lnum != 0) { limit_pos_zero(sip-si_m_endpos, maxpos); ! limit_pos_zero(sip-si_h_endpos, maxpos_h); limit_pos_zero(sip-si_eoe_pos, maxpos); sip-si_ends = TRUE; } *** *** 2600,2605 --- 2602,2614 || (maxpos.lnum == sip-si_m_endpos.lnum maxpos.col sip-si_m_endpos.col))) maxpos = sip-si_m_endpos; + if (sip-si_ends +(sip-si_flags HL_KEEPEND) +(maxpos_h.lnum == 0 + || maxpos_h.lnum sip-si_h_endpos.lnum + || (maxpos_h.lnum == sip-si_h_endpos.lnum +maxpos_h.col sip-si_h_endpos.col))) + maxpos_h = sip-si_h_endpos; } } *** syntax.cFri Sep 22 22:39:57 2006 --- syntax.c.newFri Sep 22 22:26:23 2006 *** *** 2574,2579 --- 2574,2580 { int i; lpos_Tmaxpos; + lpos_Tmaxpos_h; stateitem_T *sip; /* *** *** 2593,2605 break; maxpos.lnum = 0; for ( ; i current_state.ga_len; ++i) { sip = CUR_STATE(i); if (maxpos.lnum != 0) { limit_pos_zero(sip-si_m_endpos, maxpos); ! limit_pos_zero(sip-si_h_endpos, maxpos); limit_pos_zero(sip-si_eoe_pos, maxpos); sip-si_ends = TRUE; } --- 2594,2607 break; maxpos.lnum = 0; + maxpos_h.lnum = 0; for ( ; i current_state.ga_len; ++i) { sip = CUR_STATE(i); if (maxpos.lnum != 0) { limit_pos_zero(sip-si_m_endpos, maxpos); ! limit_pos_zero(sip-si_h_endpos, maxpos_h); limit_pos_zero(sip-si_eoe_pos, maxpos); sip-si_ends = TRUE; } *** *** 2610,2615 --- 2612,2624 || (maxpos.lnum == sip-si_m_endpos.lnum maxpos.col sip-si_m_endpos.col))) maxpos = sip-si_m_endpos; + if (sip-si_ends +(sip-si_flags HL_KEEPEND) +(maxpos_h.lnum == 0 + || maxpos_h.lnum sip-si_h_endpos.lnum + || (maxpos_h.lnum == sip-si_h_endpos.lnum +maxpos_h.col sip-si_h_endpos.col))) + maxpos_h = sip-si_h_endpos; }
Re: Convert2HTML Again
Hi developers, On 9/22/06, Bram Moolenaar [EMAIL PROTECTED] wrote: Edd - I have spoken to your development team and I think we have come to a conclusion. I draw your attention to this thread: http://tech.groups.yahoo.com/group/vimdev/message/44853 Lemme know your opinions. I haven't heard from people who have actually made changes to this script in the past. Most remarks I have seen are I think..., which isn't definitive. I still don't know why the p /p was there. There must have been a reason, it didn't get there by accicent. I last talked about this with Edward Fox, let me copy this message to him. Edward, what is your opinion about this patch? This script works perfectly. Edd Barrett also solved another problem made by the previous maintainer that the leading space doesn't appear under xhtml mode, which I didn't solved last time I modified this script. Thanks Edd! But we should change one thing before we include this patch into the official version. In the patch file, line 97: +execute normal! A\npre { font-family: courier; color: . s:fgc . ; background-color: . s:bgc . ; }\e Should be: +execute normal! A\npre { font-family: Courier, monospace; color: . s:fgc . ; background-color: . s:bgc . ; }\e As W3C suggested, every font-family indication must finish with a *GENERIC* font family name, possible values are serif, sans-serif or monospace. So I added monospace here. - Bram -- Zen Microsystems: we're the om in .com /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// Best regards, Edward L. Fox
Ragged-end block: actual behaviour conflicts with help
From *visual.txt*For Vim version 7.0. Last change: 2006 Apr 24 second paragraph under :help v_$ (lines 176-179). This help tag is about using $ in visual-block mode, which produces a block-visual selection with a ragged right side. ---8--- For moving the end of the block many commands can be used, but you cannot use Ex commands, commands that make changes or abandon the file. Commands (starting with) .pPiIaAO, CTRL-^, Z, CTRL-], CTRL-T, CTRL-R, CTRL-I and CTRL-O cause a beep and Visual mode continues. ---8--- Actual behaviour: p, P No beep. Unnamed register is added once. Block is deleted, Visual mode ends. O Go to Other corner on the same line, as documented under :help v_O a, i, Z Beep happens after next key is hit , Ctrl-], Ctrl-T, Ctrl-R, Ctrl-I, Ctrl-O Beep happens immediately I No beep. Visual mode ends. Insert happens before top left corner of block. When Esc is hit, insert is propagated to left margin of whole block. A No beep. Visual mode ends. Insert happens after top right corner of block. When Esc is hit, insert is propagated to ragged right margin of whole block. I checked for maps on the above keys, the reply was No mapping found. Best regards, Tony.
--enable-pythoninterp gives unrecognized option `-pthread' on MacOS X
Hello, I wanted to ask this for quite a long time (Vim 6.4 actually): When I compile with --enable-pythoninterp I get the following warnings: $ head -n5 vim-make.log Starting make in the src directory. If there are problems, cd to the src directory and run make there cd src gnumake first CC=gcc -Iproto -DHAVE_CONFIG_H -I/sw/include-I/sw/include -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -I/sw/include/python2.4 -pthreadsrcdir=. sh ./osdef.sh gcc: unrecognized option `-pthread' [...] etc. $ grep pthread vim-configure.log checking if -pthread should be used... yes checking for pthread_np.h... no $ ls -1 /usr/include/pthread* /usr/include/pthread.h /usr/include/pthread_impl.h $ vim --version VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 16 2006 00:05:46) Included patches: 1-109 Compiled by [EMAIL PROTECTED] Huge version without GUI. Features included (+) or not (-): +arabic +autocmd -balloon_eval -browse ++builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse -mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_xterm +multi_byte +multi_lang -mzscheme -netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save system vimrc file: $VIM/vimrc user vimrc file: $HOME/.vimrc user exrc file: $HOME/.exrc fall-back for $VIM: /usr/local/share/vim Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/sw/include -I/sw/include -I/sw/include -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -I/sw/include/python2.4 -pthread Linking: gcc -L/sw/lib -L/usr/local/lib -o vim -lncurses -liconv -L/sw/lib -L/usr/local/lib /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a -L/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -lperl -lm -lc -L/sw/lib/python2.4/config -lpython2.4 -u _PyMac_Error This is on MacOS 10.3.9: $ uname -a Darwin krille.blacktrash.org 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc However it seems to work. But I can't be sure because I don't use 'pythoninterp' very often. Ideas anyone? c -- _B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html
Re: [BUG] with 'scrolloff' and Visual mode
I agree. I confirmed this odd behavior with $ gvim -u NONE -N :set so=4 and adding 100 lines to the buffer. As you say, for Step 1 it is important to click and drag; entering Visual mode with v or double-clicking does not reproduce the bug. For Step 2, I simply used H (without the quotes). HTH --Benji Fisher On Thu, Sep 21, 2006 at 04:32:31PM -0700, Max Dyckhoff wrote: Addendum: You actually have to drag with the mouse. Just double clicking on a word will not cause this erroneous behaviour. [1-4]-clicking and then dragging will make it happen. Max -Original Message- From: Max Dyckhoff [mailto:[EMAIL PROTECTED] Sent: Thursday, September 21, 2006 11:18 AM To: vim@vim.org Cc: [EMAIL PROTECTED] Subject: [BUG] Having just activated scrolloff=4 (which is great!) I have noticed one small bug in gvim. If you do a visual select using the mouse, then the scrolloff will be entirely ignored. 1. Select some text with the mouse. 2. Use the keyboard to move the cursor up to the top of the window. 3. Watch the cursor break through the 4 line buffer described by scrolloff. 4. Press escape. 5. Use the keyboard to move the cursor up or down. 6. Observe as the buffer jumps down to compensate for the scrolloff. Nothing major, but thought I would mention it! :) Max
Re: ctrl-v after a o command
On Thu, Sep 21, 2006 at 07:37:47PM -0700, lll wrote: Hello: I'm using VIM 7.0 in windows OS. Whenever I paste something using ctrl-v after typing o to insert on next line, the pasted string would not follow the indentation of the curser. It would paste the string from the beginning of the line. This is a new behavior compare to version 6.2. Does anybody know how to set the behavior back so ctrl-v will paste the string right where the curser is? I think this is a problem that has already been fixed. I assume you are using mswin.vim, which maps C-v in Insert mode to do a paste. Try :imap C-v When I do this, I get i C-VxBSEsc:call paste#Paste()CRgi If you are missing the xBS at the beginning of the mapping, that would explain the problem. You can fix it by getting the updated files $VIMRUNTIME/mswin.vim $VIMRUNTIME/autoload/paste.vim HTH --Benji Fisher
SR
Hi I have a file where I deleted all lines that don't contain a certain pattern For example I want to delete all lines that don't contain XXX and YYY. Before: [start of file] abcde XXX fghij YYY 12345 AAA 67890 BBB klmno XXX pqrst YYY 09876 XXX 54321 BBB *()- XXX ,./;' YYY [end of file] After: [start of file] abcde XXX fghij YYY *()- XXX ,./;' YYY [end of file] How do I do that? Best Regards, Eric _ All-in-one security and maintenance for your PC. Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo005001msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail
Re: SR
Hi, Eric Leenman schrieb: I have a file where I deleted all lines that don't contain a certain pattern For example I want to delete all lines that don't contain XXX and YYY. Before: [start of file] abcde XXX fghij YYY 12345 AAA 67890 BBB klmno XXX pqrst YYY 09876 XXX 54321 BBB *()- XXX ,./;' YYY [end of file] After: [start of file] abcde XXX fghij YYY *()- XXX ,./;' YYY [end of file] How do I do that? :g/PATTERN/d deletes all lines that match a specific pattern. To keep all lines you need to use :g!/PATTERN/d or :v/PATTERN/d Now your pattern is either XXX.*YYY or XXX.*YYY\|YYY.*XXX depending on wheter you only want to keep lines with contain XXX in front of YYY or whether the order of those strings is irrelevant. So the final command is :v/XXX.*YYY/d or :v/XXX.*YYY\|YYY.*XXX/d Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)
RE: SR
I made a typo After should be: After: [start of file] abcde XXX fghij YYY klmno XXX pqrst YYY *()- XXX ,./;' YYY [end of file] Rgds, Eric From: Eric Leenman [EMAIL PROTECTED] To: vim@vim.org Subject: SR Date: Fri, 22 Sep 2006 11:59:59 + Hi I have a file where I deleted all lines that don't contain a certain pattern For example I want to delete all lines that don't contain XXX and YYY. Before: [start of file] abcde XXX fghij YYY 12345 AAA 67890 BBB klmno XXX pqrst YYY 09876 XXX 54321 BBB *()- XXX ,./;' YYY [end of file] After: [start of file] abcde XXX fghij YYY *()- XXX ,./;' YYY [end of file] How do I do that? Best Regards, Eric _ All-in-one security and maintenance for your PC. Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo005001msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail _ Try the new Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-usFORM=WLMTAG
Re: --enable-pythoninterp gives unrecognized option `-pthread' on MacOS X
On Fri, Sep 22, 2006 at 09:53:06AM +0200, Christian Ebert wrote: Hello, I wanted to ask this for quite a long time (Vim 6.4 actually): When I compile with --enable-pythoninterp I get the following warnings: $ head -n5 vim-make.log Starting make in the src directory. If there are problems, cd to the src directory and run make there cd src gnumake first CC=gcc -Iproto -DHAVE_CONFIG_H -I/sw/include-I/sw/include -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -I/sw/include/python2.4 -pthreadsrcdir=. sh ./osdef.sh gcc: unrecognized option `-pthread' [...] etc. $ grep pthread vim-configure.log checking if -pthread should be used... yes checking for pthread_np.h... no $ ls -1 /usr/include/pthread* /usr/include/pthread.h /usr/include/pthread_impl.h $ vim --version VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 16 2006 00:05:46) Included patches: 1-109 Compiled by [EMAIL PROTECTED] Huge version without GUI. Features included (+) or not (-): [snip] +python +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent [snip] system vimrc file: $VIM/vimrc user vimrc file: $HOME/.vimrc user exrc file: $HOME/.exrc fall-back for $VIM: /usr/local/share/vim Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/sw/include -I/sw/include-I/sw/include -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -I/sw/include/python2.4 -pthread Linking: gcc -L/sw/lib -L/usr/local/lib -o vim -lncurses -liconv -L/sw/lib -L/usr/local/lib /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a -L/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -lperl -lm -lc -L/sw/lib/python2.4/config -lpython2.4 -u _PyMac_Error This is on MacOS 10.3.9: $ uname -a Darwin krille.blacktrash.org 7.9.0 Darwin Kernel Version 7.9.0: Wed Mar 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC Power Macintosh powerpc However it seems to work. But I can't be sure because I don't use 'pythoninterp' very often. Ideas anyone? I also have OS X 10.3.9, but I usually compile with the Carbon/Aqua GUI. I do not see pthread anywhere in the output of make. Where do your log files come from? Are you using a script to compile vim? If you tell me what you do to configure and build, I can try to reproduce the problem. HTH --Benji Fisher
Re: :helpgrep and 'ignorecase'
Yakov Lerner wrote: Looks like :helpgrep does not take 'ignorecase' setting into account. Is this by design ? :set ignorecase :helpgrep bufwrite E480: No match: bufwrite :helpgrep \cbufwrite ... now it finds matches ... 'ignorecase' is global, making it very unclear why someone sets it. In some commands I decided not to use 'ignorecase' and require using \c. For :helpgrep I thought it was better not to use 'ignorecase'. Searching for help is mostly not related to what you are editing. -- Close your shells, or I'll kill -9 you Tomorrow I'll quota you Remember the disks'll always be full And then while I'm away I'll write ~ everyday And I'll send-pr all my buggings to you. [ CVS log Beatles style for FreeBSD ports/INDEX, Satoshi Asami ] /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: Building Vim 7 with Python
Nick Deubert wrote: I am on a system where I don't want to affect the installed packages so first I successfully built and installed python 2.5 in a directory owned by me and kept the build directory around as well. Next I put the python bin install directory on my PATH so that it would find it use the one I just built instead of the old one on the system. Then I configured vim 7.0 with: --enable-python-interp --with-python-config-dir=python build directory and it configured fine: checking for python... /home/TOOLS/python-2.5/bin/python checking Python version... 2.5 checking Python is 1.4 or better... yep checking Python's install prefix... /home/TOOLS/python-2.5 checking Python's execution prefix... /home/TOOLS/python-2.5 checking Python's configuration directory... (cached) /home/TOOLS/vim_src/Python-2.5 checking if -pthread should be used... yes checking if compile and link flags for Python are sane... yes Then when I make vim it gets a good amount compiled before getting: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA -DFUNCPROTO=15 -DNARROWPROTO-g -O2 -I/usr/X11R6/include -I/home/TOOLS/python-2.5/include/python2.5 -pthread-o objects/if_python.o if_python.c make[1]: *** No rule to make target `/home/TOOLS/vim_src/Python-2.5/config.c', needed by `objects/py_config.o'. Stop. So I took at look at the Makefile in the Python build directory and sure enough there is no rule for config.c but there is: Makefile Modules/config.c: Makefile.pre \ ... so I tried adding a rule right above it like so: config.c: Makefile Modules/config.c You should not need to build config.c, it should be somewhere in the Python files. The Vim configure script tries to find it, but perhaps it was moved between Python 2.4 and 2.5? I haven't tried 2.5 yet. You can try running configure with the --python-config-dir argument. If you manage to make it work let us know where the config.c can be found, so that the configure script can be adjusted. -- So when I saw the post to comp.editors, I rushed over to the FTP site to grab it. So I yank apart the tarball, light x candles, where x= the vim version multiplied by the md5sum of the source divided by the MAC of my NIC (8A3FA78155A8A1D346C3C4A), put on black robes, dim the lights, wave a dead chicken over the hard drive, and summon the power of GNU GCC with the magic words make config ; make!. [Jason Spence, compiling Vim 5.0] /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: --enable-pythoninterp gives unrecognized option `-pthread' on MacOS X
Christian Ebert wrote: I wanted to ask this for quite a long time (Vim 6.4 actually): When I compile with --enable-pythoninterp I get the following warnings: $ head -n5 vim-make.log Starting make in the src directory. If there are problems, cd to the src directory and run make there cd src gnumake first CC=gcc -Iproto -DHAVE_CONFIG_H -I/sw/include-I/sw/include -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include -I/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -I/sw/include/python2.4 -pthreadsrcdir=. sh ./osdef.sh gcc: unrecognized option `-pthread' [...] The configure script has a specific check for not adding -pthread on Mac OS/X. It looks like you used the --disable-darwin argument or somehow disabled Darwin in another way. Please check src/auto/config.log. -- Yesterday, all my deadlines seemed so far away now it looks as though it's freeze in four days oh I believe in cvs.. [ CVS log Beatles style for FreeBSD ports/INDEX, Satoshi Asami ] /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: :s/pattern Undocumented feature?
Bill McCarthy wrote: On Wed 20-Sep-06 1:08pm -0600, Tim Chase wrote: I hadn't seen a reply to this fly by, so I thought I'd let you know it wasn't entirely ignored :) It appears that :s/pattern produces the same result as :s/pattern//. I couldn't find that behavior in the docs. A hidden feature? (Or was I just not creative enough using helpgrep?) I'm not sure I've seen it anywhere in the docs, but I've noticed the same behavior not only in ex/vi/vim, but also in ed. I was originally hesitant to use it, not sure whether it was unintended and if it would be there from version to version. However, after finding it consistent from version 5.x of vim forward, in classic vi, as well as ed, I presume it's an undocumented feature, and have begun using it when I have the need. I scoured through the help, looking in a multitude of places I deemed sensible, and couldn't find anything documented either. Thanks, Tim, for confirming this feature. Bram, could you please add a note to the help for ':s' that documents this feature? I thought this was explained somewhere, but I can't find it. I'll add a remark below the explanation of an empty pattern. -- Snoring is prohibited unless all bedroom windows are closed and securely locked. [real standing law in Massachusetts, United States of America] /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: :helpgrep and 'ignorecase'
On 9/22/06, Bram Moolenaar [EMAIL PROTECTED] wrote: Yakov Lerner wrote: Looks like :helpgrep does not take 'ignorecase' setting into account. Is this by design ? :set ignorecase :helpgrep bufwrite E480: No match: bufwrite :helpgrep \cbufwrite ... now it finds matches ... 'ignorecase' is global, making it very unclear why someone sets it. I always have 'ignorecase' on. Why ? Because 99.5% of my searches are ignorecase. I estimate that I need case-sensitive searches less than 0.5% of my searches. I do have one-key mapping that sets/toggles 'noic'; but I estimate that I use it less than once a week. Am I, like, alone in the Universe to use/have 'set ignorecase' by default ? Yakov
sorting lines on lenght of characters
Hi, Is it possible to sort lines on line length? Shortes firsts, longest last? If so how do you do this? Rgds, Eric _ Try the new Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-usFORM=WLMTAG
Re: S
On 9/22/06, Eric Leenman [EMAIL PROTECTED] wrote: Hi I have a file where I deleted all lines that don't contain a certain pattern For example I want to delete all lines that don't contain XXX and YYY. Before: [start of file] abcde XXX fghij YYY 12345 AAA 67890 BBB klmno XXX pqrst YYY 09876 XXX 54321 BBB *()- XXX ,./;' YYY [end of file] After: [start of file] abcde XXX fghij YYY *()- XXX ,./;' YYY [end of file] :v/XXX.*YYY/d or :g!/XXX.*YYY/d Yakov
Re: sorting lines on lenght of characters
On 9/22/06, Eric Leenman [EMAIL PROTECTED] wrote: Hi, Is it possible to sort lines on line length? Shortes firsts, longest last? If so how do you do this? Are you on Windows, or on LInux/unix/OXS ? Yakov
Re: sorting lines on lenght of characters
Is it possible to sort lines on line length? Shortes firsts, longest last? If so how do you do this? This is a common use of the decorate-sort-undecorate pattern. You can do something like: :%s/^/\=strlen(getline('.')).':' :%sort n :%s/^[^:]*: In non-vim7 on a *nix platform, that second sort command becomes :%!sort -n, as the internal sort command was added in Vim7, IIRC. If you're running non-vim7 on a win32 platform where the external sort is less flexible, one would have to left-pad those numbers with zeros...changing the first line to something ugly like :%s/^/\=matchstr('000'.strlen(getline('.')), '.\{8}$').':' and then make the 2nd line :%!sort If you prefer it in reverse order (longest to shortest), the sort command(s) would become [vim7] :%sort nr [*nix] :%!sort -nr [win32] :%!sort /r Just a few ideas. -tim
Re: sorting lines on lenght of characters
Hi, Eric Leenman wrote: Is it possible to sort lines on line length? Shortes firsts, longest last? If so how do you do this? I would put the line lengths at the front of each line with leading zeroes, sort the buffer, and remove the line lengths. With Vim 7.0 you can do this with the following commands :%s/^/\=repeat('0', 8 - strlen(strlen(getline('.' . strlen(getline('.'))/ :sort :%s/^\d\{8\}// Note the double use of strlen() which is needed to prepends the line length with the necessary number of zeroes to make it 8 digits wide. Regards, Jürgen -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin)
Re: :s/pattern Undocumented feature?
I scoured through the help, looking in a multitude of places I deemed sensible, and couldn't find anything documented either. Thanks, Tim, for confirming this feature. Bram, could you please add a note to the help for ':s' that documents this feature? I thought this was explained somewhere, but I can't find it. I'll add a remark below the explanation of an empty pattern. I'm sure I've seen it in the past as well, but couldn't find it either. Perhaps something directly in the help for :s :[range]s[ubstitute]/{pattern}/{string}/[flags] [count] For each line in [range] replace a match of {pattern} with {string}. For the {pattern} see |pattern|. {string} can be a literal string, or something special; see |sub-replace-special|. as the help already describes that {string} can be something special, it's not a far stretch to also note that 1) with no [flags], the trailing slash can be omitted 2) with no {pattern} and no [flags], both trailing slashes can be omitted. This might also be visually indicated in the definition line with something like :[range]s[ubstitute]/{pattern}[/{string}[/[flags] [count]]] to show that the /[flags] portion and the /{string}/[flags] portions are optional. Just a few ideas, -tim
Re: :helpgrep and 'ignorecase'
On 9/22/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 9/22/06, Bram Moolenaar [EMAIL PROTECTED] wrote: Yakov Lerner wrote: Looks like :helpgrep does not take 'ignorecase' setting into account. Is this by design ? :set ignorecase :helpgrep bufwrite E480: No match: bufwrite :helpgrep \cbufwrite ... now it finds matches ... 'ignorecase' is global, making it very unclear why someone sets it. I always have 'ignorecase' on. Why ? Because 99.5% of my searches are ignorecase. I estimate that I need case-sensitive searches less than 0.5% of my searches. I do have one-key mapping that sets/toggles 'noic'; but I estimate that I use it less than once a week. Am I, like, alone in the Universe to use/have 'set ignorecase' by default ? And if I am, then I really need to launch this [EMAIL PROTECTED] program (Search for IntraTerrestrial Ignorecase-by-default-users). You download it, it scans every reachable computer for .vimrc with 'set \(ic\|ignorecase\)' inside, reports results back to SITI headquarters.. Yakov set ignorecase Lerner
Re: SR
Eric Leenman wrote: I have a file where I deleted all lines that don't contain a certain pattern For example I want to delete all lines that don't contain XXX and YYY. :g/PATTERN/cmd executes the given command on all lines containing the PATTERN. :v/PATTERN/cmd executes the given command on all lines _not_ containing the PATTERN. You can use LogiPat to set up patterns with boolean logic involved: :echo LogiPat('XXXYYY') which yields: \%(.*XXX.*\.*YYY.*\) The \%( and trailing ) are not needed in this case, but the pattern will, nonetheless, work. You can get LogiPat from either http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs -- LogiPat http:vim.sourceforge.net/scripts/script.php?script_id=1290 So if you want to delete all patterns not having XXX and YYY, then :v/\%(.*XXX.*\.*YYY.*\)/d would do the trick. Regards, Chip Campbell
Re: --enable-pythoninterp gives unrecognized option `-pthread' on MacOS X
* Benji Fisher on Friday, September 22, 2006 at 08:19:12 -0400: On Fri, Sep 22, 2006 at 09:53:06AM +0200, Christian Ebert wrote: Linking: gcc -L/sw/lib -L/usr/local/lib -o vim -lncurses -liconv -L/sw/lib -L/usr/local/lib /sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/auto/DynaLoader/DynaLoader.a -L/sw/lib/perl5-core/5.8.6/darwin-thread-multi-2level/CORE -lperl -lm -lc -L/sw/lib/python2.4/config -lpython2.4 -u _PyMac_Error As I mentioned in my reply to Bram I compile with --disable-darwin, otherwise the respective perl and python libs in /sw are not linked. Plus I like that Vim stays case sensitive regarding paths. I also have OS X 10.3.9, but I usually compile with the Carbon/Aqua GUI. I do not see pthread anywhere in the output of make. My bad. I don't want the GUI, and disabled Darwin. Where do your log files come from? ./configure 21 | tee vim-config.log Oops, just detected the nice log in src/auto; sorry. Are you using a script to compile vim? No. If you tell me what you do to configure and build, I can try to reproduce the problem. CFLAGS=-I/sw/include LDFLAGS=-L/sw/lib \ ./configure --prefix=/usr/local --with-features=huge \ --enable-multibyte --enable-pythoninterp --enable-perlinterp \ --without-x --disable-gui \ --disable-gtk-check --disable-gtk2-check \ --disable-motif-check --disable-athena-check \ --disable-nextaw-check --disable-carbon-check \ --disable-darwin --disable-nls \ --with-compiledby=[EMAIL PROTECTED] As in my other mail: If the warning is just a warning and nothing else, I can live with it. Thank you. c -- _B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html
Re: --enable-pythoninterp gives unrecognized option `-pthread' on MacOS X
* Bram Moolenaar on Friday, September 22, 2006 at 14:24:09 +0200: The configure script has a specific check for not adding -pthread on Mac OS/X. It looks like you used the --disable-darwin argument Yes: ./configure --prefix=/usr/local --with-features=huge \ --enable-multibyte --enable-pythoninterp --enable-perlinterp \ --without-x --disable-gui \ --disable-gtk-check --disable-gtk2-check \ --disable-motif-check --disable-athena-check \ --disable-nextaw-check --disable-carbon-check \ --disable-darwin --disable-nls \ --with-compiledby=[EMAIL PROTECTED] This is a) because I like eg. tab path-completion stay case-sensitive even with the HFS+. b) I want Vim to use python 2.4 which is installed under /sw -- this works when I pass LDFLAGS=-L/sw/lib and CFLAGS=-I/sw/include to configure /only/ when I --disable-darwin; otherwise configure insists on eg. /Library/Python/2.3 If the warning is only a warning w/o further consequences I can live with it. But I wanted to ask to make sure. c -- _B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html
Counting when modifiable is off?
In Vim7, the :s command added a n flag to not actually perform the substitute, but just report the number of changes made. However, it seems that if 'modifiable' is off, one can't do something like :%s/foo/bar/gn to count items in the non-modifiable file, as it gives E21: Cannot make changes, 'modifiable' is off which seems a bit counter-intuitive, as one's not actually making changes. [n] Report the number of matches, do not actually substitute. I don't know if this qualifies as a bug (if nomodifiable is set, a :s/foo/bar/n[g] command should be allowed), a pecularity, or desired behavior, but I didn't see anything in the docs for s_flags about the matter one way or the other. -tim
Block indent
Hi folks, I'm a new member and I have a bit question: How can I indent a code block? How can I configure the .vimrc for this? Thanks in advance. Regards. -- Thiago Nascimento #!/usr/bin/perl $_=tMM naaCt Feocmama_itpUilucoGa;$_.=$1,print $2 while s/(..)(.)//;print substr$_,1,1;
Re: :helpgrep and 'ignorecase'
On 9/22/06, Yakov Lerner [EMAIL PROTECTED] wrote: Am I, like, alone in the Universe to use/have 'set ignorecase' by default ? Yakov I'm an ignorecaser too. It gets in the way a bit with C omni-completion, though. Is there an easy way (i.e. an option... I don't want to muck with the completion scripts or hackish maps) to set noic for omni searches? -- Greg
Re: :helpgrep and 'ignorecase'
I've been an ignorecaser too (for 20 years) and share the same concerns. Greg Dunn wrote: On 9/22/06, Yakov Lerner [EMAIL PROTECTED] wrote: Am I, like, alone in the Universe to use/have 'set ignorecase' by default ? Yakov I'm an ignorecaser too. It gets in the way a bit with C omni-completion, though. Is there an easy way (i.e. an option... I don't want to muck with the completion scripts or hackish maps) to set noic for omni searches? -- Greg
Re: Block indent
I'm a new member and I have a bit question: How can I indent a code block? Well, you omit detailing what language you're using, or what a code block looks like. Given the near universality of C-like languages, I'll make the assumption that these are blocks delimited by {...} The indent/exdent commands in vim are and respectively. Thus, you can do things like ip to indent the current paragraph one 'shiftwidth' or a} to exdent the innermost {...} block surrounding the cursor. Since it's just another vim operator, you can use any motion or text-object with the / commands, so things like G (exndent to EOF) 2j (indent this line and the 2 below) The associated Ex command is the same, and thus you can do things like :g/foo/ to exdent every line containing foo, or :g/bar/ to indent 2*'shiftwidth' every line containing bar How can I configure the .vimrc for this? The only things one would put in a vimrc (or in a modeline) would be the settings for sw/ts/et to control indentation behaviors. You can read more at :help :help : :help motion :help text-objects :help a{ :help 'sw' :help 'ts' :help 'et' (the last two are helpful...usually one wants 'tabstop' to be equal to 'shiftwidth', and the 'expandtab' behavior to control whether these are indented/exdented with tabs or spaces) Just a few places to start, -tim
Re: Counting when modifiable is off?
Tim Chase wrote: In Vim7, the :s command added a n flag to not actually perform the substitute, but just report the number of changes made. However, it seems that if 'modifiable' is off, one can't do something like :%s/foo/bar/gn to count items in the non-modifiable file, as it gives E21: Cannot make changes, 'modifiable' is off which seems a bit counter-intuitive, as one's not actually making changes. [n]Report the number of matches, do not actually substitute. I don't know if this qualifies as a bug (if nomodifiable is set, a :s/foo/bar/n[g] command should be allowed), a pecularity, or desired behavior, but I didn't see anything in the docs for s_flags about the matter one way or the other. I don't get this, it works as expected for me. I have no idea how you can get this error message with the 'n' flag. -- Lawmakers made it obligatory for everybody to take at least one bath each week -- on Saturday night. [real standing law in Vermont, United States of America] /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\download, build and distribute -- http://www.A-A-P.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org///
Re: :helpgrep and 'ignorecase'
On Fri 22-Sep-06 8:44am -0600, Yakov Lerner wrote: On 9/22/06, Yakov Lerner [EMAIL PROTECTED] wrote: On 9/22/06, Bram Moolenaar [EMAIL PROTECTED] wrote: Yakov Lerner wrote: Looks like :helpgrep does not take 'ignorecase' setting into account. Is this by design ? :set ignorecase :helpgrep bufwrite E480: No match: bufwrite :helpgrep \cbufwrite ... now it finds matches ... 'ignorecase' is global, making it very unclear why someone sets it. I always have 'ignorecase' on. Why ? Because 99.5% of my searches are ignorecase. I estimate that I need case-sensitive searches less than 0.5% of my searches. I do have one-key mapping that sets/toggles 'noic'; but I estimate that I use it less than once a week. Am I, like, alone in the Universe to use/have 'set ignorecase' by default ? And if I am, then I really need to launch this [EMAIL PROTECTED] program (Search for IntraTerrestrial Ignorecase-by-default-users). You download it, it scans every reachable computer for .vimrc with 'set \(ic\|ignorecase\)' inside, reports results back to SITI headquarters.. Yakov set ignorecase Lerner You're certainly not alone. I set both ignorecase and smartcase in my _vimrc and always have. And I'll support adding [EMAIL PROTECTED] to BOINC :-) -- Best regards, Bill
Single-File Vim?
Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. Thanks, -Dmitriy
Re: Single-File Vim?
On 9/22/06, Dmitriy Yamkovoy [EMAIL PROTECTED] wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. I assume that if the whole $VIMRUNTIME tree is on your USB, and you setenv VIMRUNTIME to that location, vim.exe will happily access whole $VIMRUNTIME tree from there, no ? Is this good enough ? Yakov
Re: Single-File Vim?
On 2006-09-22, Yakov Lerner [EMAIL PROTECTED] wrote: On 9/22/06, Dmitriy Yamkovoy [EMAIL PROTECTED] wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. I assume that if the whole $VIMRUNTIME tree is on your USB, and you setenv VIMRUNTIME to that location, vim.exe will happily access whole $VIMRUNTIME tree from there, no ? Is this good enough ? According to :help VIMRUNTIME :help VIM setting $VIM would be a better choice than setting $VIMRUNTIME. Further, :help VIM says that on Windows, Vim tries to use the directory name of the executable to find VIM. So depending on how Dmitriy intends to invoke the vim on his USB key, it may not be necessary to set $VIM or $VIMRUNTIME at all. Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: show matching bracket - the emacs way
On 9/22/06, Kim Schulz [EMAIL PROTECTED] wrote: Hi Is there any way to get vim to show the line where the matching start bracket is placed (or the line above if line only contains bracket) whenever a closing bracket is pressed. e.g., if( foo == bar ) { bla bla } should show if( foo == bar ) { when the } is inserted. Emacs has this feature and I think that it is quite useful when programming, and would love to have it in Vim. I am not looking for showmatch, and dont want to jump to the line - i simply want a preview at the bottom of the script. If this is not possible directly in Vim, I an planning to write a script for this - any ideas are welcome. The patch to $VIMRUNTIME/plugin/matchparen.vim, attached, shows the line number of the matching paren on the bottom line. It's basically a demonstration of how easy it's doable with matchparen.vim. If you want to show it differently, this gives you a starting place. Look into matchparen.vim, just search two places with 3match, that's the place. Yakov --- matchparen.vim.000 2006-09-22 23:35:11.0 +0300 +++ matchparen.vim 2006-09-22 23:57:18.0 +0300 @@ -30,6 +30,7 @@ Remove any previous match. if exists('w:paren_hl_on') w:paren_hl_on 3match none +echo '' let w:paren_hl_on = 0 endif @@ -109,6 +110,9 @@ if m_lnum 0 m_lnum = line('w0') m_lnum = line('w$') exe '3match MatchParen /\(\%' . c_lnum . 'l\%' . (c_col - before) . \ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/' +let show=strpart(substitute(getline(m_lnum),'\t',' ',''),0,columns-30) +let show=substitute(show,'^ *','','') +echo substitute(c,'\\','','').substitute(c2,'\\','','').' '.m_lnum.' '.show let w:paren_hl_on = 1 endif endfunction
Re: Single-File Vim?
Thanks, guys, that helps. I guess if I really want it to be a single file, I could try a self-extracting zip file. I'll tell you how that goes. -Dmitriy On 9/22/06, Gary Johnson [EMAIL PROTECTED] wrote: On 2006-09-22, Yakov Lerner [EMAIL PROTECTED] wrote: On 9/22/06, Dmitriy Yamkovoy [EMAIL PROTECTED] wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. I assume that if the whole $VIMRUNTIME tree is on your USB, and you setenv VIMRUNTIME to that location, vim.exe will happily access whole $VIMRUNTIME tree from there, no ? Is this good enough ? According to :help VIMRUNTIME :help VIM setting $VIM would be a better choice than setting $VIMRUNTIME. Further, :help VIM says that on Windows, Vim tries to use the directory name of the executable to find VIM. So depending on how Dmitriy intends to invoke the vim on his USB key, it may not be necessary to set $VIM or $VIMRUNTIME at all. Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: show matching bracket - the emacs way
On 9/23/06, Kim Schulz [EMAIL PROTECTED] wrote: On Fri, 22 Sep 2006 23:50:43 +0300 Yakov Lerner [EMAIL PROTECTED] wrote: On 9/22/06, Kim Schulz [EMAIL PROTECTED] wrote: Hi Is there any way to get vim to show the line where the matching start bracket is placed (or the line above if line only contains bracket) whenever a closing bracket is pressed. e.g., if( foo == bar ) { bla bla } should show if( foo == bar ) { when the } is inserted. Emacs has this feature and I think that it is quite useful when programming, and would love to have it in Vim. I am not looking for showmatch, and dont want to jump to the line - i simply want a preview at the bottom of the script. If this is not possible directly in Vim, I an planning to write a script for this - any ideas are welcome. The patch to $VIMRUNTIME/plugin/matchparen.vim, attached, shows the line number of the matching paren on the bottom line. It's basically a demonstration of how easy it's doable with matchparen.vim. If you want to show it differently, this gives you a starting place. Look into matchparen.vim, just search two places with 3match, that's the place. looks nice, except that I cant see the output anywhere. I have matchparen enabled and the file is patched. can it be because I have modified my statusline ? It's most probably because some other plugin's echos overwrites messages from patched matchparen. To see how the output looks, try this: vim -u NONE -c 'set nocp|so matchparen.vim' yourfile To track down which plugin overwrites these echos, try to disable your personal plugins in your ~/.vim/plugin one-by-one (by renaming them to extension other than .vim) Yakov
copy paste file names from windows explorer
I am wondering if it is possible to copy a file in the windows explorer (MS windows) and then access the filename(s) from vim/gvim. I know there are workarounds like dnd and sendto powertoy to send the filename to clipboard, but they are not that convenience, as they either require using the mouse or you need to use several key strokes. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Single-File Vim?
On Fri, 22 Sep 2006 at 4:05pm, Dmitriy Yamkovoy wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. Thanks, -Dmitriy I think Vim, when behaving as plain Vi, doesn't require any of the runtime files. E.g., try starting vim with -u NONE option, and run :scripts command, you will see that nothing is loaded. The runtime directory is not essential for using Vim. -- HTH, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: ctrl-v after a o command
Thanks Benji. This is the problem I'm having. Adding xBS solves the problem. Benji Fisher wrote: On Thu, Sep 21, 2006 at 07:37:47PM -0700, lll wrote: Hello: I'm using VIM 7.0 in windows OS. Whenever I paste something using ctrl-v after typing o to insert on next line, the pasted string would not follow the indentation of the curser. It would paste the string from the beginning of the line. This is a new behavior compare to version 6.2. Does anybody know how to set the behavior back so ctrl-v will paste the string right where the curser is? I think this is a problem that has already been fixed. I assume you are using mswin.vim, which maps C-v in Insert mode to do a paste. Try :imap C-v When I do this, I get i C-VxBSEsc:call paste#Paste()CRgi If you are missing the xBS at the beginning of the mapping, that would explain the problem. You can fix it by getting the updated files $VIMRUNTIME/mswin.vim $VIMRUNTIME/autoload/paste.vim HTH --Benji Fisher -- View this message in context: http://www.nabble.com/ctrl-v-after-a-%22o%22-command-tf2315601.html#a6456099 Sent from the Vim - General mailing list archive at Nabble.com.
Re: Single-File Vim?
Dmitriy Yamkovoy wrote: Thanks, guys, that helps. I guess if I really want it to be a single file, I could try a self-extracting zip file. I'll tell you how that goes. -Dmitriy Don't reinvent the wheel: Steve Hall compiles, and distributes on SourceForge, self-extracting installers containing the latest (or some very recent) patchlevel of vim.exe and gvim.exe for Windows, with all runtime files: see https://sourceforge.net/project/showfiles.php?group_id=43866package_id=39721 As I'm writing this, the latest available version is 7.0.106, dated 14 September. Sooner or later, I suppose, a new version (7.0.109 or higher) will be published. Best regards, Tony.
Re: Single-File Vim?
Hari Krishna Dara wrote: On Fri, 22 Sep 2006 at 4:05pm, Dmitriy Yamkovoy wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. Thanks, -Dmitriy I think Vim, when behaving as plain Vi, doesn't require any of the runtime files. E.g., try starting vim with -u NONE option, and run :scripts command, you will see that nothing is loaded. The runtime directory is not essential for using Vim. indeed, but then you will get - no help (doc/) - no Vim tutor (tutor/) - no syntax highlighting and no colorschemes (syntax/, colors/) - no filetype detection, no filetype plugins and no filetype indenting (filetype.vim, ftplugin/, indent/) - no keymaps (keymap/) - no non-English messages (lang/) - no menus (not even English menus) (menu.vim) - no spell checking (spell/) - no matchit matching (macros/matchit.vim) - no directory browsing (plugin/netrwPlugin.vim etc.) - no editing of remote files (plugin/netrwPlugin.vim etc.) - no editing of zipfiles, tarballs, etc. (plugin/gzip.vim, plugin/tarPlugin.vim, plugin/zipPlugin.vim) - no conversion to HTML (syntax/2html.vim) - no :options command (optwin.vim) - no vimrc_example.vim (vimrc_example.vim) etc., in other words, you would lose most of the things which, IMHO, make Vim great. Best regards, Tony.
sp *.c
:sp *.c gives me too many files (same with :e *.c) why not do a split for every file? (if there's no room, maybe then give the too many files error.) just .2 c$ -- Rodolfo Borges
Re: Single-File Vim?
On 9/23/06, Mark Woodward [EMAIL PROTECTED] wrote: Hi all, On Fri, 22 Sep 2006 23:21:13 +0300 Yakov Lerner [EMAIL PROTECTED] wrote: On 9/22/06, Dmitriy Yamkovoy [EMAIL PROTECTED] wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. I assume that if the whole $VIMRUNTIME tree is on your USB, and you setenv VIMRUNTIME to that location, vim.exe will happily access whole $VIMRUNTIME tree from there, no ? Is this good enough ? Yakov so would it be possible to have vim on a usb key without modifying environment variables? What I wouldn't give to be able to use vim at work! I've asked and they've told me to use notepad They've got no idea! or assume I don't. They may not be too far from the mark but I do know which is the more powerful by a country mile!! Any windows app that does not rely on registry is reloctable (that is, you can move the app tree to another disk and run it from there). I think vim uses registry for just one thing, which is registration of Edit with vim with explorer. (I might be wrong). So if you relocate vim to another disk and/or another windows, it will be functional and runnable except for one thing: exlporer integration. Even this is easily fixable: There is some .bat script in vimruntime, which, if you run it, will register the explorer integration in the new place. I forgot the name of the script, but just several weeks ago on this list there was a thread about it. Yakov
Re: copy paste file names from windows explorer
On Sat, 23 Sep 2006 at 12:49am, Yakov Lerner wrote: On 9/23/06, Hari Krishna Dara [EMAIL PROTECTED] wrote: I am wondering if it is possible to copy a file in the windows explorer (MS windows) and then access the filename(s) from vim/gvim. I know there are workarounds like dnd and sendto powertoy to send the filename to clipboard, but they are not that convenience, as they either require using the mouse or you need to use several key strokes. It is easy to add SendTo items to file explorer. I think I had a trick that added a SendTo item and when you selected it, it puts filename to the clipboard. But I forgot how exactly I did it, and (2) it does require mouse, although yuo can do it with keyborad shortcuts like Shift-F10 ... I'm not using windows anymore, forgot it. I was also using the Rename trick: choose rename file in explorer, press Ctrl-C, and you have filename in the clipboard. Yakov The SendTo works, I currently have it, but it will just open a new instance. If you use the Vim installer, it creates Open With context menu entries which are better, as you can open with existing windows. However, this is not what I want, and I realize I am not clear about one thing here. I don't want to open the file, I just want to get the filename at the command-line (or insert the filename into the current buffer, say as a string constant). The reason I mentioned dnd is if you start the command mode, and then dnd a file, Vim nicely inserts its filename instead of actually loading the file. I want the same functionality without having to do dnd or open the file first. The best I can think of is if Vim can understand this format, and extract filename(s) it will be very useful (at least for me). I use the rename trick often, but this will not get the entire path into the clipboard, just the name. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Single-File Vim?
On Sat, 23 Sep 2006 at 1:46am, A.J.Mechelynck wrote: Hari Krishna Dara wrote: On Fri, 22 Sep 2006 at 4:05pm, Dmitriy Yamkovoy wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. Thanks, -Dmitriy I think Vim, when behaving as plain Vi, doesn't require any of the runtime files. E.g., try starting vim with -u NONE option, and run :scripts command, you will see that nothing is loaded. The runtime directory is not essential for using Vim. indeed, but then you will get - no help (doc/) - no Vim tutor (tutor/) - no syntax highlighting and no colorschemes (syntax/, colors/) - no filetype detection, no filetype plugins and no filetype indenting (filetype.vim, ftplugin/, indent/) - no keymaps (keymap/) - no non-English messages (lang/) - no menus (not even English menus) (menu.vim) - no spell checking (spell/) - no matchit matching (macros/matchit.vim) - no directory browsing (plugin/netrwPlugin.vim etc.) - no editing of remote files (plugin/netrwPlugin.vim etc.) - no editing of zipfiles, tarballs, etc. (plugin/gzip.vim, plugin/tarPlugin.vim, plugin/zipPlugin.vim) - no conversion to HTML (syntax/2html.vim) - no :options command (optwin.vim) - no vimrc_example.vim (vimrc_example.vim) etc., in other words, you would lose most of the things which, IMHO, make Vim great. First of all, I presumed that that is what OP wanted. Secondly, it is still several magnitudes better than plain Vi :) For the sake of argument, glancing through your list again I find none of them to be essential. The only feature out of the list that I use most is the matchit, the rest, I don't either (regularly) use or need. In fact most of these features didn't even exist in older Vim versions (which was still a lot better than Vi). PS: I don't need lang, but I would imagine it to be essential for someone needing a non-English language. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Single-File Vim?
Mark Woodward wrote: [...] so would it be possible to have vim on a usb key without modifying environment variables? What I wouldn't give to be able to use vim at work! I've asked and they've told me to use notepad They've got no idea! or assume I don't. They may not be too far from the mark but I do know which is the more powerful by a country mile!! [...] Yes, I think so. Just copy the directory which Vim sees as $VIMRUNTIME (usually C:\Program Files\vim\vim70 or something like that) and everything in it or in its subdirectories, including of course your gvim executable. Or if you want to carry also additions to vim which weren't in the distribution, you might want to copy the parent of that $VIMRUNTIME, i.e. $VIM with its vimfiles/ and vim70/ subdirectories, and optionally your _vimrc and/or _gvimrc scripts (which are then placed in $VIM rather than $HOME). You may leave $VIMRUNTIME and $VIM unset, and then when you start (let's say) Z:\vim\vim70\gvim.exe it will see that they are unset, and set $VIM to Z:\vim and $VIMRUNTIME to Z:\vim\vim70 Best regards, Tony.
Re: Single-File Vim?
Yakov Lerner wrote: [...] Even this is easily fixable: There is some .bat script in vimruntime, which, if you run it, will register the explorer integration in the new place. I forgot the name of the script, but just several weeks ago on this list there was a thread about it. Yakov it's not a script, it's a program: install.exe Best regards, Tony.
Re: Single-File Vim?
Hari Krishna Dara wrote: On Sat, 23 Sep 2006 at 1:46am, A.J.Mechelynck wrote: Hari Krishna Dara wrote: On Fri, 22 Sep 2006 at 4:05pm, Dmitriy Yamkovoy wrote: Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. Thanks, -Dmitriy I think Vim, when behaving as plain Vi, doesn't require any of the runtime files. E.g., try starting vim with -u NONE option, and run :scripts command, you will see that nothing is loaded. The runtime directory is not essential for using Vim. indeed, but then you will get - no help (doc/) - no Vim tutor (tutor/) - no syntax highlighting and no colorschemes (syntax/, colors/) - no filetype detection, no filetype plugins and no filetype indenting (filetype.vim, ftplugin/, indent/) - no keymaps (keymap/) - no non-English messages (lang/) - no menus (not even English menus) (menu.vim) - no spell checking (spell/) - no matchit matching (macros/matchit.vim) - no directory browsing (plugin/netrwPlugin.vim etc.) - no editing of remote files (plugin/netrwPlugin.vim etc.) - no editing of zipfiles, tarballs, etc. (plugin/gzip.vim, plugin/tarPlugin.vim, plugin/zipPlugin.vim) - no conversion to HTML (syntax/2html.vim) - no :options command (optwin.vim) - no vimrc_example.vim (vimrc_example.vim) etc., in other words, you would lose most of the things which, IMHO, make Vim great. First of all, I presumed that that is what OP wanted. Secondly, it is still several magnitudes better than plain Vi :) For the sake of argument, glancing through your list again I find none of them to be essential. The only feature out of the list that I use most is the matchit, the rest, I don't either (regularly) use or need. Not even the help? Then you've got a better (and more encyclopaedic) memory than mine. In fact most of these features didn't even exist in older Vim versions (which was still a lot better than Vi). I don't remember Vim versions older than 6.1 but I would expect them to have had a help system. PS: I don't need lang, but I would imagine it to be essential for someone needing a non-English language. When typing Russian or Arabic I would also need keymaps, except that I'm using my own keymaps, in $VIM/vimfiles/keymap or ~/vimfiles/keymap. I also use syntax colouring whenever available. Best regards, Tony.
Re: copy paste file names from windows explorer
Hari Krishna Dara wrote: On Sat, 23 Sep 2006 at 12:49am, Yakov Lerner wrote: On 9/23/06, Hari Krishna Dara [EMAIL PROTECTED] wrote: I am wondering if it is possible to copy a file in the windows explorer (MS windows) and then access the filename(s) from vim/gvim. I know there are workarounds like dnd and sendto powertoy to send the filename to clipboard, but they are not that convenience, as they either require using the mouse or you need to use several key strokes. It is easy to add SendTo items to file explorer. I think I had a trick that added a SendTo item and when you selected it, it puts filename to the clipboard. But I forgot how exactly I did it, and (2) it does require mouse, although yuo can do it with keyborad shortcuts like Shift-F10 ... I'm not using windows anymore, forgot it. I was also using the Rename trick: choose rename file in explorer, press Ctrl-C, and you have filename in the clipboard. Yakov The SendTo works, I currently have it, but it will just open a new instance. If you use the Vim installer, it creates Open With context menu entries which are better, as you can open with existing windows. However, this is not what I want, and I realize I am not clear about one thing here. I don't want to open the file, I just want to get the filename at the command-line (or insert the filename into the current buffer, say as a string constant). The reason I mentioned dnd is if you start the command mode, and then dnd a file, Vim nicely inserts its filename instead of actually loading the file. I want the same functionality without having to do dnd or open the file first. The best I can think of is if Vim can understand this format, and extract filename(s) it will be very useful (at least for me). I use the rename trick often, but this will not get the entire path into the clipboard, just the name. You can get the full path-and-filename (at least in XP) from RightClick - Properties - General - Location. Select that path by dragging the mouse pointer over it, then Ctrl-C copies it to the clipboard. Then paste it into Vim with +p or similar. Best regards, Tony.
RE: Single-File Vim?
-Original Message- From: Dmitriy Yamkovoy [mailto:[EMAIL PROTECTED] Sent: Friday, September 22, 2006 4:06 PM To: Vim List Subject: Single-File Vim? Hi all, Is there a binary compiled for Windows which allows me to run Vim without any of the runtime files? Long story short, I want something I can keep online or on a USB key and just copy to the desktop of any computer I sit at. We had a large discussion on this topic probably six months back. A number of us do this (on the Windows platforms). We each had various options on how we do it. I personally: 1. Copied my Vim directory to my USB key. 2. Run a batch file whenever I want to use Vim directly from the USB key. The batch file is simple. It puts the k:\Vim\vim70 in the $PATH (assuming k: is the USB key). No setting of $VIM or $VIMRUNTIME is required. Here is my batch file if anyone is interested. @echo off @rem You can have Windows automatically run a batch file when you open @rem a new command prompt by: @rem HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun @rem and set it to run a BAT script of your choice when it @rem starts up. @rem @rem I don't like this option and prefer to setup a shortcut to run: @rem %SYSTEMROOT%\system32\cmd.exe /F:ON /K c:\vim\tools\setupVim.bat @rem The /F:ON enables file/directory completion using CTRL-F. This @rem is useful if you do not have any rights on the machine to modify: @rem HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar @rem and set it to hex 9 (TAB) @rem Determine which drive letter we are executing this from: @rem % 0 = the cmdline used to launch the cmd file. @rem for /f %%i in ('echo %0') do @echo curr_dir=%%~di @rem From HELP FOR (when typed from a cmd.exe prompt) @rem You can now use the following optional syntax: @rem % ~I - expands %I removing any surrounding quotes () @rem % ~fI- expands %I to a fully qualified path name @rem % ~dI- expands %I to a drive letter only @rem @rem This will set BLAH = the current directory of the batch file @remset BLAH=%~dp0 @for /f %%i in (%0) do @SET cmd_driveletter=%%~di @SET driveletter=%cmd_driveletter @echo. @echo Executing %0 from this drive: %cmd_driveletter% @echo. @IF %1. NEQ . SET driveletter=%1: @IF NOT EXIST %driveletter%\ SET driveletter=%cmd_driveletter% :SETPATH @echo. @echo. Check if Vim is already in the PATH @echo. @echo on @for %%P in (%PATH%) do @IF EXIST %%P\gvim.exe GOTO ALLREADYINPATH @echo off @echo. @echo.Not already in PATH, adding it @echo. @goto ADDTOPATH @echo. @echo. Check if Vim is already in the PATH @echo. @echo on %driveletter%\Vim\Tools\which.exe gvim.exe @echo off @IF %errorlevel% EQU 0 GOTO ALLREADYINPATH :ADDTOPATH @echo. @echo. Setup path to include $VIM and other standard utilities @echo. @echo on SET PATH=%driveletter%\vim\tools;%driveletter%\Vim\Vim70;%driveletter%\util;%dri veletter%\util\unix_tools;%PATH% @echo off @goto END :ALLREADYINPATH @echo. @echo. Vim is already in the PATH @echo. @goto END :END
Why not use binary search for wildmode tag completion in case of fixed-start, non-regex pattern?
Recently, I've begun building tags for a very large development project. The time required by Vim to build the list prior to displaying the first match after I hit wildchar for a :tag command has become noticeably long. I researched it a bit in both the help and the source code, and I'm wondering why Vim always does a linear search for tag completions that could return more than one match. I mean, I understand why in a case like this :ta /[a-z]_funwildchar linear search would be necessary. But what about in the much more common case :ta ProcessAwildchar For such fixed start patterns, all possible matches will be clustered together (and usually will span no more than a handful of lines) in a sorted tags file. Thus, the beginning of the range of possibilities could be found via binary search, then the remaining matches could be found by traversing the tags file linearly until the last match is found. For tags files containing tens of thousands of tags, as mine does, this would result in a dramatic improvement in responsiveness when wildchar is hit. Thanks, Brett Stahlman
Re: Single-File Vim?
On 9/22/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: trim For the sake of argument, glancing through your list again I find none of them to be essential. The only feature out of the list that I use most is the matchit, the rest, I don't either (regularly) use or need. Not even the help? Then you've got a better (and more encyclopaedic) memory than mine. In fact most of these features didn't even exist in older Vim versions (which was still a lot better than Vi). I don't remember Vim versions older than 6.1 but I would expect them to have had a help system. When I started using Vim 11 years ago, the help was four to five pages long and the help was not displayed in a separate window. Even in those versions, Vim had more functionality than the stock Vi. - Yegappan