将匹配的选项卡移动到pentadactyl中的新选项卡组

位移位器

有谁知道我是否可以将所有与表达式匹配的选项卡移动到另一个选项卡组中?如果是这样,怎么办?

发火的

解决方案。

  • 以下Pentadactyl ex文件(带有嵌入式Javascript)应提供一个命令,该命令将使所有选项卡的标签与正则表达式匹配,并将匹配的选项卡移至具有指定ID的组。请注意,匹配不区分大小写。

    " tgroup-moveselected.penta
    " Provides the command tgroup-moveselected, which moves all tabs matching a
    " given regular expression to the group with specified id.
    " eg.  :tgroup-moveselected "penta" "pentadactyl"
    "      moves any tabs whose label matches /pentadactyl/ to the group with id "penta"
    " Requires the TabGroupie plugin.
    
    command! tgroup-moveselected 
        \ -nargs=+ 
        \ -description "move tabs matching regex to a given group" 
        \ -js tgroupMoveSelected(args[0], RegExp(args[1]))
    
    js <<EOF
    
    function getPlugin(s) {
        for (x in plugins.contexts) {
            if (x.contains(s))
                return plugins.contexts[x][s];
        }
    }
    
    var TabGroupie = getPlugin("TabGroupie");
    
    function matchingTabs(rx) {
        var alltabs = tabs.allTabs;
        var alltabs = gBrowser.getTabsToTheEndFrom(0);
        function matches(t) {
            return rx.test(t.label.toLowerCase());
        }
        var matching = alltabs.filter(matches);
        return matching;
    }
    
    function matchingTabsInGroup(rx) {
        var alltabs = gBrowser.getTabsToTheEndFrom(0);
        function matches(t) {
            return rx.test(t.label.toLowerCase());
        }
        var matching = alltabs.filter(matches);
        return matching;
    }
    
    function tgroupMoveSelected (targetgrp, rx) {
        var matching = matchingTabs(rx);
        var tgrpId = TabGroupie.getIdByTitle(targetgrp);
        var i, t;
        for (i=0; i<matching.length; ++i) {
            t = matching[i];
            TabView.moveTabTo(t, tgrpId);
        }
        TabView.hide();
    }
    
    EOF
    
  • 我已将其作为Gist上传到Github ,因此,您可以根据需要从那里下载它。

  • 该脚本需要TabGroupie插件。

    警告:在我的系统上,放置此插件~/.pentadactyl/plugins(在Pentadactyl启动时加载)将完全破坏选项卡组的功能。要修复它,我必须禁用Pentadactyl,重新启动FF并重新启用Pentadactyl。解决方法似乎是Pentadactyl启动加载TabGroupie (通过将其从/plugins/目录中删除,并在FF启动后立即进行采购)。

推荐设置

  • tgroup-moveselected.pentaTabGroupie.js都保存~/.pentadactyl目录中。

  • 将以下行添加到您的.pentadactylrc

    command! tginit :source ~/.pentadactyl/TabGroupie.js | source ~/.pentadactyl/tgroupmoveselected.penta
    
  • 启动FF时,可以使用命令初始化Pentadactyl选项卡组功能:tginit

  • 如果要频繁使用某个模式和/或选项卡组,则可以创建映射或命令作为快捷方式。例如,如果要C-m用作热键将标题中带有“ pentadactyl”的所有选项卡发送到标识为“ penta”的选项卡组,则可以使用以下命令:

    :map <C-m> :tgroup-moveselected "penta" "pentadactyl"<CR>
    

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何使用键盘移动到 gedit 中的新选项卡?

将多个工作簿中的特定选项卡移动到单个工作簿中

将产品元数据移动到WooCommerce中的“描述”选项卡

如何将Notepad ++中的选项卡移动到新窗口?

在Firefox中分离选项卡的快捷键(将选项卡移动到新窗口)

如何将选项卡移动到另一个选项卡容器?

从当前选项卡内部移动到下一个选项卡

新的GUI Builder中的选项卡

在NERDTREE选项卡中移动选项卡

阻止jQuery选项卡移动到页面顶部

zsh使用shift选项卡移动到父目录

如何将servlet重定向到新选项卡并在新选项卡中打开Excel

按钮上的警报单击并将用户移动到打开的新选项卡

如何在iterm中将拆分窗格移动到新选项卡?

选择抽屉项目时滚动到新选项卡

在vscode中来自不同选项卡组的选项卡之间切换

Angular 4如何禁用角度材质选项卡组中的选项卡导航?

表单中的选项卡

用于将代码编辑器选项卡移动到 Visual Studio 中的新窗口的键盘快捷键

需要帮助将HTML + CSS选项卡移动到相应内容窗格的下方

将产品元数据移动到附加信息选项卡

侦听选项卡控件中的选项卡单击

jQuery UI选项卡中的选项卡对齐

Delphi:将PageControl选项卡区域滚动到右侧

选项卡引导中选项卡中选项卡中的嵌套选项卡

在选项卡TornadoFX中的选项卡内切换选项卡

Internet Explorer 11:将链接拖动到新选项卡按钮不再起作用

如何将选项卡添加到ActionBar中以进行滑动选项卡?

在Ionic 2中将数据从子选项卡传递到父选项卡