GithubHelp home page GithubHelp logo

Comments (9)

gkatsev avatar gkatsev commented on August 19, 2024

There's probably some way around it but it's super tricky, probably. Someone will need to investigate.

from vimperator-labs.

Markus00000 avatar Markus00000 commented on August 19, 2024

This also applies to the new GitHub editor which will insert __. How about an additional, secondary keybinding that is unlikely to be used by sites?

from vimperator-labs.

gkatsev avatar gkatsev commented on August 19, 2024

Heh, interesting. This isn't an issue on OSX because the shortcut is still <C-i> for the editor but github uses <Command-i> for the markdown insertion.
I'm not against adding another key combo, the question is whether something is available? I wouldn't want to just keep adding combos in insert mode.
You can also create your own mapping for it:

inoremap <C-g> <C-i>

from vimperator-labs.

Markus00000 avatar Markus00000 commented on August 19, 2024

While there is no guarantee, I assume it is rare that both <C-i> and <C-S-i> are bound in a text field.

inoremap <C-S-i> <C-i>

And to be consistent:

inoremap <C-S-t> <C-t>

At least these are easy to remember and might have a higher chance to work compared to a second binding like <C-g>.

from vimperator-labs.

benoit-pierre avatar benoit-pierre commented on August 19, 2024

Using inoremap <C-S-i> <C-i> is not a complete work around, as using the remapped shortcut to open the external editor interfere with other shortcuts, e.g.:

  • click on text field
  • press <C-S-i>: external editor appears
  • give focus back to the browser, unfocus the text field with <Esc> and press <:> to open the command line: nothing happens
  • close the external editor: now Vimperator is in command line mode

Note: using @blueyed editor configuration with an additional shortcut to work around those sites that use <C-i> does work fine however.

from vimperator-labs.

blueyed avatar blueyed commented on August 19, 2024

@benoit-pierre
So the key is to use another mapping (<F4> in my case), right? (https://github.com/blueyed/dotfiles/blob/f4634c1371e3e7553509e0632fe65a6ddd6758ff/vimperatorrc#L309)

(I mean: you do not have to use the whole advanced function.)
(I might have misunderstood that part)

from vimperator-labs.

Markus00000 avatar Markus00000 commented on August 19, 2024

In my case, <C-S-i> interferes with closing the dev tools. Instead of closing them, I sometimes end up editing a CSS property in gVim externally.

A second default shortcut for sites that intercept <C-i> should be:

  • cross-platform,
  • unused,
  • convenient (function keys are far away from the home row and might require pressing the Fn key),
  • easy to remember.

How about <C-S-e for “edit” or “external”?

from vimperator-labs.

benoit-pierre avatar benoit-pierre commented on August 19, 2024

My problem is not about the choice of alternate shortcut, but how mapping this alternate shortcut using inoremap <C-S-i> <C-i> result in a different behavior when using it. Using

js mappings.addUserMap([modes.INSERT], ["<C-S-i>"], "Launch the external editor.", function() { editor.editFieldExternally(); })

to setup the alternate mapping does however work fine.

from vimperator-labs.

Kodiologist avatar Kodiologist commented on August 19, 2024

I've found that the following Greasemonkey script, which I based on this, successfully undoes site-specific bindings of C-i, allowing Vimperator's C-i to work as normal. Add @include lines to taste. Also, there may be a way to implement this in one's .vimperatorrc rather than Greasemonkey.

// ==UserScript==
// @name           Disable site keyboard shortcuts
// @description    Stop websites from hijacking keyboard shortcuts
// @version 1
//
// @run-at         document-start
// @include        https://github.com/*
// @include        https://www.gamefaqs.com/boards/*
// @include        /^https://[a-z0-9]+.stackexchange.com/
// @grant          none
// ==/UserScript==

keycodes = [73];  // Keycode for 'i'

(window.opera ? document.body : document).addEventListener('keydown',
    function(e)
       {if (keycodes.indexOf(e.keyCode) != -1 && e.ctrlKey)
           {e.cancelBubble = true;
            e.stopImmediatePropagation();}
        return false;},
    !window.opera);

from vimperator-labs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.