Ian, thank you for tackling this!!  vi mode is highly desired by other users, 
but I don't know enough about it to implement it.

Regarding repainting, does 'commandline -f repaint' work?

_fish

On Jun 21, 2012, at 12:03 AM, Ian Munsie wrote:

>> your vi-mode works wonderful.
>> I've only the problem with the 'w' and 'e' keys, which place the cursor to
>> the space, rather the last/first letter in the word.
> 
> Yes, for now I'm just using the built in forward/backward-word
> commands for them as they were close enough to get started. The 'W'
> and 'E' commands I've implemented myself and (barring a few edge
> cases) should place the cursor in the right place.
> 
> I need to implement 'w' and 'e' (and change 'W' and 'E') so they work
> as directional modifiers as well as for navigation, so the correct
> functionality is coming :)
> 
>> It would be also good
>> to have the mode indicator. The variable that I can put to the fish_prompt.
> 
> Done. If you grab the latest version there is now a vi_mode variable
> that you can use with something like this:
> 
> function fish_prompt -d "Write out the prompt"
>        printf '%s@%s%s%s%s [%s]> ' (whoami) (hostname|cut -d . -f 1)
> (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) $vi_mode
> 
> It currently gets set to one of 'I' (insert), ' ' (normal), 'R'
> (overwrite) and 'r' (replace single). I'm open to feedback on whether
> they are appropriate choices.
> 
> I ran into some trouble implementing this - I couldn't get the prompt
> to repaint when going into normal mode (yet worked fine when entering
> insert mode). I eventually figured out that 'bind '' self-insert'
> seems to be required for this to work for some reason... so now normal
> mode does that, then binds all printable 7-bit ASCII characters to do
> nothing before assigning the real bindings - a bit wasteful and ugly,
> so if anyone can suggest a better way to solve this, please let me
> know.
> 
> Cheers,
> -Ian
> 
> -- 
> http://sites.google.com/site/DarkStarJunkSpace
> --
> http://darkstarshout.blogspot.com/
> --
> On the day *I* go to work for Microsoft, faint oinking sounds will be
> heard from far overhead, the moon will not merely turn blue but
> develop polkadots, and hell will freeze over so solid the brimstone
> will go superconductive.
>      -- Eric S. Raymond, 2005
> --
> Please avoid sending me Word or PowerPoint attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Fish-users mailing list
> Fish-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/fish-users
> 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to