LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 08-18-2012, 02:30 PM   #1
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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.
 
Old 08-21-2012, 04:44 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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.
Old 08-21-2012, 05:02 AM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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.
 
Old 08-21-2012, 03:11 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
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?
 
Old 08-24-2012, 03:56 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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/
 
Old 08-25-2012, 09:14 AM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Quote:
Originally Posted by catkin View Post
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/

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
 
Old 09-08-2012, 04:51 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Glad you found the solution
Quote:
Originally Posted by sycamorex View Post
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.
 
Old 09-08-2012, 08:50 AM   #8
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Thanks catkin. The confirmation was delayed by afair 3 days. In the end I received 2 confirmation emails.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cursor issue in Urxvt Zmyrgel Linux - Desktop 1 04-01-2008 02:12 AM
Vim cursor position Tischbein Linux - Newbie 4 03-31-2008 01:32 AM
vim: startup at last cursor position chrism01 Solaris / OpenSolaris 3 02-20-2007 11:25 AM
Character under cursor in Vim 7.0. judgex Programming 1 08-14-2006 08:06 PM
Vim Cursor Color Mr_Munkey Linux - Software 0 01-06-2006 05:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration