Tim Chase-2 wrote:
> 
>> I'm new to Vim. I want to change the character before commands. For
>> example
>> saving is done by:
>> 
>> :w <enter>
>> 
>> Can it be made slightly easier by just pressing 'g' or some other key
>> that's
>> not taken? I don't know why every command has to be pre-pended by a
>> difficult to reach character like colon. In an old text editor (I think
>> one
>> by Borland), you could save by pressing just one key, i.e. F2. 
> 
> yes, the Borland IDE used to use <F2> to save.
> 
>> This isn't a flame.. I just want to do simple commands like save, quit,
>> save
>> and quit, etc. with fewer than four keys. One key like 'g' or F2 or
>> something would be awesome. Ctrl + key would be nice too. 
> 
> Most of the common letters and control-keys are occupied by 
> existing[1]/useful[1]/non-portable commands[2].  However, the F# 
> keys should be available.  You want "mappings", so to save, you'd 
> want something like this:
> 
>       :nnoremap <f2> :w<cr>
> 
> (with all less-than and greater-than signs).
> 
> For save+quit, there's "ZZ" in normal mode, and for abandon+quit, 
> there's "ZQ".  I don't use either of them as discussed on the 
> list a month or two ago (I like the intentionality of building it 
> piece-by-piece regarding whether to quit, confirm, all files, and 
> save/overwrite in the process) but they might be easier to use. 
> However, you _can_ do things like
> 
>       :nnoremap <f4> :wq<cr>
> 
> to save+quit.
> 
> 
> [1] like the "g" you suggest...very useful
> [2] such as control+[SQ] which is available in some versions, but 
> is terminal flow-control or control+Z which can suspend/minimize vim
> 
> 
> Just my $0.02 adjusted for inflation, minus taxes, social 
> security, and medicare.
> 
> -tim
> 
> 
> 
> 

Thank you very much, Tim. You are a true vim genius. The reason I don't like
ZZ is that I still have to press shift with z. :( If only it worked without
shift... But then again, like you said most keys are already bound to
functions that are useful in general (though I've never used regular z
function).

---- RANT ----
Though I don't really get the reason why every command is preceded by colon.
It should be one keypress, like maybe semi-colon. I'm sure the writers of
vim were pretty aware of that, so there must be a design issue they faced or
something that prevented one keypress instead of two (maybe they wanted to
prevent accidental press?). This was just a rant.
---- END RANT ----

One quick question, please if you could answer: what if I want to map
something like a two keys in succession to something, like gg for save, gz
for quitting and saving. How would it change?

I'm sorry if my English is bad.. it's not my first language.

Regards,
-- 
View this message in context: 
http://www.nabble.com/Customizing-vim%3A-How-to-change-the-char-before-commands-tf3443878.html#a9621585
Sent from the Vim - General mailing list archive at Nabble.com.

Reply via email to