Hi,I've updated python's 'print', added colors for mode indicators and added calling vi_mode_user in the end of
functions, which set vi_mode. You can check the code in the attached file.
By the way, prefixing functions with the same prefix will simplify splitting the vi-mode.fish in separate files and adding it to the fish.
Maxim On Mon, 25 Jun 2012 06:02:28 +0400, Maxim Gonchar <gma...@gmail.com> wrote:
Hi Ian,thank you very much for you script. On this stage I already can use it full time.I have some notes and remarks:1) I would propose to call 'print( args )' instead of 'print args' for python in order your script worked on systems with python3 as default python.2) You can set items for vi_mode variable configurable, so one could set a color for it.3) You could also support user keybindings by calling 'vi_mode_user mode' (if defined) so users can have their additional bindings set by defining vi_mode_user function.4) I think it is not a good idea to make shortnamed commands like overwrite, replace, etc. Because it's that possible users can have them defined for the interactive usage. I propose to prefix all the internal commands by '__vi_mode_' in order to avoid ambiguity.regards, MaximOn Fri, 22 Jun 2012 13:45:15 +0400, Ian Munsie <darkstarsw...@gmail.com> wrote:Hi Everyone, For those interested, I've just pushed a new version of these bindings. Now with 1000% more embedded python :-P IMPORTANT: This now relies on the version of fish in the master branch, so make sure you are running that before trying this (otherwise using any direction could cause the command line to change). The major new feature is support for directions and some commands to use them - commands like dW (delete to end of WORD), cb (change to start of word), and so on should now do as vim users expect :) Currently only the c and d commands can use directions (and obviously directions without a command move the cursor), but I've made it generic enough that it should be fairly easy to add more (the g~ family of commands come to mind). If anyone has any particular commands they can't live without let me know and I'll try to prioritise them :) The regular expressions I used for the w, e and b directions aren't quite perfect, but editing them was doing my head in and they seem close enough to me. Improvements welcome :) Other minor improvements include: - The w and e commands should now place the cursor at the correct position instead of on the space :) - The cursor should now be positioned correctly in more cases (e.g. when leaving insert or overwrite modes) The next features on my TODO list are to implement the f, F, t and T directions (which should be fairly trivial, but I ran out of time today). If I've missed any other directions/commands that people need please let me know. Cheers, -Ian
vi-mode.fish
Description: Binary data
------------------------------------------------------------------------------ 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