help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: one key-press to comment out lines of code?


From: Emanuel Berg
Subject: Re: one key-press to comment out lines of code?
Date: Sat, 03 May 2014 04:43:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

> M-u does work in zsh: it uppercases the following
> word. M-- doesn't seem to do the same in bash and
> zsh, though, so that doesn't work - but the
> functionality is probably just bound to some other
> key in zsh. However, M-b (instead of M--) and then
> M-u work (M-b as in backward-word, just as in Emacs).

Made it work like this:

upcase-previous () {
    zle backward-word
    zle up-case-word
}

zle -N upcase-previous

bindkey Ē upcase-previous

Ē is the key the VT sends on <M-caps>, which puts Emacs
in caps-mode - so here, I can use the same key to
upcase the last word - it is not as good as in Emacs,
because for a split second you see the "incorrect"
filename, and you type it, and that might bite you
later if you do it too much - but still sort of
cool. Wow, I'm certainly happy I had this discussion
with you, otherwise I wouldn't have thought of looking
this up.

-- 
underground experts united:
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]