BUG: syntax region overlaps keyword *sometimes*
Hello, I have discovered that it is possible for a syntax region to overlap a syntax keyword, even though the region is not contained in the keyword. Take the following code example and apply the syntax commands below: TEST CODE: (is_array($foo)) ( is_array($foo) ) SYNTAX COMMANDS: syntax keyword Function is_array syntax region r1 matchgroup=Typedef start=/array(/ end=/)/ keepend extend Now what is even more odd, if I add another region for the ( and ) arround the test code, the overlap doesn't happen in the first example: syntax region r2 matchgroup=Delimiter start=/(/ end=/)/ keepend extend contains=ALL What is going on here? regards, Peter On Yahoo!7 Caller tones: Replace your ring tone with your favourite sound clip! http://callertones.yahoo7.mnetcorporation.com/ctonesmailtag
Re: BUG: syntax region overlaps keyword *sometimes*
Peter Hodge wrote: Hello, I have discovered that it is possible for a syntax region to overlap a syntax keyword, even though the region is not contained in the keyword. Take the following code example and apply the syntax commands below: TEST CODE: (is_array($foo)) ( is_array($foo) ) SYNTAX COMMANDS: syntax keyword Function is_array syntax region r1 matchgroup=Typedef start=/array(/ end=/)/ keepend extend Now what is even more odd, if I add another region for the ( and ) arround the test code, the overlap doesn't happen in the first example: syntax region r2 matchgroup=Delimiter start=/(/ end=/)/ keepend extend contains=ALL What is going on here? regards, Peter I do not see anything special. For me r1 does not contribute to highlighting at all, and r2 cause parenthesis to be highlighted. I have VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 22 2006 22:03:35) MS-Windows 32 bit GUI version with OLE support Included patches: 1-109 Also with changes from patch 117.
RE: Gvim closing unexpectedly
From: Greg Dunn, Thu, October 05, 2006 9:36 am On 10/4/06, Steve Hall wrote: On Thu, 2006-10-05 at 10:04 +1000, Robbie Gates wrote: i was having problems with gvim hanging when i tried to edit my vimrc. After a bit of sleuthing, i tracked it down to has(tcl) hanging (called from syntax/vim.vim). It appears your post and one on the vim list are related: http://tech.groups.yahoo.com/group/vim/message/74227 http://tech.groups.yahoo.com/group/vimdev/message/45215 Yep, I have cygwin, and yep, the dummy tcl84.dll fixed the problem. I, too, can now confirm that the Cygwin tcl84.dll on path prior to any others causes :echo has(tcl) to hang. Can anyone here using a Windows binary different from those packaged by Cream reproduce this? -- Steve Hall [ digitect dancingpaper com ]
Re: Vim 7.0 (1-109 patches) completion bug.
On Wed 4-Oct-06 10:16pm -0600, Igor Prischepoff wrote: Hi, i think i have found a bug in vim 7.0 Patch level 1-109. Windows version +perl +python (i don't think this matters in this case) here is how to reproduce: gvim -u NONE -U NONE :set complete-=tdon't want complete from tags file - it's not important, just to switch off message :set complete+=longest that's important i now we in insert mode one two oC-N:tC-Nnow trying to complete second time - no completion, nothing i.e. i've got resulting text in buffer like this: one two one:t and no 'two' on second C-N when trying to complete 'two' and message Back at original (First completion works as expected, but second didn't shown and not complete at all) if remove 'longest' from 'complete' then everything works as expected. Can you reproduce that bug? Or it's intended behaviour? I see two issues. The first is independent of adding longest to 'completeopt'. Whenever you get Back at original in the command window, typing additional non-whitespace characters keeps you in a complete mode until you either use whitespace or backspace to the original. I don't see this behavior documented. The second, using :se cot+=longest causes Vim to complete to the longest common text among the matches (starting from the beginning) and completes the typing to that point. Yet it calls this partial completion Back at original even though it clearly is not the original - so you are back to the first issue. BTW, using gvim -u NONE -U NONE is both redundant (in the case of -U NONE), dangerous (since default settings may truncate your viminfo on exit), and put you in vi compatible mode. Better is: gvim -u NONE -i NONE -N An even better approach to getting a more virgin Vim is: gvim.exe -u NONE -i NONE -N --cmd se rtp=$VIMRUNTIME +se rtp That stops making access to personal rtp paths for starting up, and restores the default rtp at the end of startup. -- Best regards, Bill
Re: Missing CursorHold after return from insert to normal ?
Yakov Lerner wrote: CursorHold is suppsed to be triggered in normal mode after updatetime, correct ? But in the scenario below, when vim gets into normal mode after insert mode, CursorHold is not triggered: 1. vim -u NONE -U NONE 2. :let x=0 3. :let ut=200 just some low value 3. :au CursorHold * let x=x+1 | echo x 4. C-EC-EC-E -- watch CursorHold working 5. iiesc wait there's not CursorHold iiesc wait there's not CursorHold iiesc wait there's not CursorHold Why ? Bug or feature ? You don't mention the version number. Does it include patch 7.0.104? Then this patch should fix it: *** ../../vim-7.0.118/src/edit.cTue Oct 3 15:49:20 2006 --- edit.c Thu Oct 5 22:26:27 2006 *** *** 923,928 --- 923,929 if (cmdchar != 'r' cmdchar != 'v') apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL, FALSE, curbuf); + did_cursorhold = FALSE; #endif return (c == Ctrl_O); } -- hundred-and-one symptoms of being an internet addict: 1. You actually wore a blue ribbon to protest the Communications Decency Act. /// 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: Vim 7.0 (1-109 patches) completion bug.
Igor Prischepoff wrote: Hi, i think i have found a bug in vim 7.0 Patch level 1-109. Windows version +perl +python (i don't think this matters in this case) here is how to reproduce: gvim -u NONE -U NONE :set complete-=t don't want complete from tags file - it's not important, just to switch off message :set complete+=longest that's important You must mean 'completeopt' here. i now we in insert mode one two oC-N:tC-Nnow trying to complete second time - no completion, nothing i.e. i've got resulting text in buffer like this: one two one:t and no 'two' on second C-N when trying to complete 'two' and message Back at original (First completion works as expected, but second didn't shown and not complete at all) if remove 'longest' from 'complete' then everything works as expected. Can you reproduce that bug? Or it's intended behaviour? Vim is still in completion mode and there is no word matching one:t thus you don't get any completions. If you type CTRL-N one more time then it works. I can see this is unexpected, perhaps when longest is used and there is only one match it should work as if that match was selected with CTRL-N. -- hundred-and-one symptoms of being an internet addict: 4. Your eyeglasses have a web site burned in on them. /// 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: Vim 7.0 (1-109 patches) completion bug.
Dnia czwartek, 5 października 2006 05:16, Igor Prischepoff napisał: Hi, i think i have found a bug in vim 7.0 Patch level 1-109. Windows version +perl +python (i don't think this matters in this case) here is how to reproduce: gvim -u NONE -U NONE :set complete-=t don't want complete from tags file - it's not important, just to switch off message :set complete+=longest that's important i now we in insert mode one two oC-N:tC-Nnow trying to complete second time - no completion, nothing i.e. i've got resulting text in buffer like this: one two one:t and no 'two' on second C-N when trying to complete 'two' and message Back at original (First completion works as expected, but second didn't shown and not complete at all) if remove 'longest' from 'complete' then everything works as expected. Can you reproduce that bug? Confirming it for 7.0.110 (Linux, GTK2). Or it's intended behaviour? I don't think so. Note, when you press space and later return to the end of one:t it works. m.
Re: Missing CursorHold after return from insert to normal ?
On 10/5/06, Bram Moolenaar [EMAIL PROTECTED] wrote: Yakov Lerner wrote: CursorHold is suppsed to be triggered in normal mode after updatetime, correct ? But in the scenario below, when vim gets into normal mode after insert mode, CursorHold is not triggered: 1. vim -u NONE -U NONE 2. :let x=0 3. :let ut=200 just some low value 3. :au CursorHold * let x=x+1 | echo x 4. C-EC-EC-E -- watch CursorHold working 5. iiesc wait there's not CursorHold iiesc wait there's not CursorHold iiesc wait there's not CursorHold Why ? Bug or feature ? You don't mention the version number. Does it include patch 7.0.104? Yes Then this patch should fix it: *** ../../vim-7.0.118/src/edit.cTue Oct 3 15:49:20 2006 --- edit.c Thu Oct 5 22:26:27 2006 *** *** 923,928 --- 923,929 if (cmdchar != 'r' cmdchar != 'v') apply_autocmds(EVENT_INSERTLEAVE, NULL, NULL, FALSE, curbuf); + did_cursorhold = FALSE; #endif return (c == Ctrl_O); } That fixes it, thanks. Yakov
Re: BUG: syntax region overlaps keyword *sometimes*
--- Ilya Bobir [EMAIL PROTECTED] wrote: Peter Hodge wrote: Hello, I have discovered that it is possible for a syntax region to overlap a syntax keyword, even though the region is not contained in the keyword. Take the following code example and apply the syntax commands below: TEST CODE: (is_array($foo)) ( is_array($foo) ) SYNTAX COMMANDS: syntax keyword Function is_array syntax region r1 matchgroup=Typedef start=/array(/ end=/)/ keepend extend Now what is even more odd, if I add another region for the ( and ) arround the test code, the overlap doesn't happen in the first example: syntax region r2 matchgroup=Delimiter start=/(/ end=/)/ keepend extend contains=ALL What is going on here? regards, Peter I do not see anything special. For me r1 does not contribute to highlighting at all, and r2 cause parenthesis to be highlighted. I have VIM - Vi IMproved 7.0 (2006 May 7, compiled Sep 22 2006 22:03:35) MS-Windows 32 bit GUI version with OLE support Included patches: 1-109 Also with changes from patch 117. Thanks for your help, I had another look and found out you need another syntax command to reproduce it properly. Here is the revised bug report Start vim using vim -u NONE insert the following test code (note that the 4th line must be indented). array($foo) is_array $foo is_array($foo) is_array($foo) Apply the following syntax commands: syn on syn keyword Function is_array syn region r1 matchgroup=Type start=/array(/ end=/)/ syn keyword Error foo containedin=NOTHING You will find that the keyword is_array and region r1 are confused over how to highlight is_array(...) when it doesn't start at the beginning of the line, and it has something to do with the 'foo' keyword having a 'containedin=' option. regards, Peter On Yahoo!7 Break a world record with Total Girl's Worlds Largest Slumber Party http://www.totalgirl.com.au/slumberparty
vim -u NONE (was: Re: Vim 7.0 (1-109 patches) completion bug.)
BTW, using gvim -u NONE -U NONE is both redundant (in the case of -U NONE), dangerous (since default settings may truncate your viminfo on exit), and put you in vi compatible mode. Better is: gvim -u NONE -i NONE -N I wouldn't think the -i option is necessary, because 'viminfo' is empty by default anyway. Perhaps there should be a shell script distributed with vim so that anyone can start up vim cleanly. cleanvim.sh: vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp' cleanvim.bat: gvim.exe -u NONE -i NONE -N --noplugin --cmd set rtp=$VIMRUNTIME +set rtp regards, Peter On Yahoo!7 Men's Health: What music do you want to hear on Men's Health Radio? http://www.menshealthmagazine.com.au/
Re: vim -u NONE (was: Re: Vim 7.0 (1-109 patches) completion bug.)
On 2006-10-06, Peter Hodge [EMAIL PROTECTED] wrote: BTW, using gvim -u NONE -U NONE is both redundant (in the case of -U NONE), dangerous (since default settings may truncate your viminfo on exit), and put you in vi compatible mode. Better is: gvim -u NONE -i NONE -N I wouldn't think the -i option is necessary, because 'viminfo' is empty by default anyway. Perhaps there should be a shell script distributed with vim so that anyone can start up vim cleanly. cleanvim.sh: vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp' cleanvim.bat: gvim.exe -u NONE -i NONE -N --noplugin --cmd set rtp=$VIMRUNTIME +set rtp Setting -u NONE -i NONE -N is all that's needed. See :help -u. When {vimrc} is equal to NONE (all uppercase), all initializations from files and environment variables are skipped, including reading the |gvimrc| file when the GUI starts. Loading plugins is also skipped. The viminfo file may be empty initially, but it probably is not once vim has been run. Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
Re: vim -u NONE
On Thu 5-Oct-06 8:54pm -0600, Gary Johnson wrote: On 2006-10-06, Peter Hodge [EMAIL PROTECTED] wrote: BTW, using gvim -u NONE -U NONE is both redundant (in the case of -U NONE), dangerous (since default settings may truncate your viminfo on exit), and put you in vi compatible mode. Better is: gvim -u NONE -i NONE -N I wouldn't think the -i option is necessary, because 'viminfo' is empty by default anyway. Perhaps there should be a shell script distributed with vim so that anyone can start up vim cleanly. cleanvim.sh: vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp' cleanvim.bat: gvim.exe -u NONE -i NONE -N --noplugin --cmd set rtp=$VIMRUNTIME +set rtp Setting -u NONE -i NONE -N is all that's needed. See :help -u. When {vimrc} is equal to NONE (all uppercase), all initializations from files and environment variables are skipped, including reading the |gvimrc| file when the GUI starts. Loading plugins is also skipped. The viminfo file may be empty initially, but it probably is not once vim has been run. Gary, the reason I use and suggested --cmd se rtp=$VIMRUNTIME is to prevent customizations such as adding all of your colorschemes, compilers, etc. in the Gvim menus, custom icons, etc. --cmd happens before menu.vim is sourced. The reason I use: +se rtp is to have 'rtp' set as by default but without the side effects mentioned above. :h startup For fun start with the above but without the --cmd above but add -V99nocmd. Then include the --cmd above and with -V99wcmd. Finally do a vimdiff on nocmd and wcmd. -- Best regards, Bill
Re: Patch 7.0.111
Bram Moolenaar wrote: Fan Decheng wrote: Bram Moolenaar wrote: Patch 7.0.111 Problem:The gzip plugin can't handle filenames with single quotes. Solution: Add and use the shellescape() function. (partly by Alexey Froloff) Files: runtime/autoload/gzip.vim, runtime/doc/eval.txt, src/eval.c, src/mbyte.c, src/misc2.c, src/proto/misc2.pro [...] I wonder whether it is possible to use execv() instead of escaping the command and then sending it to the shell. How do you think? Vim doesn't have an execv() function. Implementing this properly for all systems isn't that simple. At least you would need to take care of $PATH. Oh, right. Calling the shell requires escaping, and using execv() requires a portability layer and dealing with $PATH. Calling the shell is relatively simpler.
Re: vim -u NONE
On 2006-10-05, Bill McCarthy [EMAIL PROTECTED] wrote: On Thu 5-Oct-06 8:54pm -0600, Gary Johnson wrote: On 2006-10-06, Peter Hodge [EMAIL PROTECTED] wrote: BTW, using gvim -u NONE -U NONE is both redundant (in the case of -U NONE), dangerous (since default settings may truncate your viminfo on exit), and put you in vi compatible mode. Better is: gvim -u NONE -i NONE -N I wouldn't think the -i option is necessary, because 'viminfo' is empty by default anyway. Perhaps there should be a shell script distributed with vim so that anyone can start up vim cleanly. cleanvim.sh: vim -u NONE -i NONE -N --noplugin --cmd 'set rtp=$VIMRUNTIME' '+set rtp' cleanvim.bat: gvim.exe -u NONE -i NONE -N --noplugin --cmd set rtp=$VIMRUNTIME +set rtp Setting -u NONE -i NONE -N is all that's needed. See :help -u. When {vimrc} is equal to NONE (all uppercase), all initializations from files and environment variables are skipped, including reading the |gvimrc| file when the GUI starts. Loading plugins is also skipped. The viminfo file may be empty initially, but it probably is not once vim has been run. Gary, the reason I use and suggested --cmd se rtp=$VIMRUNTIME is to prevent customizations such as adding all of your colorschemes, compilers, etc. in the Gvim menus, custom icons, etc. --cmd happens before menu.vim is sourced. The reason I use: +se rtp is to have 'rtp' set as by default but without the side effects mentioned above. :h startup For fun start with the above but without the --cmd above but add -V99nocmd. Then include the --cmd above and with -V99wcmd. Finally do a vimdiff on nocmd and wcmd. Well, I stand corrected. Thanks for explaining that. I was sure that -u NONE -i NONE -N was as sufficient for gvim as it is for vim. I had no idea that gvim was so insistent on loading certain files. Sure enough, under :help -U it says: Exception: Reading the system-wide menu file is always done. But unfortunately it doesn't go on to say that this implies that 'rtp' will be searched for certain other files, e.g., autoload/paste.vim. I also found this under :help gui-init: To skip loading the system menu include 'M' in 'guioptions'. So to avoid loading _anything_, at the expense of not having any menus, one could start gvim as gvim -N -u NONE -i NONE --cmd 'set go+=M' Regards, Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | Wireless Division | Spokane, Washington, USA
BUG: getwinvar/gettabwinvar returns wrong dictionary w/ patch
When calling getwinvar or gettabwinvar with an empty string as the last argument it is supposed to return a dictionary of the values defined in the specified window. This does not appear to be documented in the help files but it is documented in a comment within getwinvar in eval.c. The current code does not switch the window before calling find_var_in_ht to get the dictionary so it always returns the dictionary for the current window. The attached patch switches the notion of curwin for all input instead of just when retrieving a window local option. -- Geoff Reedy gettabwinvar-dict.patch Description: Binary data
RE: Vim 7.0 (1-109 patches) completion bug.
Well, i still don't understand vim logic behind that process. Let's see more realistic example. gvim -U NONE -u NONE Let's suppose that I am a poor pascal programmer and typing code like this: :set completeopt+=longest :set complete-=t i var one : byte; two : byte; two_and_three : byte; three : byte; // may be this is a word? one:=three; // or next one is a a word? one:=two_and_three; oC-N:=tC-n // completion in second C-N still not working here... // so there is no word? not 'one:=t*' or 't*' words in buffer? // I still thinks it should be considered as a bug. Vim is still in completion mode and there is no word matching one:t Okay, in above example there is 'one:=three' word specially for vim, but still no completion. And why vim looks for 'one:=t' word? ':' and '=' should not be in the 'word', right? I think that vim should looks for 't' words. Because '=' and ':' is not word, it's not part of identifier. Part of line -may be, but not words. thus you don't get any completions. If you type CTRL-N one more time then it works. Sorry,it's not working for me. (1-105 patches) I mean that I'm typing Ctrl-N many times in desperate attempts to get some completion and: no completion absolutely :(. Even when there is multiply matches for t -starting words. And what more strange is that if I'm switching to normal mode and then switch back in insert mode then completion on the same construction one:=tc-n works as expected. Now vim guesses right about ':' and '=' not being parts of a word, but why not from the first attempt? -- Igor.
Re: copy a word without moving cursor
On 10/2/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote: Osho GG wrote: I am already putting this segment in much larger map that does other things on a contents. However, the way I currently do it has a disadvantage that the cursor moves and then it moves back and then the screen flashes - all for nothing really. ayaw or ayiw doesn't work for me because it changes cursor position. So, I want a simple way to find the word at the current cursor position. Its not 100% clear what you want; does :echo expand(cword) illustrate something like what you want? Exactly what I want! Thanks!! Osho Regards, Chip Campbell
Forms example
Dnia środa, 4 października 2006 05:06, Hari Krishna Dara napisał: A new version is available, to try: - Download the below file and put it in your autoload directory: http://haridara.googlepages.com/forms.vim - Start a fresh Vim session and execute: :call forms#demo() The new version has support for listening to changes in the field values. The demo can now automatically lookup city and state when you fill in your zipcode using a webservice (you need wget in the path and need Internet connection). Using this version I wrote example tag form generated from xml data file. It uses simple validation (only two fields: accesskey and dir) acting when leaving field. Playing with it gave me some more ideas: - obligatory fields (and highlighting of that) - single hotkey per form is real problem (try C-Go), at least shortcut should take to *first* field with that letter not last - bug when first field is empty; cursor is placed directly after ':' in label, only Tab is taking it to real field; below workaround is putting always ' ' as value if field is empty. How to use. - open it ;) - correct path to xml/xhtml10s.vim - so % - Form Data about attributes: g:xmldata_{b:html_omni_flavor}[tagname][1] if !exists('g:xmldata_xhtml10s') source ~/.vim/autoload/xml/xhtml10s.vim endif let attrs = g:xmldata_xhtml10s['a'][1] let g:tfList = {} function! g:tfList.actionPerformed(name) if a:name ==# 'ok' let output = \ Output:\n for i in g:formfields if b:curForm.getFieldValue(i) !~ '^\s*$' let output .= i.'='.b:curForm.getFieldValue(i).\\n endif endfor call input(output) redraw else call input('Form cancelled, closing window') return :bw!\CR endif endfunction function! g:tfList.valueChanged(name, oldval, newval) if a:name == 'accesskey' function! UpdateAcckey() if len(b:curForm.getFieldValue('accesskey')) 1 call b:curForm.fieldMap['accesskey'].setValue(' ') endif endfunction return :call UpdateAcckey()\CR elseif a:name == 'dir' function! UpdateDir() if b:curForm.getFieldValue('dir') !~ '^\(\s*\|ltr\|rtl\)$' call b:curForm.fieldMap['dir'].setValue(' ') endif endfunction return :call UpdateDir()\CR endif return '' endfunction let htmlform = g:forms#form.new(Tag a) let g:formfields = [] for attr in sort(keys(attrs)) if len(attrs[attr]) == 0 call htmlform.addTextField(attr, attr.':', ' ', attr[0]) else call htmlform.addComboBox(attr, attr.':', '', attrs[attr], attr[0], 1) endif let g:formfields += [attr] endfor call htmlform.addButton('ok', 'OK', '', 'o', g:tfList) call htmlform.addButton('cancel', 'cancel', '', 'c', g:tfList) call htmlform.setDefaultButton('ok') for field in htmlform.fields if field.type != g:forms#FT_BUTTON call field.setListener(g:tfList) endif endfor vert new exe normal! 30\C-W| call forms#ShowForm(htmlform) -
Re: Key remapping doesn't work
VetteVert wrote: Yakov Lerner-3 wrote: Is your 'nocp' option properly set ? (it must be 'nocp') ? Yakov Yes it is set. I cannot get any keymappings to work... thanks I take that back. This did work (testing...) :map Enter o ESC -- View this message in context: http://www.nabble.com/Key-remapping-doesn%27t-work-tf2382854.html#a6656199 Sent from the Vim - General mailing list archive at Nabble.com.
Re: Forms highlighting
Dnia czwartek, 5 października 2006 01:16, Hari Krishna Dara napisał: I have 6.3 version of cygwin and arrows work fine in rxvt. I stil think your term settings are not right. But this is not really concern forms plugin, though it means we might have to support some other maps that will reliably work in all the terms. C-N, C-P? It should work everywhere and is quite natural for Vim users (IMO). Another thing. Until now I was only playing with demo. Now I tried to do my own form and have one thing to say: Listener stuff is complicated. Can it be done simpler? Do you mean simplify the listener interface, or completely do away with them? Former. - If you mean the former, then the alternative is to accept a function name (this is what my previous version worked). But a big problem with this is that the function has to be global and I hate defining global functions without intending them to be part of API, and I know several others feel the same. The current scheme of expecting a dict object should be more familiar to many, who worked with the newer GUI frameworks (such as Swing and Flex). While not having to define a global dict variable, it also provides a way to create more contextual listeners (you can e.g., put the form that the listener is attached to, without having to modify the listener interface to also expect the form object). I would expect some simplifying in use. For example why explicitly declare them? Create listeners automatically. Check example I send earlier. Core stuff is quite simple, big part of it is overhead dealing with listeners. What do you think are the next priority TODO items before making the first release (or a beta release)? I am thinking if I fix the known issues and implement the items that improve the overall feel of a static form, it will be good enough. Right now, there are too many ways the user can end up in 'modifiable' mode and just remove/change anything, giving the impression that the plugin is not robust). - Pressing Esc in textfield doesn't let you BS into the existing value (need to set backspace=start, but this is global). - Support for radio buttons. - Optional user completion for textfields and comboboxes (no preset data). - Support for disabling fields (greyed out and no editing or focusing). - Validators. Local validation (onBlur event) can be already done. Problem is when doing after pressing OK. Hmm, in fact it can be also done but is boring ;) to do. Some API for that would be good. - For non-editable comboboxes, don't accept a value that is not in the data. - C-N/P in select mode should cancel selection and bring up popup (or do nothing by setting 'keymodel' to empty value, but this is global). - When the focus is moved in, explicitly set the value again, to make sure any fouled up entries are fixed. Don't understand that. Maybe you were thinking about moving out of field (onBlur JavaScript event)? It is already possible. - Detect cusor movements beyond the fields and disable modifiable. This will reduce the chance of accidentally mucking up the form. - Avoid first empty line (in an empty buffer). - Recognize no/empty title. Title may be declared. Make it support for non showing it, like:: let demoform = g:forms#form.new('Address Entry Form', 1) To show it and 0 for non showing it. - Encode the field boundaries (like [], ) in the field itself. This will make some of the logic more generic and will make it more flexible to change them. One change which would be good to introduce before official beta: obligatory fields. As I wrote earlier - full validation if possible but laborious. And declaring it in API should allow for some emphasis (highlighting?). m.
RE: Forms highlighting
I gave the demo a whirl. When you enter the State field the omni completion pops up. You cannot hit escape to get out of this. In fact you must choose something, even if you didn't want to. Entering the Country field. If you cursor is on U, press C. I wanted to just type Canada, but of course C in normal mode changes to end of line. So this wiped out the rest of the line. It seems when the is gone, things get messed up. You can't actually type anything. So I restarted the form. When to USA hit cw, typed in Canaada. Realized my mistake, but my cursor on the a and hit x. Since I was in visual mode this left me with xada. Now use the left and right keys to reposition yourself. Very funky behaviour ending up with the existing characters being repeated many times. Actually it does this with h,l as well. That is all I had a chance to try this morning. Dave
Simple how to unhighlight after search
When I do a search, I have highlighting turned on. I like that. When I have completed I now search for something completely bogus to turn off highlighting. I'm not using F12 and would like to program it to unhighlight F12 .. unhighlight after search map f12 : ?
Re: Help with emptytags in xml.vim
Kevin Old wrote: Hello all, I'm using the xml.vim plugin (http://www.vim.org/scripts/script.php?script_id=1397) and have it working well, but am trying to set a percent tag % % (used with HTML::Mason) as an emptytag. Here's the line in my .vimrc: let g:emptyTags='^\(img\|input\|param\|frame\|br\|hr\|meta\|link\|base\|area\|TMPL_VAR\|TMPL_INCLUDE\|%\)$' All of the tags act as they should and do not try to close except for some weird issue with the % tag. Here's what happens. In HTML::Mason code I can print a variable like this % $variable %. This works fine. But if I try to use this with an object there is a problem. I type the following: % $obj- but when I enter the xml.vim adds a closing tag, so it now looks like this: % $obj-/% It shouldn't add the /% as % is in the emptytags definition above. I can't seem to figure out why this is happening. Any help is appreciated! Thanks, Kevin The of - is seen as ending the (opening) % tag, and since it is preceded by neither / nor % the plugin thinks that a closing tag is missing. Try using % $obj-gt; instead (i.e. replacing by gt;). Then you will enter % somewhat later on, to end the tag. Best regards, Tony.
Re: Gvim closing unexpectedly
On 10/4/06, Steve Hall [EMAIL PROTECTED] wrote: [cross-posting to connect threads] On Thu, 2006-10-05 at 10:04 +1000, Robbie Gates wrote: Hi All, i was having problems with gvim hanging when i tried to edit my vimrc. After a bit of sleuthing, i tracked it down to has(tcl) hanging (called from syntax/vim.vim). It appears your post and one on the vim list are related: http://tech.groups.yahoo.com/group/vim/message/74227 http://tech.groups.yahoo.com/group/vimdev/message/45215 I'm not on a Windows box tonight to track this down, can anyone help us figure out if this is in the binary or runtime? 1. Verify syntax/vim.vim is not corrupt 2. Test the binary: :echo has(tcl) Greg, do you have Cygwin installed? Interesting that this just cropped up twice in two hours, these packages have been downloaded nearly 300 times over 8 days. Yep, I have cygwin, and yep, the dummy tcl84.dll fixed the problem. One difference I have from the dev thread is that my gvim doesn't hang, it just closes. -- Greg
RE: Gvim closing unexpectedly
From: Greg Dunn, Thu, October 05, 2006 9:36 am On 10/4/06, Steve Hall wrote: On Thu, 2006-10-05 at 10:04 +1000, Robbie Gates wrote: i was having problems with gvim hanging when i tried to edit my vimrc. After a bit of sleuthing, i tracked it down to has(tcl) hanging (called from syntax/vim.vim). It appears your post and one on the vim list are related: http://tech.groups.yahoo.com/group/vim/message/74227 http://tech.groups.yahoo.com/group/vimdev/message/45215 Yep, I have cygwin, and yep, the dummy tcl84.dll fixed the problem. I, too, can now confirm that the Cygwin tcl84.dll on path prior to any others causes :echo has(tcl) to hang. Can anyone here using a Windows binary different from those packaged by Cream reproduce this? -- Steve Hall [ digitect dancingpaper com ]
C++ IDE
Hi all, after being fed up by Eclipse's slowness/memory usage, I've decided to see if Vim could replace it. I've already found numerous nice plugin's that each implement part of the functionality of Eclipse: - quickfix - clewn/vimgdb - Taglist - Project Configuring it all to work nicely together is another matter. I could of course spend a couple of days learning how to write vim scripts and rolling my own solution. But as I'm probably not the first to try to use Vim as an IDE, there must be a nice all-in-one solution out there somewhere. Or that's what I thought anyway. I can't seem to find any! Is the anything like Cream that turns Vim into a development environment? I'm thinking about something that includes all those plugins and has easy-to-remember shortcut keys mapped to actions such as build, debug, name completion etc. While we're at it... I recently installed Cream and I very much like the shortcut key mappings. Unfortunately, Cream disables Vim's modes by default. The option of Creamlite behaviour enables modes, but removes (most of) the shortcut key mappings along with it. Is there any way to have the best of both worlds? Regards, Brecht
Re: Help with emptytags in xml.vim
Kevin Old wrote: [...] Hi Tony, I can't use gt; in place of the - I'm writing perl, not html. The % % tags basically do a print $obj-obj_var for me if I used it like this % $obj-obj_var %. Kevin Have you tried? If it's within an XML file, then the XML user-agent (the program which handles the XML text) should translate -gt; to - before passing it to perl (or anything). Similarly, when writing a URI to be passed to a program (be it cgi, php or whatever) the separating the arguments must be written amp; (gt; lt; and amp; are the three entities which are standard not only in all versions of standard HTML but in standard XML too). If the file containing those strings is _not_ valid XML, then I guess you shouldn't be using the xml.vim plugins. Best regards, Tony.
Re: C++ IDE
On 10/5/06, Brecht Machiels [EMAIL PROTECTED] wrote: But as I'm probably not the first to try to use Vim as an IDE No, you're not. The issue is not that you're trying to use vim as an IDE, it is that you're trying to use vim as Eclipse. Define IDE. When I use vim as an IDE, I use things like ctags to jump around files, change things here and there, run :make, etc etc taglist is nice. So are clewn/vimgdb, but not as much as raw gdb. Now, if you want vim to write makefiles and things for you, that's another story. I have a feeling this is what you want - a step to integrate build these files. Things like Eclipse / Visual Studio have a files listing which is used to know which files to compile / embed / whatever. make does this just fine, and better, IMO, but requires you to write a Makefile. I guess I could answer better if you defined what an IDE is to you. I get mixed answers on this when I ask people. In short: you are trying to use vim like tools you are used to. It doesn't work that way. vim is vim. It is not Eclipse.
RE: C++ IDE
Just to add to what you said about IDE, I moved from MSVC++ to vim. I had to write my own make file, big++ for future. I eventually programmed my function keys to do Make Make clean Make test First error Next error Previous error List all errors It was no where as nice as mscv++ but after the transition, I will never go back to an ide On my pc now I use cygwin for all my unix compatible work, which is my entire world. -Original Message- From: Aaron Griffin [mailto:[EMAIL PROTECTED] Sent: Thursday, October 05, 2006 12:50 PM To: Brecht Machiels Cc: vim@vim.org Subject: Re: C++ IDE On 10/5/06, Brecht Machiels [EMAIL PROTECTED] wrote: But as I'm probably not the first to try to use Vim as an IDE No, you're not. The issue is not that you're trying to use vim as an IDE, it is that you're trying to use vim as Eclipse. Define IDE. When I use vim as an IDE, I use things like ctags to jump around files, change things here and there, run :make, etc etc taglist is nice. So are clewn/vimgdb, but not as much as raw gdb. Now, if you want vim to write makefiles and things for you, that's another story. I have a feeling this is what you want - a step to integrate build these files. Things like Eclipse / Visual Studio have a files listing which is used to know which files to compile / embed / whatever. make does this just fine, and better, IMO, but requires you to write a Makefile. I guess I could answer better if you defined what an IDE is to you. I get mixed answers on this when I ask people. In short: you are trying to use vim like tools you are used to. It doesn't work that way. vim is vim. It is not Eclipse.
Re: C++ IDE
Hi, [Using vim as an IDE] Of course, there are many who use vi as an IDE and I think many use it differently. Does anyone know a good information source where I can see _how_ people are using vim as an IDE? I know http://www.vim.org/tips/tip.php?tip_id=1119 How to use Vim like an IDE and http://www.vim.org/tips/tip.php?tip_id=3 use vim to quickly compile java files. (I see some of you writing you defined shortcuts, list errors, use ctags,... - where can I get an overview or an introduction on how to do all this?) Thanks, James
Re: C++ IDE
Hello Aaron, Now, if you want vim to write makefiles and things for you, that's another story. I have a feeling this is what you want - a step to integrate build these files. No. I was looking into build systems for that. I'm very disappointed by what's on offer though. I given Boost.build V2 a shot, but it is over-complex. Or at least the documentation isn't good enough. I also tried SCons. It seems alot more intuitive. But according to http://www.gamesfromwithin.com/articles/0509/000100.html it is rather slow (if that article is to be trusted). Jam is dead, but FTJam seems to be alive. I think I'll try that next (but first check to see if they have some decent docs). Things like Eclipse / Visual Studio have a files listing which is used to know which files to compile / embed / whatever. make does this just fine, and better, IMO, but requires you to write a Makefile. I have written makefiles in the past. However, I'd like to be able to build my projects on several platforms. From what I hear the autotools require you to read tons and tons of documentation. I guess I could answer better if you defined what an IDE is to you. I get mixed answers on this when I ask people. In short: you are trying to use vim like tools you are used to. It doesn't work that way. vim is vim. It is not Eclipse. I just used IDE to describe what I was thinking of. What I mean exactly is that I simply want to have all those plugins nicely integrated with keys mapped to them for easy access. As soon as I got that (and found a decent build system), I'll be perfectly satisfied :) Regards, Brecht
Re: C++ IDE
On 10/5/06, Brecht Machiels [EMAIL PROTECTED] wrote: Hello Aaron, Now, if you want vim to write makefiles and things for you, that's another story. I have a feeling this is what you want - a step to integrate build these files. No. I was looking into build systems for that. I'm very disappointed by what's on offer though. I given Boost.build V2 a shot, but it is over-complex. Or at least the documentation isn't good enough. I also tried SCons. It seems alot more intuitive. But according to http://www.gamesfromwithin.com/articles/0509/000100.html it is rather slow (if that article is to be trusted). Jam is dead, but FTJam seems to be alive. I think I'll try that next (but first check to see if they have some decent docs). While this is a tad offtopic, I will touch on this below. Things like Eclipse / Visual Studio have a files listing which is used to know which files to compile / embed / whatever. make does this just fine, and better, IMO, but requires you to write a Makefile. I have written makefiles in the past. However, I'd like to be able to build my projects on several platforms. From what I hear the autotools require you to read tons and tons of documentation. autotools != Makefile I dislike autotools. I write makefiles by hand. Not Makefile.am files, but actual Makefiles. I just used IDE to describe what I was thinking of. What I mean exactly is that I simply want to have all those plugins nicely integrated with keys mapped to them for easy access. As soon as I got that (and found a decent build system), I'll be perfectly satisfied :) Most of these plugins come with a function to toggle/show whatever UI you want. It's a vimrc one-liner to bind it to a key. i.e. doing something like this: http://phraktured.net/screenshots/ss-20060427211348.png is two keypresses (except the help screen). That screenshot is just an omg look at all the crap screenshot. I actually used it to help someone further describe what an IDE means to them (I get into conversations like this alot). As for build systems, there's alot of the integrated into vim. :make doesn't necessarilly call make - it uses makeprg (set via the 'compiler' option). You can use this to easilly expand to whatever build system you want - there's alot already there and on vim.org. Now, rant time. A fully cross platform build system is a fallacy. Unless you're unduely smart, you'll run into a problem *somewhere*. Doing everything zomgcrossplatform requires layers and layers of additional complexity to push things into common denominator land. I prefer, instead, to embrace the differences. As I stated, I like to write makefiles by hand. I also prefer the OS/host based makefile concept: Makefile just passing things off to the correct Makefile.linux or Makefile.solaris or Makefile.mingw. GNU make, or some version thereof is on most systems anyway - at least more than bjam or python+scons or perl+cons. People are scared of Makefiles because of the abomination autotools have cause them to be. Try writing them by hand without autotools a few times. rant over
Re: C++ IDE
Hello, I have written makefiles in the past. However, I'd like to be able to build my projects on several platforms. From what I hear the autotools require you to read tons and tons of documentation. autotools != Makefile I dislike autotools. I write makefiles by hand. Not Makefile.am files, but actual Makefiles. Oops... What I wrote there does look a tad confusing indeed :) The autotools sentence should've been added to my paragraph about the build tools. Most of these plugins come with a function to toggle/show whatever UI you want. It's a vimrc one-liner to bind it to a key. i.e. doing something like this: http://phraktured.net/screenshots/ss-20060427211348.png is two keypresses (except the help screen). That screenshot is just an omg look at all the crap screenshot. I actually used it to help someone further describe what an IDE means to them (I get into conversations like this alot). As for build systems, there's alot of the integrated into vim. :make doesn't necessarilly call make - it uses makeprg (set via the 'compiler' option). You can use this to easilly expand to whatever build system you want - there's alot already there and on vim.org. I know it's not *that* much work. But I know that when I start messing around with such things, I'll end up tweaking it for days on end. I was hoping someone would reply and say go to this website and download that nicely set up Vim 'IDE' configuration :) Now, rant time. A fully cross platform build system is a fallacy. I'm actually starting to think that you are absolutely correct. If I had more time, I'd probably try to prove us wrong, but that'll never happen :) Perhaps I can still use Jam as an easier and faster make (if it is indeed as fast as that article claims). Regards, Brecht
RE: C++ IDE
From: Brecht Machiels, Thu, October 05, 2006 1:07 pm While we're at it... I recently installed Cream and I very much like the shortcut key mappings. Unfortunately, Cream disables Vim's modes by default. The option of Creamlite behaviour enables modes, but removes (most of) the shortcut key mappings along with it. Is there any way to have the best of both worlds? Of course, Cream *IS* Vim, it uses 100% Vim commands and binaries. You should be able to use it's Expert Mode and turn off insertmode. But this is OT for this list, please email me privately or use the Cream lists if you want to discuss the Cream configuration further. -- Steve Hall [ digitect dancingpaper com ]
Re: C++ IDE
James Oliver wrote: Hi, [Using vim as an IDE] Of course, there are many who use vi as an IDE and I think many use it differently. Does anyone know a good information source where I can see _how_ people are using vim as an IDE? I know http://www.vim.org/tips/tip.php?tip_id=1119 How to use Vim like an IDE and http://www.vim.org/tips/tip.php?tip_id=3 use vim to quickly compile java files. (I see some of you writing you defined shortcuts, list errors, use ctags,... - where can I get an overview or an introduction on how to do all this?) Thanks, James To know how to use Vim (as Vim or as anything else that it can be used as), read the help. ;-) OK, I know it's a tall order. The Vim help is unbelievably complete, but that also means unbelievably bulky. (TANSTAAFL.) But there are several ways to use it. - Cover-to-Cover (not very useful). Start by hitting F1. When you come to the end of that file, you will see a list of other help files. Tackle them one after the other. -- This method should work, in theory, but IMHO it is not the best one for this purpose, among other reasons because it is too tedious. - The Dictionary Game: start anywhere, and when a link (in gvim, something displayed in dark green) looks interesting, follow it, either by double-clicking it with the mouse or by hitting Ctrl-] with the cursor on it. Repeat at will. - Helptag menu completion: First, set menu completion mode: :set wildmenu That's once and for all. You can write it into your vimrc (see :help vimrc). Then, type :help (without the quotes) followed by part of a help topic name, or by a Vim pattern (see :help pattern-overview) which might match something that interests you. Instead of completing your command with the Enter key, hit the Tab key instead. The bottom status line (where you normally see the file name -- if using split windows, the name of the file in the lower split window) will become a menu of possible entries (if there are two or more: if there is only one you will see it on the command-line). Select by hitting the left and right arrow keys, then hit Enter to accept or Esc to cancel. - Searching the whole text of all helpfiles: :helpgrep pattern where pattern is, again, a Vim pattern which defines what to search for: for instance, \word\ where \ and \ represent word boundaries. When Vim has searched all the help for matches, it will show the first one (if any). Use :cn[ext], :cp[revious] (or :cN[ext]), :cfir[st] (or :cr[ewind]), :cla[st] to navigate the list of matches, or :cope[n] to show all the matching lines in a split window (see :help quickfix). (In all cases without the quotes and brackets, and you can include or omit all or part of the text in brackets). Best regards, Tony.
Java Omni Complete
Hi Vimmers, I have searched the Internet and vim.org for an omni complete function/script for java (i.e. javacomplete.vim), but have had no luck. Does anyone know if such a script/function exists? Jason
Re: Font rendering on Mac
Hi Frank I've been using the new 'Consolas' font from the Vista font pack for my vim editing on my Mac for a month or so without problems. This font looks amazing, but _only_ when anti-aliased, otherwise it looks like a mess. The other day, I setup a second mac here, and was trying to get it to render Consolas the same as on my first machine. It simply refuses to render properly. See http://dagsolutions.ca/vim_brokenfonts1.png and http://dagsolutions.ca/vim_brokenfonts2.png for the working and non-working screenshots respectively. I've got a terminal running top in the background, using Consolas as well, to show that the font works equally well on both machines in Terminal.app. have you tested this in other software than vim (terminal etc.) in tha not anti-aliased version? should be the same result. Yes, it looks just as ugly when anti-aliasing is disabled in other apps :) terminal seems using the antialiased version in both pictures. Right, that was to demonstrate that Terminal is able to render it just fine antialiased on both machines, while vim seems unable to do the same. it could be, that this font (i haven't used it myself), is not well hinted or not yet hinted, or not hinted for this specific font size, which is very small indeed. It's hinted only for a few sizes, including this (yes, very) small size - 9pt. I like to keep my screen real estate, and pretend I have a 30 monitor! :) truetype and opentype fonts can be optimized for output in small sizes. verdana, tahoma etc. are very well hinted, but there are many fonts that aren't, which gives bad results in small sizes, when no anti-aliasing is used. Well, it looks fine on my macbook pro, where anti-aliasing works. The real question becomes, why won't antialiasing work on my other mac? Dave -- Dave Goodlad [EMAIL PROTECTED] or [EMAIL PROTECTED] http://david.goodlad.ca/
bug in map expr and complete()
The help on complete() gives an example as a usage pattern which seems to be very useful, but it doesn't work. Here is a slightly modified example to avoid breaking the lines in email transmission: inoremap expr F5 ListWeeks() func! ListWeeks() call complete(col('.'), ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']) return '' endfunc If you hit F5, Vim complains about the complete() as not allowed. Error detected while processing function ListWeeks: line1: E523: Not allowed here I am assuming that this is another place where the code is too strict than required (like setting :compiler in a FileChangeRO handler that I reported long back). I tried to modify this such that expr is not used, like this: inoremap F5 C-R=ListWeeks()CR and it works fine, but expr approach is superior and more flexible. Also, while playing with the above (by pressing F5 repeatedly while opening new lines) I observed that occassionally, Mon gets inserted instead of Sun. I can't find a reproduciable case other than trying to bring up popup several times (happened twice while trying may be about 20 times). I have observed this in general while using the complete() function that Vim advances one too many items in the completion list (happens very often with my LookupFile plugin). -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com