You are not logged in.
Hello again,
my next urxvt extension reached a stable stage, so it's time to post it here: keyboard-select
Please have a look at the top of the file for details on how to use it, or read the README on github.
The usage is comparable to tmux/gnu screen, but its mappings are more vim-like.
As for now, the most basic cursor movement keys are available, I'm planning to add the following in the near future: [fFwWbBeE;,/?nN]
And this time I've also managed to upload a PKGBUILD before writing this post...
Last edited by ber_t (2011-03-29 12:36:50)
Offline
Great! Always wanted something like this.
But is it possible to add emacs-like keybindings? That would be very useful
Offline
Offline
an even happier customer! and emacs-like keybindings +1, but we could also modify the keys in the script ourselves of course. If only I wasn't that lazy... but who knows.
Offline
you implemented ctrl-v?!
AWESOME.
/me bows
Ogion
(The above may be irc style, but it was just meant to show my surprised awe at just randomly trying out ctrl-v after installing your script and going as it worked)
(my-dotfiles)
"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
"Enlightenment is man's leaving his self-caused immaturity." - Immanuel Kant
Offline
http://github.com/ervandew/vimfiles/raw … scrollback
try this ,vim like scrollback
Offline
@hitsmaxft: Your extension looks nice, I will try it out later. But your one always uses urxvt's selection for highlighting; I use rendition bits for that, because I want a chance to cancel visual mode without losing the content of the primary buffer. It also misses some delete statements, for example, it always creates a new overlay without deleting the old one.
I will continue developing mine (at least just for the fun of it), even if your one already features everything I'd plan to implement.
For all the emacs lovers: I will try to provide vim and emacs keybindings, but I didn't come up with a nice way of handling this. And by nice I mean no code duplication and no complex key dispatcher, taking up more code than the real functionality.
Be patient, or:
... but we could also modify the keys in the script ourselves of course. If only I wasn't that lazy... but who knows.
Offline
The functionality is nice, but I rather wanted to have it in tmux, so I wrote tmux-open-url:
#!/bin/sh
# tmux-open-url - open last URL in current tmux pane in firefox
LAST_URL=$(tmux capture-pane \; show-buffer -b0 \; delete-buffer -b0 |
grep -P -o '(?:https?://|ftp://|news://|mailto:|file://|\bwww\.)[a-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27,~#]*(\([a-zA-Z0-9\-\@;\/?:&=%\$_.+!*\x27,~#]*\)|[a-zA-Z0-9\-\@;\/?:&=%\$_+*~])+' |
tail -1)
[ -n "$LAST_URL" ] && firefox "$LAST_URL"
and put into my tmux.conf:
bind u run tmux-open-url
This will only open the last URL, but a parameter can be added easily.
Offline
@chneukirchen: You're in the wrong thread, the titles are a little bit confusing though.
Last edited by ber_t (2010-08-17 15:13:04)
Offline
Hey, i tried both keyboard-select and clipboard, but I can't get them to work.
in my .Xdefaults:
URxvt.perl-lib: /home/dieter/.local/share/urxvt/plugins/
URxvt.perl-ext-common: default,matcher,tabbed,clipboard,keyboard-select
!URxvt.keysym.M-c: perl:clipboard:copy
URxvt.keysym.M-v: perl:clipboard:paste
URxvt.keysym.M-C-v: perl:clipboard:paste_escaped
URxvt.keysym.M-c: perl:keyboard-select:activate
I downloaded the files to /home/dieter/.local/share/urxvt/plugins/, chmodded +x (not sure if that's needed)
I fail to activate any of the plugins. I changed the keybinding from M-Escape because my WM (awesome) seems to grab those, but M-c and M-v have no effect. modkey = superkey right? anyway i tried with alt, ctrl, altgr and right control as well..
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
@Dieter@be: Just a guess: Have you run xrdb after changing your .Xdefaults:
xrdb -merge ~/.Xdefaults
What's happening when you start urxvt from within another terminal? Does it report anything? You could also add a print statement to the on_start subroutine to check if the scripts are actually parsed by urxvt.
Offline
That exactly what I'm looking for, thanks!
Offline
@Dieter@be: Just a guess: Have you run xrdb after changing your .Xdefaults:
xrdb -merge ~/.Xdefaults
What's happening when you start urxvt from within another terminal? Does it report anything? You could also add a print statement to the on_start subroutine to check if the scripts are actually parsed by urxvt.
I think I falsely assumed that spawning a new terminal was enough. (so I didn't do the xrdb - merge yesterday).
Today I'm in a fresh X session and it works both the clipboard (awesome!) and the keyboard-select work. although just pressing 'y' (without return) is enough to copy it to my primary buffer and exist the selection mode
< Daenyth> and he works prolifically
4 8 15 16 23 42
Offline
although just pressing 'y' (without return) is enough to copy it to my primary buffer and exist the selection mode
The README is a bit ambigous, but I meant that the either y or Return can be used for this. This is going to change in the next version, where y copies the selection, but let's you stay in selection mode, whereas Return also deactivates it.
Offline
Updated to version 1.1
It now uses logical lines instead of terminal rows and columns, so cursor movement works a lot more like in vim. The cursor should also never leave the displayed text.
Changing lines after using '$' always moves the cursor to the end of the new line.
The Ctrl-[fbdu] mappings now scroll the buffer instead of moving the cursor, so that the cursor position inside the window is preserved.
Offline
Hey ber_t,
Typo, should you care:
http://github.com/muennich/urxvt-perls/ … /README.md
After installing, put the folling lines in your .Xdefaults:
s/folling/following/
The typo is shown twice.
Last edited by steve___ (2010-08-19 13:28:25)
Offline
Updated to version 1.2
Added [fF;,wWbB] mappings. I did my best to make them work exactely the same as in vim.
Offline
Updated to version 1.2
Added [fF;,wWbB] mappings. I did my best to make them work exactely the same as in vim.
Awesome.
Offline
It's because of amazing software like this that pops up that I take the time to routinely scan the Community Contributions. This is the greatest thing since sliced bread! Sometimes when I boot my computer my mouse won't select text (don't know why), but with this extension, I won't be forced to restart my computer in order to copy and paste text from the terminal. Thanks!
Registed Linux User 483618
Offline
/unplugs his mouse
I love you.
transcend to the fifth abode
Offline
Updated to version 1.3
Fixed some cursor movement inconsistencies and added [/?nN] mappings.
You can directly enter the backward search mode (?)---without using Meta-Escape first---by adding the following line to your .Xdefaults:
URxvt.keysym.M-s: perl:keyboard-select:search
This overwrites/replaces the default Meta-s search mode, provided by the searchable-scrollback extension, which is therefore no longer needed.
Offline
Updated to version 1.4
No big changes since the last update, but I wanted to move them into a stable version, because there has not been any development in roughly two months.
To me, this extension seems to be feature complete with this release...
Offline
Nice work, thank you.
Offline
Thanks for this wonderful work!
I suspect this extension is not working correctly in ncurses (in mutt, at least). Do you think that it can be solved? your other extension, url-select, is already working in mutt flawlessly.
Offline
Mutt uses rxvt-unicode's facility to make the cursor invisible. There is no way to make it temporarily visible within the perl extension.
But you can either patch (and recompile) mutt or rxvt-unicode, to prevent this behaviour. I prefer to patch rxvt-unicode because I have already customized and compiled it for some other reasons. Below you'll find my simple one-line patch and the modified PKGBUILD. Please note, that no application will be able to hide the cursor inside an urxvt, when using this patch, which you might prefer, if you like using keyboard-select.
If you would rather patch mutt, then you are on your own, but it's a simple task, too. Just do a `grep mutt_curs_set *' inside mutt's src-dir and you should know what to do...
Offline