cnoremap js <Esc>
which if I understand correctly is supposed to make 'js'
do what Esc does when typed on the command line. But it
seems to do something slightly different:
:boguscommandjs
results in an error message:
E492: Not an editor command: boguscommand
while
:boguscommand<Esc>
appears to just silently abort the command line.
I don't think I have any other mappings that should interfere
here, but just in case I've attached my .vimrc. Here are all
the mapping commands I have in it:
" Fine point: we don't make these mappings in operator pending mode.
This
" the timeout on the ds map to delete upward with movement via s).
nnoremap s k
vnoremap s k
nnoremap ds s
vnoremap ds s
"nmap js <Nop>
" Including a trailing space in the "to" part of these mappings has an
onoremap js <Esc>
xnoremap js <Esc>
snoremap js <Esc>
inoremap js <Esc>
cnoremap js <Esc>
" This was the old mapping I used, maintained until new mapping is
learned.
inoremap jf <Esc>
noremap <Space> h
noremap , ;
:noremap ;w <C-w>w
noremap ;s :sh<CR>
":noremap ' `
inoremap { {}<Left>
inoremap {<CR> {<CR>}<Esc>O
inoremap {{ {
inoremap {} {}
"inoremap ( ()<Left>
"inoremap (<CR> (<CR>)<Esc>O
"inoremap (( (
"inoremap () ()
"inoremap [ []<Left>
"inoremap [<CR> [<CR>]<Esc>O
"inoremap [[ [
"inoremap [] []
Thanks in advance for any help,
Britton
As described at
:help c_<esc>
in macros (which I also understand from the evidence you've
presented, to mean "mappings and macros"), the command you've
entered thus far is run.
However, right below that help, you can see how to prevent it
from happening: use CTRL-C
:cnoremap js <c-c>
which seems to do what you're looking for.
-tim
Well, even if it worked, you should be careful: what about
:e scriptname.js
? (I don't write javascript myself, except that user.js and prefs.js are
names for preference files used by Mozilla applications.)
Here you may have to hit the { key six times to create a {{{ fold-marker
(in a file using foldmethod=marker and the default markers)
> inoremap {} {}
> "inoremap ( ()<Left>
> "inoremap (<CR> (<CR>)<Esc>O
> "inoremap (( (
> "inoremap () ()
> "inoremap [ []<Left>
> "inoremap [<CR> [<CR>]<Esc>O
> "inoremap [[ [
> "inoremap [] []
>
>
> Thanks in advance for any help,
> Britton
Well, my help (or rather, my recommendation) is: learn how Vim behaves
natively, it's often more productive than trying to force it to behave
like Netscape, Emacs, gobbledywriter or anything.
Best regards,
Tony.
--
186,282 miles per second:
It isn't just a good idea, it's the law!
If you don't like reaching out to the top-left Esc key, use Ctrl-[ (to
Vim it's the same as Esc). You can reach them with two fingers of your
right hand with very little movement away grom the home position -- if
you got [ right of the P on a QWERTY layout, I think you can reach
Ctrl-[ quite easily with, hm... let's see... I'd say the little finger
on (right) Ctrl and the middle finger on [. Or you can use both hands
and the left Ctrl instead.
Best regards,
Tony.
--
A consultant is a person who borrows your watch, tells you what time it
is, pockets the watch, and sends you a bill for it.