Re: Progressive quickfix buffer / background compilations
I played around a bit more and got to a similar stage that I think everybody else is getting to using --remote commands to progressively update buffers. Here's my current script. This script is a little less sophisticated than Marc's in that it doesn't keep track of the background process' pid but I think that'd be easy to rip from his script. ;) I had to use Ruby because I'm not very experienced with vimscript. (That might be obvious given my vimscript below.) You can see that I go through several options for trying to refresh gvim's quickfix buffer using --remote commands, none of which seem to work right (update it without crashing vim and without disrupting the editing of other buffers). Anyway it is here as a template if somebody has any good ideas to make it work "right". I'll post any future versions of it that I write to this thread, too. " Function for compilation in background with progressively updated quickfix " buffer. " vim:ts=2:sw=2:et:sts nmap :call QuickFixRefresh() imap :call QuickFixRefresh()a vmap :call QuickFixRefresh()v " Runs a command in the background with progressive output in the quickfix " window. Requires gvim (relies on vim server). function! QuickFix(...) if a:0 > 1 let i=1 let command=[] while i<=a:0 let command += [a:{i}] let i += 1 endwhile else let command = a:1 endif ruby << EORUBY module Shell # Escape string so that it interpreted right by sh/bash. # Like Regexp.escape but for shell scripts. def self.escape(string) if string !~ %r{[ "\\]}i string else '"' + string.gsub(%r{(["\\])}i, '\1') + '"' end end # Turn a set of commands such as those from ARGV into a string # that can be passed to IO.popen or `` or similar without messing # up due to spaces in filenames etc. def self.command(args) args.map{|x| escape(x) }.join(' ') end end module VIM # Like evaluate but returns a Ruby array from a VIM array value. def self.evaluate_array(str) evaluate(str).split(/\n/m) end module Quickfix def self.path() "/tmp/vim.quickfix" end def self.truncate() File.open(path, "w") end def self.append(line) File.open(path, "a") do |f| f.print line end end def self.reload() VIM.command("cgetfile #{path}") end end end command = Shell.command(VIM.evaluate_array("l:command")) VIM::Quickfix.truncate VIM.command("copen") fork do IO.popen(command) do |io| io.each_line do |line| # Append the line to the file. VIM::Quickfix.append(line) # Refresh the quickfix buffer in Vim from the file. # No nice way to do this! :( # Here are the alternatives I've played with: # Using VIM.command("cfile ..") here causes errors like: # Xlib: unexpected async reply # because we are in a sub-process and vim gets confused. (?) #VIM::Quickfix.reload # Use --remote-send, to emulate typing the refresh command myself. # This makes the window flicker, takes you out of insert mode, and # generally makes continuing to use gvim impossible while the # compilation progresses. But it doesn't crash vim... #system("gvim", "--remote-send", # ":cgetfile #{VIM::Quickfix.path}") # A variant on that theme. Pre-defined keybinding that works in all # modes. Lots of flickering, same as above. #system("gvim", "--remote-send", "") # Another variation, try using silent! #`gvim --remote-send ':silent! exec "silent! cgetfile #{VIM::Quickfix.path}"'` #break if $? != 0 # Idea: user --remote-expr to call a function we define. An expression # with a side-effect. # This works really really nicely - it doesn't disrupt editing - but # sometimes causes a segment violation which crashes gvim :( #output = `gvim --remote-expr 'QuickFixRefresh()'`.strip # output should be '0' end end end EORUBY endfunction function! QuickFixRefresh() exe "cgetfile /tmp/vim.quickfix" endfunction -- Greg McIntyre
Re: bug in map and complete()
Hi, Hari Krishna Dara wrote: > 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 ListWeeks() > func! ListWeeks() > call complete(col('.'), ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']) > return '' > endfunc > > If you hit , Vim complains about the complete() as not allowed. > > Error detected while processing function ListWeeks: > line1: > E523: Not allowed here I don't know the reason for this restriction, but it is documented under ":help complete()": | Set the matches for Insert mode completion. | Can only be used in Insert mode. You need to use a mapping | with CTRL-R = |i_CTRL-R|. It does not work after CTRL-O or | with an expression mapping. 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)
bug in map 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 ListWeeks() func! ListWeeks() call complete(col('.'), ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']) return '' endfunc If you hit , 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 is not used, like this: inoremap =ListWeeks() and it works fine, but approach is superior and more flexible. Also, while playing with the above (by pressing 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
Re: Java Omni Complete
On Thu, 5 Oct 2006 at 7:28pm, Jason Mills wrote: > 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 I am beginning to experiment with a model that uses BSH's ClassManager to do the completion. This has many limitations, but at least it will make the job much easier and the development itself will be much simper. To make the lookup responsive, I have tried running BSH in nailgun server and it seems to work well, though I only had the JDK classes in the classpath. I have a working import completion, but this is all very rudimentary right now. No guarantees on when I can complete these, as I have too many things going on right now and don't want to burden myself by releasing even pre-alpha code to users. If someone wants to collaborate the development effort, I am ok with it (means I am OK to receive contributions to the code, but NOT ok with feature requests and bug reports :)) I was also experimenting with Eclipse like code generation, and was successful using BSH again to generate a new class. This is the reason why I started working on the forms.vim plugin, as there are too many parameters to input, and requires things like completion of super class and interfaces. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
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/
Re: Font rendering on Mac
hi david, > 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. terminal seems using the antialiased version in both pictures. 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. 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. As Robert Hicks said, Consolas is a font mainly for anti-aliased use. best regards, frank -- frank hellenkamp | interface designer [EMAIL PROTECTED] | mail +49.30.49 78 20 70 | tel +49.173.70 55 781 | mbl +49.1805.4002.243 912 | fax signature.asc Description: OpenPGP digital signature
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: 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 where is, again, a Vim pattern which defines what to search for: for instance, \ 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.
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
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
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 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
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
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
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: Help with emptytags in xml.vim
Kevin Old wrote: [...] Hi Tony, I can't use > 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 -> 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 & (> < and & 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.
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
On 10/5/06, A.J.Mechelynck <[EMAIL PROTECTED]> wrote: 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-> instead (i.e. replacing > by >). Then you will enter %> somewhat later on, to end the tag. Best regards, Tony. Hi Tony, I can't use > 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 -- Kevin Old [EMAIL PROTECTED]
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-> instead (i.e. replacing > by >). Then you will enter %> somewhat later on, to end the tag. Best regards, Tony.
Re: 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 : ? :nnoremap :noh You can learn more at :help :noh -tim
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 : ?
Help with emptytags in xml.vim
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 -- Kevin Old [EMAIL PROTECTED]
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: 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: 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
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. , ? 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 in textfield doesn't let you 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. > - 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: 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 o -- 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: Key remapping doesn't work
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 -- View this message in context: http://www.nabble.com/Key-remapping-doesn%27t-work-tf2382854.html#a6656175 Sent from the Vim - General mailing list archive at Nabble.com.
Re: Colorschemes Need Updating
On Tue 3-Oct-06 7:59am -0600, Charles E Campbell Jr wrote: > Bill McCarthy wrote: > >>I primarily use just one - ps_color - but missed the update. >>I have it now, thanks. I sure wish those Vim Online folks >>had an FTP site so we could easily updated the files we've >>downloaded with a simple shell command once a week or so. > Try GetLatestVimScripts -- > http://vim.sourceforge.net/scripts/script.php?script_id=642 > (also at > http://mysite.verizon.net/astronaut/vim/index.html#VimFuncs > ; see "getscript.tar.gz"). Set up a list of scripts you're > interested in (an example is included with either of the > two downloads) and type > :GLVS > whenever you want updates. That quite a comprehensive script. It not only downloads the files, it also optionally installs most of them. I look forward to studying it - maybe I can figure out how to automate downloading an updated tips file too (I can't download the compressed file from WinXP). Thanks! -- Best regards, Bill
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 o), 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!\" 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()\" 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()\" 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\|" call forms#ShowForm(htmlform) -