in MySQL Command Line, how do I paste from the clipboard using only the keyboard? - mysql

Hi I'm learning MySQL using MySQL Workbench Command Line Client v 5.6 in Windows 7.
I type my commands into a text editor, then from the text edtor I copy them onto the clipboard. To paste them into the Command Line Client (CLC) I must right click with the mouse and go to "paste" in the context menu.
I would like to forgo the mouse entirely. But in the CLC, none of the Windows keyboard shortcuts seem to work. CTRL+V for example produces "^v" while SHIFT+INSERT does nothing.
Is there a keyboard shortcut for "paste"?

Although this question is clearly not a programming question this a way you can do this.
First you start by selecting the window with the command line. This can be done by alt + tab. Then when the command line windows is active you can paste the content of your clipboard with: alt + space Then go trough the menu with e and then p. The letters will dependent on the language from your windows OS.

If you are using Win 10, you can turn on CTRL + C and CTRL + V shortcuts to work in the command prompt:

If anyone else was trying to paste the password directly into the MySQL "Enter password" prompt, use ctrl+shift+v instead of ctrl+v

Related

Shorcut for `Run Line(s)` in Octave / Matlab

In RStudio it is Ctrl+Enter, while in PyCharm it is Ctrl+backslash, but I can't find a similar shortcut for Octave (not so interested in Matlab). There has to be a way to run a single line of code on the editor without running the entire document. I know there is a method to run chunks of code, but this doesn't seem practical, either.
You need to select the code that you want to run first. The actual shortcut to then execute the selection is configurable (Edit > Preferences...) but defaults to F9.
Or you can right click on the editor which shows you the options and shortcut:

Sublime Text 2 - Jump to a specific word

I am using Sublime Text and use the Cmd+F search tool very often. However everytime I use it, it highlight the word I am looking work and I then have to click on it to start typing there.
What is the shortcut to directly jump to the word I am looking for?
Many thanks
I'm assuming that as you said CMD + F rather than CTRL + F you are using the OSX version of Sublime Text.
The Windows / Linux shortcut for Goto word in current file is CTRL + ;
But if you look at the corresponding list for OSX shortcuts that one is missing.
(I am currently on a Windows machine so I can't test the lack of an OSX shortcut)

Split selection into lines in PHPStorm

In Sublime I was quite fond of the "Split selection into lines" shortcut (super+shift+l). However I cannot find an equivalent of that in PHP Storm 8, I've found a "Split into lines" function in the Edit menu but feeding it either \n or \r doesn't seem to work. Does that function exist in PS ?
By default on PHPStorm 10+, you can toggle the Column Selection Mode with:
CMD + SHIFT + 8
Of course, you can configure any stroke you like. I like to keep the original one and add the one that matches Sublime which is CMD + SHIFT + L. Here is how:
Another option would be to use column selection mode:
https://stackoverflow.com/a/30031481/672989
There is a "Split Selection into Lines" action in the Extra Actions plugin.
Compatible with: Compatible with: IntelliJ IDEA PhpStorm WebStorm PyCharm RubyMine AppCode CLion GoLand DataGrip Rider MPS Android Studio
If I have a 200 line selection I don't want to have to create a cursor at the end of every line.
You do not have to "create a cursor at the end of every line" -- just create cursor on the beginning of each line (on Windows it would be Alt+Mouse drag Down/Up) and then just press End button. This is not that straightforward as separate dedicated action .. but still does the same job and pretty easy to execute.
In any case: there is no such exact action currently available in PhpStorm, unfortunately.
Please follow this ticket (star/vote/comment) to get notified on progress: http://youtrack.jetbrains.com/issue/IDEA-122181

pressing ctrl+w in mysql workbench results in ETB

So I'm using the MySQL Workbench SQL Editor 5.2.45 CE
However whenever I try to close a tab using the keyboard shortcut Ctrl+W, instead of closing the tab it prints out "ETB" in the query editor instead and does not close the tab...
Any idea what's causing this and how to resolve it?
You are probably working on Windows. The ETB output is from the editor when the hotkey is not handled in the UI and hits the editors input processor without being defined for an action (like select word or copy to clipboard). The editor control is a Scintilla instance which is able to also display non-printable characters.
The hotkey Ctrl+W was previously used to close tabs, but since Ctrl+F4 is much more common on Windows it was changed. So use Ctrl+F4 in the future instead.

Syntax highlighting when pasting into emails

Im in the situation that I often send small codesnippets and xml-snippets to coworkers and partners via my outlook.
Has anyone got a good idea or tool that I can use to have my pastes syntaxhighlighted before I paste them into an email.
I was thinking of an intermediate paste to "$fancytool" and then I would have something to copy that will htmlified so I can copy paste it into the "compose email" window.
Edit-More-info:
Im pasting from windows within a VMWare virtual Machine, it might be eclipse, xmlspy, logfiles and other programs
Even-more-info:
I've seen this link how to do it from Vim. Unfortunately it seldom from vim im copying Code, and my email machine hasnt got any vim. The vmware machines has gvim, but I was hoping for an easier way that pasting to vim, saving to file, opening in internetexplorer and then copy/paste
Late but I can give an answer that works.
You need 2 things
putty
access to some Unix server (With vim)
In putty options, Under window → selection , turn the check box on for
Paste in to clipboard in RTF as well as plain text.
Log on to the server using putty.
start vim by typing vim
Paste your text (for example XML ) in to vim.
enter command mode (of vim by pressing ESC) and type
:set syn=xml.
Syntax highlighting kicks in.
Copy the text using mouse and paste it into your email.
5 years too late, sorry, but I've a much simpler solution than the accepted answer.
Use this online tool: http://tohtml.com/
copy the preview from your browser window and just paste into Word or Outlook.
Vim (or GVim) will output your code as formatted HTML. Then as long as your email is using an HTML format you can copy and paste it in.
Just an update on this matter, if you're on Windows, you can install Notepad++ (which is one of the best windows editors anyway), it comes out of the box with a plugin for this: "Copy text with Syntax Highlighting", when you select some text and right click on it.
If you just want the Add-In here it is.
If you want to know how it is done, here is an article on how to write the Add-In.
Comment: svrist mentioned a code paste site with syntax highlighting. Try http://codepad.org/
(don't have enough mojo to comment yet)
This link led me to SciTE.
Looks like SciTE has a Copy to RTF feature:
Edit(vmware upgrade):
But it looks like I am pretty much lost when I use vmware because I cant transfer rtf clipboard items to the vmware host. And I cant install software on the vmware host.
Maybe a paste-site with syntax highlighting?
If you're on Windows, Visual Studio does this automatically. At least it does for me, using Visual Studio 2005 on XP and copy/pasting to both MS Word and Lotus Notes
HeidiSQL does this for sql queries, and the syntax highlighting choices they made are quite readable. However, this will only work for sql queries, not other code. I like Notepad++ for Windows-based systems, and here are some instructions for Notepad++. Several people mentioned VIM for unix/shell environment.
For gVim (Windows), I defined this function and a convenience mapping:
function! HlCopy() range
exec a:firstline.','.a:lastline.'TOhtml'
normal yG
q!
!start /min powershell "Get-Clipboard | Set-Clipboard -AsHtml"
redraw
endfun
vmap Y :call HlCopy()<CR>
How to use?
Enter visual mode with v or by selecting text with left mouse. Then copy the current selection as raw text with y or highlighted text with Y.
Pass range directly (without visual mode): :1,3call HlCopy().
If you are lazy like me, you can set additional options for TOhtml in that function. I have this in my vimrc:
function! HlCopy() range
let g:html_font = "Consolas"
let g:html_number_lines = 0
exec a:firstline.','.a:lastline.'TOhtml'
normal yG
q!
!start /min powershell "Get-Clipboard | Set-Clipboard -AsHtml"
redraw
endfun
vmap Y :call HlCopy()<CR>