I have updated it again. The main difference is some syntax highlighting rules and some tweaks. I also changed the hotkey to link to Underlined, which has both a color as well as underscore by default (and I doubt any colorscheme change this). I also added a few extra rules/conditions to highlight the right hotkey as well as the boundaries of fields and button labels.
-- Thanks, Hari On Mon, 2 Oct 2006 at 5:33pm, Hari Krishna Dara wrote: > My comments below. If anyone is still interested to try, here is how you > do it: > > - 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() > - Optionally, remove the downloaded file after you are done trying. > > It is very easy and safe to try it (I hope I haven't scared away folks > with the warning in my previous email :) > > On Tue, 3 Oct 2006 at 1:31am, Mikolaj Machowski wrote: > > > Hello, > > > > Below patch to yesterday version of forms.vim . > > > > Rather proof of concept than full solution but looks much nicer: > > > > Features: > > > > - highlight header of form in Comment > > - highlight labels of fields as Questions > > - hightlight hotkeys as Statements > > I applied your patch and it looks very nice, thanks for taking the time. > One minor problem is that if the hotkey repeats multiple times in the > label, it is highlighted multiple times. > > > > > Limitations: > > > > - Buttons are not supported > > We can also highlight checkboxes and comboboxes differently. > > > Problems with current version of forms: > > > > - arrows doesn't work in terminal. They are completely messing things > > eg. destroy knowledge about default value. > > Do arrows work like j and k outside form? Since I am mapping <Up> and > <Down> keys, as long as they work outside form, I am assuming they > shoudl work inside form also. > > > - when there is more than one the same character as hotkey repeating > > hotkey doesn't cycle between them. It stucks with last entry with that > > hotkey > > I noted this down as a limitation for now. We can look at it later. I am > creating a map of hotkey->field which will obviously not work if the > same hotkey is used multiple times. > > On Mon, 2 Oct 2006 at 10:28am, Mikolaj Machowski wrote: > > > Maybe not all. You should catch "only" switching between major modes > > and vertical movement. The rest isn't so important. > > When you Tab into the fields, the values are first selected so that the > user can easily overwrite it (like most GUIs do). However, the user can > press <Esc> once to get into the normal insert mode and change the > values (there is currently a known issue with this that you can't change > the value, unless 'backspace' has "start"). If you want, you can press > <Esc> again to get into the normal mode to move around, but this will > put the buffer in a 'readonly' state, so when you find the field that > you want to edit, you can press <Space> on the field to get back into > edit mode. Let me know if you have ideas on how this can be improved. > > > After some consideration <C-K> wasn't best suggestion. I think in such > > forms is bigger probability of digraphs than somewhere else. Other > > possibilities; <C-F> (may break behave mswin and/or Cream - obvious > > client of such script); <C-D/T> no mnemonic value but are covering > > indenting mappings. > > How about using <C-G>? i_CTRL_G is used to move around the buffer, which > we prevent anyway, and it could be a good mnemonic too. > > > Maybe you are right. I am biased here - I hate buffer management and if > > someone else can take care about that... ;) > > I agree, buffer management is messy, which is why putting the task on > the user makes it a little easier for the first version to get out :) > > I have now uploaded a version with your changes. > > http://haridara.googlepages.com/forms.vim > > This version also contains an API to create forms. The forms#demo() > function shows you how to use the API. You can invoke it as: > > :call forms#demo() > > I will enhance the demo with some buffer management as a suggested > pattern for the users. > > Are you interested to use the forms for any of your plugins or are you > just helping me out? :) (in either case, many thanks). > > I wish more people will come forward to try and give feedback, > especially that it is so easy to try it. > > -- > Thanks, > Hari > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com