You are not logged in.

#1 2015-09-10 10:53:11

garbochock
Member
Registered: 2014-10-07
Posts: 12

urxvt C-Return - not working!

Dear Forum,
I can't bind C-Return in vim using urxvt:

nnoremap <buffer> <C-Return> :call SClang_block()<CR>

Above has no effect at all - it essentially produces "Return". CTRL-v - CTRL-Return does produce ^M, which in my knowledge is in order.

I've tried the following in my Xdefaults:
URxvt.keysym.Control-Return: <Control-Return>
With no effect, it simply prints it as a string.

C-Return can be bound to other values using ascii-code, such as:
URxvt.keysym.Control-Return: \033\015
Meaning workarounds are possible by way of ascii octal codes, unfortunately - they cannot produce a simple "CTRL", or "RETURN"...

If anyone has any idea, I'd be very thankful. I'm sure that I'm overlooking something simple.
Best,
Garbochock

Offline

#2 2015-09-10 11:45:38

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: urxvt C-Return - not working!

Why do you think this is urxvt specific?  Have you successfully used this key binding in other terminals or the tty?  The vim documentation doesn't seem to indicate that "Return" is a key notation, "Enter" is.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2015-09-10 13:02:30

garbochock
Member
Registered: 2014-10-07
Posts: 12

Re: urxvt C-Return - not working!

Well, I assume that when I press C-Enter, urxvt sends a value to vim, and looking at people with similar problems this seems to be the case.
I did actually manage to bind ctrl+enter in vim, as ctrl+v, ctrl+enter produces ^M in urxvt - and looking at this I found that <CR> could be used as the character for bind.
As it happens, ^M is also the output of shift+enter, so I don't really know how to make a ctrl+enter specific bind. Anyhow if there is no better alternative perhaps someone else can make use of this...

Edit: Ehm, ok, nevermind - <CR> just binds the Enter-key, regardless of any ctrl or shift business.

Last edited by garbochock (2015-09-10 13:07:27)

Offline

#4 2015-09-10 13:12:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,543
Website

Re: urxvt C-Return - not working!

WTF? Why assume all this.  The documentation clearly shows how to bind Ctrl+Enter.  Why assume this is a urxvt issue when you could so easily test it in a TTY or another terminal?  Why assume that <CR> is how to bind Ctrl-Enter when it is not in the documentation (it is listed as how to produce a carriage return, not bind one).

I give up.  It seems you like having this problem.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2015-09-10 13:40:15

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: urxvt C-Return - not working!

Offline

#6 2015-09-10 13:53:52

garbochock
Member
Registered: 2014-10-07
Posts: 12

Re: urxvt C-Return - not working!

Well, assuming these folks are correct it seems my best shot is to do with a workaround, thanks.

Trilby wrote:

WTF? Why assume all this.  The documentation clearly shows how to bind Ctrl+Enter.  Why assume this is a urxvt issue when you could so easily test it in a TTY or another terminal?  Why assume that <CR> is how to bind Ctrl-Enter when it is not in the documentation (it is listed as how to produce a carriage return, not bind one).

I give up.  It seems you like having this problem.

No need being rude Trilby, it seems my assumptions (although possibly premature) was correct. Unless I wan't to switch over to Gvim or switch terminal, I'm supposedly stuck with this issue.

Last edited by garbochock (2015-09-10 13:56:40)

Offline

#7 2015-09-10 14:29:54

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: urxvt C-Return - not working!

garbochock wrote:

Well, assuming these folks are correct it seems my best shot is to do with a workaround, thanks.

Well, that's not the only source. I even thought I'd seen something in vim's help, once upon a time (at least about Shift), but this was the best I could come up with after a quick search.

Last edited by Raynman (2015-09-10 14:30:14)

Offline

Board footer

Powered by FluxBB