<commit_before>// Vimium/cVim
map('u', 'e');
mapkey('p', "Open the clipboard's URL in the current tab", function() {
    Front.getContentFromClipboard(function(response) {
        window.location.href = response.data;
    });
});
map('P' , 'cc');
map('gi', 'i');
map('_F', 'F');
map('_C', 'C');
map('F' , '_C');
map('C' , '_F');
map('gf', 'w');
map('`' , '\'');
map('H' , 'S');
map('L' , 'D');
map('gt', 'R');
map('gT', 'E');
map('K' , 'R');
map('J' , 'E');

// Unmap temporary keys
unmap('_F');

// Unmap emoji input
iunmap(':');

// settings.hintAlign = "left"

//Add shift-toggle for background hints
settings.hintShiftNonActive = true;

// Smart Page Boundary
settings.smartPageBoundary = true;

// Search aliases
removeSearchAliasX('b', 's') // Get rid of baidu
removeSearchAliasX('w', 's') // Get rid of bing

// Wikipedia search alias
addSearchAliasX(
  'w', // Alias
  'wikipedia', // Prompt
  'https://en.wikipedia.org/w/index.php?title=Special:Search&search=', // search url
  's', // leader key
  'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&namespace=0&limit=20&suggest=true&search=', // suggestion url
  (response) =>  JSON.parse(response.text)[1] // Response parser
);

// Pivotal tracker search alias
addSearchAliasX(
  'p',
  'pivotal story id',
  'https://www.pivotaltracker.com/story/show/',
  's'
);

// Change open detected URL to new tab
unmap("O");
mapkey('O', '#1Open detected links from text', function() {
  Hints.create(runtime.conf.clickablePat, function(element) {
      window.open(element[2]);
  }, {statusLine: "Open detected links from text"});
});

// Improve default remove query/fragment
mapkey('g?', '#4Reload current page without query', function() {
  window.location.href = window.location.href.replace(/\?[^?#]*/, '');
});
mapkey('g#', '#4Reload current page without hash fragment', function() {
  window.location.href = window.location.href.replace(/\#[^#]*/, '');
});
mapkey('gB', '#4Reload current page without query or hash fragment', function() {
  window.location.href = window.location.href.replace(/[#?].*/, '');
});

// Add copy without query/fragment
mapkey('y?', "#7Copy current page's URL without query", function() {
  Clipboard.write(window.location.href.replace(/\?[^?#]*/, ''))
});
mapkey('y#', "#7Copy current page's URL without hash fragment", function() {
  Clipboard.write(window.location.href.replace(/#[^#]*/, ''))
});
mapkey('yb', "#7Copy current page's URL without query or hash fragment", function() {
  Clipboard.write(window.location.href.replace(/[#?].*$/, ''))
});

// Base64 stuff
vmapkey("dy", "#9Base64 decode and copy selection", function() {
  const text = window.getSelection().toString()
  Clipboard.write(atob(text))
  Visual.toggle();
});

vmapkey("do", "#9Base64 decode selection and open as URL", function() {
  const text = window.getSelection().toString()
  window.open(atob(text));
  Visual.toggle()
});

// Bottom-style omnibar
settings.omnibarPosition = 'bottom';

// Open new tabs at end
settings.newTabPosition = 'last';

// Tomorrow night style hints
Hints.style('font-family: system-ui;');
Hints.style("font-family: system-ui;", "text");

// set theme
settings.theme = `
/* Edit these variables for easy theme making */
:root {
  /* Font */<commit_msg>Disable surfingkeys tabs at end<commit_after>// Vimium/cVim
map('u', 'e');
mapkey('p', "Open the clipboard's URL in the current tab", function() {
    Front.getContentFromClipboard(function(response) {
        window.location.href = response.data;
    });
});
map('P' , 'cc');
map('gi', 'i');
map('_F', 'F');
map('_C', 'C');
map('F' , '_C');
map('C' , '_F');
map('gf', 'w');
map('`' , '\'');
map('H' , 'S');
map('L' , 'D');
map('gt', 'R');
map('gT', 'E');
map('K' , 'R');
map('J' , 'E');

// Unmap temporary keys
unmap('_F');

// Unmap emoji input
iunmap(':');

// settings.hintAlign = "left"

//Add shift-toggle for background hints
settings.hintShiftNonActive = true;

// Smart Page Boundary
settings.smartPageBoundary = true;

// Search aliases
removeSearchAliasX('b', 's') // Get rid of baidu
removeSearchAliasX('w', 's') // Get rid of bing

// Wikipedia search alias
addSearchAliasX(
  'w', // Alias
  'wikipedia', // Prompt
  'https://en.wikipedia.org/w/index.php?title=Special:Search&search=', // search url
  's', // leader key
  'https://en.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&namespace=0&limit=20&suggest=true&search=', // suggestion url
  (response) =>  JSON.parse(response.text)[1] // Response parser
);

// Pivotal tracker search alias
addSearchAliasX(
  'p',
  'pivotal story id',
  'https://www.pivotaltracker.com/story/show/',
  's'
);

// Change open detected URL to new tab
unmap("O");
mapkey('O', '#1Open detected links from text', function() {
  Hints.create(runtime.conf.clickablePat, function(element) {
      window.open(element[2]);
  }, {statusLine: "Open detected links from text"});
});

// Improve default remove query/fragment
mapkey('g?', '#4Reload current page without query', function() {
  window.location.href = window.location.href.replace(/\?[^?#]*/, '');
});
mapkey('g#', '#4Reload current page without hash fragment', function() {
  window.location.href = window.location.href.replace(/\#[^#]*/, '');
});
mapkey('gB', '#4Reload current page without query or hash fragment', function() {
  window.location.href = window.location.href.replace(/[#?].*/, '');
});

// Add copy without query/fragment
mapkey('y?', "#7Copy current page's URL without query", function() {
  Clipboard.write(window.location.href.replace(/\?[^?#]*/, ''))
});
mapkey('y#', "#7Copy current page's URL without hash fragment", function() {
  Clipboard.write(window.location.href.replace(/#[^#]*/, ''))
});
mapkey('yb', "#7Copy current page's URL without query or hash fragment", function() {
  Clipboard.write(window.location.href.replace(/[#?].*$/, ''))
});

// Base64 stuff
vmapkey("dy", "#9Base64 decode and copy selection", function() {
  const text = window.getSelection().toString()
  Clipboard.write(atob(text))
  Visual.toggle();
});

vmapkey("do", "#9Base64 decode selection and open as URL", function() {
  const text = window.getSelection().toString()
  window.open(atob(text));
  Visual.toggle()
});

// Bottom-style omnibar
settings.omnibarPosition = 'bottom';

// Tomorrow night style hints
Hints.style('font-family: system-ui;');
Hints.style("font-family: system-ui;", "text");

// set theme
settings.theme = `
/* Edit these variables for easy theme making */
:root {
  /* Font */
{'fraction_non_alphanumeric': 0.21074443591711436, 'fraction_numerical': 0.006446661550268611, 'mean_word_length': 4.531409168081494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '454594', 'n_tokens_mistral': 2265, 'n_tokens_neox': 2207, 'n_words': 529}