精华内容
下载资源
问答
  • urxvt是一个很棒的终端模拟器,但是花时间在Mac上使我错过了使用⌘+ Plus和⌘+ Minus动态调整文本大小的功能(在iTerm中!)。 我还认为,如果可以将调整终端字体的大小Xresources到Xresources 。 事实证明,这很...
  • URxvt.perl-ext-common: ...,module 要安装这些脚本,请复制或链接到/usr/lib/urxvt/perl 。 全屏 为终端切换全屏 URxvt.perl-ext-common: ...,fullscreen URxvt.keysym.F11: perl:fullscreen:switch 依赖:wmctrl...
  • urxvt-gist GitHub Gist自动上传以供URxvt选择 这是一个URxvt扩展,将所选内容上传为GitHub Gist。 当前,它需要使用存储在.Xdefaults / .Xresources中的oauth令牌。 文件上传的当前名称是所选内容的十六进制编码...
  • urxvt 包含我的urxvt终端配置文件的存储库
  • urxvt主题切换 urxvt插件,允许在运行时切换颜色主题
  • xmonad-ubuntu by @CestDiego 仍然只在 Ubuntu 14.04 中测试过并且还安装了各种 安装 git clone /CestDiego/xmonad-ubuntu ~/.xmonad 然后你就可以运行安装脚本...完整的 URXVT 终端支持远程 (SSH) 连接 写于 1.8.2012
  • 浅紫绿色 > 深紫色 Julia 混合很多 漂亮 蓝色空间 随机树 深海 一个主题 落下 光滑白蓝 秋季绿色 ncmpcpp 某物 大哥 我不是gentoo 好彩虹 自制棉花糖 树皮 所有的颜色和狗屎 ... 冷静的女孩
  • 敏捷性,urxvt,白蚁,st 编辑 neovim,emacs,vscode,intellij,vscodium,neovim-gtk,notepadqq,kakoune 壳 zsh,鱼,bash,破折号,ksh 外壳提示 飞船,无知者,外星人,吸血鬼 zsh插件 zsh语法突出显示,...
  • klaxalkLinux环境 的Ubuntu ...urxvt与(使用测距仪文件管理器时)来显示图像的能力的终端仿真器 tmux终端多路复用器一直在运行 用于tmux会话自动化的tmuxinator 与vim兼容的键绑定,用于拆分切换
  • dotfiles:我的* NIX dotfiles [i3wm,URxvt,tmux,zsh,rofi,cmus,irssi,vifm,mutt,feh,mpv,newsbeuter]
  • dotFiles:XTerm,URXvt,i3,vim的Arquivos deconfiguração。
  • urxvt 配置 此存储库包含要与 urxvt (rxvt-unicode) 一起使用的配置文件。 它使用来自 [muennich/urxvt-perls]( muennich/urxvt-perls) 的 Perl 插件 安装 urxvt 在 Arch Linux 上运行: sudo pacman -S rxvt-...
  • vim-scrollback是urxvt的扩展,它提供了类似vim的scrollback模式和粘贴功能 用法 不处于vim回滚模式时 ctrl-v-进入vim-scrollback模式 ctrl -r *-将主剪贴板粘贴到命令行 ctrl-r +-将辅助剪贴板粘贴到命令行 注意:...
  • 它是 urxvt 的 perl 扩展,允许使用 fifo。 安装 添加到.Xresources : URxvt.perl-ext-common: [another extensions],fifo URxvt.keysym.Mod4-C-f: perl:fifo:start URxvt.fifo.file: /tmp/urxvt.fifo 用法 echo...
  • urxvt常用设置

    2013-01-03 21:14:12
    urxvt常用设置,字体,边框,中文等,从网上找的资料
  • urxvt-utils unicode-rxvt有用的实用程序的集合。 用perl编写。 tabbed_enh:用于rxvt(urxvt)的增强的选项卡管理工具,已使用可配置的密钥从原始工具中修改了该工具。 有关详细信息,请参见设置会话。 安装 $ ...
  • Urxvt 的简单配置

    千次阅读 2020-02-12 17:06:56
    Simple config file for urxvt: 首先在当前用户的家目录创建 .vimrc 文件 touch .Xresources code: Xft.dpi: 96 URxvt*font:xft:FiraCode:antialias=true:pixelsize=21,xft:WenQuanYi Zen Hei:pixelsize=21 URxvt*...

    Simple config file for urxvt:

    首先在当前用户的家目录创建 .Xresoures文件

    touch .Xresources
    
    code:
    Xft.dpi:		96
    URxvt*font:xft:FiraCode:antialias=true:pixelsize=21,xft:WenQuanYi Zen Hei:pixelsize=21
    URxvt*boldFont:xft:FiraCode:antialias=true:pixelsize=21,xft:WenQuanYi Zen Hei:pixelsize=21
    
    URxvt*depth:	32
    URxvt*background:		black
    URxvt*foreground:		green
    URxvt*borderColor:		cyan
    URxvt*borderLess:		false
    URxvt*internalBorder:	1
    URxvt*externalBorder:	-1
    URxvt*scrollBar:		false
    URxvt*scrollBar_floating:	false
    URxvt*scrollstyle:		plain
    URxvt*geometry:			92x25
    URxvt*cursorBlink:		true
    URxvt*saveLines:		99999
    
    # Transparent
    !URxvt.inheritPixmap: True
    !URxvt.tintColor: gray
    !URxvt.shading: 30
    
    
    效果:

    在这里插入图片描述

    本人喜欢简单,并没有过多配置 urxvt 的其他功能

    当然复制粘贴快捷键:Alt + Ctrl + C (复制) Alt + Ctrl + V (粘贴)

    一些快捷键如下:

    Ctrl + P		# 返回上一条命令
    Ctrl + A		# 光标移动到命令起始端
    Ctrl + E		# 光标移动到命令终止端
    Ctrl + B		# 光标向命令起始端单个字符移动
    Ctrl + F 		# 光标向命令终止端单个字符移动
    Ctrl + K		# 删除光标之后的命令
    Ctrl + U		# 删除光标之前的命令 
    Ctrl + R		# 搜索历史命令
    
    展开全文
  • urxvt

    千次阅读 2010-09-04 15:24:00
    urxvt -fg lightgray -bg black -cr 2 -bc -tr -tint lightgray -sh 20 -fn "xft:serif:Regular:pixelsize=16" -tn rxvt -sl 65535 -sr     ==============================================...

    urxvt -fg lightgray -bg black -cr 2 -bc -tr -tint lightgray -sh 20 -fn "xft:serif:Regular:pixelsize=16" -tn rxvt -sl 65535 -sr

     

     

    ============================================================================

    ~/.Xdefauts


    URxvt.title:URxvt-Unicode
    URxvt.termName:rxvt-unicode
    URxvt.scrollBar:false
    URxvt.saveLines:500

    URxvt.background:black
    URxvt.foreground:lightgray
    URxvt.colorBD:yellow
    URxvt.colorUL:Green
    !URxvt.font:xft:serif:Regular:pixelsize=16
    URxvt.font:xft:AR PL KaitiM GB:Regular:pixelsize=17:antialias=true
    URxvt.keysym.C-Up: command:]50;xft:AR PL KaitiM GB:Regular:pixelsize=20:antialias=true
    URxvt.keysym.C-Down:command:]50;xft:AR PL KaitiM GB:Regular:pixelsize=17:antialias=true


    ! bg transparent set
    URxvt.inheritPixmap: true
    URxvt.tintCddolor: lightgray
    URxvt.shading: 10

    URxvt.perl-lib: /home/jixiuf/.config/URxvt/
    URxvt.perl-ext-common:clipboard,vim_scrollback

    !URxvt.matcher.button:  1
    !Control+Shift+c 剪切
    !Control+Shift+v paste
    URxvt.keysym.Control-C: perl:clipboard:copy
    URxvt.keysym.Control-V: perl:clipboard:paste
    !M means Alt
    URxvt*vim-scrollback: M-s
    !URxvt*vim-scrollback-paste: M-p
    URxvt*vim-scrollback-bg: 16
    URxvt*vim-scrollback-fg: 10
    =============================================================

    /home/jixiuf/.config/URxvt/ 目录下有 clipboard,vim_scrollback

    两个文件

    clipboard 对剪切粘贴操作进行映射但是需要用到xsel(操作剪切板的命令)命令,必须先安装上

    clipboard文件内容如下

    #! /usr/bin/perl
    #这里做了两件事,一是把selection 复制到primary ,及clipboard 内
    #二是字义了copy paste 两个事件 ,可以键绑定
    #用法在.Xdefaults 里
    #指定perl 文件的存放在,需要把本文件复制到此目录下或者/usr/lib/uxrvt/perl/
    #URxvt.perl-lib: /home/jixiuf/.config/URxvt/
    #然后将本文件名加入到这里,此处本文件名为clipboard
    #URxvt.perl-ext-common:clipboard

    #Shift-Control-c copy 到clipboard  大写的C 表示Shift-c
    # URxvt.keysym.Control-C: perl:clipboard:copy
    #Shift-Control-v paste clipboard 的内容
    # URxvt.keysym.Control-V: perl:clipboard:paste


    #当有内容选中的时候调用
    #把selection 复制到primary ,及clipboard 内
    sub on_sel_grab {
        my $query = quotemeta $_[0]->selection;
        $query =~ s/
    //n/g;
        $query =~ s/ //r/g;
        system( "echo -en " . $query . " | xsel -i -b -p" );
    }

    sub copy {
       my ($self) = @_;
       my $pid = open( pout, "| xsel -i -b" ) or die "fork";
       print pout $self->selection;
       close(pout) or die "close";
    }

    sub paste {
       my ($self) = @_;
       my $content = `xsel -o -b` ;
       $self->tt_write ($content);
    }

    sub on_user_command {
       my ($self, $cmd) = @_;
       if ($cmd eq "clipboard:copy") {
          $self->copy;
       }
       if ($cmd eq "clipboard:paste") {
          $self->paste;
       }
    }

    ==========================================================================================

    vim_scrollback 文件内容如下, 一般用不到这个

    Alt+s 键后,会进行vim 操作模式Esc 退出 ,可以用jkhl 等vim 常用操作对urxvt 进行操作

    ################################################################################
    # Usage
    #
    # While not in vim scrollback mode
    # ctrl-v     - enter vim-scrollback mode
    # ctrl-r *   - pastes the primary clipboard onto the command line
    # ctrl-r +   - pastes the secondary clipboard onto the command line
    #
    # Note: both ctrl-v and ctrl-r can be configured to different values
    # (configuration examples further down).
    #
    # While in the vim scrollback mode the following key bindings work:
    # motions:
    # h j k l
    # w e b
    # 0 _ $
    # ctrl-u ctrl-d
    # gg G
    #
    # f<char> - jump to next occurrence of <char> on the current line
    # F<char> - jump to prev occurrence of <char> on the current line
    #
    # visual mode:
    # V v ctrl-v
    # gv - reselect last selection
    #
    # yank:
    # y - yank to primary clipboard (*)
    # Y - yank to secondary clipboard (+)
    #
    # paste:
    # p - pastes onto the end of the command line
    #
    # undo / redo:
    # u / ctrl-R - undo / redo pastes to command line
    #
    # marks:
    # m[a-z] '[a-z] ''
    #
    # search:
    # / - searches up
    # ? - searches down
    # n - next in current direction
    # N - next in opposite direction
    # * - search for word under the cursor
    #
    # misc:
    # gf - behave like the shipped matcher plugin for urxvt.  allows you to open a
    #      url or other configured pattern and launcher.  See matcher docs for info
    #      on configuring:
    #      http://cvs.schmorp.de/rxvt-unicode/doc/rxvtperl.3.html#PREPACKAGED_EXTENSIONS
    #
    # Note: counts can be supplied to most commands like in vim
    #
    ################################################################################
    # Configuration
    #
    # Vim scrollback supports various configuration settings which can be supplied
    # in your ~/.Xdefaults file.
    #
    # ; configure alt-s as the keybinding to enter vim scrollback mode.
    # URxvt*vim-scrollback: M-s
    #
    # ; configure alt-p as the keybinding to paste mode.
    # URxvt*vim-scrollback-paste: M-p
    #
    # ; configure the background and foreground colors used for the status bar while
    # ; in scrollback mode.
    # URxvt*vim-scrollback-bg: 16
    # URxvt*vim-scrollback-fg: 10
    #
    # ; configure the command used when opening urls. Note, uses the same
    # ; configuration as the url launcher script shipped with urxvt.
    # urxvt*urlLauncher: firefox
    #
    ################################################################################

    my $DEBUG = 1;
    my $DEBUG_FILE = '/tmp/urxvt_vim_scrollback.log';
    my $DEBUG_FH;

    # copied from matcher
    my $url =
       qr{
          (?:https?://|ftp://|news://|mailto:|file://|/bwww/.)
          [a-zA-Z0-9/-/@;//?:&=%/$_.+!*/x27,~#]*
          (
             /([a-zA-Z0-9/-/@;//?:&=%/$_.+!*/x27,~#]*/)| # Allow a pair of matched parentheses
             [a-zA-Z0-9/-/@;//?:&=%/$_+*~]  # exclude some trailing characters (heuristic)
          )+
       }x;

    sub on_init {
       my ($self) = @_;

       my $hotkey = $self->x_resource("vim-scrollback") || "M-v";
       $self->parse_keysym($hotkey, "perl:vim-scrollback:start")
          or warn "unable to register '$hotkey' as vim scrollback start hotkey/n";

       $hotkey = $self->x_resource("vim-scrollback-paste") || "M-r";
       $self->parse_keysym($hotkey, "perl:vim-scrollback:paste")
          or warn "unable to register '$hotkey' as vim paste hotkey/n";

       ()
    }

    sub on_user_command {
       my ($self, $cmd) = @_;
       $cmd eq "vim-scrollback:start" and $self->enter;
       $cmd eq "vim-scrollback:paste" and $self->paste;
       ()
    }

    # entry point for vim mode
    sub enter {
       my ($self) = @_;

       return if $self->{overlay};

       if ($DEBUG){
          open($DEBUG_FH, ">$DEBUG_FILE");
          select((select($DEBUG_FH), $| = 1)[0]);
       }

       $self->{view_start} = $self->view_start;
       $self->{pty_ev_events} = $self->pty_ev_events(urxvt::EV_NONE);
       $self->enable(
          key_press => /&key_press,
          resize_all_windows => /&resize_window
       );

       my ($lnum, $cnum) = $self->screen_cur();
       $self->{orig_nrow} = $self->nrow;
       $self->{orig_lnum} = $lnum;
       $self->{orig_cnum} = $cnum;
       $self->{out_lnum} = $lnum;
       $self->{out_cnum} = $cnum;
       $self->{visual_mode};
       $self->{visual_clnum};
       $self->{visual_ccnum};
       $self->{visual_slnum};
       $self->{visual_scnum};
       $self->{visual_elnum};
       $self->{visual_ecnum};
       $self->{visual_rectangle};

       my $end = $self->line($lnum)->end;
       if ($end == $self->nrow - 1){
         $self->screen_cur($end, 0);
         $self->scr_add_lines("/n");
         $self->{orig_lnum} = $lnum - 1;
         $self->{out_lnum} = $lnum - 1;
         $self->screen_cur($self->{orig_lnum}, $cnum);
       }

       $self->{term_buffer} = [];
       $self->{term_undo} = [];
       $self->{term_redo} = [];
       $self->{mode} = "normal";
       $self->{mode_info} = "";
       $self->{registers} = {};
       $self->{marks} = {};
       $self->{search_history} = [];
       $self->{key_buffer} = "";

       my $fg_color = $self->x_resource("vim-scrollback-fg");
       my $bg_color = $self->x_resource("vim-scrollback-bg");
       my $style = urxvt::OVERLAY_RSTYLE | urxvt::RS_Bold;
       $style = urxvt::SET_FGCOLOR($style, $fg_color) if $fg_color;
       $style = urxvt::SET_BGCOLOR($style, $bg_color) if $bg_color;
       $self->{msg_style} = $style;

       # modified from matcher
       my $urlLauncher = $self->my_resource("launcher") ||
                           $self->x_resource("urlLauncher") ||
                           "sensible-browser";
       # handle shell variable
       if ($urlLauncher =~ /^/$/) {
          $urlLauncher =~ s//$//;
          $urlLauncher = $ENV{$urlLauncher};
       }
       $self->{launcher} = $urlLauncher;

       # copied from matcher
       my @defaults = ($url);
       my @matchers;
       for (my $idx = 0; defined (my $res = $self->my_resource("pattern.$idx") || $defaults[$idx]); $idx++) {
          $res = $self->locale_decode($res);
          utf8::encode $res;
          my $launcher = $self->my_resource("launcher.$idx");
          $launcher =~ s//$&|/$/{&/}//${0}/g if ($launcher);
          # handle shell variable
          if ($launcher =~ /^/$/) {
             $launcher =~ s//$//;
             $launcher = $ENV{$launcher};
          }
          push @matchers, [qr($res)x, $launcher];
       }
       $self->{matchers} = /@matchers;

       $self->msg("");
    }

    sub leave {
       my ($self, $event) = @_;

       $self->term_write_flush();
       $self->disable("key_press", "resize_all_windows");
       $self->pty_ev_events($self->{pty_ev_events});
       $self->clear_selection($event);
       $self->screen_cur($self->{orig_lnum}, $self->{orig_cnum});
       $self->view_start($self->{view_start});
       $self->want_refresh;

       delete $self->{overlay};
       delete $self->{search};
       delete $self->{search_history};
       delete $self->{mode};
       delete $self->{mode_info};
       delete $self->{orig_lnum};
       delete $self->{orig_cnum};
       delete $self->{out_lnum};
       delete $self->{out_cnum};
       delete $self->{term_buffer};
       delete $self->{term_undo};
       delete $self->{term_redo};
       delete $self->{visual_mode};
       delete $self->{launcher};
       delete $self->{matchers};

       if ($DEBUG){
          close($DEBUG_FH);
       }
    }

    sub resize_window {
       my ($self, $t_width, $t_height) = @_;

       # prompt at bottom of term
       if($self->{orig_lnum} == $self->{orig_nrow} - 2){
          # adjust location of the prompt
          my $adj = $self->nrow - $self->{orig_nrow};
          $self->{orig_lnum} += $adj;

          # adjust location of last visual mode if necessary.
          if ($self->{visual_mode}){
            $self->{visual_slnum} += $adj;
            $self->{visual_elnum} += $adj;
            $self->{visual_clnum} += $adj;
          }

          # adjust all marks
          for my $key (keys %{$self->{marks}}){
             $self->{marks}{$key}[0] += $adj;
          }

          # failed attempt to reposition the cursor.
          #my ($lnum, $cnum) = $self->screen_cur();
          #$self->screen_cur($lnum + $adj, $cnum);
          #$self->debug("adj = $adj lnum = $lnum cnum = $cnum");
          #$self->view_start(List::Util::min 0, $lnum - ($self->nrow >> 1));
          #$self->want_refresh;
       }

       $self->{orig_nrow} = $self->nrow;
    }

    sub key_press {
       my ($self, $event, $keysym, $string) =  @_;

       #delete $self->{manpage_overlay};

       if ($self->{mode} eq "search"){
          return $self->key_press_search($event, $keysym, $string);
       }elsif ($self->{mode} =~ /visual/){
          return $self->key_press_visual($event, $keysym, $string);
       }

       return $self->key_press_normal($event, $keysym, $string);
    }

    sub key_press_normal {
       my ($self, $event, $keysym, $string) =  @_;

       $self->msg("");
       if ($keysym == 0xff1b ||
          $string =~ /^/cC$/ ||
          ($self->{key_buffer} =~ /^:qa?$/ && $keysym == 0xff0d))
       { # esc, ctrl-c, :q<enter>, :qa<enter>
          if($self->{key_buffer} and $self->{key_buffer} !~ /^:qa?$/){
             $self->{key_buffer} = "";
             $self->msg("");
          }else{
             $self->leave($event);
          }
          return 1;
       }

       # arbitrary limit on the number of keys we'll allow the user to press
       # without matching a command before we just stop recording them.
       if (length($self->{key_buffer}) < 5){
          $self->{key_buffer} .= $string;
       }
       $string = $self->{key_buffer};

       # parse out count if necessary
       $self->{repeat} = 1;
       if ($string =~ /^/d+/D/){
          (my $repeat = $string) =~ s/^(/d+)/D.*$//1/;
          $self->{repeat} = $repeat;
          $string =~ s/^/d+(.*)//1/;
       }

       # searching
       if ($string =~ /^[//?]$/) { # start search mode with / or ?
          ($self->{search_lnum}, $self->{search_cnum}) = $self->screen_cur();
          ($self->{search_slnum}, $self->{search_scnum}) = $self->screen_cur();
          my $line = $self->line($self->{search_lnum});
          $self->{search_cnum} = $line->offset_of($self->{search_lnum}, $self->{search_cnum});
          $self->{search_scnum} = $self->{search_cnum};
          ($self->{search_olnum}, $self->{search_ocnum}) = $self->screen_cur();
          $self->{mode} = "search";
          $self->{search} = "(?i)";
          $self->{search_save} = $self->{search};
          $self->{search_history_index} = -1;
          $self->{search_dir} = $string eq '/' ? -1 : 1;
          $self->{search_wrap} = 0;
          $self->search_prompt;
       } elsif ($string eq "*") { # find word under the cursor
          my ($lnum, $cnum) = $self->screen_cur();
          my $line = $self->line($lnum);
          my $index = $cnum + ($self->ncol * ($lnum - $line->beg));

          my $prefix = substr($line->t, 0, $index + 1);
          $prefix =~ s/.*/W(/w.*?)//1/;
          my $suffix = substr($line->t, $index + 1);
          $suffix =~ s/(/w.*?)/W.*//1/;
          if ($suffix =~ /^/s/){
            $suffix = '';
          }
          my $word = $prefix . $suffix;
          $self->{search} = "//b$word//b";
          unshift(@{$self->{search_history}}, $self->{search});
          $self->{search_dir} = -1;
          $self->{search_wrap} = 0;
          ($self->{search_lnum}, $self->{search_cnum}) = $self->screen_cur();
          ($self->{search_slnum}, $self->{search_scnum}) = $self->screen_cur();
          my $line = $self->line($self->{search_lnum});
          $self->{search_cnum} = $line->offset_of($self->{search_lnum}, $self->{search_cnum});
          $self->{search_scnum} = $self->{search_cnum};
          $self->search($event, $self->{search_dir}, 1);
          $self->{search_wrap} = 0;

       } elsif ($string eq "n") { # next search result (up)
          ($self->{search_lnum}, $self->{search_cnum}) = $self->screen_cur();
          ($self->{search_slnum}, $self->{search_scnum}) = $self->screen_cur();
          my $line = $self->line($self->{search_lnum});
          $self->{search_cnum} = $line->offset_of($self->{search_lnum}, $self->{search_cnum});
          $self->{search_scnum} = $self->{search_cnum};
          $self->search($event, $self->{search_dir}, 1);
          $self->{search_wrap} = 0;
       } elsif ($string eq "N") { # previous search result (down)
          ($self->{search_lnum}, $self->{search_cnum}) = $self->screen_cur();
          ($self->{search_slnum}, $self->{search_scnum}) = $self->screen_cur();
          my $line = $self->line($self->{search_lnum});
          $self->{search_cnum} = $line->offset_of($self->{search_lnum}, $self->{search_cnum});
          $self->{search_scnum} = $self->{search_cnum};
          $self->search($event, 0 - $self->{search_dir}, 1);
          $self->{search_wrap} = 0;

       # visual mode
       } elsif ($string eq "v") { # start char based visual selection mode
          $self->{mode} = "visual";
          $self->{mode_info} = "-- VISUAL -- ";
          ($self->{visual_lnum}, $self->{visual_cnum}) = $self->screen_cur();
          my ($lnum, $cnum) = $self->screen_cur();
          $self->move_cursor($event, $lnum, $cnum);
          $self->msg("");
       } elsif ($string eq "V") { # start line based visual selection mode
          $self->{mode} = "visual_line";
          $self->{mode_info} = "-- VISUAL LINE -- ";
          ($self->{visual_lnum}, $self->{visual_cnum}) = $self->screen_cur();
          my ($lnum, $cnum) = $self->screen_cur();
          $self->move_cursor($event, $lnum, $cnum);
          $self->msg("");
       } elsif ($string =~ /^/cV$/) { # start block based visual selection mode
          $self->{mode} = "visual_block";
          $self->{mode_info} = "-- VISUAL BLOCK -- ";
          ($self->{visual_lnum}, $self->{visual_cnum}) = $self->screen_cur();
          my ($lnum, $cnum) = $self->screen_cur();
          $self->move_cursor($event, $lnum, $cnum);
          $self->msg("");

       # paste
       } elsif ($string eq "p") {
          $self->set_mark("'");
          $self->term_write($event, $self->{registers}{'"'});

       # motions
       } elsif ($string eq "j") {
          my ($lnum, $cnum) = $self->screen_cur();
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             if ($lnum < $self->nrow - 2){
                $self->move_cursor($event, ++$lnum, $cnum);
             }
          }
       } elsif ($string eq "k") {
          my ($lnum, $cnum) = $self->screen_cur();
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             if ($lnum > $self->top_row){
                $self->move_cursor($event, --$lnum, $cnum);
             }
          }
       } elsif ($string eq "h") {
          my ($lnum, $cnum) = $self->screen_cur();
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             if ($cnum > 0){
                $self->move_cursor($event, $lnum, --$cnum);
             }
          }
       } elsif ($string eq "l") {
          my ($lnum, $cnum) = $self->screen_cur();
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             if ($cnum < $self->ncol - 1){
                $self->move_cursor($event, $lnum, ++$cnum);
             }
          }
       } elsif ($string eq "0") {
          my ($lnum, $cnum) = $self->screen_cur();
          my $line = $self->line($lnum);
          $self->move_cursor($event, $line->coord_of(0));
       } elsif ($string eq "_") {
          my ($lnum, $cnum) = $self->screen_cur();
          my $line = $self->line($lnum);
          my $ltrimmed = $line->t;
          $ltrimmed =~ s/^/s+//;
          my $offset = (length($line->t) - length($ltrimmed));
          $self->move_cursor($event, $line->coord_of(0 + $offset));
       } elsif ($string eq '$') {
          my ($lnum, $cnum) = $self->screen_cur();
          my $line = $self->line($lnum);
          $self->move_cursor($event, $line->coord_of($line->l - 1));
       } elsif ($string eq "gg") {
          $self->set_mark("'");
          $self->move_cursor($event, $self->top_row, 0);
       } elsif ($string eq "G") {
          $self->set_mark("'");
          $self->move_cursor($event, $self->{orig_lnum}, $self->{orig_cnum});
       } elsif ($string =~ /^/cD$/) {
          my ($lnum, $cnum) = $self->screen_cur();
          my $row = $lnum + 20;
          $row = $row < $self->{orig_lnum} ? $row : $self->{orig_lnum};
          $self->move_cursor($event, $row, $cnum);
       } elsif ($string =~ /^/cU$/) {
          my ($lnum, $cnum) = $self->screen_cur();
          my $row = $lnum - 20;
          $row = $row > $self->top_row ? $row : $self->top_row;
          $self->move_cursor($event, $row, $cnum);
       } elsif ($string eq "w" or $string eq "e") {
          my $pattern = $string eq "w" ? '/W/w' : '/w/W';
          my $adj = $string eq "w" ? 0 : -1;
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             my ($lnum, $cnum) = $self->screen_cur();
             my $line = $self->line($lnum);
             my $index = $cnum + ($self->ncol * ($lnum - $line->beg));
             my $suffix = substr($line->t, $index + 1);
             if($suffix =~ /$pattern/g){
                my $offset = $index + pos($suffix) + $adj;
                $self->move_cursor($event, $line->coord_of($offset));
             }elsif ($lnum < $self->nrow - 2){
                $self->move_cursor($event, $line->end + 1, 0);
             }
          }
       } elsif ($string eq "b") {
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             my ($lnum, $cnum) = $self->screen_cur();
             my $line = $self->line($lnum);
             my $index = $cnum - 1 + ($self->ncol * ($lnum - $line->beg));
             if($index > 0){
                my $prefix = substr($line->t, 0, $index);
                if($prefix =~ /.*/W/w/g){
                   my $offset = pos($prefix) - 1;
                   $self->move_cursor($event, $line->coord_of($offset));
                }elsif($cnum != 0){
                   $self->move_cursor($event, $lnum, 0);
                }
             }else{
                $self->screen_cur($lnum - 1, $self->ncol);
                $self->key_press_normal($event, $keysym, $string);
             }
          }
       } elsif ($string =~ /^f./) {
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             my ($lnum, $cnum) = $self->screen_cur();
             (my $char = $string) =~ s/^f(.)//1/;
             $char = quotemeta($char);
             my $line = $self->line($lnum);
             my $index = $cnum + ($self->ncol * ($lnum - $line->beg));
             my $suffix = substr($line->t, $index + 1);
             if($suffix =~ /$char/g){
                my $offset = $index + pos($suffix);
                $self->move_cursor($event, $line->coord_of($offset));
             }
          }
       } elsif ($string =~ /^F./) {
          for(my $ii = 0; $ii < $self->{repeat}; $ii++){
             my ($lnum, $cnum) = $self->screen_cur();
             (my $char = $string) =~ s/^F(.)//1/;
             $char = quotemeta($char);
             my $line = $self->line($lnum);
             my $index = $cnum - 1 + ($self->ncol * ($lnum - $line->beg));
             if($index > 0){
                my $prefix = substr($line->t, 0, $index);
                if($prefix =~ /.*$char/g){
                   my $offset = pos($prefix) - 1;
                   $self->move_cursor($event, $line->coord_of($offset));
                }
             }
          }

       # undo / redo
       } elsif ($string eq "u") {
          $self->set_mark("'");
          push(@{$self->{term_redo}}, pop(@{$self->{term_buffer}}));
          my ($slnum, $scnum, $elnum, $ecnum) = @{pop(@{$self->{term_undo}})};
          $self->screen_cur($slnum, $scnum);

          my ($beg, $end) = (0, 0);
          for(my $ii = $slnum; $ii <= $elnum; $ii++){
             $beg = ($ii == $slnum) ? $scnum : 0;
             $end = ($ii == $elnum) ? $ecnum : $self->ncol;
             for(my $jj = $beg; $jj <= $end; $jj++){
                $self->scr_add_lines(" ");
             }
          }

          $self->{out_lnum} = $slnum;
          $self->{out_cnum} = $scnum;
          $self->move_cursor($event, $slnum, $scnum);
       } elsif ($string =~ /^/cR$/) {
          $self->set_mark("'");
          $self->term_write($event, pop(@{$self->{term_redo}}));

       } elsif ($string =~ /^/cG$/) {
          if ($DEBUG){
             my ($lnum, $cnum) = $self->screen_cur();
          }

       # marks
       } elsif ($string =~ /^m[a-z']$/) {
          (my $mark = $string) =~ s/^m(.)//1/;
          $self->set_mark($mark);
       } elsif ($string =~ /^'[a-z']$/) {
          (my $mark = $string) =~ s/^'(.)//1/;
          my $lnum = $self->{marks}{$mark}[0];
          my $cnum = $self->{marks}{$mark}[1];
          $self->set_mark("'");
          $self->move_cursor($event, $lnum, $cnum);

       # g mappings
       } elsif ($string eq "gv") {
          if ($self->{visual_mode}){
             my ($sl, $sc) = ($self->{visual_slnum}, $self->{visual_scnum});
             my ($el, $ec) = ($self->{visual_elnum}, $self->{visual_ecnum});
             $self->move_cursor($event, $self->{visual_clnum}, $self->{visual_ccnum});
             $self->make_selection($event, $sl, $sc, $el, $ec, $self->{visual_rectangle});
             $self->{mode} = $self->{visual_mode};
          }
       } elsif ($string eq "gf") {
          my ($lnum, $cnum) = $self->screen_cur();
          my @exec = $self->command_for($lnum, $cnum);

          # handle ticket numbers
          # TODO: convert to generic url variable substitution support.
          if (@exec[1] =~ /^#/d+$/){
             (my $ticket = @exec[1]) =~ s/^#//;
             (my $url = @exec[0]) =~ s/<id>/$ticket/;
             @exec = ($self->{launcher}, $url);
          }

          if (@exec){
            $self->exec_async(@exec);
          }

       }elsif ($string =~ /^([0-9]+|[gm'])$/) {
          $self->msg($self->{msg});
          return 1;
       }

       $self->{key_buffer} = "";
       $self->msg($self->{msg});
       return 1;
    }

    sub key_press_search {
       my ($self, $event, $keysym, $string) =  @_;

       if ($keysym == 0xff0d || $keysym == 0xff8d) { # enter
          $self->normal_mode($event);
          unshift(@{$self->{search_history}}, $self->{search});
          if ($self->{search_found}){
             $self->set_mark("'");
             my ($lnum, $cnum) = ($self->{search_found}[0], $self->{search_found}[1]);
             if ($lnum){
                my $line = $self->line($lnum);
                ($lnum, $cnum) = $line->coord_of($cnum);
                $self->move_cursor($event, $lnum, $cnum);
             }
          }
       } elsif ($keysym == 0xff1b || $string =~ /^/cC$/) { # escape or ctrl-c
          $self->normal_mode($event, 1);
          $self->move_cursor($event, $self->{search_olnum}, $self->{search_ocnum});
       } elsif ($keysym == 0xff08) { # backspace
          substr $self->{search}, -1, 1, "";
          $self->{search_save} = $self->{search};
          $self->incremental_search($event);
       } elsif ($string !~ /[/x00-/x1f/x80-/xaf]/) {
          $self->{search} .= $self->locale_decode($string);
          $self->{search_save} = $self->{search};
          $self->incremental_search($event);
       } elsif ($keysym == 0xff52) { # up
          my $length = length(@{$self->{search_history}});
          if ($self->{search_history_index} < $length and $length > 0) {
             $self->{search_history_index}++;
             $self->{search} = @{$self->{search_history}}[$self->{search_history_index}];
             $self->incremental_search($event);
          }
       } elsif ($keysym == 0xff54) { # down
          if ($self->{search_history_index} > 0){
             $self->{search_history_index}--;
             $self->{search} = @{$self->{search_history}}[$self->{search_history_index}];
             $self->incremental_search($event);
          } elsif ($self->{search_history_index} == 0){
             $self->{search_history_index}--;
             $self->{search} = $self->{search_save};
             $self->incremental_search($event);
          }
       }

       1
    }

    sub key_press_visual {
       my ($self, $event, $keysym, $string) =  @_;

       if ($keysym == 0xff1b || $string =~ /^/cC$/) { # escape or ctrl-c
          $self->normal_mode($event, 1);
       } elsif ($string eq "v") {
          if ($self->{mode} eq "visual") {
             $self->normal_mode($event, 1);
          }else{
             $self->{mode} = "visual";
             $self->{mode_info} = "-- VISUAL -- ";
             my ($lnum, $cnum) = $self->screen_cur();
             $self->move_cursor($event, $lnum, $cnum);
             $self->msg("");
          }
       } elsif ($string eq "V") {
          if ($self->{mode} eq "visual_line") {
             $self->normal_mode($event, 1);
          }else{
             $self->{mode} = "visual_line";
             $self->{mode_info} = "-- VISUAL LINE -- ";
             my ($lnum, $cnum) = $self->screen_cur();
             $self->move_cursor($event, $lnum, $cnum);
             $self->msg("");
          }
       } elsif ($string =~ /^/cV$/) {
          if ($self->{mode} eq "visual_block") {
             $self->normal_mode($event, 1);
          }else{
             $self->{mode} = "visual_block";
             $self->{mode_info} = "-- VISUAL BLOCK -- ";
             my ($lnum, $cnum) = $self->screen_cur();
             $self->move_cursor($event, $lnum, $cnum);
             $self->msg("");
          }
       } elsif ($string eq "y") {
          $self->{registers}{'"'} = $self->selection();
          $self->normal_mode($event, 1);
       } elsif ($string eq "Y") {
          # the act of selecting puts the text on the primary, so just need to copy
          # to secondary.
          if (open(my $process, "| xclip -i -selection clipboard")){
             print $process $self->selection();
          }
          $self->normal_mode($event, 1);
       #} elsif ($string !~ /[/x00-/x1f/x80-/xaf]/) {
       }else{
          # pass to key_press_normal
          return $self->key_press_normal($event, $keysym, $string);
       }

       1
    }

    sub normal_mode {
       my ($self, $event, $clear_selection) =  @_;
       if ($self->{mode} =~ /^visual/){
          ($self->{visual_clnum}, $self->{visual_ccnum}) = $self->screen_cur;
          ($self->{visual_slnum}, $self->{visual_scnum}) = $self->selection_beg;
          ($self->{visual_elnum}, $self->{visual_ecnum}) = $self->selection_end;
          $self->{visual_mode} = $self->{mode};
          $self->{visual_rectangle} = $self->{mode} eq 'visual_block';
       }
       $self->{mode} = "normal";
       $self->{mode_info} = "";
       $self->msg("");
       if ($clear_selection){
          $self->clear_selection($event);
       }
    }

    sub search {
       my ($self, $event, $dir, $move_cursor) = @_;

       my ($search_row, $search_col) = ($self->{search_lnum}, $self->{search_cnum});
       my ($search_srow, $search_scol) = ($self->{search_slnum}, $self->{search_scnum});
       my ($top_row, $bot_row) = ($self->top_row, $self->nrow);
       my $search = $self->special_encode($self->{search});
       $self->{search_found} = [];

       no re 'eval'; # just to be sure
       if (my $re = eval { qr/$search/ }) {
          while (($dir < 0 and ((not $self->{search_wrap} and $search_row >= $top_row) or
                                $search_row > $search_srow)) or
                 ($dir > 0 and ((not $self->{search_wrap} and $search_row <= $bot_row) or
                                $search_row < $search_srow)))
          {
             my $line = $self->line($search_row)
                or last;

             my $text = $line->t;
             if ($text =~ /$re/g) {
                my ($slnum, $selscnum) = $line->coord_of($-[0]);
                my ($elnum, $selecnum) = $line->coord_of($+[0]);
                my $scnum = $-[0];
                my $ecnum = $+[0];

                while ($text =~ /$re/g and
                   ($dir < 0 or ($dir > 0 and $scnum <= $search_col)))
                {
                  my ($nlnum, $ncnum) = $line->coord_of($-[0]);
                  my $ncnum = $-[0];
                  if (($dir < 0 and $ncnum < $search_col) or
                      ($dir > 0 and $ncnum > $search_col))
                  {
                     ($slnum, $selscnum) = $line->coord_of($-[0]);
                     ($elnum, $selecnum) = $line->coord_of($+[0]);
                     $scnum = $-[0];
                     $ecnum = $+[0];
                  }
                }

                if (($dir < 0 and ($scnum < $search_col or $slnum < $search_row)) or
                    ($dir > 0 and ($scnum > $search_col or $slnum > $search_row)))
                {
                   $self->make_selection($event, $slnum, $selscnum, $elnum, $selecnum);
                   $self->{search_found} = [$slnum, $scnum];
                   $self->view_start(List::Util::min 0, $slnum - ($self->nrow >> 1));
                   if ($move_cursor){
                      $self->set_mark("'");
                      $self->{search_lnum} = $slnum;
                      $self->{search_cnum} = $scnum;
                      $self->move_cursor($event, $slnum, $selscnum);

                      if ($dir < 0 and $search_row > $search_srow
                            and not $self->{search_wrap_notify}){
                         $self->msg("search hit TOP, continuing at BOTTOM");
                         $self->{search_wrap_notify} = 1;
                      }elsif ($dir > 0 and $search_row < $search_srow
                            and not $self->{search_wrap_notify}){
                         $self->msg("search hit BOTTOM, continuing at TOP");
                         $self->{search_wrap_notify} = 1;
                      }
                   }
                   return $self->{search_found};
                }
             }
             if ($dir < 0 and $search_row == $top_row){
                $search_row = $bot_row;
                $search_col = $self->line($search_row)->l;
                $self->{search_wrap} = 1;
                $self->{search_wrap_notify} = 0;
             }elsif ($dir > 0 and $search_row == $bot_row){
                ($search_row, $search_col) = ($top_row, 0);
                $self->{search_wrap} = 1;
                $self->{search_wrap_notify} = 0;
             }else{
                $search_row = $dir < 0 ? $line->beg - 1 : $line->end + 1;
                $search_col = $dir < 0 ? $self->line($search_row)->l : -1;
             }
          }
       }

       return 0;
    }

    sub incremental_search {
       my ($self, $event) =  @_;

       $self->{search} =~ s/^/(/?i/)//
          if $self->{search} =~ /^/(.*[[:upper:]]/;

       if(not $self->search($event, $self->{search_dir})){
          $self->clear_selection($event);
          my $line = $self->line($self->{search_slnum});
          my ($lnum, $cnum) = $line->coord_of($self->{search_scnum});
          $self->move_cursor($event, $lnum, $cnum);
       }
       $self->{search_lnum} = $self->{search_slnum};
       $self->{search_cnum} = $self->{search_scnum};
       $self->{search_wrap} = 0;
       $self->search_prompt;

       1
    }

    sub search_prompt {
       my ($self) = @_;
       my $key = $self->{search_dir} == -1 ? '/' : '?';
       $self->msg("$key$self->{search}█");
    }

    sub move_cursor {
       my ($self, $event, $lnum, $cnum) = @_;
       $self->screen_cur($lnum, $cnum);

       if ($self->{mode} eq "visual"){
          my $vlnum = $self->{visual_lnum};
          my $vcnum = $self->{visual_cnum};
          if ($lnum > $vlnum or ($vlnum == $lnum and $cnum >= $vcnum)){
             $self->make_selection($event, $vlnum, $vcnum, $lnum, $cnum + 1);
          }else{
             $self->make_selection($event, $lnum, $cnum, $vlnum, $vcnum + 1);
          }
       }elsif ($self->{mode} eq "visual_line"){
          my $vlnum  = $self->{visual_lnum};
          if ($vlnum > $lnum){
             $self->make_selection($event, $lnum, 0, $vlnum, $self->ncol);
          }else{
             $self->make_selection($event, $vlnum, 0, $lnum, $self->ncol);
          }
       }elsif ($self->{mode} eq "visual_block"){
          my $vlnum = $self->{visual_lnum};
          my $vcnum = $self->{visual_cnum};

          my ($sl, $el) = $lnum < $vlnum ? ($lnum, $vlnum) : ($vlnum, $lnum);
          my ($sc, $ec) = $cnum < $vcnum ? ($cnum, $vcnum + 1) : ($vcnum, $cnum + 1);

          $self->make_selection($event, $sl, $sc, $el, $ec, 1);
       }
       $self->view_start(List::Util::min 0, $lnum - ($self->nrow >> 1));
       $self->want_refresh;
    }

    sub make_selection {
       my ($self, $event, $br, $bc, $er, $ec, $block) = @_;
       $self->selection_beg($br, $bc);
       $self->selection_end($er, $ec);
       $self->selection_make($event->{time}, $block);
    }

    sub clear_selection {
       my ($self, $event) = @_;
       $self->make_selection($event, -1, -1, -1, -1);
    }

    sub set_mark {
       my ($self, $mark) = @_;
       my ($lnum, $cnum) = $self->screen_cur();
       my @loc = ($lnum, $cnum);
       $self->{marks}{$mark} = /@loc;
    }

    sub term_write {
       my ($self, $event, $string) =  @_;

       # detect shell (mysql, postgres, python, etc) and use proper line
       # continuation
       my $shell = $self->line($self->{orig_lnum})->t;
       my $shell_continuation_start = "> ";
       my $shell_continuation_end = " //";
       if ($shell =~ /^(>>>|...) /){ # python
          $shell_continuation_start = ">>> ";
          $shell_continuation_end = "";
       }elsif ($shell =~ /^(mysql>|/s*->) /){ # mysql
          $shell_continuation_start = "    -> ";
          $shell_continuation_end = "";
       }elsif ($shell =~ /^/w+(=|-)(#|/>) /){ # postgres
          ($shell_continuation_start = $shell) =~ s/^(/w+)(=|-)(#|/>).*/$1-$3 /;
          $shell_continuation_end = "";
       }elsif ($shell =~ /^irb.*?(>|/*) /){ # irb
          (my $prefix = $shell) =~ s/^(irb.*?:).*/$1/;
          (my $suffix = $shell) =~ s/^irb.*?:[0-9]+(:.*?)(>|/*).*/$1/;
          (my $irbnum = $shell) =~ s/^irb.*?:([0-9]+):.*/$1/;
          $irbnum = sprintf('%03d', int($irbnum) + 1);
          $shell_continuation_start = "$prefix$irbnum$suffix> ";
          $shell_continuation_end = "";
       }elsif ($shell =~ /^(/?|>)> /){ # irb --simple-prompt
          $shell_continuation_start = ">> ";
          $shell_continuation_end = "";
       }

       $string =~ s/([^//])/n/$1 $shell_continuation_end/n/g;
       push(@{$self->{term_buffer}}, $string);

       my ($undo_slnum, $undo_scnum) = ($self->{out_lnum}, $self->{out_cnum});
       if ($string =~ //n/g) {
          my @lines = split(//n/, $string);
          foreach(@lines){
             $self->term_write_line($event, $_);
             $self->scr_add_lines("/n");
             $self->move_cursor($event, $self->{out_lnum} + 1, 0);
             $self->scr_add_lines($shell_continuation_start);
             $self->{out_lnum} += 1;
             $self->{out_cnum} = length($shell_continuation_start);
          }
       }else{
          $self->term_write_line($event, $string);
       }
       push(@{$self->{term_undo}},
          [$undo_slnum, $undo_scnum, $self->{out_lnum}, $self->{out_cnum}]);
    }

    # should only be called by term_write.
    sub term_write_line {
       my ($self, $event, $string) =  @_;

       my $data = $self->locale_encode($string);
       my $newline = "";
       $self->move_cursor($event, $self->{out_lnum}, $self->{out_cnum});
       $self->{out_cnum} += length($data);

       # account for edge case where scr_add_lines screws up on the next write if
       # the current data is up to the last column.
       if ($self->{out_cnum} == $self->ncol){
          $newline = "/n";
       }

       # adjust line and column where next write will start.
       while ($self->{out_cnum} >= $self->ncol){
          $self->{out_lnum} += 1;
          $self->{out_cnum} -= $self->ncol;
       }

       $self->scr_add_lines($string);

       # continuation of scr_add_lines edge case.
       if ($newline){
          $self->scr_add_lines($newline);
          $self->move_cursor($event, $self->{out_lnum}, $self->{out_cnum});
       }

       # hack to keep last line and cursor visible.
       if ($self->{out_lnum} == $self->nrow - 1){
         $self->scr_add_lines("/n/n");
         $self->{orig_lnum} -= 2;
         $self->{out_lnum} -= 2;
         $self->screen_cur($self->{out_lnum}, $self->{out_cnum});
         $self->view_start(List::Util::min 0, $self->{out_lnum} - ($self->nrow >> 1));
       }

       $self->want_refresh;
    }

    # should only be called by leave.
    sub term_write_flush () {
       my ($self) = @_;
       my $data = $self->locale_encode(join('', @{$self->{term_buffer}}));
       my @lines = split(//n/, $data);
       my $length = scalar(@lines);
       foreach(@lines){
          $self->tt_write($_);
          if ($length > 1){
             $self->tt_write("/n");
          }
       }
    }

    sub msg {
       my ($self, $msg) = @_;
       my $mode_info = $self->{mode_info};

       $self->{msg} = $msg;
       $msg = $self->special_encode("$mode_info" . $msg);

       my $start = $self->view_start();
       my $end = $start - $self->nrow;
       my $label = '';
       if ($start == $self->top_row){
          $label = 'Top';
       }elsif ($start == 0){
          $label = 'Bot';
       }else{
          $label = sprintf("%i%%", (abs($start) / abs($self->top_row)) * 100);
       }
       my $percentage = sprintf(" %3s", $label);

       my $pad = $self->ncol - length($msg) - 3;
       $msg = sprintf("%s %${pad}s", $msg, $self->{key_buffer} . $percentage);

       $self->{overlay} = $self->overlay(0, -1, $self->ncol, 1, $self->{msg_style}, 0);
       $self->{overlay}->set(0, 0, $msg);
    }

    # copied from matcher
    sub command_for {
       my ($self, $row, $col) = @_;
       my $line = $self->line ($row);
       my $text = $line->t;

       for my $matcher (@{$self->{matchers}}) {
          my $launcher = $matcher->[1] || $self->{launcher};
          while (($text =~ /$matcher->[0]/g)) {
             my $match = $&;
             my @begin = @-;
             my @end = @+;
             if (!defined($col) || ($-[0] <= $col && $+[0] >= $col)) {
                if ($launcher !~ //$/) {
                   return ($launcher, $match);
                } else {
                   # It'd be nice to just access a list like ($&,$1,$2...),
                   # but alas, m//g behaves differently in list context.
                   my @exec = map { s//$(/d+)|/$/{(/d+)/}/
                      substr($text,$begin[$1||$2],$end[$1||$2]-$begin[$1||$2])
                      /egx; $_ } split(//s+/, $launcher);
                   return @exec;
                }
             }
          }
       }

       ()
    }

    # copied from matcher
    sub my_resource {
       my $self = shift;
       $self->x_resource ("$self->{name}.$_[0]");
    }

    sub debug {
       my ($self, $msg) = @_;
       print $DEBUG_FH "$msg/n";
    }

    ####################################
    # Vim like pasting to terminal.
    ####################################

    # entry point for paste mode
    sub paste {
       my ($self, $selection) = @_;
       $self->enable(key_press => /&key_press_paste);
    }

    sub key_press_paste {
       my ($self, $event, $keysym, $string) =  @_;

       if ($string){
          my $selection = '';
          if ($string eq "*"){
             $selection = 'primary';
          }elsif ($string eq "+"){
             $selection = 'clipboard';
          }

          if ($selection){
             # avoid xclip hang when using primary with an active selection in the
             # current terminal.
             my $text = $self->selection();
             if($selection eq "primary" && $text){
                $self->tt_write($text);
             }else{
                if(open(my $process, "xclip -o -selection $selection |")){
                   $text = join('', <$process>);
                   $self->tt_write($text);
                }
             }
          }
          $self->disable("key_press");
          1
       }
    }

    # vim:shiftwidth=3:tabstop=3



    展开全文
  • 总览 这个存储库是我的模板,用于通过Ansible for Arch和... 航站楼:urxvt 外壳:zsh AUR Arch的辅助工具:trizen 安装后,您将拥有以下软件包。 Arch Linux 请参阅Roles / system / vars / main.yml 的Ubuntu
  • 定制的Urxvt Perl插件 修复url-select的问题 将计时器添加到tabbedex
  • Archlinux下i3wm与urxvt的配置

    千次阅读 2016-07-07 13:41:00
    前段时间学习了GitHub的两位前辈:Airblader和wlh320。...本篇博客则是根据他们的教程总结出来的,...这篇博客将告诉你如何配置一个漂亮的i3wm界面以及支持透明的urxvt。当然我这个透明是在i3wm下的,应该还会有别的通...

          前段时间学习了GitHub的两位前辈:Airblader和wlh320。他们的相关教程在https://github.com/Airblader/i3https://github.com/wlh320。本篇博客则是根据他们的教程总结出来的,当然大部分是直接扒的配置。这篇博客将告诉你如何配置一个漂亮的i3wm界面以及支持透明的urxvt。当然我这个透明是在i3wm下的,应该还会有别的通用方法,如果各位知道,请发到我的邮箱,感激不尽!

    1 urxvt的基本配置

    1.1 安装及配置文件

    urxvt是一个轻量级的终端,功能不是很多,但是用着很舒服。在Archlinux下安装它的命令为:

     #pacman -S urxvt  

    它的配置文件在$HOME/.Xresources这个文件中。

    1.2 配置文件代码

     1 !!$HOME/.Xresources
     2 URxvt.preeditType:Root
     3 !!调整此处设置输入法
     4 URxvt.inputMethod:fcitx
     5 !!颜色设置
     6 URxvt.depth:32
     7 !!中括号内数表示透明度
     8 URxvt.inheritPixmap:true
     9 URxvt.background:#000000
    10 URxvt.foreground:#ffffff
    11 URxvt.colorBD:Gray95
    12 URxvt.colorUL:Green
    13 URxvt.color1:Red2
    14 URxvt.color4:RoyalBlue
    15 URxvt.color5:Magenta2
    16 URxvt.color8:Gray50
    17 URxvt.color10:Green2
    18 URxvt.color12:DodgerBlue
    19 URxvt.color14:Cyan2
    20 URxvt.color15:Gray95
    21 !!URL操作
    22 URxvt.urlLauncher:chromium
    23 URxvt.matcher.button:1
    24 Urxvt.perl-ext-common:matcher
    25 !!滚动条设置
    26 URxvt.scrollBar:False
    27 URxvt.scrollBar_floating:False
    28 URxvt.scrollstyle:plain
    29 !!滚屏设置
    30 URxvt.mouseWheelScrollPage:True
    31 URxvt.scrollTtyOutput:False
    32 URxvt.scrollWithBuffer:True
    33 URxvt.scrollTtyKeypress:True
    34 !!光标闪烁
    35 URxvt.cursorBlink:True
    36 URxvt.saveLines:3000
    37 !!边框
    38 URxvt.borderLess:False
    39 !!字体设置
    40 Xft.dpi:96
    41 URxvt.font:xft:Source Code Pro:antialias=True:pixelsize=18,xft:WenQuanYi Zen Hei:pixelsize=18
    42 URxvt.boldfont:xft:Source Code Pro:antialias=True:pixelsize=18,xft:WenQuanYi Zen Hei:pixelsize=18
    View Code

    1.3 终端提示符配置

    写完.Xresources文件后,urxvt的终端提示符是黑白的,如何将提示符变成彩色的呢?详情参考我的另一篇博客:终端提示符的配置

    我的设置如下($HOME/.bashrc):

     PS1='\[\033[31m\]\h\[\033[34m\]@\u:\[\033[0;32m\]\w\[\033[33m\]>>> \[\033[0m\]' 

    1.4 生效

    改完了以上的内容,还缺少一步,让这个设置生效。我是直接把这个命令写进i3wm的启动配置文件$HOME/.xinitrc里了:

     xrdb -load ~/.Xresources

    现在除了透明,其他都不错的。

    2 i3wm的配置

    2.1 安装及配置文件

    i3wm是一个平铺式桌面管理器,Archlinux下载如下:

     #pacman -S i3wm 

    它的配置文件是$HOME/.config/i3/config。它的语法规则可以查看i3wm官方手册

    2.2 配置文件代码

     如果你没有找到这个config文件,则把/etc/i3/config这个文件复制过去,或者是直接运行命令

     #i3-config-wizard 

    这时候$HOME/.config/i3/config文件里的配置是比较基本的,这里介绍一下我添加的一些功能,或者是美化的部分。

    首先要清楚的是i3wm的特色是可以绑定各种快捷键,当然大部分是与mod有关,mod键可以由用户设定,可以是alt(Mod1)或者是win(Mod4)。

    介绍几种实用的改进:

    •设置win键为mod键,在配置文件里添加:

     set $mod Mod4 

    •win+enter键启动urxvt,透明启动哦!

    这里如果要想urxvt透明,先得安装compton,并且在配置文件里设置自启,安装如下

     #pacman -S compton 

    透明启动urxvt,在配置文件里添加:

      exec --no-startup-id compton -b #开机自启

      bindsym $mod+Return exec urxvt -sh 40 #透明参数0-100  

    •设置壁纸,首先安装feh,同样的pacman,这里不再赘述,安装完成后添加:

     exec_always --no-startup-id feh --bg-scale "/path/xxx.jpg" 

    •按键盘上的print键全屏截图,按win+print键用户自选区域截图,需要安装shutter,pacman搞定,然后添加:

     bindsym Print exec shutter -f -e -o ~/Pictures/shot/%Y-%m-%d-%T.png  

     bindsym $mod+Print exec shutter -s -e -o ~/Pictures/shot/%Y-%m-%d-%T.png  

    这里表示将截图保存在~/Picture/shot/文件夹里,名字为年-月-日-时间.png格式,当然了这些自己随便设定。

    •黑屏时间设定,即多久用户无操作黑屏i3wm的黑屏和屏保是一个意思,但是都得设置,如下:

    先把屏保功能关了:

     exec --no-startup-id xset s 0 

    然后黑屏、睡眠、断电时间分别设为6000s,8000s,9000s,也可以只写前一个,不必三个都写

     exec --no-startup-id xset dpms 6000 8000 9000 

    •win+shift+减号实现隐藏一个窗口,win+减号重新打开

     bindsym $mod+Shift+minus move scratchpad 

     bindsym $mod+minus scratchpad show 

    还有很多基本的功能,请参照i3wm官网手册来自己写。下面介绍三处较大改进的地方。

    2.3 工作区的配置

    下面的代码可以实现将我比较常用的软件在用户设定的工作区打开,下面是代码:

     1 #打开URxvt的同时切换到tab模式
     2 for_window [class="URxvt"] layout tabbed
     3 
     4 #打开软件时自动移至相应工作区
     5 assign [class="URxvt"] $WS1
     6 assign [class="Thunar"] $WS1
     7 assign [class="Firefox"] $WS2
     8 assign [class="Zathura"] $WS3
     9 assign [class="Gvim"] $WS4
    10 assign [class="Ise"] $WS5
    11 assign [class="VirtualBox"] $WS6
    View Code

    2.4 电源管理

    win+c可以调出选项,你可以选择锁屏(L),注销(O),重启(R),关机(S),退出选项(Esc)。

     1 #*********************************************电源管理*************************************
     2 set $mode_system  lock(L) logout(O) reboot(R) shutdown(S) exit(Esc)
     3 bindsym $mod+c mode "$mode_system"
     4 mode "$mode_system" {
     5     bindsym l exec --no-startup-id i3lock -c '#000000', mode "default"
     6     bindsym o exec --no-startup-id i3-msg exit, mode "default"
     7     bindsym r exec --no-startup-id systemctl reboot, mode "default"
     8     bindsym s exec --no-startup-id systemctl poweroff, mode "default"
     9     bindsym Escape mode "default"
    10 }
    View Code

    2.5 主题设置

    将i3bar美化,这里要用到脚本文件jconky以及i3bar美化文件conkyrc,后面我会贴下载地址,当然也可以按照下面的代码写一份。文件需要移至$HOME/.config/i3/下。

    注意:这里需要安装ttf-font-awesome字体(点击下载),AUR里有。且这里要安装conky

    jconky:

     1 #!/bin/sh
     2  
     3 # Send the header so that i3bar knows we want to use JSON:
     4 echo '{"version":1}'
     5  
     6 # Begin the endless array.
     7 echo '['
     8  
     9 # We send an empty first array of blocks to make the loop simpler:
    10 echo '[],'
    11  
    12 # Now send blocks with information forever:
    13 exec conky -c ~/.config/i3/conkyrc
    View Code

    conkyrc

     1 out_to_x no
     2 out_to_console yes
     3 background no
     4 double_buffer no
     5 update_interval 1
     6 total_run_times 0
     7 override_utf8_locale no
     8 short_units yes
     9 if_up_strictness address
    10 cpu_avg_samples 2
    11 
    12 TEXT
    13 [
    14 #{ "full_text" : "", "color": "\#BADA55"},
    15 #{ "full_text": " ${exec curl icanhazip.com}"},
    16 { "full_text" : ${if_up eno1}"  ${upspeed eno1}/s  ${downspeed eno1}/s"${else}""${endif}, "color" : "\#94F397" },
    17 { "full_text" : ${if_up wlo1}"  ${upspeed wlo1}/s  ${downspeed wlo1}/s"${else}""${endif}, "color" : "\#94F397" },
    18 { "full_text" : " ${cpu cpu0}%" , "color" : "\#8BC3E7" },
    19 { "full_text" : " ${mem}" , "color" : "\#B987D9" },
    20 { "full_text" : " ${fs_used_perc /}%" , "color" : "\#FF9D17" },
    21 { "full_text" : " ${battery_percent}%" , "color" : "\#A4DC6A" },
    22 { "full_text" : " ${time %Y/%m/%d %a}" , "color" : "\#ff797b" },
    23 { "full_text" : " ${time %H:%M}" , "color" : "\#8BADF9" }
    24 ],
    View Code

    config代码

     1 #**************************************************主题设置*********************************************
     2 # 窗口颜色                边框    背景    文字    提示
     3 client.focused          #333333 #333333 #FFFFFF #333333
     4 client.focused_inactive #999999 #999999 #FFFFFF #3399FF
     5 client.unfocused        #999999 #999999 #FFFFFF #3399FF
     6 client.urgent           #990000 #990000 #FFFFFF #990000
     7 client.placeholder      #000000 #000000 #FFFFFF #000000
     8 client.background       #FFFFFF
     9 
    10 #i3bar设置
    11 bar {
    12     i3bar_command i3bar -t
    13     height 28
    14     #禁止systemtray
    15     tray_output none
    16     # i3bar调用
    17     status_command ~/.config/i3/jconky
    18     # 显示位置top/bottom
    19     position bottom
    20     # 是否隐藏
    21     #mode hide
    22     # 拆解工作区名(隐藏前面的1:2:3:……)
    23     strip_workspace_numbers yes
    24     # 定义分隔符∥
    25     separator_symbol ""
    26 
    27     colors {
    28         background #10101000
    29         statusline #FFFFFF
    30         separator  #3399FF
    31         # 工作区颜色         边框    背景    文字
    32         focused_workspace  #3297FD #11111100 #FFFFFF
    33         active_workspace   #FFFFFF #FFFFFF00 #FFFFFF
    34         inactive_workspace #111111 #11111100 #FFFFFF
    35         urgent_workspace   #990000 #11111100 #FFFFFF
    36         binding_mode       #990000 #99000000 #FFFFFF
    37     }
    38 }
    View Code

    注:i3bar_command i3bar -t的-t参数实现i3bar的透明,前提是安装了i3gap,没有则不用-t。

    2.6 i3gaps

    可以透明化i3bar,也可以在使窗口之间设定透明间隔,安装和编译可以参考https://github.com/Airblader/i3

    安装具体如下:

    •首先在github下载文件,在bash中执行

     #git clone https://github.com/Airblader/i3 ~/i3-gaps --将文件下载到~/i3-gaps文件夹中 

    •进入i3-gaps目录,进行编译,执行:

     #make && make install 

    安装完成后,贴下config设置:

     1 #********************************************i3-gaps*********************************
     2 for_window [class="^.*"] border pixel 0
     3 gaps inner 8
     4 gaps outer 6
     5 set $mode_gaps Gaps: (o) outer, (i) inner
     6 set $mode_gaps_outer Outer Gaps: +|-|0 (local), Shift + +|-|0 (global)
     7 set $mode_gaps_inner Inner Gaps: +|-|0 (local), Shift + +|-|0 (global)
     8 bindsym $mod+Shift+g mode "$mode_gaps"
     9 
    10 mode "$mode_gaps" {
    11         bindsym o      mode "$mode_gaps_outer"
    12         bindsym i      mode "$mode_gaps_inner"
    13         bindsym Return mode "default"
    14         bindsym Escape mode "default"
    15 }
    16 
    17 mode "$mode_gaps_inner" {
    18         bindsym plus  gaps inner current plus 5
    19         bindsym minus gaps inner current minus 5
    20         bindsym 0     gaps inner current set 0
    21 
    22         bindsym Shift+plus  gaps inner all plus 5
    23         bindsym Shift+minus gaps inner all minus 5
    24         bindsym Shift+0     gaps inner all set 0
    25 
    26         bindsym Return mode "default"
    27         bindsym Escape mode "default"
    28 }
    29 mode "$mode_gaps_outer" {
    30         bindsym plus  gaps outer current plus 5
    31         bindsym minus gaps outer current minus 5
    32         bindsym 0     gaps outer current set 0
    33 
    34         bindsym Shift+plus  gaps outer all plus 5
    35         bindsym Shift+minus gaps outer all minus 5
    36         bindsym Shift+0     gaps outer all set 0
    37 
    38         bindsym Return mode "default"
    39         bindsym Escape mode "default"
    40 }
    View Code

    3 效果图

    说了这么多,终于到了秀桌面的时候了么,这些都是shutter截的图哦!

    各个工作区截图:

    工作区1,urxvt和thunar

    工作区2,firefox

    工作区3,Zathura,一个pdf阅读器,用法有着vim的特色

    工作区4,gvim

    ..........

    4 相关文件下载

    •font-awesome:开源的图标字体,可通过简单地复制粘贴使用,具体查看http://fontawesome.io/cheatsheet/

    •urxvt配置文件下载:click here

    •i3wm相关配置文件下载:click here

    完...

    转载于:https://www.cnblogs.com/vachester/p/5649813.html

    展开全文
  • Xresources:Xresources,包括URxvt和Xterm配置
  • tabbedalt:rxvt-unicode(urxvt)的扩展的选项卡式插件
  • 安装URxvt和weechat插件,甚至通过SSH和TMUX内部都具有来自weechat的桌面通知。 用法 通知消息的格式如下: $ printf "\e]777;im-notify;%d;%d;%s\a" 0 0 nick 如果第一个参数是1 ,则不会播放通知声音。 如果第二...
  • 使用并设置urxvt终端

    千次阅读 2017-03-11 11:49:29
    URxvt.font:-misc-fixed-medium-r-normal--14-*-*-*-*-*-iso10646-1,xft:WenQuanYi Bitmap Song:size=10 !颜色 Rxvt.background:black Rxvt.foreground:white Rxvt.colorBD:yellow Rxvt.colorUL:green !滚动条 Rxvt...
    一般使用系统自带的终端启动较慢,rxvt还是比较好的。

    Ubuntu安装rxvt使用命令:

    sudo apt-get install rxvt-unicode

    安装的unicode版的支持中文比较好。
    配置:用vim打开自己home目录下的 .Xresources

    vim ~/.Xresources

    输入以下内容:其中" ! "表示注释,可以直接粘贴

    !!=============================================================================
    !! RXVT-unicode setting
    !!=============================================================================
    !设置字体分辨率
    Xft.dpi:96
    !设置字体,其中的"14”代表字号大小
    URxvt.font:-misc-fixed-medium-r-normal--14-*-*-*-*-*-iso10646-1,xft:WenQuanYi Bitmap Song:size=10 
    !颜色
    Rxvt.background:black
    Rxvt.foreground:white
    Rxvt.colorBD:yellow
    Rxvt.colorUL:green
    !滚动条
    Rxvt.scrollBar:True
    Rxvt.scrollBar_right:True
    Rxvt.scrollBar_floating: False
    Rxvt.scrollstyle:plain
    !屏幕缓冲
    Rxvt.saveLines:10000
    Rxvt.color12:DodgerBlue
    Rxvt.menu:/etc/X11/rxvt.menu
    Rxvt.preeditType:Root
    !输入法设置
    !inputMethod:xim


    展开全文
  • Urxvt - awesome

    2019-10-06 00:06:44
    Urxvt - awesome Urxvt - awesomeUrxvtFrom awesomeJump to: navigation, searchrxvt-unicode (urxvt for short) is a clone of the rxvt term...
  • 指示 创建源文件 将文件/文件夹添加到基本目录,然后修改config.yaml以反映所需的符号链接映射。 保持所有自定义shell命令为幂等。 安装源文件 就像运行一样简单: ./install.sh 从此顶级目录。...
  • manjaro urxvt 复制粘贴方法

    千次阅读 2016-12-02 20:03:13
    惊人的发现鼠标中键也可以用作复制粘贴! 而且和系统剪贴板,即ctrl+c ctrl+v不是同一个,他们互不干扰!于是urxvt就用这种方法复制就好了。。。中键粘贴,框选即复制,到其他程序中也可以用鼠标中键粘贴出来
  • 达尔文的gentoo前缀覆盖。 所有软件包都可以在 osx Mavericks (10.9) 上构建 建筑与叮当 Clang 需要此 ebuild 中可用的较新的 binutils-apple。 Gentoo 允许您根据package.env有选择地选择编译器 ...
  • uRxvt 字体配置及时生效命令

    千次阅读 2013-07-21 14:04:59
    xrdb ~/.Xresources

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 549
精华内容 219
关键字:

urxvt