Re: forms support for Vim
Dnia poniedziałek, 2 października 2006 01:41, Hari Krishna Dara napisał: > First, a big thank you for trying it and giving feedback. > > On Sun, 1 Oct 2006 at 4:11pm, Mikolaj Machowski wrote: > > Hello, > > > > Interesting concept. The most difficult thing are Vim habits. Seeing > > spelling error in line before I tend to make k than which > > is obviously messing things. > > Yes, that will be a problem, For short forms, this will not be much of a > problem, as you don't expect to spend a lot of time on them (that is > when your inherent habits start to show up). Covering all the vim > movement commands and supporting them will be a lot of pain and > maintenance. Maybe not all. You should catch "only" switching between major modes and vertical movement. The rest isn't so important. > > Avoid mappings. They don't always and everywhere work. Better use > > something like f to go to the First name field. > > Good comment, I am now mapping both the meta keys as well as your > suggested keys. After some consideration wasn't best suggestion. I think in such forms is bigger probability of digraphs than somewhere else. Other possibilities; (may break behave mswin and/or Cream - obvious client of such script); no mnemonic value but are covering indenting mappings. > > > Hotkey emphasis should be rather done with syntax highlighting, not > > underscore (not always available). > > I took note of this. I don't have much idea of how to implement syntax > coloring right now. You know where key label ends. Use \% > Full version should take care about creation and destruction of > > buffer. With all this mappings it is tricky. > > For the first implementation, this is not important. With all the > mappings, it is hard for the plugin to manage a single buffer for all > the forms. E.g., if clicking on a button should bring up another form, > then it is better to use a different buffer. It is easier for the client > of forms plugin to create a new window with a new temp buffer and show > forms, and wipe it off at the end. Handling this inside forms plugin > will need more thought. Your comments are welcome. Maybe you are right. I am biased here - I hate buffer management and if someone else can take care about that... ;) > Thanks again for your feedback. I uploaded the new version here: > > http://haridara.googlepages.com/forms.vim > I will check it in the evening. m.
Re: forms support for Vim
First, a big thank you for trying it and giving feedback. On Sun, 1 Oct 2006 at 4:11pm, Mikolaj Machowski wrote: > Hello, > > Interesting concept. The most difficult thing are Vim habits. Seeing > spelling error in line before I tend to make k than which > is obviously messing things. Yes, that will be a problem, For short forms, this will not be much of a problem, as you don't expect to spend a lot of time on them (that is when your inherent habits start to show up). Covering all the vim movement commands and supporting them will be a lot of pain and maintenance. > >- Use in fields to cancel changes and restore old value. > > This doesn't work. > > I am getting 17|v$h Sorry, I broke this later. As I said, it was meant to be a proof-of-concept, so I wasn't really testing all the features :) > Cannot accept entry from combobox, CTRL-Y jumps to first element, > anything else doesn't work or insert 17|v$h. Fixed. > thing is inserted also when hitting twice. Fixed. > > I would appreciate any kind of feedback on this. > > Random remarks: > > After completely removing of entry tabbing goes wild (it works only from > first entry to removed one). Fixed. > Combobox (Zip-code) is only drop-down menu: in combobox you should be > able to insert your own values. This will be a editable combobox, and I didn't implement it as of last time (it was there in the TODO), however it is now implemented and the Country field in the demo allows you to do this. > Avoid mappings. They don't always and everywhere work. Better use > something like f to go to the First name field. Good comment, I am now mapping both the meta keys as well as your suggested keys. > Introduce Arrows (, ) navigation. Although Tab works > everywhere doesn't work in terminal. Currently , are > extending visual selection to other fields. Good comment again, both work now. On combobox, the in addition opens up the popup (if not already open). When open, you can only out forwards or out backwards, but when not open You can also use out backwards (but as I said will popup completion). > Hotkey emphasis should be rather done with syntax highlighting, not > underscore (not always available). I took note of this. I don't have much idea of how to implement syntax coloring right now. > Full version should take care about creation and destruction of buffer. > With all this mappings it is tricky. For the first implementation, this is not important. With all the mappings, it is hard for the plugin to manage a single buffer for all the forms. E.g., if clicking on a button should bring up another form, then it is better to use a different buffer. It is easier for the client of forms plugin to create a new window with a new temp buffer and show forms, and wipe it off at the end. Handling this inside forms plugin will need more thought. Your comments are welcome. Thanks again for your feedback. I uploaded the new version here: http://haridara.googlepages.com/forms.vim I will add API to create forms and a few other things next. I have to implement some more features (especially the user-completion on fields) before I can start using it for myself. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: forms support for Vim
Hello, Interesting concept. The most difficult thing are Vim habits. Seeing spelling error in line before I tend to make k than which is obviously messing things. >- Use in fields to cancel changes and restore old value. This doesn't work. I am getting 17|v$h Cannot accept entry from combobox, CTRL-Y jumps to first element, anything else doesn't work or insert 17|v$h. thing is inserted also when hitting twice. > I would appreciate any kind of feedback on this. Random remarks: After completely removing of entry tabbing goes wild (it works only from first entry to removed one). Combobox (Zip-code) is only drop-down menu: in combobox you should be able to insert your own values. Avoid mappings. They don't always and everywhere work. Better use something like f to go to the First name field. Introduce Arrows (, ) navigation. Although Tab works everywhere doesn't work in terminal. Currently , are extending visual selection to other fields. Hotkey emphasis should be rather done with syntax highlighting, not underscore (not always available). Full version should take care about creation and destruction of buffer. With all this mappings it is tricky. m.
Re: forms support for Vim
I couldn't actually hold myself from doing some more work on this, so I added support for comboboxes (had to prove to myself that this is possible) and checkboxes. Now the sample form is a complete address entry with a combobox for state selection and checkbox to specify if it is a billing address. I forgot to mention this, please try the plugin only in a fresh Vim instance, and don't use it in your regular Vim session. It is a pre-alpha quality code and though it is likely to erase your harddrive, it could probably do some harmful things such as crashing your Vim session resulting in loosing work. I am not liable for any damage it might cause. -- Thanks, Hari On Sat, 30 Sep 2006 at 6:01pm, Hari Krishna Dara wrote: > > As I was building complex code generation framework, I realized that > asking for user input for several options is cumbersome and unproductive > (especially when most of the options are anyway defaulted). I have seen > some very clever use of dialogs in the form of wizards before (I think in > the cream project), but it is cumbersome to build and not to my taste > either. All that I need is a very simple presentation of a form with > data and allow the user to change only the fields that are required, so > I started experimenting and came up with a few maps that allow form like > features such as tabbing between fields and pressing buttons. > > It works somewhat like the plugin that allows you to see and change Vim > settings in a buffer (can't recollect where I saw it), but allows ad-hoc > building of forms, more like a GUI (with no frills), so plugins can > define forms and show them for user input. It has a very simple > interface and forces some habbits on the user, but I think it is still > much better than not having anything. With some more improvements > (especially the syntax coloring) and more widget support, it can be very > useful. > > The plugin is still in a proof-of-concept stage, but you can actually > define forms and play with them. Before I go ahead and spend a lot more > time, I thought it is wise to get the opinion of the experts here and > get the feedback as a whole (and may be even generate some interest for > contribution). It is available from: > > http://haridara.googlepages.com/forms.vim > > I have included the definition of a demo form so to try, all that you > need to do is download the above file and put in your autoload directory > and execute: > > :call forms#ShowForm(forms#form) > > The hotkeys are not currently highlighted, but they are functional, so > try pressing the first letter of field names with the meta combination > (e.g., for the "First Name:" field). > > Here are the features that I implemented so far: >- Supports "textfield" and "button" fields. >- Supports tabbing between fields. >- Hotkeys to jump to a field directly. >- Listeners for actions on buttons. >- Use in fields to cancel changes and restore old value. >- Support for "default button" by hitting anywhere. > > I think support for combobox and checkbox will make this truly > distinguishable from using dialogs and such. Vim7 popup completion will > be a great fit for implementing combobox. Here are the TODO items I have > noted so far: >- Constructors/utilties for creating form objects (createForm(), addField() > getField(), etc.). >- Syntax highlighting: > - labels > - Buttons > - Hotkey (underline) >- ComboBox using completion popup. Optional user completion. >- CheckBox using True/False combobox or "[x]" style buttons. >- Support for disabling fields. >- Mouse support. >- Trap and disable 'modifiable' > > I would appreciate any kind of feedback on this. > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
forms support for Vim
As I was building complex code generation framework, I realized that asking for user input for several options is cumbersome and unproductive (especially when most of the options are anyway defaulted). I have seen some very clever use of dialogs in the form of wizards before (I think in the cream project), but it is cumbersome to build and not to my taste either. All that I need is a very simple presentation of a form with data and allow the user to change only the fields that are required, so I started experimenting and came up with a few maps that allow form like features such as tabbing between fields and pressing buttons. It works somewhat like the plugin that allows you to see and change Vim settings in a buffer (can't recollect where I saw it), but allows ad-hoc building of forms, more like a GUI (with no frills), so plugins can define forms and show them for user input. It has a very simple interface and forces some habbits on the user, but I think it is still much better than not having anything. With some more improvements (especially the syntax coloring) and more widget support, it can be very useful. The plugin is still in a proof-of-concept stage, but you can actually define forms and play with them. Before I go ahead and spend a lot more time, I thought it is wise to get the opinion of the experts here and get the feedback as a whole (and may be even generate some interest for contribution). It is available from: http://haridara.googlepages.com/forms.vim I have included the definition of a demo form so to try, all that you need to do is download the above file and put in your autoload directory and execute: :call forms#ShowForm(forms#form) The hotkeys are not currently highlighted, but they are functional, so try pressing the first letter of field names with the meta combination (e.g., for the "First Name:" field). Here are the features that I implemented so far: - Supports "textfield" and "button" fields. - Supports tabbing between fields. - Hotkeys to jump to a field directly. - Listeners for actions on buttons. - Use in fields to cancel changes and restore old value. - Support for "default button" by hitting anywhere. I think support for combobox and checkbox will make this truly distinguishable from using dialogs and such. Vim7 popup completion will be a great fit for implementing combobox. Here are the TODO items I have noted so far: - Constructors/utilties for creating form objects (createForm(), addField() getField(), etc.). - Syntax highlighting: - labels - Buttons - Hotkey (underline) - ComboBox using completion popup. Optional user completion. - CheckBox using True/False combobox or "[x]" style buttons. - Support for disabling fields. - Mouse support. - Trap and disable 'modifiable' I would appreciate any kind of feedback on this. -- Thanks, Hari __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com