[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to map the # key to a command?
From: |
Paul Fox |
Subject: |
Re: How to map the # key to a command? |
Date: |
Sat, 13 May 2023 07:48:25 -0400 |
chris wrote:
> On Sat, May 13, 2023 at 11:09:59AM +0100, Chris Green wrote:
> > On Sat, May 13, 2023 at 11:04:26AM +0100, Chris Green wrote:
> > > I can map the # key to do ^Xe 'manually' when running vile simply by
> > > going to the colon prompt and entering 'map ', then entering # in
> > > response to 'change this string' and, finally ^Xe in response to 'to
> > > this new string'. The # key then opens the file under the cursor for
> > > editing.
> > >
> > > However I can't seem to get the same result by entering the map
> > > command in my .vilerc file.
> > >
> > > What do I need in .vilerc to get # to 'edit file under cursor'?
> > >
> > It's OK, I think I've worked it out, I need to use bind-cmdmode-key to
> > do it.
> >
> But of course rebinding the # key has lots of repercussions! :-) I
> need to go and rethink what I'm doing!
:-)
I do use map for some things, but sometimes I find it easier
to use load-register. If I happen to use the register for a yank
while editing (unlikely for the later members of the alphabet), I
lose that macro, but it's not a big deal. (I've converted the literal
^M characters to two ascii characters for this message, but they need
to be literal in .vilerc)
; @h --turn off syntax highlighting
use-register h load-register ":set nohighlight^M"
; @w -- make current buffer's file writeable, and write it
use-register w load-register ":!chmod +w %^M:w^M"
; @s -- suck in my .signature
use-register s load-register "G:r ~/.signature^M"
I guess it doesn't really help if you're trying to find a shortcut for
a two character command (^Xe --> #), But unlike ^X, '@' doesn't need a
modifier.
paul
=----------------------
paul fox, pgf@foxharp.boston.ma.us (arlington, ma)