You are not logged in.
Exploring the feasibility of using vi instead of vim as my text editor, I have gotten stuck trying to get Vi to accept more than one character for the lhs of key mappings.
Single characters work fine, but any attempt to use more than one produces the visual bell error (what the actual message may be is not shown and otherwise I don't know where it may be found).
Section 6.9. of "An Introduction to Display Editing with Vi" states "... lhs should be one keystroke (either 1 character or one function
key) since it must be entered within one second (unless notimeout is set, in which case you can type it as
slowly as you wish, and vi will wait for you to finish it before it echoes anything). The lhs can be no longer
than 10 characters, the rhs no longer than 100.", which seems to imply that the mapping can be invoked by as many as 10 characters for the lhs, if "set notimeout" is specified.
My .exrc is currently
map gg 1G
map '0 :e /home/g/.Xdefaults
map 'B :e /home/g/.bashrc
map 'E :e /home/g/.exrc
map 'I :e /home/g/.inputrc
map 'L :e /home/g/.lynxrc
map 'V :e /home/g/.vimrc
map 'X :e /home/g/.xinitrc
map 'N :e /mnt/1/Notes
map 'K :e /home/g/.fluxbox/keys
map 'A :e /mnt/1/ebk.awk
map 'Z :e /mnt/1/Vi/pdf/Vi-paper.html
au! BufWritePost ~/.exrc source %
set autoindent autowrite notimeout showcmd shiftwidth=2 tabstop=2
set directory=/tmpLast edited by porphyry5 (2015-01-26 18:09:01)
Offline
As far as I can determine these are limited to one key or one compound keystroke (Ctrl+x e.g.). So I began looking for ways around it, and the solution seems to be to use multiple key mapping files, with one such in each directory where one customarily does one's text editing.
Wherever it may be started, Vi reads .exrc from one's home directory, and this would be limited to set commands and a terminating 'source keymappingsrc'. The directory one is working in would contain the file keymappingsrc with key mappings appropriate for the kind of text editing one normally does in that directory. Other directories in which one customarily does text editing would each have their own different versions of keymappingsrc.
Offline
Since you already solved the issue, may I ask... ![]()
Why did you choose to use Vi instead of Vim?
Offline
Since you already solved the issue, may I ask...
Why did you choose to use Vi instead of Vim?
There is a joke vim users tell against emacs, that it would make a great OS if it only had a decent editor. But no one seems to notice that vim has gone down the same road as emacs. In its desire to become 'all things to all men' vim has become over-complex. I waste far too much time with vim tracing obscure side-effects produced by the interaction of its parts, most of which I have no use for. After 3 years of use, I've come to the conclusion I will never be able to use it other than at the cookbook level (hunting the internet for solutions to the problem I currently have with it).
Everything I like about vim derives from vi, and it follows that unix principle of being a simple program that does one thing very well. It edits text. I really don't want a command center for orchestrating everything I do on my computer
Offline