Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
08-18-2012, 02:30 PM
|
#1
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,089
|
cursor in vim / urxvt
I'm playing with my .vimrc
I'd like to change the shape of the cursor in vim (urxvt). I've found the following:
Code:
if &term =~ "xterm\\|rxvt"
" use an orange cursor in insert mode
let &t_SI = "\<Esc>]12;orange\x7"
" use a red cursor otherwise
let &t_EI = "\<Esc>]12;red\x7"
silent !echo -ne "\033]12;red\007"
" reset cursor when vim exits
autocmd VimLeave * silent !echo -ne "\033]112\007"
" use \003]12;gray\007 for gnome-terminal
endif
And changing the cursor shape.
Code:
if &term =~ '^xterm'
" solid underscore
let &t_SI .= "\<Esc>[4 q"
" solid block
let &t_EI .= "\<Esc>[2 q"
" 1 or 0 -> blinking block
" 3 -> blinking underscore
endif
It works fine for xterm, but I can't get it work in urxvt. I've changed the following:
Code:
if &term =~ "xterm\\|rxvt"
to "urxvt", "Urxvt", "^urxvt", "rxvt", "rxvt-unicode" but have no luck.
That's my .Xresources
Code:
XTerm*faceName: Inconsolata
XTerm*faceSize: 13
XTerm*cursorBlink: true
XTerm*cursorUnderLine: true
XTerm*saveLines: 32768
XTerm*locale: true
XTerm*utf8: 1
XTerm*termName: xterm-256color
XTerm*autoWrap: true
Xft.dpi: 96
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.lcdfilter: lcddefault
Xft.rgba: rgb
Xft.autohint: 0
URxvt.font: xft:Inconsolata:pixelsize=17
URxvt.saveLines: 65535
URxvt.scrollBar: false
URxvt.depth: 32
URxvt*cursorUnderline: true
URxvt*termName: rxvt-unicode-256color
URxvt.perl-ext-common: default,matcher
URxvt*urlLauncher: /usr/bin/firefox
URxvt.matcher.button: 1
URxvt.internalBorder: 0
Rxvt*cursorBlink: true
Rxvt*visualBell: true
# Enabling Ctrl/Alt + arro keys for vim
URxvt.keysym.M-Up: \033[1;3A
URxvt.keysym.M-Down: \033[1;3B
URxvt.keysym.M-Right: \033[1;3C
URxvt.keysym.M-Left: \033[1;3D
URxvt.keysym.M-Prior: \033[5;3~
URxvt.keysym.M-Next: \033[6;3~
URxvt.keysym.M-End: \033[1;3F
URxvt.keysym.M-Home: \033[1;3H
URxvt.keysym.C-Up: \033[1;5A
URxvt.keysym.C-Down: \033[1;5B
URxvt.keysym.C-Right: \033[1;5C
URxvt.keysym.C-Left: \033[1;5D
URxvt.keysym.C-Prior: \033[5;5~
URxvt.keysym.C-Next: \033[6;5~
URxvt.keysym.C-End: \033[1;5F
URxvt.keysym.C-Home: \033[1;5H
Thank you.
|
|
|
|
08-21-2012, 04:44 AM
|
#2
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Replying because nobody else has ...
Perhaps the &t_* settings do not work with urxvt. Perhaps &term is none of the values tried so far.
The &t_* settings could be tested with urxvt by removing the conditional test -- either by removing the if and endif lines or by adding an else.
Alternatively it should (TM) be possible to make vim display the value of &term. Could it be the value set by URxvt*termName: rxvt-unicode-256color ?
All of this would be trivial to investigate with a knowledge of the scripting language vim uses in .vimrc but my attempts to find a reference for it have found only bewilderingly complex examples of using it and nothing about the language itself.
Last edited by catkin; 08-21-2012 at 04:45 AM.
Reason: sense
|
|
|
1 members found this post helpful.
|
08-21-2012, 05:02 AM
|
#3
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,089
Original Poster
|
Thanks. I'm at work now but I'll check it in the evening. Why didn't I think about it before? It makes sense:
1. It doesn't have to be a conditional statement.
2. I didn't see the correlation between the name set in .Xresources and the script.
I'll check it later.
|
|
|
|
08-21-2012, 03:11 PM
|
#4
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,089
Original Poster
|
It seems urxvt does not support vim's &t_* settings. I changed the name to the one mentioned in .Xresources with no luck. Then I removed the conditional bits and it works with xterm and sakura but still has no effect on urxvt. Interestingly enough it works in rxvt. How different are rxvt and rxvt-unicode?
|
|
|
|
08-24-2012, 03:56 AM
|
#5
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
AFAIK urxvt is very similar to rxvt apart from the Unicode extensions.
The best place to ask the current question might be the urxvt mailing list. Subscription is via http://lists.schmorp.de/mailman/listinfo/rxvt-unicode. In case it has been answered before it would be worth searching the mailing list archive at http://lists.schmorp.de/pipermail/rxvt-unicode/
|
|
|
|
08-25-2012, 09:14 AM
|
#6
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,089
Original Poster
|
Quote:
Originally Posted by catkin
|
Thanks catkin. I've already tried to subscribe to their mailing list twice. I have been waiting for any kind of confirmation for 2 days. A couple of hours ago I /joined their irc channel. I'm still the only person there.
Having said that, I've found a solution. Since rxvt and urxvt differ only in the unicode bit, it must have been something in my config that stopped urxvt from executing the script. I've done what I should've done in the first place, ie. comment out the urxvt entries in .Xresources. As one can guess, the culprit was:
Code:
URxvt*cursorUnderline: true
Cheers
sycamorex
|
|
|
|
09-08-2012, 04:51 AM
|
#7
|
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian Squeeze (server), Slackware 13.37 (netbook), Slackware64 14.0 (desktop),
Posts: 8,357
|
Glad you found the solution
Quote:
Originally Posted by sycamorex
Thanks catkin. I've already tried to subscribe to their mailing list twice. I have been waiting for any kind of confirmation for 2 days.
|
Sorry -- I can't remember how the procedure went but do not recall any trouble. Maybe there was no confirmation; have you tried posting to the mailing list? I am happy to try to help if you like; contact via this thread or LQ PM.
|
|
|
|
09-08-2012, 08:50 AM
|
#8
|
|
LQ Veteran
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,089
Original Poster
|
Thanks catkin. The confirmation was delayed by afair 3 days. In the end I received 2 confirmation emails.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:49 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|