Re: A small VIM patch
Martti Kuparinen wrote: Please apply the attached patch to remove an invalid usage of the test command. I have tested this against VIM 7.0.121 in NetBSD pkgsrc. Thanks for the fix! -- hundred-and-one symptoms of being an internet addict: 49. You never have to deal with busy signals when calling your ISP...because you never log off. /// 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///
Patch 7.0.138 (extra)
Patch 7.0.138 (extra) Problem:Mac: modifiers don't work with function keys. Solution: Use GetEventParameter() to obtain modifiers. (Nicolas Weber) Files: src/gui_mac.c *** ../vim-7.0.137/src/gui_mac.cTue Aug 22 21:39:18 2006 --- src/gui_mac.c Sun Oct 15 14:53:38 2006 *** *** 2014,2020 void *data) { /* Multibyte-friendly key event handler */ ! OSStatus e = -1; UInt32actualSize; UniChar *text; char_uresult[INLINE_KEY_BUFFER_SIZE]; --- 2014,2020 void *data) { /* Multibyte-friendly key event handler */ ! OSStatus err = -1; UInt32actualSize; UniChar *text; char_uresult[INLINE_KEY_BUFFER_SIZE]; *** *** 2022,2195 UInt32key_sym; char charcode; int key_char; ! UInt32modifiers; size_tencLen; char_u*to = NULL; Boolean isSpecial = FALSE; int i; /* Mask the mouse (as per user setting) */ if (p_mh) ObscureCursor(); ! do ! { ! /* Don't use the keys when the dialog wants them. */ ! if (dialog_busy) ! break; ! if (noErr != GetEventParameter(theEvent, kEventParamTextInputSendText, ! typeUnicodeText, NULL, 0, actualSize, NULL)) ! break; ! text = (UniChar *)alloc(actualSize); ! if (text) ! { ! do ! { ! if (noErr != GetEventParameter(theEvent, ! kEventParamTextInputSendText, ! typeUnicodeText, NULL, actualSize, NULL, text)) ! break; ! EventRef keyEvent; ! if (noErr != GetEventParameter(theEvent, ! kEventParamTextInputSendKeyboardEvent, ! typeEventRef, NULL, sizeof(EventRef), NULL, keyEvent)) ! break; ! if (noErr != GetEventParameter(keyEvent, ! kEventParamKeyModifiers, ! typeUInt32, NULL, sizeof(UInt32), NULL, modifiers)) ! break; ! if (noErr != GetEventParameter(keyEvent, ! kEventParamKeyCode, ! typeUInt32, NULL, sizeof(UInt32), NULL, key_sym)) ! break; ! if (noErr != GetEventParameter(keyEvent, ! kEventParamKeyMacCharCodes, ! typeChar, NULL, sizeof(char), NULL, charcode)) ! break; ! key_char = charcode; ! if (modifiers controlKey) ! { ! if ((modifiers ~(controlKey|shiftKey)) == 0 !(key_char == '2' || key_char == '6')) ! { ! /* CTRL-^ and CTRL-@ don't work in the normal way. */ ! if (key_char == '2') ! key_char = Ctrl_AT; ! else ! key_char = Ctrl_HAT; ! text[0] = (UniChar)key_char; ! modifiers = 0; ! } ! } ! if (modifiers cmdKey) ! #ifndef USE_CMD_KEY ! break; /* Let system handle Cmd+... */ ! #else ! { ! /* Intercept CMD-. */ ! if (key_char == '.') ! got_int = TRUE; ! ! /* Convert the modifiers */ ! modifiers = EventModifiers2VimModifiers(modifiers); ! ! /* Following code to simplify and consolidate modifiers !* taken liberally from gui_w48.c */ ! ! key_char = simplify_key(key_char, (int *)modifiers); ! ! /* remove SHIFT for keys that are already shifted, e.g., !* '(' and '*' */ ! if (key_char 0x100 ! !isalpha(key_char) isprint(key_char)) ! modifiers = ~MOD_MASK_SHIFT; ! ! /* Interpret META, include SHIFT, etc. */ ! key_char = extract_modifiers(key_char, (int *)modifiers); ! if (key_char == CSI) ! key_char = K_CSI; ! if (modifiers) ! { ! result[len++] = CSI; ! result[len++] = KS_MODIFIER; ! result[len++] = modifiers; ! } ! isSpecial = TRUE; ! } ! #endif ! else ! { ! /* Find the special key (eg., for cursor keys) */ ! if (!(actualSize sizeof(UniChar)) ! ((text[0] 0x20) || (text[0] == 0x7f))) ! { ! for (i = 0; special_keys[i].key_sym !=
Patch 7.0.139
Patch 7.0.139 Problem:Using CTRL-PageUp or CTRL-PageDown in Insert mode to go to another tab page does not prepare for undo properly. (Stefano Zacchiroli) Solution: Call start_arrow() before switching tab page. Files: src/edit.c *** ../vim-7.0.138/src/edit.c Sat Oct 14 14:33:21 2006 --- src/edit.c Mon Oct 16 21:28:05 2006 *** *** 8822,8828 if (mod_mask MOD_MASK_CTRL) { /* C-PageUp: tab page back */ ! goto_tabpage(-1); return; } #endif --- 8822,8832 if (mod_mask MOD_MASK_CTRL) { /* C-PageUp: tab page back */ ! if (first_tabpage-tp_next != NULL) ! { ! start_arrow(curwin-w_cursor); ! goto_tabpage(-1); ! } return; } #endif *** *** 8881,8887 if (mod_mask MOD_MASK_CTRL) { /* C-PageDown: tab page forward */ ! goto_tabpage(0); return; } #endif --- 8885,8895 if (mod_mask MOD_MASK_CTRL) { /* C-PageDown: tab page forward */ ! if (first_tabpage-tp_next != NULL) ! { ! start_arrow(curwin-w_cursor); ! goto_tabpage(0); ! } return; } #endif *** ../vim-7.0.138/src/version.cTue Oct 17 12:53:31 2006 --- src/version.c Tue Oct 17 13:38:27 2006 *** *** 668,669 --- 668,671 { /* Add new patch number below this line */ + /**/ + 139, /**/ -- hundred-and-one symptoms of being an internet addict: 53. To find out what time it is, you send yourself an e-mail and check the Date: field. /// 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: Patch 7.0.139
On Tue, Oct 17, 2006 at 01:40:04PM +0200, Bram Moolenaar wrote: Patch 7.0.139 Problem:Using CTRL-PageUp or CTRL-PageDown in Insert mode to go to another tab page does not prepare for undo properly. (Stefano Zacchiroli) Solution: Call start_arrow() before switching tab page. Files:src/edit.c Thanks a lot for this fix! Cheers. -- Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy [EMAIL PROTECTED],debian.org,bononia.it} -%- http://www.bononia.it/zack/ If there's any real truth it's that the entire multidimensional infinity of the Universe is almost certainly being run by a bunch of maniacs. -!-
Re: Patch 7.0.138 (extra)
Hi, Patch 7.0.138 (extra) Problem:Mac: modifiers don't work with function keys. Solution: Use GetEventParameter() to obtain modifiers. (Nicolas Weber) Files: src/gui_mac.c thanks for including this. Sadly, I just found another problem caused by this patch: Mappings on characters which need the meta/option/alt (whatever you call it) modifier pressed no longer work (for example, :map ç j does no longer work). The reason is this: I have to press alt-c on my keyboard to generate a 'ç' character. But the new keyboard handler sends the alt modifier along with the 'ç' character to vim which seems to lead to confusion (interestingly, :map m-ç j doesn't work either). The old version had no problems with this, because the old version only sent modifiers to vim if the command key was pressed (so :map d- ç j doesn't work in the old version either). I think the correct solution is to send only modifiers to vim that are not needed to generate a character. I'll write a fix for this problem. I don't think this is serious enough to back out this patch, but that's something Bram has to decide :-P Bye, Nico
Patch 7.0.141
Patch 7.0.141 Problem:When pasting a while line on the command line an extra CR is added literally. Solution: Don't add the trailing CR when pasting with the mouse. Files: src/ex_getln.c, src/proto/ops.pro, src/ops.c *** ../vim-7.0.140/src/ex_getln.c Thu Sep 14 11:27:12 2006 --- src/ex_getln.c Sun Oct 15 16:17:20 2006 *** *** 86,92 static void draw_cmdline __ARGS((int start, int len)); static void save_cmdline __ARGS((struct cmdline_info *ccp)); static void restore_cmdline __ARGS((struct cmdline_info *ccp)); ! static intcmdline_paste __ARGS((int regname, int literally)); #if defined(FEAT_XIM) defined(FEAT_GUI_GTK) static void redrawcmd_preedit __ARGS((void)); #endif --- 86,92 static void draw_cmdline __ARGS((int start, int len)); static void save_cmdline __ARGS((struct cmdline_info *ccp)); static void restore_cmdline __ARGS((struct cmdline_info *ccp)); ! static intcmdline_paste __ARGS((int regname, int literally, int remcr)); #if defined(FEAT_XIM) defined(FEAT_GUI_GTK) static void redrawcmd_preedit __ARGS((void)); #endif *** *** 1116,1122 #endif if (c != ESC) /* use ESC to cancel inserting register */ { ! cmdline_paste(c, i == Ctrl_R); #ifdef FEAT_EVAL /* When there was a serious error abort getting the --- 1116,1122 #endif if (c != ESC) /* use ESC to cancel inserting register */ { ! cmdline_paste(c, i == Ctrl_R, FALSE); #ifdef FEAT_EVAL /* When there was a serious error abort getting the *** *** 1231,1246 goto cmdline_not_changed; /* Ignore mouse */ # ifdef FEAT_CLIPBOARD if (clip_star.available) ! cmdline_paste('*', TRUE); else # endif ! cmdline_paste(0, TRUE); redrawcmd(); goto cmdline_changed; # ifdef FEAT_DND case K_DROP: ! cmdline_paste('~', TRUE); redrawcmd(); goto cmdline_changed; # endif --- 1231,1246 goto cmdline_not_changed; /* Ignore mouse */ # ifdef FEAT_CLIPBOARD if (clip_star.available) ! cmdline_paste('*', TRUE, TRUE); else # endif ! cmdline_paste(0, TRUE, TRUE); redrawcmd(); goto cmdline_changed; # ifdef FEAT_DND case K_DROP: ! cmdline_paste('~', TRUE, FALSE); redrawcmd(); goto cmdline_changed; # endif *** *** 2890,2898 * return FAIL for failure, OK otherwise */ static int ! cmdline_paste(regname, literally) int regname; int literally;/* Insert text literally instead of as typed */ { long i; char_u*arg; --- 2890,2899 * return FAIL for failure, OK otherwise */ static int ! cmdline_paste(regname, literally, remcr) int regname; int literally;/* Insert text literally instead of as typed */ + int remcr;/* remove trailing CR */ { long i; char_u*arg; *** *** 2968,2974 return OK; } ! return cmdline_paste_reg(regname, literally); } /* --- 2969,2975 return OK; } ! return cmdline_paste_reg(regname, literally, remcr); } /* *** ../vim-7.0.140/src/proto/ops.proSun Apr 30 20:25:07 2006 --- src/proto/ops.pro Tue Oct 17 16:24:08 2006 *** *** 20,26 extern int do_execreg __ARGS((int regname, int colon, int addcr)); extern int insert_reg __ARGS((int regname, int literally)); extern int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg)); ! extern int cmdline_paste_reg __ARGS((int regname, int literally)); extern void adjust_clip_reg __ARGS((int *rp)); extern int op_delete __ARGS((oparg_T *oap)); extern int op_replace __ARGS((oparg_T *oap, int c)); --- 20,26 extern int do_execreg __ARGS((int regname, int colon, int addcr)); extern int insert_reg __ARGS((int regname, int literally)); extern int get_spec_reg __ARGS((int regname, char_u **argp, int *allocated, int errmsg)); ! extern int cmdline_paste_reg __ARGS((int regname, int literally, int remcr)); extern void adjust_clip_reg __ARGS((int *rp)); extern int op_delete __ARGS((oparg_T *oap)); extern int op_replace __ARGS((oparg_T *oap, int c)); *** ../vim-7.0.140/src/ops.cFri Oct 6 23:33:22 2006 --- src/ops.c Sun Oct 15 16:43:54 2006 *** *** 1480,1488 * return FAIL for failure, OK otherwise */ int ! cmdline_paste_reg(regname, literally) int regname; int literally;/* Insert text literally instead
Patch 7.0.142
Patch 7.0.142 Problem:Using the middle mouse button in Select mode to paste text results in an extra y. (Kriton Kyrimis) Solution: Let the middle mouse button replace the selected text with the contents of the clipboard. Files: src/normal.c *** ../vim-7.0.141/src/normal.c Tue Oct 10 13:27:30 2006 --- src/normal.cTue Oct 17 16:54:57 2006 *** *** 2380,2390 /* * If visual was active, yank the highlighted text and put it * before the mouse pointer position. */ if (VIsual_active) { ! stuffcharReadbuff('y'); ! stuffcharReadbuff(K_MIDDLEMOUSE); do_always = TRUE; /* ignore 'mouse' setting next time */ return FALSE; } --- 2380,2399 /* * If visual was active, yank the highlighted text and put it * before the mouse pointer position. +* In Select mode replace the highlighted text with the clipboard. */ if (VIsual_active) { ! if (VIsual_select) ! { ! stuffcharReadbuff(Ctrl_G); ! stuffReadbuff(\+p); ! } ! else ! { ! stuffcharReadbuff('y'); ! stuffcharReadbuff(K_MIDDLEMOUSE); ! } do_always = TRUE; /* ignore 'mouse' setting next time */ return FALSE; } *** ../vim-7.0.141/src/version.cTue Oct 17 16:26:52 2006 --- src/version.c Tue Oct 17 16:51:23 2006 *** *** 668,669 --- 668,671 { /* Add new patch number below this line */ + /**/ + 142, /**/ -- Keyboard not found. Think ENTER to continue. /// 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///
Patch 7.0.143
Patch 7.0.143 Problem:Setting 'scroll' to its default value was not handled correctly. Solution: Compare the right field to PV_SCROLL. Files: src/option.c *** ../vim-7.0.142/src/option.c Tue Oct 10 18:43:50 2006 --- src/option.cTue Oct 17 17:29:09 2006 *** *** 3405,3411 } else if (flags P_NUM) { ! if (varp == (char_u *)PV_SCROLL) win_comp_scroll(curwin); else { --- 3405,3411 } else if (flags P_NUM) { ! if (options[opt_idx].indir == PV_SCROLL) win_comp_scroll(curwin); else { *** ../vim-7.0.142/src/version.cTue Oct 17 16:55:47 2006 --- src/version.c Tue Oct 17 18:34:53 2006 *** *** 668,669 --- 668,671 { /* Add new patch number below this line */ + /**/ + 143, /**/ -- hundred-and-one symptoms of being an internet addict: 56. You leave the modem speaker on after connecting because you think it sounds like the ocean wind...the perfect soundtrack for surfing the net. /// 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///
Patch 7.0.144
Patch 7.0.144 Problem:May compare two unrelated pointers when matching a pattern against a string. (Dominique Pelle) Solution: Avoid calling reg_getline() when REG_MULTI is false. Files: src/regexp.c *** ../vim-7.0.143/src/regexp.c Tue Aug 29 17:28:56 2006 --- src/regexp.cTue Oct 17 18:30:18 2006 *** *** 3777,3784 op = OP(scan); /* Check for character class with NL added. */ ! if (!reg_line_lbr WITH_NL(op) *reginput == NUL !reglnum = reg_maxline) { reg_nextline(); } --- 3777,3784 op = OP(scan); /* Check for character class with NL added. */ ! if (!reg_line_lbr WITH_NL(op) REG_MULTI !*reginput == NUL reglnum = reg_maxline) { reg_nextline(); } *** *** 4855,4862 break; case NEWL: ! if ((c != NUL || reglnum reg_maxline || reg_line_lbr) ! (c != '\n' || !reg_line_lbr)) status = RA_NOMATCH; else if (reg_line_lbr) ADVANCE_REGINPUT(); --- 4855,4862 break; case NEWL: ! if ((c != NUL || !REG_MULTI || reglnum reg_maxline !|| reg_line_lbr) (c != '\n' || !reg_line_lbr)) status = RA_NOMATCH; else if (reg_line_lbr) ADVANCE_REGINPUT(); *** *** 5316,5323 ++count; mb_ptr_adv(scan); } ! if (!WITH_NL(OP(p)) || reglnum reg_maxline || reg_line_lbr !|| count == maxcount) break; ++count;/* count the line-break */ reg_nextline(); --- 5316,5323 ++count; mb_ptr_adv(scan); } ! if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum reg_maxline !|| reg_line_lbr || count == maxcount) break; ++count;/* count the line-break */ reg_nextline(); *** *** 5341,5347 } else if (*scan == NUL) { ! if (!WITH_NL(OP(p)) || reglnum reg_maxline || reg_line_lbr) break; reg_nextline(); scan = reginput; --- 5341,5348 } else if (*scan == NUL) { ! if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum reg_maxline ! || reg_line_lbr) break; reg_nextline(); scan = reginput; *** *** 5370,5376 } else if (*scan == NUL) { ! if (!WITH_NL(OP(p)) || reglnum reg_maxline || reg_line_lbr) break; reg_nextline(); scan = reginput; --- 5371,5378 } else if (*scan == NUL) { ! if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum reg_maxline ! || reg_line_lbr) break; reg_nextline(); scan = reginput; *** *** 5399,5405 } else if (*scan == NUL) { ! if (!WITH_NL(OP(p)) || reglnum reg_maxline || reg_line_lbr) break; reg_nextline(); scan = reginput; --- 5401,5408 } else if (*scan == NUL) { ! if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum reg_maxline ! || reg_line_lbr) break; reg_nextline(); scan = reginput; *** *** 5424,5430 { if (*scan == NUL) { ! if (!WITH_NL(OP(p)) || reglnum reg_maxline || reg_line_lbr) break; reg_nextline(); scan = reginput; --- 5427,5434 { if (*scan == NUL) { ! if (!REG_MULTI || !WITH_NL(OP(p)) || reglnum reg_maxline ! || reg_line_lbr) break; reg_nextline(); scan = reginput; *** *** 5454,5460 #endif if (*scan == NUL) { ! if (!WITH_NL(OP(p)) || reglnum reg_maxline || reg_line_lbr) break; reg_nextline(); scan = reginput; --- 5458,5465 #endif if (*scan == NUL) { ! if (!REG_MULTI ||
Backup file (with ~ ) on rsync server
I notice that (a few seconds ago) the file runtime/tutor/tutor.gr.utf8 on the rsync server is accompanied by a tutor.gr.utf8~ -- I suppose the latter can be removed? Best regards, Tony.
Re: (oops) Backup file (with ~ ) on rsync server
A.J.Mechelynck wrote: I notice that (a few seconds ago) the file runtime/tutor/tutor.gr.utf8 on the rsync server is accompanied by a tutor.gr.utf8~ -- I suppose the latter can be removed? Best regards, Tony. oops: .utf-8 and .utf-8~ Bet regards, Tony.
Patch 7.0.145
Patch 7.0.145 (after 7.0.142) Problem:Compiler warning. Solution: Add type cast. Files: src/normal.c *** ../vim-7.0.144/src/normal.c Tue Oct 17 16:55:47 2006 --- src/normal.cTue Oct 17 22:37:42 2006 *** *** 2387,2393 if (VIsual_select) { stuffcharReadbuff(Ctrl_G); ! stuffReadbuff(\+p); } else { --- 2387,2393 if (VIsual_select) { stuffcharReadbuff(Ctrl_G); ! stuffReadbuff((char_u *)\+p); } else { *** ../vim-7.0.144/src/version.cTue Oct 17 18:50:15 2006 --- src/version.c Tue Oct 17 22:38:21 2006 *** *** 668,669 --- 668,671 { /* Add new patch number below this line */ + /**/ + 145, /**/ -- hundred-and-one symptoms of being an internet addict: 59. Your wife says communication is important in a marriage...so you buy another computer and install a second phone line so the two of you can chat. /// 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: Backup file (with ~ ) on rsync server
Tony Mechelynck wrote: I notice that (a few seconds ago) the file runtime/tutor/tutor.gr.utf8 on the rsync server is accompanied by a tutor.gr.utf8~ -- I suppose the latter can be removed? I'll remove it. -- Q: Should I clean my house or work on Vim? A: Whatever contains more bugs. /// 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///
svn vs rsync vs ftp
Of different current methods to access vim sources (svn, ftp, rsync, etc) which one is fastest to be updated when new patch is issued, and also has most reliable/fast server ? Yakov
Re: vim and 64bit xp
Doug Cook wrote: Shell extensions are very specific to a particular bitness of Windows. -- 32-bit DLLs can only load into 32-bit processes. -- 64-bit DLLs can only load into 64-bit processes. The default shell for Win64 is the 64-bit version of explorer.exe (this is configurable), and it will NOT load the 32-bit gvimext.dll for two reasons: 1. The 32-bit gvimext.dll is a 32-bit DLL. 2. The 32-bit gvimext.dll is registered in the 32-bit registry. To make this work, you would have to rebuild gvimext.dll in a 64-bit version and register it in the 64-bit section of the registry. Note that you may find gvimext working in such places as the File-Save and File-Load dialogs of 32-bit processes, since they DO load the 32-bit shell extensions. You can also run the 32-bit shell instead of the 64-bit shell, and this will get your shell extensions back in most cases. As an alternative, you can get Open with gVim in your right-click menu WITHOUT gvimext.dll. This works on ALL versions of Windows. Open RegEdit and: 1. Navigate to HKEY_CLASSES_ROOT\* 2. Create or open a subkey named shell. 3. Create a subkey named vim. 4. (Optional.) Set the default value of the vim key to whatever you want to appear in the right-click menu (i.e. Edit with gVim). If you don't do this, the name of the subkey (vim) will be used. 5. Create a subkey named command. 6. Set the default value of the command key to the command you want to run. Mine is: C:\Tools\vim\vim70\gvim.exe %1 You can get this functionality without even editing the registry, by adding a shortcut to gvim.exe into your SendTo directory. But it won't give you the same menu items you get with gvimext.dll, and in particular the choice to edit in an already-running instance of gvim (and which one) or in a new one. Best regards, Tony.
Re: svn vs rsync vs ftp
On Tue 17-Oct-06 4:04pm -0600, Yakov Lerner wrote: Of different current methods to access vim sources (svn, ftp, rsync, etc) which one is fastest to be updated when new patch is issued, and also has most reliable/fast server ? I wasn't aware that sources were on FTP. Where are they? Patches are available on FTP and patched sources are available on CVS, frequently before the emailed patches are received. SVN patched files appear a little later. FTP and CVS are currently at patch level 145. SVN is at 132. Speed is more important getting updates to the runtime. It currently takes about a minute to check the runtime/dos tree for updates (and not download anything). I get them at ftp.home.vim.org - if you know of a faster site, I would like to know. -- Best regards, Bill
Re: substitude, write and close with one command
Peter Hodge napsal(a): --- Tomas Lovetinsky [EMAIL PROTECTED] wrote: Hi, I would like to ask you for help with my problem. I think it is simple but in fact I'm not able to find the solution as quickly as I need. I need to do sometink like :s/a/b/g :wq It means to substitute, write and close file. Hello, You can separate multiple commands using '|', therefore: :s/a/b/g | wq regards, Peter Thanks to all for your advices - it works well! Tomas
Re: How to find a file.
--- Zheng Da [EMAIL PROTECTED] wrote: Hello. I want to open a file, and I know its name, but don't know the path. I want to use the command find. For example I want to open the file space.cc, and use the command :find space.cc. I know the file may be in the current directory, or the subdirectories, but always get the error E345: Cannot find file space.cc in path. I use the default path, it should be .,/usr/include,,. (I use Linux). So what's the problem? And how to open the file I want? Hello, If you prefix '**/' to the filename, Vim should search through subdirectories for the file: :edit **/space.cc :find **/space.cc Also, if you use CTRL+D, Vim will show you a list of matching files: :find **/space.ccCTRL+D src/space.cc src/backup/space.cc regards, Peter On Yahoo!7 Music: Create your own personalised radio station. http://au.launch.yahoo.com/
Re: Cannot compile vim 7.0
Perhaps X is not fully installed. On Mon, 16 Oct 2006, Anne Wall wrote: /usr/include/Xm/Xm.h:42:34: X11/extensions/Print.h: No such file or directory -- .
Contextual 'iskeyword'?
In some text, I've got compound words separated by a single hyphen. For convenience of yanking, I've added the hyphen to my iskeyword setting which works nicely for the most part. However, I also use a doubled-hyphen to the effect one would use an em-dash which leads to the unwanted situation that a yank of a word now includes the first word of the subordinate sentence structure--such as this where the dashes are doubled--and effects my ^N/^P searching (as duplicates appear for entries followed by the double-dash). I'm on the prowl for some way to keep the iskeyword behavior for things like doubled-hyphen and em-dash in the above paragraph, but exclude things like structure--such and doubled--and, limiting the word to things with a dash only if that dash is not repeated. Something like \w-\w but not \w-\+\w (assuming that - isn't part of iskeyword for this example) Any hints? Thanks, -tim
RE: Contextual 'iskeyword'?
-Original Message- From: Benji Fisher [mailto:[EMAIL PROTECTED] Sent: 17 October 2006 15:03 To: Vim users Subject: Re: Contextual 'iskeyword'? On Tue, Oct 17, 2006 at 05:43:08AM -0500, Tim Chase wrote: In some text, I've got compound words separated by a single hyphen. For convenience of yanking, I've added the hyphen to my iskeyword setting which works nicely for the most part. However, I also use a doubled-hyphen to the effect one would use an em-dash which leads to the unwanted situation that a yank of a word now includes the first word of the subordinate sentence structure--such as this where the dashes are doubled--and effects my ^N/^P searching (as duplicates appear for entries followed by the double-dash). I'm on the prowl for some way to keep the iskeyword behavior for things like doubled-hyphen and em-dash in the above paragraph, but exclude things like structure--such and doubled--and, limiting the word to things with a dash only if that dash is not repeated. Something like \w-\w but not \w-\+\w (assuming that - isn't part of iskeyword for this example) Any hints? Let's think big and look for a generic solution. IMHO, it is way too restrictive to insist that a word is anything matching the pattern /\k\+/ . I want a new option, 'wordpat', with a default value of '\k\+', that specifies what should be recognized as a word, for purposes of search patterns, Normal-mode commands such as w and b, and maybe other uses. (Oh, yes: Insert-mode completion.) Examples: :let l:wordpat = '\k\+\(-\k\+\)*' allows words-with-hyphens but--as requested--does not match double hyphens. Change the '*' to '\=' to allow no more than one hyphen per word. C programmers may like to use '\.' instead of '-'. :let l:wordpat = '\\\=\k\+' matches TeX commands like \def and \input and caters to the (lazy but common) style of omitting optional white space: $ \alpha\beta\gamma=\alpha+\beta+\gamma $. :let l:wordpat = '\a\l*' matches Capitalized words but rejects CamelCase words. What do you think? Would this solve enough problems to be worth the effort? How many vim users would add it to their wish lists? You + others + 1. ---Zdenek
RE: Cannot compile vim 7.0
Do you mean X Windows? Motif? We're running X Windows, and it seems like it has no problems. How would I tell if that's the problem? Do I need to reinstall X Windows to get vim to compile? {shudder} -Original Message- From: Vigil [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 4:04 AM To: Vim Mailing List Subject: Re: Cannot compile vim 7.0 Perhaps X is not fully installed. On Mon, 16 Oct 2006, Anne Wall wrote: /usr/include/Xm/Xm.h:42:34: X11/extensions/Print.h: No such file or directory -- .
RE: Cannot compile vim 7.0
I guess I don't really have to recompile it; I just couldn't find any more recent binary than 6.3 for my platform, and I thought, as long as I'm trying to get it to run, I should do the best install I could. We already have a binary of 6.1, and one of our users complains that he has some problems with it. Maybe his problems are actually related to the possibly incomplete X install. I could compile the non-GUI version, but if the user is already addicted to the GUI, that's going backwards. I'm just hesitant to make changes to anything that could affect my coworkers adversely. I guess I'll try compiling the non-GUI. I've poked around in the Makefile; I guess I was just hoping someone else had seen the same problem before. -Original Message- From: Smith Eric [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 9:32 AM To: Anne Wall Subject: RE: Cannot compile vim 7.0 A quick scan for Xm.h reveals that it is a Motif header file; you would need to install any required Motif header files (i.e., the associated development package), or alternatively compile the non GUI version (via the appropriate switch). This is Compiling 101 type stuff, and you should probably consult a compilation from sources tutorial before you continue. Why do you need to recompile Vim? Why not just use the appropriate binaries? On Redhat: yum -y install vim Provided of course yum has been set up :) --Eric BTW, Google is your friend: google Xm.h. -Original Message- From: Anne Wall [mailto:[EMAIL PROTECTED] Sent: 17 October 2006 04:14 PM To: Vim Mailing List Subject: RE: Cannot compile vim 7.0 Do you mean X Windows? Motif? We're running X Windows, and it seems like it has no problems. How would I tell if that's the problem? Do I need to reinstall X Windows to get vim to compile? {shudder} -Original Message- From: Vigil [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 4:04 AM To: Vim Mailing List Subject: Re: Cannot compile vim 7.0 Perhaps X is not fully installed. On Mon, 16 Oct 2006, Anne Wall wrote: /usr/include/Xm/Xm.h:42:34: X11/extensions/Print.h: No such file or directory -- . Confidentiality Warning *==* The contents of this e-mail and any accompanying documentation are confidential and any use thereof, in what ever form, by anyone other than the addressee is strictly prohibited.
RE: replace using variable
p1. I am good/p p2. You sucks!/p p3. Take that, moron/p I want to change those sentences into: p id=11. I am good/p p id=22. You sucks!/p p id=33. Take that, moron/p How do I do that using vim replace command? All I can think is this: :%s/p\d/p id=\d\d/igc Me personally? I'd do something like :s/\(p\)\([0-9]*\)\(. \)/p id=\2\2\3/p Ie, first field is the p, second is the index, third is the '. ' (you want to preserve the format, and not get any false hits), and replace with the new tag, and simply put back the 2nd/3rd fields.
RE: replace using variable
Hi, I have these words: p1. I am good/p p2. You sucks!/p p3. Take that, moron/p P.S. If you are feeling frustrated (Vim can do that to you), try writing something more soothing, e.g.: p1. I am happy/p p2. You are beautiful!/p p3. Take that, as a token of my love/p Heh, I thought his version was funny as all Hell. :D
Re: problem compiling vim70.
On 2006-10-16, Ajay Gupta [EMAIL PROTECTED] wrote: Hello all, I am trying to compile vim70 on my 'newly installed' fc4 box. But I get the following error: snip checking for stack_t... (cached) yes checking whether stack_t has an ss_base field... no checking --with-tlib argument... empty: automatic terminal library selection checking for tgetent in -lncurses... (cached) yes ncurses library is not usable checking for tgetent in -ltermlib... no checking for tgetent in -ltermcap... no checking for tgetent in -lcurses... no no terminal library found checking for tgetent()... configure: error: NOT FOUND! You need to install a terminal library; for example ncurses. Or specify the name of the library with --with-tlib. /snip Anybody has any ideas what I need to do? I tried updating libncurses using 'yum install curses'. Updation completed successfully with the following message: snip Updated: ncurses.i386 0:5.4-19.fc4 Complete! /snip Note that the messages say that configure is checking for tgetent in termlib, termcap and curses. They say nothing about checking in ncurses. If you want to use ncurses, you have to tell configure that: ./configure --with-tlib=ncurses [other options] As long as you installed ncurses in a standard place, you don't need to say where you put it. HTH, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: Cannot compile vim 7.0
Anne Wall wrote: I couldn't find any more recent binaries than 6.3, but I did find the RPMs for that, so I installed it, and the populace is happy and peaceful. Thanks for your help! I'm grateful for your kind advice. I was under some wrong impressions, especially thinking it's important to compile the source yourself. I tried redirecting my Motif directories to the correct ones, as it mentioned in the Makefile, but that didn't help. WELL, I take it back. It did properly find Print.h, so that was an improvement. It had errors, though, so not fixed. I did try to compile after diabling the GUI, but I still had the same problems. Then I finally wised up and gave up, went looking for binaries, and looked away, whistling, as I left the directory full of lovely vim source code to slowly gather dust and cd'd back to home. It does make sense to compile Vim yourself, because the bugfix cycle is so fast that repackaged binaries (especially commercial ones such as RedHat) unavoidably lag behind by a very significant margin. For instance, Bram Moolenaar (the Vim project leader and head maintainer) just uploaded nine new bugfixes today, bringing the current version and patchlevel up to 7.0.144. The list of bugfixes (with a one-line description of what each of them fixes) can be read online at http://ftp.vim.org/pub/vim/patches/7.0/README . You can see what is new in version 7 as :help version7.txt in Vim 7.0, or, if still using Vim 6.3 or 6.4, as a Vim helpfile located at http://ftp.vim.org/pub/vim/runtime/doc/version7.txt However, if you compile anything (not only Vim) you need not only a compiler and linker with their libraries and header files, but also development versions of every piece of software that the stuff you're compiling is using. To compile any program which uses X, you need an X11-devel (or something: on my system it's called xorg-x11-devel) package. To compile Vim with Motif, you need not only a development X11 package, but also a development Motif package, as well as development packages for everything else that Vim uses: e.g., to compile Vim 7 with all interpreted-language interfaces, you need not only mzscheme, perl, python, ruby and tcl installed, but also mzscheme-devel, perl-devel, python-devel, ruby-devel and tcl-devel. To get the name of the RPM you need, use rpm -qa | grep packagename where packagename is part or all of the name of the companion non-development package you already have installed. Tack -devel between the name and the version number to get the development package name. For instance, the development package that goes with xorg-x11-6.8.2-30 is xorg-x11-devel-6.8.2-30 ; the one which goes with openmotif-2.2.3-11 is openmotif-devel-2.2.3-11 ; etc. IIRC, the full name of the RPM file is the package name (with version etc.) with .rpm added at the end. Since I didn't want headaches guessing what Vim did or didn't use, I installed devel RPM packages of everything that I have installed (I'm on SuSE Linux, which uses a software architecture quite similar to RedHat's) and Vim compiles like a charm, with every single bell and whistle that I knew how to include. Once I got it running flawlessly on both Windows and Linux, I wrote a pair of HowTo pages: the one for Linux is at http://users.skynet.be/antoine.mechelynck/vim/compunix.htm Best regards, Tony. -Original Message- From: Smith Eric [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 9:32 AM To: Anne Wall Subject: RE: Cannot compile vim 7.0 A quick scan for Xm.h reveals that it is a Motif header file; you would need to install any required Motif header files (i.e., the associated development package), or alternatively compile the non GUI version (via the appropriate switch). This is Compiling 101 type stuff, and you should probably consult a compilation from sources tutorial before you continue. Why do you need to recompile Vim? Why not just use the appropriate binaries? On Redhat: yum -y install vim Provided of course yum has been set up :) --Eric BTW, Google is your friend: google Xm.h. -Original Message- From: Anne Wall [mailto:[EMAIL PROTECTED] Sent: 17 October 2006 04:14 PM To: Vim Mailing List Subject: RE: Cannot compile vim 7.0 Do you mean X Windows? Motif? We're running X Windows, and it seems like it has no problems. How would I tell if that's the problem? Do I need to reinstall X Windows to get vim to compile? {shudder} -Original Message- From: Vigil [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 4:04 AM To: Vim Mailing List Subject: Re: Cannot compile vim 7.0 Perhaps X is not fully installed. On Mon, 16 Oct 2006, Anne Wall wrote: /usr/include/Xm/Xm.h:42:34: X11/extensions/Print.h: No such file or directory -- . Confidentiality Warning *==* The contents of this e-mail and any accompanying documentation are confidential and any use thereof, in what ever form, by anyone
RE: Cannot compile vim 7.0
Oh mah gah. That's the best. You've really encapsulated the whole deal here. Thank you, because that's pretty excellent. I already knew that there were about 132 patches for vim, and I optimistically applied every single one before trying the install the first time. That in itself was a bit silly, because I didn't realize that some of them are platform-specific. Oy. I'm going to give it a shot and get the other packages. -Original Message- From: A.J.Mechelynck [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 3:53 PM To: Anne Wall Cc: 'Smith Eric'; Vim Mailing List Subject: Re: Cannot compile vim 7.0 Anne Wall wrote: I couldn't find any more recent binaries than 6.3, but I did find the RPMs for that, so I installed it, and the populace is happy and peaceful. Thanks for your help! I'm grateful for your kind advice. I was under some wrong impressions, especially thinking it's important to compile the source yourself. I tried redirecting my Motif directories to the correct ones, as it mentioned in the Makefile, but that didn't help. WELL, I take it back. It did properly find Print.h, so that was an improvement. It had errors, though, so not fixed. I did try to compile after diabling the GUI, but I still had the same problems. Then I finally wised up and gave up, went looking for binaries, and looked away, whistling, as I left the directory full of lovely vim source code to slowly gather dust and cd'd back to home. It does make sense to compile Vim yourself, because the bugfix cycle is so fast that repackaged binaries (especially commercial ones such as RedHat) unavoidably lag behind by a very significant margin. For instance, Bram Moolenaar (the Vim project leader and head maintainer) just uploaded nine new bugfixes today, bringing the current version and patchlevel up to 7.0.144. The list of bugfixes (with a one-line description of what each of them fixes) can be read online at http://ftp.vim.org/pub/vim/patches/7.0/README . You can see what is new in version 7 as :help version7.txt in Vim 7.0, or, if still using Vim 6.3 or 6.4, as a Vim helpfile located at http://ftp.vim.org/pub/vim/runtime/doc/version7.txt However, if you compile anything (not only Vim) you need not only a compiler and linker with their libraries and header files, but also development versions of every piece of software that the stuff you're compiling is using. To compile any program which uses X, you need an X11-devel (or something: on my system it's called xorg-x11-devel) package. To compile Vim with Motif, you need not only a development X11 package, but also a development Motif package, as well as development packages for everything else that Vim uses: e.g., to compile Vim 7 with all interpreted-language interfaces, you need not only mzscheme, perl, python, ruby and tcl installed, but also mzscheme-devel, perl-devel, python-devel, ruby-devel and tcl-devel. To get the name of the RPM you need, use rpm -qa | grep packagename where packagename is part or all of the name of the companion non-development package you already have installed. Tack -devel between the name and the version number to get the development package name. For instance, the development package that goes with xorg-x11-6.8.2-30 is xorg-x11-devel-6.8.2-30 ; the one which goes with openmotif-2.2.3-11 is openmotif-devel-2.2.3-11 ; etc. IIRC, the full name of the RPM file is the package name (with version etc.) with .rpm added at the end. Since I didn't want headaches guessing what Vim did or didn't use, I installed devel RPM packages of everything that I have installed (I'm on SuSE Linux, which uses a software architecture quite similar to RedHat's) and Vim compiles like a charm, with every single bell and whistle that I knew how to include. Once I got it running flawlessly on both Windows and Linux, I wrote a pair of HowTo pages: the one for Linux is at http://users.skynet.be/antoine.mechelynck/vim/compunix.htm Best regards, Tony. -Original Message- From: Smith Eric [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 9:32 AM To: Anne Wall Subject: RE: Cannot compile vim 7.0 A quick scan for Xm.h reveals that it is a Motif header file; you would need to install any required Motif header files (i.e., the associated development package), or alternatively compile the non GUI version (via the appropriate switch). This is Compiling 101 type stuff, and you should probably consult a compilation from sources tutorial before you continue. Why do you need to recompile Vim? Why not just use the appropriate binaries? On Redhat: yum -y install vim Provided of course yum has been set up :) --Eric BTW, Google is your friend: google Xm.h. -Original Message- From: Anne Wall [mailto:[EMAIL PROTECTED] Sent: 17 October 2006 04:14 PM To: Vim Mailing List Subject: RE: Cannot compile vim 7.0 Do you mean X Windows? Motif?
search visual block
Is it possible to search for a string by selecting that string in visual mode? Meaning, if I highlight something, and then want to search for that thing which is highlighted in the rest of the doc? otherwise, is there a way to copy that string so that I can later put it into the :/ command? thanks! -lev
Re: Cannot compile vim 7.0
Anne Wall wrote: Oh mah gah. That's the best. You've really encapsulated the whole deal here. Thank you, because that's pretty excellent. Thanks for the compliment; I used to be a teacher. I already knew that there were about 132 patches for vim, and I optimistically applied every single one before trying the install the first time. That in itself was a bit silly, because I didn't realize that some of them are platform-specific. Oy. I'm going to give it a shot and get the other packages. I also apply every single patch as it gets published, and I have no problem with that (as I have downloaded the full sources, not only the unix and lang archives but also extra). Any modules that I don't need (such as Windows- or Mac-specific modules when compiling on Linux) are simply not compiled; and the binary which I just compiled neatly displays Included patches: 1-144 in the output of its :version command. Since (IIUC) the Unix shell expands the wildcards in lexicographic order, after downloading all patches into (let's say) ~/.build/vim/vim70/patches/, you can apply them (for your first v7 compile) by doing cd ~/.build/vim/vim70 cat patches/7.0.??? | patch -p0 For incremental patching (when a few new patches are published, and you've already applied the previous ones) it's usually easier to apply them one-by-one: e.g., the next one will be patch -p0 patches/7.0.145 unless of course Vim 7.1 comes out first ;-). Best regards, Tony.
Re: Contextual 'iskeyword'?
Let's think big and look for a generic solution. IMHO, it is way too restrictive to insist that a word is anything matching the pattern /\k\+/ . I want a new option, 'wordpat', with a default value of '\k\+', that specifies what should be recognized as a word, for purposes of search patterns, Normal-mode commands such as w and b, and maybe other uses. (Oh, yes: Insert-mode completion.) Examples: :let l:wordpat = '\k\+\(-\k\+\)*' In the general, I like it! In the implementation, I don't know if there are snags that one will encounter. One might have to include the cursor position to anchor it in the search text. Funky conditions could occur if patterns contain certain atoms (for better or worse). Could things like using \%9c enforce that words are only contained before column 9 (makes me think of my cobol days)? Or even something like '\%0l\%42l\k*\%#\k*' enforce that keywords are only found in the first 41 lines of your file? Or can keywords only be duplicate-part words like mahimahi using a pattern like '\(\k\+\)\1'? Or keywords are only ever preceeded by int like 'int\_s\+\zs\k+'? Or alter the behavior of the * and # commands to find the word that *preceeds* the word under the cursor with something like '\k\+\ze\K\+\k*\%#' All these seem like sensible (for cases where sensible may be a subset of as pathological) potential use-cases for such a thing. -tim
Re: search visual block
On Tue 17-Oct-06 4:03pm -0600, Lev Lvovsky wrote: Is it possible to search for a string by selecting that string in visual mode? Meaning, if I highlight something, and then want to search for that thing which is highlighted in the rest of the doc? You can do this with a visual map: vnoremap leader/ y/C-RCR This will not always work - the visual area may contain characters will special meaning in a pattern. See :h :y :h c_CTRL-R_= -- Best regards, Bill
www.vim.org down?
Hi I get a blank page when I go to www.vim.org. If I go to vim.sf.net I get the vim pages. A problem with the alias? Preben
Re: Slightly OT: HELP! IDE ahead !
Meino Christian Cramer wrote: Hi, Is it possible to convince kdevelop from using vim? I searched the web but the only source of information I found was of kvim -- and its homepage isn't there anymore. Any ideas? Thank you very much in advanve for any help! Keep hacking! mcc I'll suppose you mean convince kdevelop to use Vim, not away from using Vim. I don't use kdevelop myself, but I think the following should work: 1. Open Konqueror. 2. Type settings:/Components/ in the Location Bar. 3. Click Vim Embedding. 4. In the popup which opens now, open the tab Vim Executable Selection 5. Select the radio button Vim/X11 Communication (if it is greyed out, then proceed with steps 6 and 7 below and select the radio button after doing them). 6. Click the Browse button (usually a blue folder-like icon) next to the top type-in bar, and browse to the location of your Vim executable (e.g. /usr/local/bin/vim ). It must be a Vim executable with at least +gui and +clientserver compiled-in; +eval is recommended. 7. If you click Test, it will display whether this Vim executable has GUI and client-server features compiled-in, and at which version. Depending on your GUI version, there may be a popup warning; but if you're using an up-to-date binary it shouldn't be a problem. 8. Click OK to close the popup. Close Konqueror if you don't need it for something else. 9. In kdevelop, select Settings - Configure KDevelop - Editor, and make sure that Embedded Editor is set to Embedded Advanced Text Editor. Then click OK. If that doesn't work, you may need to search the KDE help; but I hope the above can put you on the right track. Best regards, Tony.
Re: www.vim.org down? - surf to vim.sf.net
* Preben Randhol [EMAIL PROTECTED] [2006-10-18 00:30]: I get a blank page when I go to www.vim.org. If I go to vim.sf.net I get the vim pages. A problem with the alias? something like that - yes. the powers that be have been alerted. please stay calm. in the meantime please surf to vim.sf.net - thankyou! Sven
Using Ctrl-] to tag on a filename
Does vim support a special type of 'iskeyword' setting for Ctrl-] searching for tags? Here is my problem: after adding filenames to my tags file, I now want to use the convenience of Ctrl-] to jump to files as well as identifiers. For example, positioning the cursor on defines.h and pressing Ctrl-], from inside a line like this, #include defines.h I get an error, E426: tag not found: defines But Ctrl-] finds the tag if I do this, set iskeyword+=. I presume Ctrl-] is searching for the keyword under the cursor, so the .h portion is not seen unless I add . to iskeyword. But adding . to iskeyword makes Ctrl-] work incorrectly on identifiers in other cases, such as, bufmgr.refcnt using Ctrl-] on bufmgr causes vim to search for bufmgr.refcnt, which is obviously not correct. How do I solve this apparent discrepancy? Regards, David __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Contextual 'iskeyword'?
Tim Chase wrote: In some text, I've got compound words separated by a single hyphen. For convenience of yanking, I've added the hyphen to my iskeyword setting which works nicely for the most part. However, I also use a doubled-hyphen to the effect one would use an em-dash which leads to the unwanted situation that a yank of a word now includes the first word of the subordinate sentence structure--such as this where the dashes are doubled--and effects my ^N/^P searching (as duplicates appear for entries followed by the double-dash). I'm on the prowl for some way to keep the iskeyword behavior for things like doubled-hyphen and em-dash in the above paragraph, but exclude things like structure--such and doubled--and, limiting the word to things with a dash only if that dash is not repeated. Something like \w-\w but not \w-\+\w (assuming that - isn't part of iskeyword for this example) Any hints? Thanks, -tim After reading this thread, I've seen requests for improvement to the Vim source; but let's try to find (for the time being) something which works in the current Vim version. 1. Em dashes should normally be set apart from the neighbouring words by blank spaces -- like this -- and if they are, they won't be mistaken for part of a word regardless of whether 'iskeyword' includes the dash. 2. To toggle the kewordness of the dash character on the fly: :mapF5:set isk+=-CR :mapS-F5 :set isk-=-CR :imap F5C-O:set isk+=-CR :imap S-F5 C-O:set isk-=-CR 3. To add spaces between em dashes and the adjoining words (but not between an em dash and a space, comma, full stop, line break, etc.): :%s/\(\k\)--/\1 --/g :%s/--\(\k\)/-- \1/g Best regards, Tony.
Re: search visual block
--- Lev Lvovsky [EMAIL PROTECTED] wrote: Is it possible to search for a string by selecting that string in visual mode? Meaning, if I highlight something, and then want to search for that thing which is highlighted in the rest of the doc? Why go to the trouble of highlighting it? Have you discovered the * key? Just press the * key while in normal mode and vim searches for the word under the cursor. See this tip, http://vim.sourceforge.net/tips/tip.php?tip_id=1 Regards, David __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: search visual block
--- David Thompson [EMAIL PROTECTED] wrote: --- Lev Lvovsky [EMAIL PROTECTED] wrote: Is it possible to search for a string by selecting that string in visual mode? Meaning, if I highlight something, and then want to search for that thing which is highlighted in the rest of the doc? Why go to the trouble of highlighting it? Have you discovered the * key? Just press the * key while in normal mode and vim searches for the word under the cursor. See this tip, http://vim.sourceforge.net/tips/tip.php?tip_id=1 Btw, at the bottom of this tip, I added a comment about mapping F10 to use hlsearch. Here it is, it may do what you want, map F10 :set invhlsCR:let @/=C-rC-wCR/BS Now use F10 key just like the * key, except F10 enables and disables the highlight search mode. See also, :help hlsearch Regards, David __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: search visual block
On Oct 17, 2006, at 4:36 PM, David Thompson wrote: Why go to the trouble of highlighting it? Have you discovered the * key? Just press the * key while in normal mode and vim searches for the word under the cursor. I have indeed, very useful, however this is for multiple words separated by spaces. -lev
RE: search visual block
From :help visual-operators Note that the :vmap command can be used to specifically map keys in Visual mode. For example, if you would like the / command not to extend the Visual area, but instead take the highlighted text and search for that: :vmap / y/C-RCR I would suggest not using the default yank register (it annoys me when things clear it without warning me!) so try this instead (which uses the 'q' register instead): :vmap / qy/C-RqCR Then whenever you press / with something highlighted in visual mode, it will get searched for! Hope that helps! Max -Original Message- From: Lev Lvovsky [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 17, 2006 4:47 PM To: David Thompson Cc: vim@vim.org Subject: Re: search visual block On Oct 17, 2006, at 4:36 PM, David Thompson wrote: Why go to the trouble of highlighting it? Have you discovered the * key? Just press the * key while in normal mode and vim searches for the word under the cursor. I have indeed, very useful, however this is for multiple words separated by spaces. -lev
Re: www.vim.org down?
Preben Randhol [EMAIL PROTECTED] 写于 2006-10-18 06:23:20: Hi I get a blank page when I go to www.vim.org. If I go to vim.sf.net I get the vim pages. A problem with the alias? Preben I don't think it is happen recently. During the past two years I'd never sucess in visiting www.vim.org, only vim.sf.net works -- Sincerely, Pan, Shi Zhu. ext: 2606
RE: Using Ctrl-] to tag on a filename
--- Max Dyckhoff [EMAIL PROTECTED] wrote: --- David Thompson [mailto:[EMAIL PROTECTED] wrote: Does vim support a special type of 'iskeyword' setting for Ctrl-] searching for tags? Here is my problem: after adding filenames to my tags file, I now want to use the convenience of Ctrl-] to jump to files as well as identifiers. For example, positioning the cursor on defines.h and pressing Ctrl-], from inside a line like this, #include defines.h I get an error, E426: tag not found: defines But Ctrl-] finds the tag if I do this, set iskeyword+=. I presume Ctrl-] is searching for the keyword under the cursor, so the .h portion is not seen unless I add . to iskeyword. But adding . to iskeyword makes Ctrl-] work incorrectly on identifiers in other cases, such as, bufmgr.refcnt using Ctrl-] on bufmgr causes vim to search for bufmgr.refcnt, which is obviously not correct. How do I solve this apparent discrepancy? Regards, David You could just use 'gf' to open the file under the cursor, assuming that it lies in your path. ^wgf will open it in a new split, just like ^w^] does for tags. If that isn't an acceptable solution, I don't have any other suggestions. Well, I did solve the problem with a rather ugly function that sets resets iskeyword for one tag lookup. But I was hoping vim might have a better way to use iskeyword in a contextual manner specific just for tags. Here is my solution: I still use normal Ctrl-] for identifiers, but now use Ctrl-\ to tag on a filename. It works pretty well, especially since the ] and \ keys are next to each other on my QWERTY keyboard. In my ~/.vimrc, I added, map Ctrl-\ to do Ctrl-] on filenames nnoremap silent C-\ :call TagFilename()CR function! TagFilename() let old_iskeyword = iskeyword setlocal iskeyword+=\.,/ let fname = expand('cword') let l:iskeyword = old_iskeyword let v:errmsg = silent! execute :tag .fname if v:errmsg != echohl ErrorMsg echo v:errmsg echohl None endif endfunc Regards, David __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Contextual 'iskeyword'?
--- Benji Fisher [EMAIL PROTECTED] wrote: On Tue, Oct 17, 2006 at 05:43:08AM -0500, Tim Chase wrote: In some text, I've got compound words separated by a single hyphen. For convenience of yanking, I've added the hyphen to my iskeyword setting which works nicely for the most part. However, I also use a doubled-hyphen to the effect one would use an em-dash which leads to the unwanted situation that a yank of a word now includes the first word of the subordinate sentence structure--such as this where the dashes are doubled--and effects my ^N/^P searching (as duplicates appear for entries followed by the double-dash). I'm on the prowl for some way to keep the iskeyword behavior for things like doubled-hyphen and em-dash in the above paragraph, but exclude things like structure--such and doubled--and, limiting the word to things with a dash only if that dash is not repeated. Something like \w-\w but not \w-\+\w (assuming that - isn't part of iskeyword for this example) Any hints? Let's think big and look for a generic solution. IMHO, it is way too restrictive to insist that a word is anything matching the pattern /\k\+/ . I want a new option, 'wordpat', with a default value of '\k\+', that specifies what should be recognized as a word, for purposes of search patterns, Normal-mode commands such as w and b, and maybe other uses. (Oh, yes: Insert-mode completion.) Examples: :let l:wordpat = '\k\+\(-\k\+\)*' allows words-with-hyphens but--as requested--does not match double hyphens. Change the '*' to '\=' to allow no more than one hyphen per word. C programmers may like to use '\.' instead of '-'. :let l:wordpat = '\\\=\k\+' matches TeX commands like \def and \input and caters to the (lazy but common) style of omitting optional white space: $ \alpha\beta\gamma=\alpha+\beta+\gamma $. :let l:wordpat = '\a\l*' matches Capitalized words but rejects CamelCase words. What do you think? Would this solve enough problems to be worth the effort? How many vim users would add it to their wish lists? I have exactly the same problem with '_' and '__' in words, so I would like the feature also, if it is possible. That said, you can use something like the following to get by in the meantime: function! SelectCustomWord() let l:oldISK = isk let l:oldSearch = @/ set isk+=\- normal! v?\\|--?e+1 mto`t/\\|--/s-1 let isk = l:oldISK let @/ = l:oldSearch nohls endfunction enable using 'yi-' just like you use 'yiw' onoremap i- :call SelectCustomWord()CR vnoremap i- v:call SelectCustomWord()CR a mapping for you to try stuff out map F5 ayi-:echo @aCR Then you can use 'i-' just like you would use 'iw'. here's some words for you to try it on (press F5 with the cursor over different words): one-word two--words first-word--second-word--thirdword! See ':help text-objects' and ':help iw' for more information on how to use 'iw' and your new 'i-' command. regards, Peter Do you Yahoo!? Spring Racing Carnival - Check out Sonia Kruger's blog http://au.sports.yahoo.com/racing/
Re: search visual block
* Lev Lvovsky [2006.10.17 17:15]: Is it possible to search for a string by selecting that string in visual mode? Meaning, if I highlight something, and then want to search for that thing which is highlighted in the rest of the doc? You already got lots of good answers. Here's another one. I've had this in my vimrc for years, and use it when the string I'm searching for is not a keyword. It works both forward and backward, puts the searched pattern in the search history and doesn't screw up any register. -- cut here --- Search for visually selected text {{{ From an idea by Michael Naumann, Jürgen Krämer. function! VisualSearch(direction) range let l:saved_reg = @ execute normal! vgvy let l:pattern = escape(@, '\\/.*$^~[]') let l:pattern = substitute(l:pattern, \n$, , ) if a:direction == 'b' execute normal ? . l:pattern . else execute normal / . l:pattern . endif let @/ = l:pattern let @ = l:saved_reg endfunction vnoremap silent * :call VisualSearch('f')CR vnoremap silent # :call VisualSearch('b')CR -- cut here --- HTH, -- JR [who has a vague remembrance that this subject has come up before]
split vertically at a tag
If I do ctrl-W ctrl-] in normal mode, vim splits the current window horizontally. Is there any way to achieve the same functionality but with window being split vertically instead of horizontally? thanks raju
Re: split vertically at a tag
Kamaraju Kusumanchi wrote: If I do ctrl-W ctrl-] in normal mode, vim splits the current window horizontally. Is there any way to achieve the same functionality but with window being split vertically instead of horizontally? thanks raju If any ex-command splits a window horizontally, you can make it split vertically by prefixing it with :vert[ical] or open a new tab by prefixing it with :tab. Since the :winc[md] ex-command is equivalent to the Ctrl-W prefix, and since Ctrl-W Ctrl-] is equivalent to Ctrl-W ] you can do :vert winc ] If you want Ctrl-W Ctrl-] to _always_ split vertically, you can use :mapC-WC-]:vertical wincmd ]CR This will leave Ctrl-W ] available to split horizontally as an exception. Best regards, Tony.
Re: Slightly OT: HELP! IDE ahead !
From: A.J.Mechelynck [EMAIL PROTECTED] Subject: Re: Slightly OT: HELP! IDE ahead ! Date: Wed, 18 Oct 2006 00:51:50 +0200 Meino Christian Cramer wrote: Hi, Is it possible to convince kdevelop from using vim? I searched the web but the only source of information I found was of kvim -- and its homepage isn't there anymore. Any ideas? Thank you very much in advanve for any help! Keep hacking! mcc I'll suppose you mean convince kdevelop to use Vim, not away from using Vim. I don't use kdevelop myself, but I think the following should work: 1. Open Konqueror. 2. Type settings:/Components/ in the Location Bar. 3. Click Vim Embedding. 4. In the popup which opens now, open the tab Vim Executable Selection 5. Select the radio button Vim/X11 Communication (if it is greyed out, then proceed with steps 6 and 7 below and select the radio button after doing them). 6. Click the Browse button (usually a blue folder-like icon) next to the top type-in bar, and browse to the location of your Vim executable (e.g. /usr/local/bin/vim ). It must be a Vim executable with at least +gui and +clientserver compiled-in; +eval is recommended. 7. If you click Test, it will display whether this Vim executable has GUI and client-server features compiled-in, and at which version. Depending on your GUI version, there may be a popup warning; but if you're using an up-to-date binary it shouldn't be a problem. 8. Click OK to close the popup. Close Konqueror if you don't need it for something else. 9. In kdevelop, select Settings - Configure KDevelop - Editor, and make sure that Embedded Editor is set to Embedded Advanced Text Editor. Then click OK. If that doesn't work, you may need to search the KDE help; but I hope the above can put you on the right track. Best regards, Tony. Hi Tony, :) yes of course...! I mean what you have said, not what I have written... :) ;O) Again my german English hits me... My company plans to unify the use of tools. Kdevelop for all! Top down analysis for the masses! Ok, I will not comment on this. For me it is more important to have unified code styles, tab spaces and so on instead of the same editor to produce the results...as it is allowed to configure KDE/kdevelop...we will see... I will check your recipe! Thank you very much for your help Tony! : Dont worry, ask Tony ! :O)) --- VERY BIG SMILEY! Have a nice day!!! mcc
Re: Slightly OT: HELP! IDE ahead !
Meino Christian Cramer wrote: [...] My company plans to unify the use of tools. Kdevelop for all! Top down analysis for the masses! Ok, I will not comment on this. For me it is more important to have unified code styles, tab spaces and so on instead of the same editor to produce the results...as it is allowed to configure KDE/kdevelop...we will see... [...] Well, I guess if you can configure gvim as your embedded editor for kdevelop, you will be able to edit your files with Vim and make believe that you're using kdevelop, so everyone'll be happy. (My SuSE system came with kvim set up as the embedded editor for any KDE applications that use one; but that means a Vim version 6.2.14 -- you bet I changed that to my homemade 7.0 ! ) Best regards, Tony.
Re: Slightly OT: HELP! IDE ahead !
[EMAIL PROTECTED] wrote: [...] Hi, Sorry for my ignorance but I've never heard of kvim before. Is it a Vim implementation with Qt GUI? I see from Vim source of no evidence of that. It does not seemed to be available in Official Vim 7.0 source. (No Qt or KDE option for GUI selection in the Makefile) kvim used to be a KDE project to develop a Vim GUI based on Qt widgets. You can test for it by means of has(gui_kde), which tests TRUE in those obsolete builds only, and FALSE in all other Vim builds. Its 'guifont' format was incompatible with the format used by all other flavours of gvim. That project was occasionally mentioned on the vim-dev list a year or two ago, but it has now been abandoned (at some point between Vim 6.2 and 6.3 IIUC). How do you home-made a kvim? (I currently compiled it with Gtk2 lib, but I do like a Qt version if possible). How do I home-make a kvim? I don't. I still have a 6.2.14 version of kvim but what I normally use is Vim 7 with Gnome2 GUI (i.e., GTK2 and GNOME). The advantage (for me) over plain GTK2 is that it saves its session transparently when I close the kde window manager. It is enabled by the --enable-gnome-check option to configure (or by export CONF_OPT_GUI='--enable-gnome-check' [with the single quotes and without the double quotes] in bash prior to running make config or make reconfig). -- Sincerely, Pan, Shi Zhu. ext: 2606 Best regards, Tony.
Re: split vertically at a tag
--- A.J.Mechelynck [EMAIL PROTECTED] wrote: If any ex-command splits a window horizontally, you can make it split vertically by prefixing it with :vert[ical] or open a new tab by prefixing it with :tab. Since the :winc[md] ex-command is equivalent to the Ctrl-W prefix, and since Ctrl-W Ctrl-] is equivalent to Ctrl-W ] you can do :vert winc ] If you want Ctrl-W Ctrl-] to _always_ split vertically, you can use :mapC-WC-]:vertical wincmd ]CR This will leave Ctrl-W ] available to split horizontally as an exception. Hmm, I found on vim6 this still splits horizontally, but it works correctly on vim7. Regards, David __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com