<commit_before>const Modes = {
  Unset: 0,
  Cx: 1,
  Mark: 2,
};

const baseExcludedApps = [
  '^org\\.gnu\\.Emacs$',
  '^org\\.gnu\\.AquamacsEmacs$',
  '^org\\.gnu\\.Aquamacs$',
  '^org\\.pqrs\\.unknownapp.conkeror$',
  '^com\\.microsoft\\.rdc$',
  '^com\\.microsoft\\.rdc\\.mac$',
  '^com\\.microsoft\\.rdc\\.macos$',
  '^com\\.microsoft\\.rdc\\.osx\\.beta$',
  '^net\\.sf\\.cord$',
  '^com\\.thinomenon\\.RemoteDesktopConnection$',
  '^com\\.itap-mobile\\.qmote$',
  '^com\\.nulana\\.remotixmac$',
  '^com\\.p5sys\\.jump\\.mac\\.viewer$',
  '^com\\.p5sys\\.jump\\.mac\\.viewer\\.web$',
  '^com\\.teamviewer\\.TeamViewer$',
  '^com\\.vmware\\.horizon$',
  '^com\\.2X\\.Client\\.Mac$',
  '^com\\.apple\\.Terminal$',
  '^com\\.googlecode\\.iterm2$',
  '^co\\.zeit\\.hyperterm$',
  '^co\\.zeit\\.hyper$',
  '^io\\.alacritty$',
  '^net\\.kovidgoyal\\.kitty$',
  '^org\\.vim\\.',
  '^com\\.qvacua\\.VimR$',
  '^com\\.vmware\\.fusion$',
  '^com\\.vmware\\.horizon$',
  '^com\\.vmware\\.view$',
  '^com\\.parallels\\.desktop$',
  '^com\\.parallels\\.vm$',
  '^com\\.parallels\\.desktop\\.console$',
  '^org\\.virtualbox\\.app\\.VirtualBoxVM$',
  '^com\\.vmware\\.proxyApp\\.',
  '^com\\.parallels\\.winapp\\.',
  '^org\\.x\\.X11$',
  '^com\\.apple\\.x11$',
  '^org\\.macosforge\\.xquartz\\.X11$',
  '^org\\.macports\\.X11$',
  '^com\\.microsoft\\.VSCode$'
];

const webBrowsers = [
  '^com\\.google\\.Chrome$',
];

const ides = [
  '^com\\.jetbrains\\.intellij$',
];

const terminals = [
  '^com\\.apple\\.Terminal$',
  '^com\\.googlecode\\.iterm2$',
];

module.exports = {
  title: `kui's Bindings`,
  rules: [
    ////////////////////////////////////////////////////////////
    {
      description: 'Terminal',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_if',
          bundle_identifiers: terminals
        }
      ], [
        // bindKey('any? + left_option', 'left_command'),
        bindKey('left_option', 'left_command'),
        // bindKey('any? + left_command', 'left_option'),
        bindKey('left_command', 'left_option'),
        bindKey('option + shift? + tab', 'command + tab'),
      ]),
    },

    /////////////////////////////////////////////////////////////
    {
      description: 'Web Browser',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_if',
          bundle_identifiers: webBrowsers,
        },
      ], [
        bindKey('control + shift? + t', 'command + t'),
        bindKey('control + shift? + l', 'command + l'),
        bindKey('control + shift? + r', 'command + r'),
        bindKey('command + shift + period', 'command + down_arrow'),
        bindKey('command + shift + comma', 'command + up_arrow'),
      ]),
    },

    /////////////////////////////////////////////////////////////
    {
      description: 'IDE',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_if',
          bundle_identifiers: ides,
        },
      ], [
        bindKey('command + x', 'command + 3'),
        bindKey('command + i', 'command + e'),
        bindKey('control + o', 'f3'),
        bindKey('control + s', 'command + j'),
        bindKey('command + slash', 'control + spacebar'),
        Object.assign(
          bindKey('control + f', [
            'command + shift + r',
            unsetMode()
          ]),
          { conditions: [{
            type: 'variable_if',
            name: 'mode',
            value: Modes.Cx,
          }]},
        )
      ]),
    },

    /////////////////////////////////////////////////
    {
      description: 'Like Emacs',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_unless',
          bundle_identifiers: baseExcludedApps,
        },
      ], [
        // Mark mode
        bindKey('control + spacebar', setMode(Modes.Mark)),
        ...conditionsGroup(
          [{
            type: 'variable_if',
            name: 'mode',<commit_msg>add key bind to jump to top/bottom<commit_after>const Modes = {
  Unset: 0,
  Cx: 1,
  Mark: 2,
};

const baseExcludedApps = [
  '^org\\.gnu\\.Emacs$',
  '^org\\.gnu\\.AquamacsEmacs$',
  '^org\\.gnu\\.Aquamacs$',
  '^org\\.pqrs\\.unknownapp.conkeror$',
  '^com\\.microsoft\\.rdc$',
  '^com\\.microsoft\\.rdc\\.mac$',
  '^com\\.microsoft\\.rdc\\.macos$',
  '^com\\.microsoft\\.rdc\\.osx\\.beta$',
  '^net\\.sf\\.cord$',
  '^com\\.thinomenon\\.RemoteDesktopConnection$',
  '^com\\.itap-mobile\\.qmote$',
  '^com\\.nulana\\.remotixmac$',
  '^com\\.p5sys\\.jump\\.mac\\.viewer$',
  '^com\\.p5sys\\.jump\\.mac\\.viewer\\.web$',
  '^com\\.teamviewer\\.TeamViewer$',
  '^com\\.vmware\\.horizon$',
  '^com\\.2X\\.Client\\.Mac$',
  '^com\\.apple\\.Terminal$',
  '^com\\.googlecode\\.iterm2$',
  '^co\\.zeit\\.hyperterm$',
  '^co\\.zeit\\.hyper$',
  '^io\\.alacritty$',
  '^net\\.kovidgoyal\\.kitty$',
  '^org\\.vim\\.',
  '^com\\.qvacua\\.VimR$',
  '^com\\.vmware\\.fusion$',
  '^com\\.vmware\\.horizon$',
  '^com\\.vmware\\.view$',
  '^com\\.parallels\\.desktop$',
  '^com\\.parallels\\.vm$',
  '^com\\.parallels\\.desktop\\.console$',
  '^org\\.virtualbox\\.app\\.VirtualBoxVM$',
  '^com\\.vmware\\.proxyApp\\.',
  '^com\\.parallels\\.winapp\\.',
  '^org\\.x\\.X11$',
  '^com\\.apple\\.x11$',
  '^org\\.macosforge\\.xquartz\\.X11$',
  '^org\\.macports\\.X11$',
  '^com\\.microsoft\\.VSCode$'
];

const webBrowsers = [
  '^com\\.google\\.Chrome$',
];

const ides = [
  '^com\\.jetbrains\\.intellij$',
];

const terminals = [
  '^com\\.apple\\.Terminal$',
  '^com\\.googlecode\\.iterm2$',
];

module.exports = {
  title: `kui's Bindings`,
  rules: [
    ////////////////////////////////////////////////////////////
    {
      description: 'Terminal',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_if',
          bundle_identifiers: terminals
        }
      ], [
        // bindKey('any? + left_option', 'left_command'),
        bindKey('left_option', 'left_command'),
        // bindKey('any? + left_command', 'left_option'),
        bindKey('left_command', 'left_option'),
        bindKey('option + shift? + tab', 'command + tab'),
      ]),
    },

    /////////////////////////////////////////////////////////////
    {
      description: 'Web Browser',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_if',
          bundle_identifiers: webBrowsers,
        },
      ], [
        bindKey('control + shift? + t', 'command + t'),
        bindKey('control + shift? + l', 'command + l'),
        bindKey('control + shift? + r', 'command + r'),
        bindKey('command + shift + period', 'command + down_arrow'),
        bindKey('command + shift + comma', 'command + up_arrow'),
      ]),
    },

    /////////////////////////////////////////////////////////////
    {
      description: 'IDE',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_if',
          bundle_identifiers: ides,
        },
      ], [
        bindKey('command + x', 'command + 3'),
        bindKey('command + i', 'command + e'),
        bindKey('control + o', 'f3'),
        bindKey('control + s', 'command + j'),
        bindKey('command + slash', 'control + spacebar'),
        Object.assign(
          bindKey('control + f', [
            'command + shift + r',
            unsetMode()
          ]),
          { conditions: [{
            type: 'variable_if',
            name: 'mode',
            value: Modes.Cx,
          }]},
        ),
        bindKey('command + shift + period', 'command + down_arrow'),
        bindKey('command + shift + comma', 'command + up_arrow'),
      ]),
    },

    /////////////////////////////////////////////////
    {
      description: 'Like Emacs',
      manipulators: conditionsGroup([
        {
          type: 'frontmost_application_unless',
          bundle_identifiers: baseExcludedApps,
        },
      ], [
        // Mark mode
        bindKey('control + spacebar', setMode(Modes.Mark)),
        ...conditionsGroup(
          [{
            type: 'variable_if',
            name: 'mode',
{'fraction_non_alphanumeric': 0.2750340388661963, 'fraction_numerical': 0.004455997029335313, 'mean_word_length': 1.6701916721744878, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3850257', 'n_tokens_mistral': 2908, 'n_tokens_neox': 2738, 'n_words': 377}