2

Simple goal:

Using GitBash for Windows, I would like to be able to paste my clipboard into gitbash Via CTRL+V.

Problem:

Every tutorial I can find says:

  1. Right-click on the Git Bash icon and select Properties. Under the

  2. Options tab, select QuickEdit Mode and click OK.

  3. Restart Git Bash and try pasting again using the right-click menu or Ctrl+V.

In fact, this has some paste shortcuts (middle mouse; CTRL+SHIFT+INSERT. But I don't like those!

Obviously this doesn't work (I'm here).

What I've tried:

Poking around like a child with a stick in a puddle.

MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ echo -e '"\C-v": paste' > ~/.inputrc
source ~/.inputrc
echo -e '"\e[1;5C": forward-word\n"\e[1;5D": backward-word' > ~/.inputrc
source ~/.inputrc
bash: \C-v:: No such file or directory
bash: $'\E[1;5C:': command not found
bash: $'\E[1;5D:': command not found
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ echo -e '"\e[1;5C": forward-word\n"\e[1;5D": backward-word' > ~/.inputrc
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ source ~/.inputrc
bash: $'\E[1;5C:': command not found
bash: $'\E[1;5D:': command not found
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ ^C
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ ^[[200~echo -e "\"\e[1;5C\": forward-word\n\"\e[1;5D\": backward-word" > ~/.inputrc
bash: $'\E[200~echo': command not found
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ echo -e "\"\e[1;5C\": forward-word\n\"\e[1;5D\": backward-word" > ~/.inputrc
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $ source ~/.inputrc
bash: $'\E[1;5C:': command not found
bash: $'\E[1;5D:': command not found
MINIGW 64 Git 2.39.2.windows.1: /z/py
Fri, 0323, 06:45 $

AHK script (not working as a workaround):

;ahk v1
SingleInstance, Force
^+v:: ;Ctrl+Shift+V.
SendInput %Clipboard% ;Sends the clipboard at keystroke speed.
return ;Exits the hotkey.

It would probably be more effective in AHK to do something like assign MiddleMouse, which I think would require the keyboard hook, or to have ctrl+v send shift+insert if that really works, like this:

;ahk v1.
#SingleInstance, Force
^v::+{ins}
7
  • 1
    Poking around like a child with a stick in a puddle. .. made my day. I don't think that this is an option but [Shift]+[Insert] is (old school keys for paste). Many of us left handed people still use this but it doesn't help you right handed people. Commented Mar 30, 2023 at 23:46
  • 1
    You could always launch it through an app like ConEmu.
    – Destroy666
    Commented Mar 31, 2023 at 3:40
  • Okay. I guess I'll try these approaches. I can't figure out how to customize it, but there are a lot of pasting options in the Keyboard and Mouse menu in Options from the top-left dropdown menu. Middle click, for example. Thanks! Commented Apr 1, 2023 at 2:26
  • You may use a product such as AutoHotKey to map only for git bash the keys ctrl+v to ctrl+shift+insert.
    – harrymc
    Commented Apr 1, 2023 at 19:20
  • @harrymc Yeah, I got a ahk keyset, but it doesn't work with gitbash for some reason: ahk v1 ^+v:: SendInput %Clipboard% return Commented Apr 3, 2023 at 14:33

1 Answer 1

1

Respectfully, just use shift+ins unless you have a very important reason not to: you should be using your apps with default settings to the extent that you can because it allows you to work on other devices.

To change that to ctrl+v you probably would need to do a custom build: I also tested bash.rc and could not get ctrl+v to work.

1
  • 2
    Respecfully, why break the standard used everywhere, and if not ctrl+v at least ctrl+shift+v like in most Linux terminals. And my 65% keyboard doesn't have an insert button.
    – Mehdi
    Commented Jan 29 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .