Re: Vim 7.0 (1-109 patches) completion bug.
This was a response to a personal mail from Igor, but I am unable to reach his address by mail. I got my message back with: [EMAIL PROTECTED]: 80.91.16.141 does not like recipient. Remote host said: 553 5.7.1 smtp106.sbc.mail.mud.yahoo.com[68.142.198.205]: Client host rejected: Big domain level Giving up on 80.91.16.141. This continues the conversion with the same subject. There does appear to be a bug. Please read on. On Sun 8-Oct-06 10:42pm -0600, Igor Prischepoff wrote: Hello, Bill. Can you try _one more last time_ please ? gvim - whatever you prefer for clean vim without preferences set cot+=longest set cot-=menuone set complete-=t After starting with: gvim -u NONE -i NONE -N I typed: :se cot+=longest cpt-=t cot cpt Gvim outputs: completeopt=menu,preview,longest complete=w,b,u,i which is hopefully the same state you get. i one : word two : word oC-N:tC-N On the first C-N, 'o' is expanded to 'one', however I get a message Back at original. That is wrong. The original is 'o' not 'one'. Gvim appears confused. Typing any non- whitespace printable characters continues its confusion and another C-N, after typing one or more of these characters, does nothing. After the 'one' is completed from the first C-N, a second C-N changes the message to The only match. Now you can continue typing - the completion text in the command area will be cleared and C-N will work on 't' (but you'll be in the same wrong state of completion with the incorrect message of Back at original. BTW, a C-Y is supposed to tell Gvim you are done with completion. It behaves strangely here. After the C-N completes the 'o' to 'one', a C-Y indeed ends the completion but I am not left with 'one', I am left with 'ow'! what I've got is one : word two : word one:t and message Back at original Please note that when you type C-N first time (after 'o') you should get 'one' expanded automatically because it's only match in this case. And when type C-N after 't' you should get nothing (that's a bug I think). In both cases you should get NO MENU. (because of longest and no menuone in completeoption) I get no menu because there is no menuone, not because of longest. Don't you also see the problem begins with the first C-N after the 'o'? If you got other result's can you please send you :ver output? mine is : vi Improved 7.0 Included patches:1-118 Here the output of :version VIM - Vi IMproved 7.0 (2006 May 7, compiled Oct 8 2006 13:02:44) MS-Windows 32 bit GUI version with OLE support Included patches: 1-121 Compiled by Bill McCarthy [EMAIL PROTECTED] Big version with 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_gui +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +folding -footer +gettext/dyn -hangul_input +iconv/dyn +insert_expand +jumplist +keymap +langmap +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape +multi_byte_ime/dyn +multi_lang +mzscheme/dyn +netbeans_intg +ole -osfiletype +path_extra -perl -postscript +printer -profile +python/dyn +quickfix +reltime +rightleft -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl -tgetent -termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -xfontset -xim -xterm_save -xpm_w32 system vimrc file: $VIM\vimrc user vimrc file: $HOME\_vimrc 2nd user vimrc file: $VIM\_vimrc user exrc file: $HOME\_exrc 2nd user exrc file: $VIM\_exrc system gvimrc file: $VIM\gvimrc user gvimrc file: $HOME\_gvimrc 2nd user gvimrc file: $VIM\_gvimrc system menu file: $VIMRUNTIME\menu.vim Compilation: gcc -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=pentium3 -Wall -Ic:/util/MzScheme/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=c:/util/MzScheme/collects -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=libmzsch209_000.dll -DDYNAMIC_MZGC_DLL=libmzgc209_000.dll -DFEAT_PYTHON -I c:/util/python24/include -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=python24.dll -O3 -fomit-frame-pointer -freg-struct-return -s Linking: gcc -Iproto -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DFEAT_CSCOPE -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=pentium3 -Wall -Ic:/util/MzScheme/include -DFEAT_MZSCHEME -DMZSCHEME_COLLECTS=c:/util/MzScheme/collects -DDYNAMIC_MZSCHEME
Re: Q: rsync://ftp.vim.org/Vim/runtime/ - when?
Bill McCarthy wrote: On Sun 8-Oct-06 7:39pm -0600, A.J.Mechelynck wrote: Bill McCarthy wrote: On Sun 8-Oct-06 5:42pm -0600, Alexey I. Froloff wrote: When current version of vim runtime will be updated for latest patches? Patch 111 modifies autoload/gzip.vim and doc/eval.txt which are still outdated on ftp... The gzip.vim is clearly old, but comparing (vimdiff) the eval.txt on the FTP site to the patch version on CVS, they both share the same internal date of 22-Sep-2006 yet the one on the FTP site looks newer. I generally find it easier to ignore the patches to runtime files and, instead, rely on the FTP site for those. They are usually updated fairly quickly. After checking, the new versions of the files mentioned in patch 111 agree with the latest versions I downloaded from the rsync server, except that the gzip.vim lacks the new datestamp (the rest of the file is OK though.) After deleting gzip.vim and performing a copy update from the ftp site, the gzip.vim downloaded is older. It will not use the new shellescape function. It has this logic: if v:version 700 || (v:version == 700 has('patch999')) return shellescape(a:name) endif The patched version on the CVS, has the same code but the has() has: has('patch111')) so it will use the new function. I suggest the attached patch, to test function existence directly, rather than patch number. Best regards, Tony. *** runtime/autoload/gzip.vim.orig Mon Oct 9 11:59:07 2006 --- runtime/autoload/gzip.vim Mon Oct 9 11:59:07 2006 *** *** 176,183 endfun fun s:escape(name) !shellescape() was added by patch 7.0.999 ! if v:version 700 || (v:version == 700 has('patch999')) return shellescape(a:name) endif return ' . a:name . ' --- 176,182 endfun fun s:escape(name) ! if exists(*shellescape) return shellescape(a:name) endif return ' . a:name . '
RE: Vim 7.0 (1-109 patches) completion bug.
Thank you, Bill. I can confirm same behaviour as you described with my vim. Now it is up to Bram to decide if this is wrong or right. --- [EMAIL PROTECTED]
Re: [BOF] Killer feature
On 10/7/06, Martin Krischik [EMAIL PROTECTED] wrote: Eclipse-Integration And yes, I already voted on it. I soon have to work with Eclipse - no two ways around it. And I don't think I am the only one. And while Eclipse has tons of features when it comes to text editing it's just another CUA Editor. Don't forget visual studio too!
Patch 7.0.122
Patch 7.0.122 Problem:GUI: When clearing after a bold, double-wide character half a character may be drawn. Solution: Check for double-wide character and redraw it. (Yukihiro Nakadaira) Files: src/screen.c *** ../vim-7.0.121/src/screen.c Thu Sep 14 21:04:09 2006 --- src/screen.cSat Oct 7 15:13:43 2006 *** *** 5079,5093 * character too. If we didn't skip any blanks above, then we * only redraw if the character wasn't already redrawn anyway. */ ! if (gui.in_use (col startCol || !redraw_this) ! # ifdef FEAT_MBYTE !enc_dbcs == 0 ! # endif ! ) { hl = ScreenAttrs[off_to]; if (hl HL_ALL || (hl HL_BOLD)) ! screen_char(off_to - 1, row, col + coloff - 1); } #endif screen_fill(row, row + 1, col + coloff, clear_width + coloff, --- 5079,5116 * character too. If we didn't skip any blanks above, then we * only redraw if the character wasn't already redrawn anyway. */ ! if (gui.in_use (col startCol || !redraw_this)) { hl = ScreenAttrs[off_to]; if (hl HL_ALL || (hl HL_BOLD)) ! { ! int prev_cells = 1; ! # ifdef FEAT_MBYTE ! if (enc_utf8) ! /* for utf-8, ScreenLines[char_offset + 1] == 0 means !* that its width is 2. */ ! prev_cells = ScreenLines[off_to - 1] == 0 ? 2 : 1; ! else if (enc_dbcs != 0) ! { ! /* find previous character by counting from first !* column and get its width. */ ! unsigned off = LineOffset[row]; ! ! while (off off_to) ! { ! prev_cells = (*mb_off2cells)(off); ! off += prev_cells; ! } ! } ! ! if (enc_dbcs != 0 prev_cells 1) ! screen_char_2(off_to - prev_cells, row, ! col + coloff - prev_cells); ! else ! # endif ! screen_char(off_to - prev_cells, row, ! col + coloff - prev_cells); ! } } #endif screen_fill(row, row + 1, col + coloff, clear_width + coloff, *** ../vim-7.0.121/src/version.cSun Oct 8 13:56:53 2006 --- src/version.c Mon Oct 9 22:10:17 2006 *** *** 668,669 --- 668,671 { /* Add new patch number below this line */ + /**/ + 122, /**/ -- How To Keep A Healthy Level Of Insanity: 7. Finish all your sentences with in accordance with the prophecy. /// 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///
Another UTF-8 Issue (with Chinese)
Hi Gurus, I have found another issue with Chinese and UTF-8 combined. When I select 新宋体 (probably called NSimSun on your non-Simplified Chinese Windows box) in gvim with encoding=utf-8, the result of typing `:set guifont?' is: guifont=d0c2cbcecce5:h12:cGB2312 (The `d0...e5' part is in blue colour. D0C2, CBCE, and CCE5 are exactly the GB2312/GBK code points for the three characters 新宋体.) I cannot choose the font by typing `:set guifont=新宋体:h12', so basically I cannot choose it in my _vimrc while using UTF-8. Best regards, Yongwei -- Wu Yongwei URL: http://wyw.dcweb.cn/
Re: Another UTF-8 Issue (with Chinese)
On 10/9/06, Yongwei Wu [EMAIL PROTECTED] wrote: Hi Gurus, I have found another issue with Chinese and UTF-8 combined. When I select 新宋体 (probably called NSimSun on your non-Simplified Chinese Windows box) in gvim with encoding=utf-8, the result of typing `:set guifont?' is: guifont=d0c2cbcecce5:h12:cGB2312 (The `d0...e5' part is in blue colour. D0C2, CBCE, and CCE5 are exactly the GB2312/GBK code points for the three characters 新宋体.) I cannot choose the font by typing `:set guifont=新宋体:h12', so basically I cannot choose it in my _vimrc while using UTF-8. I was not accurate enough. I was able to choose this font by: exec 'set guifont=' . iconv('新宋体', 'utf-8', 'cp936') . ':h12' But I do not think it is a nice way. Best regards, Yongwei -- Wu Yongwei URL: http://wyw.dcweb.cn/
Re: Another UTF-8 Issue (with Chinese)
Yongwei Wu [EMAIL PROTECTED] 写于 2006-10-09 14:19:20: On 10/9/06, Yongwei Wu [EMAIL PROTECTED] wrote: Hi Gurus, I have found another issue with Chinese and UTF-8 combined. When I select 新宋体 (probably called NSimSun on your non-Simplified Chinese Windows box) in gvim with encoding=utf-8, the result of typing `:set guifont?' is: guifont=d0c2cbcecce5:h12:cGB2312 (The `d0...e5' part is in blue colour. D0C2, CBCE, and CCE5 are exactly the GB2312/GBK code points for the three characters 新宋体.) I cannot choose the font by typing `:set guifont=新宋体:h12', so basically I cannot choose it in my _vimrc while using UTF-8. I was not accurate enough. I was able to choose this font by: exec 'set guifont=' . iconv('新宋体', 'utf-8', 'cp936') . ':h12' But I do not think it is a nice way. Best regards, Yongwei -- Wu Yongwei URL: http://wyw.dcweb.cn/ Hi, it seems that Windows require the fontname to be encoded as cp936, or if the '新宋体' is encoded in cp936? Well, whatever you do in Vim, Vim should ask windows for the fontname '新宋体' with cp936 encoding. But what should Vim do then? add a 'fontnameencoding' option? I'd remembered that you have some articles in IBM archive, which said the 'termencoding' should be the encoding of the operating system. Okay, then should Vim be changed to use 'termencoding' as the fontname encoding? I doubt it. Every font has a pure-latin name, it may be safer to use the latin name of the font, (average users may not know how to get the latin name of the font though). -- Sincerely, Pan, Shi Zhu. ext: 2606
What's worng with my .vimrc
I have used this file for years. I got laid off and rehired 10 months later. I was using it steadily for the last 10 years. Then after the 10 months it no longer works. Everything works properly in gvim but it doesn't in vim. I have the function keys programmed, I espically use f1-4. When I hit f1 the screen splits and I get a new file opened. I'm running vim 6.3 on Linux box Gvim 6.3 Here's my .rc version 5.3 set nocp syntax on set hlsearch set incsearch set nf= Note the t here allows tearoff menus, last menu can be teared of with mouse 3 set go=mlbgt set bs=2 allow backspacing over everything in insert mode set laststatus=2 always display a status line at the bottom of window set backup set bex=.bak set exrc set visualbell set et gives spaces for tabs set tf set noml set showcmd set showmode showmatch set tabstop=2 set mouse=a set mousehide set mousemodel=extend set shiftwidth=2 set autoread syntax on set autoindent set ru F1 show buffers map f1 :buffersCR F2 select buffer map f2 :buffer F3 .. next buffer map f3 :nCR F4 .. write then next buffer map f4 :wnCR F5 .. make map f5 :make CR F6 .. make test map f6 :make testCR F7 .. make clean map f7 :make cleanCR F8 .. display erors map f8 :ccCR F9 .. next error map f9 :cnCR F10 .. previous error map f10 :cpCR F11 .. list all errors map f11 :clCR F12 .. unhighlight after search map f12 :nohCR map C-Z C-VC-V map C-Z :shellCR map C-Z :ctrl-z suspending disabled CR Vim color file Maintainer: Surya Last Change: 12/23/2003 10:32:41 . version: 1.0 This color scheme uses a dark background. set background=dark hi clear if exists(syntax_on) syntax reset endif let g:colors_name = koehler hi Normal guifg=white guibg=black hi Scrollbar guibg=darkgray guifg=darkgray hi Menu guifg=black guibg=gray hi SpecialKey term=bold cterm=bold ctermfg=darkred guifg=Blue hi NonTextterm=bold cterm=bold ctermfg=darkred gui=bold guifg=Blue hi Directory term=bold cterm=bold ctermfg=brown guifg=Blue hi ErrorMsg term=standout cterm=bold ctermfg=grey ctermbg=blue gui=bold guifg=White guibg=brown hi Search term=reverse ctermfg=white ctermbg=red gui=bold guifg=#00 guibg=Magenta hi MoreMsgterm=bold cterm=bold ctermfg=darkgreen gui=bold guifg=SeaGreen hi ModeMsgterm=bold cterm=bold gui=bold guifg=White guibg=Blue hi LineNr term=underline cterm=bold ctermfg=darkcyan guibg=brown guifg=white hi Question term=standout cterm=bold ctermfg=darkgreen gui=bold guifg=Green hi StatusLine term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guibg=white guifg=brown hi StatusLineNC term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue hi Title term=bold cterm=bold ctermfg=darkmagenta gui=bold guifg=Magenta hi Visual term=reverse cterm=reverse gui=reverse hi WarningMsg term=standout cterm=bold ctermfg=darkblue gui=bold guifg=cyan guibg=Black hi Cursor guifg=bg guibg=cyan hi Commentterm=bold cterm=bold ctermfg=cyan guifg=#80a0ff hi Constant term=underline cterm=bold ctermfg=magenta guifg=#ffa0a0 hi String term=underline cterm=bold ctermfg=magenta gui=bold guifg=brown guibg=darkgray hi Number term=underline cterm=bold ctermfg=magenta guifg=#00 hi Specialterm=bold gui=bold cterm=bold ctermfg=red guifg=Orange hi Identifier term=underline ctermfg=brown guifg=#40 hi Statement term=bold cterm=bold ctermfg=yellow gui=bold guifg=#60 hi PreProcterm=underline ctermfg=darkblue guifg=#ff80ff hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#60ff60 hi Errorgui=bold guifg=Yellow guibg=Black hi Todo term=standout ctermfg=black ctermbg=darkcyan guifg=Blue guibg=Yellow hi VertSplit guifg=#00 guibg=#00 gui=bold hi link IncSearch Visual hi link Character Constant hi link Boolean Constant hi link Float Number hi link FunctionIdentifier hi link Conditional Statement hi link Repeat Statement hi link Label Statement hi link OperatorStatement hi link Keyword Statement hi link Exception Statement hi link Include PreProc hi link Define PreProc hi link Macro PreProc hi link PreCondit PreProc hi link StorageClassType hi link Structure Type hi link Typedef Type hi link Tag Special hi link SpecialChar Special hi link Delimiter Special hi link
Re: What's worng with my .vimrc
On 10/9/06, Billy Patton [EMAIL PROTECTED] wrote: I have used this file for years. I got laid off and rehired 10 months later. I was using it steadily for the last 10 years. Then after the 10 months it no longer works. Everything works properly in gvim but it doesn't in vim. I have the function keys programmed, I espically use f1-4. F1 show buffers map f1 :buffersCR - What is your $TERM (echo $TERM) - What does this show: :set F1 ? - What does vim show on screen when you do the following: Press i to enter insert mode Press Ctrl-V Press F1 - Which terminal do you use (xterm ,konsole, urxvt, ...); which Linux ? Yakov
RE: What's worng with my .vimrc
Yep that fixed it. I'm back to normal. I had my function keys programmed to edit or change directories when in a xterm, by highlighting and hitting the correct function key. So how can I have both? -Original Message- From: Billy Patton [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 7:56 AM To: 'Yakov Lerner' Cc: vim@vim.org Subject: RE: What's worng with my .vimrc I think I know what it is :) I'm mapping the function keys in my .Xdefaults -Original Message- From: Yakov Lerner [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 6:30 AM To: Billy Patton Cc: vim@vim.org Subject: Re: What's worng with my .vimrc On 10/9/06, Billy Patton [EMAIL PROTECTED] wrote: I have used this file for years. I got laid off and rehired 10 months later. I was using it steadily for the last 10 years. Then after the 10 months it no longer works. Everything works properly in gvim but it doesn't in vim. I have the function keys programmed, I espically use f1-4. F1 show buffers map f1 :buffersCR - What is your $TERM (echo $TERM) - What does this show: :set F1 ? - What does vim show on screen when you do the following: Press i to enter insert mode Press Ctrl-V Press F1 - Which terminal do you use (xterm ,konsole, urxvt, ...); which Linux ? Yakov
Re: Win32 build of updated gvim
On 10/8/06, A.J.Mechelynck [EMAIL PROTECTED] wrote: Yongwei Wu wrote: [...] How to update the runtime files is OS-dependent, but it is usually not much more than a one-liner. On my SuSE Linux system (with bash), I use cd ~/.build/vim/vim70 rsync -avzcP --delete --exclude=/dos/ ftp.nluug.nl::Vim/runtime/ ./runtime/ cd src make installruntime ../inst_rt.log 21 If people have Cygwin installed, this is easy too: cd 'C:\Program Files\Vim\vim70' rsync -avzcP ftp.nluug.nl::Vim/runtime/dos/ . But this will not delete obsolete local files. (the important line is the second one; the third and fourth ones are not necessary if I compile immediately afterwards). Bill McCarthy (on Windows with 4NT.EXE) uses copy /us ftp://ftp.home.vim.org/pub/vim/runtime/dos/*; c:\vim\vim70\ Method I should work on any Unix-like system, including Cygwin if rsync is installed. I don't know whether Method II works with CMD.EXE. No, CMD.EXE is not that good. Best regards, Yongwei -- Wu Yongwei URL: http://wyw.dcweb.cn/
Re: Another UTF-8 Issue (with Chinese)
Hi Shi Zhu, On 10/9/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Yongwei Wu [EMAIL PROTECTED] 写于 2006-10-09 14:19:20: On 10/9/06, Yongwei Wu [EMAIL PROTECTED] wrote: Hi Gurus, I have found another issue with Chinese and UTF-8 combined. When I select 新宋体 (probably called NSimSun on your non-Simplified Chinese Windows box) in gvim with encoding=utf-8, the result of typing `:set guifont?' is: guifont=d0c2cbcecce5:h12:cGB2312 (The `d0...e5' part is in blue colour. D0C2, CBCE, and CCE5 are exactly the GB2312/GBK code points for the three characters 新宋体.) I cannot choose the font by typing `:set guifont=新宋体:h12', so basically I cannot choose it in my _vimrc while using UTF-8. I was not accurate enough. I was able to choose this font by: exec 'set guifont=' . iconv('新宋体', 'utf-8', 'cp936') . ':h12' But I do not think it is a nice way. Best regards, Yongwei -- Wu Yongwei URL: http://wyw.dcweb.cn/ Hi, it seems that Windows require the fontname to be encoded as cp936, or if the '新宋体' is encoded in cp936? Well, whatever you do in Vim, Vim should ask windows for the fontname '新宋体' with cp936 encoding. But what should Vim do then? add a 'fontnameencoding' option? dumpbin /imports gvim.exe | grep -i font 3A CreateFontIndirectA C9 EnumFontFamiliesA 39 CreateFontA 2 ChooseFontA If the ..A functions are used, font names should be converted from `encoding' (UTF-8 in my case) to system default encoding (CP936 in my case, which Vim *knows*). Alternatively, Vim could use the ..W functions, and convert the font names from `encoding' to UTF-16. I do not feel this necessary. Every font has a pure-latin name, it may be safer to use the latin name of the font, (average users may not know how to get the latin name of the font though). I did not know either. The font file is names simsun.ttc, and contains really two fonts: 宋体 (SimSun) and 新宋体 (NSimSun). Vim does not like SimSun (probably because it is not regarded a fixed-width font). I rebooted to another locale to find out the name NSimSun (but I did not try it since I was frustrated by the failure of set guifont=SimSun:h12). It works, so it is one solution. Thanks. Best regards, Yongwei -- Wu Yongwei URL: http://wyw.dcweb.cn/
Replacing '%' in a text file
I have to replace every occurrence of % in a file with % |. I have been effectively replacing text using the following construct: :%s/\text\/replacement/g However when I try to do the following: :%s/\%\/% |/g I am greeted by an error message. Obviously, the % character needs to be treated differently for being replaced. Escap sequence? I cannot figure out how to do it. May be trivial for the gurus here. I will be thankful for a hint. Many thanks in advance. -- Muhammad Farooq-i-Azam __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Replacing '%' in a text file
Hi, Muhammad Farooq-i-Azam wrote: I have to replace every occurrence of % in a file with % |. I have been effectively replacing text using the following construct: :%s/\text\/replacement/g However when I try to do the following: :%s/\%\/% |/g I am greeted by an error message. Obviously, the % character needs to be treated differently for being replaced. Escap sequence? I cannot figure out how to do it. May be trivial for the gurus here. I will be thankful for a hint. normally % is not included in the 'iskeyword' option so it is not considered part of a word. Therefore there can not be the beginning of a word right in front of %. The same is for true for the end of a word immediately after a %. You either have to include % in the 'iskeyword' option by issuing a :set iskeyword+=% before executing your substitute command or use :%s/%/% |/g without '\' and '\', respectively. 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: Replacing '%' in a text file
I have to replace every occurrence of % in a file with % |. I have been effectively replacing text using the following construct: :%s/\text\/replacement/g However when I try to do the following: :%s/\%\/% |/g I am greeted by an error message. Obviously, the % character needs to be treated differently for being replaced. Escap sequence? The error message returned should give a clue regarding the problem (E486: Pattern not found: \%\). Your pattern \text\ works well for words, ensuring that you don't find them as a sub-portion of some other word (such as finding the foo in food, snafoo, or confoosion). However, the \ and \ tokens require a transition from a non-word-character to a word-character (or vice-versa). The % character, by default, is not a key-word character (though this can be altered by changing the 'iskeyword' setting). Unless there is some context in which you *don't* want to replace a % with % |, you can just use :%s/%/% |/g without the \ and \ markers. You can read more about the problematic operators at :help /\ or making them part of the set of characters that constitute a keyword, by reading at :help 'iskeyword' HTH, -tim
Re: Replacing '%' in a text file
I create a test file and was able to replace all % with % | by doing this: :%s/%/% |/g You shouldn't need to escape the % Muhammad Farooq-i-Azam wrote: I have to replace every occurrence of % in a file with % |. I have been effectively replacing text using the following construct: :%s/\text\/replacement/g However when I try to do the following: :%s/\%\/% |/g I am greeted by an error message. Obviously, the % character needs to be treated differently for being replaced. Escap sequence? I cannot figure out how to do it. May be trivial for the gurus here. I will be thankful for a hint. Many thanks in advance. -- Muhammad Farooq-i-Azam __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-754-4592 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim
compile troubles with vim 7.0 on RH 3ES
Hello All, I am new to compiling vim, but a longtime user. I would like to get some of the new features in vim 7.0 but am having trouble compiling it for Red Hat enterprise edition 3ES. There does not appear to be am rpm to just install it, therefor I am trying to compile it. The configure command appears to complete normally. When I type make I get these messages at the end: /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXt.so when searching for -lXt /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXt.a when searching for -lXt /usr/bin/ld: cannot find -lXt collect2: ld returned 1 exit status make: *** [vim] Error 1 I have run compile -disable-gui --without-x and the compile completes normally, but the resulting vim executable does not have the features I need. Any comments or suggestions would be appreciated. Kevin Let us not say that in the greatest of Kevin Sorrentino deeds or in the greatest of men there[EMAIL PROTECTED] is perfection. For in all that thy hand achieves there will always be one falt. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: strange mapping in Latex Suite ?
* Matias Grana on Monday, October 09, 2006 at 10:04:42 -0300: So I have two questions here: why a map on M-i ends up on 'é' ? And what is a good way to change this mapping? I mean, a way which works after an eventual update of LatexSuite. http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-e-acute http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-euro-symbols c -- _B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html
Re: strange mapping in Latex Suite ?
On Mon, Oct 09, 2006 at 06:09:54PM +0200, Christian Ebert wrote: * Matias Grana on Monday, October 09, 2006 at 10:04:42 -0300: So I have two questions here: why a map on M-i ends up on 'é' ? And what is a good way to change this mapping? I mean, a way which works after an eventual update of LatexSuite. http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-e-acute http://vim-latex.sourceforge.net/index.php?subject=faqtitle=FAQ#faq-euro-symbols c -- _B A U S T E L L E N_ lesen! --- http://www.blacktrash.org/baustellen.html Thanks! M.
Setting up netrw
Hello, At present, I copy remote directories using the following one-line command: c:\opt\putty\PSCP.EXE -r -v -l the_user -pw the_password 111.11.11.111:/home/suresh/examples/mcf/vmul . How do I set-up netrw to edit a file such as 111.11.11.111:/home/suresh/examples/mcf/vmul/the_file.c ? And what command do I use inside gvim? Note: I am on Windows XP, remote machine is linux. Pscp.exe is not in my path. Thanks, --Suresh
Re: Setting up netrw
On 10/9/06, Suresh Govindachar [EMAIL PROTECTED] wrote: Hello, At present, I copy remote directories using the following one-line command: c:\opt\putty\PSCP.EXE -r -v -l the_user -pw the_password 111.11.11.111:/home/suresh/examples/mcf/vmul . How do I set-up netrw to edit a file such as 111.11.11.111:/home/suresh/examples/mcf/vmul/the_file.c ? And what command do I use inside gvim? Note: I am on Windows XP, remote machine is linux. Pscp.exe is not in my path. I think you do let g:netrw_scp_cmd=c:/path/to/pscp.exe -l user -pw password -q -batch in vimrc, then vim scp://hostname/path/to/file See :help netrw-pscp Yakov
RE: Setting up netrw
Yakov Lerner Sent: Monday, October 09, 2006 12:32 PM On 10/9/06, Suresh Govindachar [EMAIL PROTECTED] wrote: Hello, At present, I copy remote directories using the following one-line command: c:\opt\putty\PSCP.EXE -r -v -l the_user -pw the_password 111.11.11.111:/home/suresh/examples/mcf/vmul . How do I set-up netrw to edit a file such as 111.11.11.111:/home/suresh/examples/mcf/vmul/the_file.c ? And what command do I use inside gvim? Note: I am on Windows XP, remote machine is linux. Pscp.exe is not in my path. I think you do let g:netrw_scp_cmd=c:/path/to/pscp.exe -l user -pw password -q -batch in vimrc, then vim scp://hostname/path/to/file See :help netrw-pscp Close ... From inside gvim, I tried both of the following: :Nread scp://111.11.11.111/home/suresh/examples/mcf/vmul/manager/manager_vmul.c and :sf scp://111.11.11.111/home/suresh/examples/mcf/vmul/manager/manager_vmul.c But the system command they each resulted in was: c:/opt/putty/pscp.exe -l user -pw password -q -batch '111.11.11.111:home/suresh/examples/mcf/vmul/manager/manager_vmul.c' VID62.tmp.c The preceding system command doesn't work. Two changes need to be made to make it work: 1) Remove the single quotes '' [unknown host with ''] 2) Add a / after the : in :home/suresh [file does not exist without /] I downloaded all sources and built gvim yesterday. --Suresh
Re: Replacing '%' in a text file
Muhammad Farooq-i-Azam wrote: I have to replace every occurrence of % in a file with % |. I have been effectively replacing text using the following construct: :%s/\text\/replacement/g However when I try to do the following: :%s/\%\/% |/g I am greeted by an error message. Obviously, the % character needs to be treated differently for being replaced. Escap sequence? I cannot figure out how to do it. May be trivial for the gurus here. I will be thankful for a hint. Many thanks in advance. -- Muhammad Farooq-i-Azam Which message do you encounter? If it's E486: Pattern not found: \%\ it means that Vim doesn't find a match. I guess the boundary between space and %, or % and space, is not seen as a word boundary. What is 'iskeyword' set to? By default, nothing lower than 48 (0x30 i.e., the digit zero) is a keyword character. Now % is 0x25, i.e., it is not included. Thus it is not seen as part of a word, and therefore it cannot be preceded by a begin-of word or followed by an end-of-word. I suggest the following code snippet: let save_isk = isk setlocal isk+=% %s/\%\/% |/g let l:isk = save_isk If you can afford to replace every percent sign regardless of what precedes or follows it, you can do simply :%s/%/% |/g Best regards, Tony.
Re: compile troubles with vim 7.0 on RH 3ES
Kevin Sorrentino wrote: Hello All, I am new to compiling vim, but a longtime user. I would like to get some of the new features in vim 7.0 but am having trouble compiling it for Red Hat enterprise edition 3ES. There does not appear to be am rpm to just install it, therefor I am trying to compile it. The configure command appears to complete normally. When I type make I get these messages at the end: /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXt.so when searching for -lXt /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXt.a when searching for -lXt /usr/bin/ld: cannot find -lXt collect2: ld returned 1 exit status make: *** [vim] Error 1 I have run compile -disable-gui --without-x and the compile completes normally, but the resulting vim executable does not have the features I need. Any comments or suggestions would be appreciated. Kevin Let us not say that in the greatest of Kevin Sorrentino deeds or in the greatest of men there[EMAIL PROTECTED] is perfection. For in all that thy hand achieves there will always be one falt. Apparently your X11 libraries are incompatible with what Vim expects. In your shell, enter rpm -qa |grep x11 This will give you the names and versions of all your installed X11 packages. You need development packages for everything that Vim uses, and the version number of the development packages must be the same as those of the corresponding non-development packages. I have, among others, xorg-x11-6.8.2-30 xorg-x11-Mesa-6.8.2-30 xorg-x11-Mesa-devel-6.8.2-30 xorg-x11-Xvnc-6.8.2-30.4 xorg-x11-devel-6.8.2-30 xorg-x11-fonts-100dpi-6.8.2-30 xorg-x11-fonts-75dpi-6.8.2-30 xorg-x11-fonts-cyrillic-6.8.2-30 xorg-x11-fonts-scalable-6.8.2-30 xorg-x11-fonts-syriac-6.8.2-30 xorg-x11-libs-6.8.2-30.3 xorg-x11-man-6.8.2-30 xorg-x11-server-6.8.2-30.7 xorg-x11-server-glx-6.8.2-30 and have no problems compiling gvim. I suppose the important ones are xorg-x11, xorg-x11-devel and/or xorg-x11-libs Best regards, Tony.
Folding between #ifdef _DEBUG and #endif
I've got some C++ source code that I'd like to fold away. Basically I want vim to have folds only between #ifdef _DEBUG and the corresponding #endif statement, and nowhere else. My vimfu is a bit weak in this respect so I'm not quite sure how I would go about doing this. Using foldexpr, changing the marker type? Previously I was just manually creating folds, but as you can imagine it gets fairly tedious and it would be great if I could automate it. Your help is much appreciated. -- Kamil Kisiel [EMAIL PROTECTED]
Re: Bug in :(un)lockvar
Bram, I need to create a doubly linked list and since this will cause problem with lockvar, I will just comment the lock/unlockvar commands. I am wondering if you have any plans to fix this issue. The lockvar is a great way to prevent accidental changes (and it already helped me once) so I would rather not comment it. -- Thank you, Hari On Sat, 7 Oct 2006 at 5:56pm, Hari Krishna Dara wrote: On Sat, 7 Oct 2006 at 3:32pm, Bram Moolenaar wrote: Hari Krishna Dara wrote: The :lockvar and :unlockvar commands fail when there is a recursive references. E.g., try the below: :let a = {} :let b = {} :let a.b = b :let b:a = a :lockvar! a E743: variable nested too deep for (un)lock You could of course end up with more complicated indirect recursive references as well, so it should guard against it. Although it's correct as such, I know a trick to detect the same list or dictionary is encountered a second time, and then don't recurse into it. Does that mean you will provide a patch? Also note that it could be a self recursion too (:let a.a = a). Also, just noticed that string() fails as well. :echo string(a) E724: variable nested too deep for displaying This is much harder to avoid. It's very well possible that a list or dictionary appears multiple times without a recursive reference. In that case it should be listed normally. It's not easy to distinguish a normal reference from a recursive reference. Why is it hard to distinguish a direct reference and indirect reference? In any case, this functionality is not much of a use unless you really want to be able to restore the original structure using eval(), but I doubt if string() has special semantics to preserve identities. There are probably others that would fail as well. What others? I just meant there could be others, but I looked at the list there shouldn't be any others. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com