Using Sublime Text 2 key bindings in PyCharm - keyboard-shortcuts

I would like to use the Sublime Text 2 key bindings in Pycharm. I know how to edit it one by one. Is there a way to override the entire keymap in one shot?
Something like
export the key bindings from sublime text 2
convert it into Pycharm's format
import it into Pycharm
Pycharm has some pre-configured keymaps. If there's a text / XML / JSON file where these maps are stored, I can try to convert it myself.

PyCharm now has Sublime Text keymap inbuilt as an alternative to Default Keymap.
Go to Setting -> Keymap and select Sublime Text from Keymap dropdown.
Hope that helps.

After poking around, I feel there's no easy way to do this.
If you change the default bindings, PyCharm creates a file in user space that shows the format of keymap. Theoretically, one could override all the fields in this file. But the problem is, there's no standard way of describing the action performed by a shortcut. Someone will have to do it manually, for each macro, to establish a correspondence between the actions performed by PyCharm & Sublime Text.

There is an IntelliJ request for this in their Youtrack tracker: IDEA-111333 Provide Sublime Text keymap.
From that thread, I found a repository for another remapping project. The keybinding file that imitates most of Sublime text can be found at in the directory PHPStorm-SpacePeacock/win_linux-keymaps-only/keymaps/Default for GNOME copy.xml. From the README:
The key mapping has been updated to better fit Sublime Text
conventions. Because I didn't think that ctrl + shift + alt + t is a
reasonable key combination for something as frequently used as
Refactor This.
Additionally, "search everywhere" HAD to be changed because
double-tapping left-shift is a two stroke trigger. This is a problem
because as you're working the IDE will be busy with analyzing,
indexing, and all of the things that IDEs do. If it's busy when you
try to hit the first left-shift, then the second left-shift won't pop
up the window. As far as user interfaces go, you should never have any
lack of confidence that an action will trigger the appropriate
response. Once you have that, you have to visually check each
operation which is slow and creates cognitive overhead. Consequently,
this was changed to ctrl + p (also to match Sublime Text) which
completely removes this problem.
ctrl + p search everywhere
ctrl + r search methods in current file
ctrl + alt + p change projects
ctrl + shift + enter complete current statement
ctrl + alt + enter refactor this
alt + enter show intended actions (intentions are one of my favorite
part JetBrains software)
ctrl + n new thing dialog
ctrl + shift + f format code
ctrl + d select word at cursor, or if a word is selected the select
the next occurrence of the word (multiple-cursors)
ctrl + t run tests
ctrl + alt + h show local history
ctrl + alt + r git conflict merge tool

(Less popular) keymaps that can be used with JetBrains Rider but not included in the installation package.
https://github.com/JetBrains/rider-non-bundled-keymaps
Intalling keymaps
In releases, get the sublime-text-keymap.jar file for the desired keymap.
In your IDE, choose File | Import Settings... from the menu and select the sublime-text-keymap.jar file.

Related

What are the bigquery keyboard shortcuts?

Google's bigquery editor has keyboard shortcuts. For example ctrl+space composes a new query. I suspect there are more shortcuts, but I haven't found an useful list of them. Does anyone know them?
Ctrl + Space: If no query is open: compose new query. If query editor is open: autocomplete current word.
Ctrl + Enter: Run current query.
Tab: Autocomplete current word.
Ctrl: Highlight table names.
Ctrl + click on table name: Open table schema.
Ctrl + E: Run query from selection.
Ctrl + /: Comment current or selected line(s).
Ctrl + Shift + F: Format query.
(on Mac, replace Ctrl with Cmd)
This is the list from the official documentation: https://cloud.google.com/bigquery/docs/bigquery-web-ui#keyboard_shortcuts
You can see the shortcuts on the UI.
I found myself constantly refreshing bq page by accidentally hitting F5 as it is commonly used shortcut in many data tools for query/script execution. So in recently published Chrome Extension - BigQuery Mate - I have added F5 to execute query while in query editor.
Just Added:
I realized (a little ago) that one more shortcut is available now that i didn't know or see anyone mentioned before and was not available at a time this question was asked:
While your mouse is over Query Editor - pressing Alt - enters you into mode of copy of any rectangular part of your code. Quite useful!
July, 7 2016 Refresh:
I thought it also can be helpful to refresh this post with some BgQuery Mate keyboard shortcuts:
F5 – run query
Ctrl + F5 – run selection
F1 – help on selected or under-cursor-position keyword/function - opens respective documentation (SQL Version sensitive - Legacy / Standard)
Ctrl + Alt + / and Shift + Ctrl + Alt + / - comment/uncomment outside selection
Contextual Menu
Right Click > BigQuery Mate > Help on selected keyword/function – opens respective documentation (SQL Version sensitive - Legacy / Standard)
Right Click > BigQuery Mate > Preserve Format anywhere in Editor – Preserve Format – adjust Query Text such that further copy/paste preserves casing
I don't know all of them, but this seems a good place to share those I know:
ctrl+enter: runs the query
tab: autocomple
keep ctrl pressed: highlights the tables, clicking on them takes you to it
(note that in Apple ctrl might be the command key - I didn't know about ctrl+space, but it might be overloaded by mac os)
Continuing from Felipe Hoffa's answer above, the following keyboard shortcuts work on the Mac:
ctrl+enter: runs the query (same as Windows)
tab: autocompletes
keep the command key pressed: highlights the tables, clicking on them takes you to it.
Apparently, in the new tabbed view UI, there's two new keyboard shortcuts:
Alt+↑: move line of code up
Alt+↓: move line of code down
There might be others. I found them by accidentally hitting these keys. I can't find any documentation on these shortcuts, or I would include it.

Intellij IDEA with ideavim. Cannot copy text from another source

I tried to copy text from IDEA with ideavim plugin, using default vim keybindings (y). But this text isn't copied in global buffer and i can paste it only in IDEA.
How can I use copied piece of text in browser, for example?
Vim's yank command doesn't yank to the system clipboard by default; it yanks to the unnamed register. You can use the * or + register to access the system clipboard; also see this wiki article for more information. Or just set this option in your ~/.ideavimrc:
set clipboard+=unnamed
This ~/.ideavimrc setting has been supported in IdeaVim since VIM-476 was implemented in version 0.38. If the file does not exist create it in your user/home directory.
Note also that this is all standard Vim behavior; none of it is specific to IdeaVim except for the name of the config file.
Another option is that you can go to the setting of the ideavim plugin and set ctrl + c and ctrl + v to be handled by the IDE and not by vim.
This will allow you to copy and paste as usual in the IDE and paste outside the IDE as well.
Note
when you set ctrl + v to be handled by the IDE ctrl + v for selection will not work in VIM. As an alternative you might just use ctrl + shift + v in IDE as default (works by default for paste with selection)
Steps
in your lower right corner select settings:
Then search for the shortcut and select the option IDE for handler.

How can I select next occurrence in IDEA editors

Ctrl+D performs the find_under_expand command in sublime. This basically searched for the next occurrence of the already selected text and selected it, so when I edit, it's edited on both places at the same time. I'm currently trying to move to IDEA editors (such as WebStorm, PHPStorm, PyCharm, etc) but didn't find something like this command in this IDE yet.
I believe they recently added this to the latest IntelliJ release, and I would assume PhpStorm as well. As the bindings are system specific, take a look at http://blog.jetbrains.com/phpstorm/2014/03/working-with-multiple-selection-in-phpstorm-8-eap/. Looks like that version is available through EAP, so don't know when they will release it for general consumption (or if they have already).
DEFAULT SHORTCUTS
Alt+J on Windows and Linux, Ctrl+G on Mac OS X
On Mac OS X, you can select the next occurrence with Ctrl+G
In the settings window, search for ”Add Selection for Next Occurence” (PhpStorm 8.0.1)
On mac the default is ctrl+G, but you can change it to ctrl+D (or cmd+D on mac)
Currently its mapped with
for selection, Alt + J
for unselection, Alt + Shift + J
but if you're familiar with sublime shortcuts like Ctrl + D
Jetbrains give you an option to change settings,
Settings -> Keymap -> Editor Actions
search for multiple selection, find Alt + J
then right click -> select change keyboard shortcuts
set shortcuts you want as like sublime, Ctrl + D
Here is the Docs
On Windows
Alt+j - Multiple Select
Alt+Shift+j - Unselect Multiple Select
I think what you want to do is refactor it at all the place in the file at once.
So in MAC machine the handy shortcut for it is shift + F6 (you may have have to use fn key before F6).
Click on the text you want to change and then press shift + F6. It will highlight the text and then your change at all the place in the file. :)
It will do the job same as sublime ctrl + D
PhpStorm has a "Select Word at Caret", Ctl+W and Ctl+Shift+W respectively (you can check your keys by searching under Preferences > Keymap).
Detail here:
http://www.jetbrains.com/phpstorm/webhelp/selecting-text-in-the-editor.html#d617165e275
Not entirely sure if it's the same as you mentioned, but it's mighty handy!

What is the shortcut key for replace text in all files in Sublime Text 2?

How do I execute the "Replace" command with a keyboard shortcut?
I can't seem to find the "command" in the default keymap for OS X.
I know the single file replace all shortcut is control + option + enter, but that doesn't work in this case. This is in OS X, but it probably applies to Windows.
20 minutes of research turned up nothing.
Attempts:
Opened up the Find in Files panel and tried lots of combinations. No luck.
Browsed the keybindings file for anything bound to the find_in_files panel. No luck
Browsed the official Sublime Text API. No luck.
Browsed the unofficial list of commands. No luck.
This feels like a big oversight...
update: This is not implemented. Here is the official feature request.
Ctrl + shift + F
now you can add files and folder where you want to find and replace in all files.
Ctrl + Alt + Enter works for me in the latest Sublime Text 2

What are the most useful Intellij IDEA keyboard shortcuts? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I did a bit of googling hoping to find a post on IDEA shortcuts similar to Jeff's post on Visual Studio shortcuts (Visual Studio .NET 2003 and 2005 Keyboard Shortcuts), but didn't really spot anything that helped. Hopefully the answers to this question will fill the void.
These are some of my most used keyboard short cuts
Syntax aware selection in the editor selects a word at the caret and then selects expanding areas of the source code. For example, it may select a method name, then the expression that calls this method, then the whole statement, then the containing block, etc.:
Ctrl+W
Basic Code Completion, to complete methods, keywords etc.:
Ctrl+Space
Go to Declaration. Use this to navigate to the declaration of a class, method or variable used somewhere in the code:
Ctrl+B
Introduce Variable Refactoring, to create a variable from an expression. This expression may even be incomplete or contain errors. Since version 8, IDEA intelligently selects a likely expression when no text is selected:
Ctrl+Alt+V
Go to Class, to quickly open any class in the editor:
Ctrl+N
To open any file, not just classes:
Ctrl+Shift+N
Comment/Uncomment current line or selection:
Ctrl+/ and Ctrl+Shift+/
Quick JavaDoc Popup to show the JavaDoc of the method or class at the text cursor:
Ctrl+Q (Ctrl+J on Mac OS X)
Smart Type Completion to complete an expression with a method call or variable with a type suitable in the current Context:
Ctrl+Shift+Space
Rename refactoring to rename any identifier. Can look in comments, text files and across different languages too:
Shift+F6
Select in Popup to quickly select the currently edited element (class, file, method or field) in any view (Project View, Structure View or other):
Alt+F1
Highlight Usages in File. Position the text cursor on any identifier without selecting any text and it will show all places in the file where that variable, method etc. is used. Use it on a throws, try or catch keyword to show all places where the exception is thrown. Use it on the implements keyword to highlight the methods of the implemented interface:
Ctrl+Shift+F7
By far my favourite all purpose shortcut is Ctrl+Shift+A
It does a search as you type through all the commands in intellij. Not only that but when you find the command you want it also displays the corresponding shortcut key next to it!
Here are the Intellij IDEA keyboard shortcuts I find most useful (listed in roughly the order of usage for me):
The shortcut I use the most is Ctrl + B (Go to declaration), to see what a method does, where a variable is declared etc. This is almost always followed by Ctrl + Alt + Left to get back to where I was (Ctrl + Alt + Right works to “go forward” again).
A related navigation shortcut is Ctrl + Alt + B, (Go to implementation). Press it when the caret is at the method name of an interface, and you get a pop-up list of all the places where this method is implemented, and you can select which one you want to go to (if there is only one implementation, you go straight there). The same goes for overridden methods.
The opposite of this is Ctrl + U (Go to super-method/super-class). If the caret is at the implementation of a method in an interface (indicated by the little green interface-symbol in the left gutter), this shortcut takes you to the interface itself.
When I want to see all the places where a method or variable is used (which I want to do a lot), I use Ctrl + Alt + F7 (Show usages). This gives you a pop-up list of all the usages, and you can easily navigate to each one. I prefer this over Alt + F7 (Find usages), which gives you the same information, but in a separate pane below.
To find classes, I use Ctrl + N (Go to class), which lets you search using only the capital letters in the class name (“camel humps”), and * as wildcard.
Yet another shortcut I use, both when reading and writing code, is Ctrl + P (Parameter info) at the arguments of methods and constructors, to see the types and names of the parameters.
When it comes to writing code, I use Ctrl + space (Basic code completion) a lot to auto-complete method names, variable names etc (or simply to see which methods are available for a certain object, by trying to auto-complete directly at the dot following the name of the object).
For searching in the current file I use Ctrl-F (Find - probably the least surprising shortcut in this list), F3/Shift + F3 (Find next/previous) to repeat the search, and Ctrl + Shift + F (Find in path) to search in the whole project.
Ctrl + W (Select successively increasing code blocks) is handy when selecting chunks of code. Repeatedly pressing it selects more and more of the code. Useful when searching, indenting, commenting out code etc.
If there are errors in the file, F2/Shift + F2 (Next/previous highlighted error) will jump to them.
I use the sequence Alt + C, N (Show Changes View) to see which files in the project I have modified compared to the subversion repository. To diff the current file against the version in the subversion repository, I use the sequence Alt + C, S, Y (Compare with the Same Repository Version). In the diff view, I use F7/Shift + F7 to navigate between the changes.
When not in the diff view, I use Ctrl + Shift + Alt + Up/Ctrl + Shift + Alt + Down to jump to the parts of the file that have been changed compared to the checked-out version. At each modification point, you see the corresponding part in the checked-out version in a pop-up window.
Finally, I run JUnit tests using Ctrl + Shift + F10.
Edit: One really useful shortcut that I've only started using in the last few months is Ctrl + E. It brings up a pop-up with the 15 most recently used files, and you just arrow down to the one you want and hit enter to navigate to it.
According to the Jetbrains folks, it will have to be these, as they are for the one wearing the shirt: (Got that from Devoxx)
Help\Productivity Guide
It tells you what are the shortcuts you use/don't use and displays usage statistics. It will guide you to the unknown features.
Some of the time savers:
Alt + Enter : show intention actions (like Eclipse quick fix)
Ctrl + Alt + V : introduce variable (never type the left hand side of an assignment again)
Ctrl + Shift + Space : smart completion ( even two levels down since IntelliJ 8 )
Ctrl + W : select succesively increasing code blocks. Kind of obvious but a real time saver!
The Canoo blog contains some (+8) articles on some more advanced IntelliJ keyboard shortcuts.
The Key Promoter and Shortcut keys list plugins are really helpful for (constantly) learning new IntelliJ keyboard shortcuts.
Try using the Key Promoter plugin. That will help in learning the shortcuts.
Couple of shortcuts apart from the above suggestions:
Alt + Ins: Works consistently to insert anything. (Add a new class, method etc)
Ctrl + Alt + T: Surround code block. Another useful stuff.
This is probably dependent on your development environment, but when doing BlackBerry development I code in IntelliJ and still compile and debug through the BlackBerry JDE. Ctrl + Shift + C is vital in this case as it allows you to copy the full path of the file you are currently editing, making it easy to open the file in the separate dev environment.
Yes, Ctrl + Shift + A is the most useful one. It's a meta shortcut
Within the tool:
"Help -> Default Keymap Reference"
(as suggested by krosenvold)
On the Internet: "IntelliJ IDEA Developers Documentation"
Windows, Linux and Mac keyboard shortcut reference cards for versions 8, 7, 6, 5, and 4.5.
(I knew I had seen and used these reference "cards" before! ;-)
One of my favorites (not shown on the JetBrains cards) is "Ctrl+Shift+{Up or Down Arrow}" to move lines/methods up and down in the source code.
See also "Intellij Idea Keyboard Shortcuts" page on Ward's Wiki.
Shift+Delete deletes the entire line (will 'cut' it to clipboard)
Ctrl+Alt+L to reformat and optimize imports
Ctrl+Shift+J to join lines (pull content of next line up to current line).
Alt + Shift + Insert - switches to column selection mode, allowing the selection of rectangular text fragments (columns)
Ctrl + Shift + Backspace - go to most recent code edit. Hit again to go even further back. Very useful when coding something, browsing other classes for a while and then wanting to go back where we left our code.
Ctrl+E - recently opened files
Ctrl+Shift+E - recently edited files
Ctrl+Shift+V - paste one of the previous values from clipboard
One of my real favorites may not count as a keyboard shortcut exactly. But the "iter" smart template is really great.
basically if you want to iterate though something using a for loop type "iter" then tab to use the live template
itertab
it will figure out the most likely variable you want to iterate over and generate a for loop for it. I'm pretty sure it uses the nearest reference to an object which supports iteration.
Ctrl + F11 invokes a dialog with all alphanumeric keys on the keyboard. Selecting one empty will add the current line to bookmarks and mark the line with selected key.
Shift + F11 invokes a list of bookmarks. Pressing a key takes to associated bookmark.
Ctrl + Shift + Enter - automatically completes the code statement you are typing, inserting the quotation marks, brackets, curly braces and other punctuation as necessary.
F7 F8 F9 for debugging
If you are coming from Eclipse:
http://tanu.wordpress.com/2010/09/24/moving-from-eclipse-to-intellij-idea/
General documentation and shortcuts are on Intellij's site
http://www.jetbrains.com/idea/documentation/index.jsp
Any combination of Ctrl + Alt + Shift and N.
Ctrl + Shift + T in idea8 is also excellent.
There is a complete keymap in the online help too.
Ctrl + N : Open class.
Alt + F7 : Find usages.
http://www.jetbrains.com/idea/docs/ReferenceCard70_mac.pdf has everything you need. after a while, you'll develop your own preference for certain shortcuts.
This link has everything you need. Plus in Idea 8 atleast, every shortcut is completely customizable, so it's really up to you what the most useful ones are.
Idea 8 reference PDF