Related
Is there a way to search through all Xcode project files? I know that I can find some text inside file with finder, but finding something with Xcode will be very helpful. When I press cmd+f I can only find or find and replace in current display file.
Use cmd + shift + f for complete Xcode search.
To do it simply from the UI, with a click
By default, this will be searching through the entire project searching for any files containing the specific string you entered.
From this point, you can start doing more stuffs like replace all, etc, like this
On the left hand side of the editor you have a magnifying glass. There's a search box there. That should do the trick. (it's called the search navigator)
cmd + shift + f opens it too.
cmd + shift + f
then press return key of you keyboard.
Use Command + 3 a minimum keyboard shortcut
or Command + Shift + f
In find use: Find > Text > Containing
Right Click on any text and select 'Find Selected Text in Workspace'
In my experience, cmd + shift + f requires cmd + c before hand to populate the search term. So, my go to search for text in all files is to do the above.
The functionality I'm talking about is in VI/VIM. ie. When the cursor is over the text of a word like say jiggle in command mode, press * to search for the next instance of jiggle. I use this all the time in VIM. Does such a shortcut exist for Xcode? or can we only double-click to highlight, CMD + C, CMD + F, CMD + V, and hit Enter?
Ok, Phrogz has a good solution, but I found a simpler way to do this...
To search consecutive instances of a word in Xcode:
Double-click the word you would like to find the next instance(s) of, then as Phrogz mentioned press ⌘ + E (Use Selection for Find) and then ⌘ + G (Find Next) to search for the next occurrence(s)
Cmd + Ctrl + T will invoke the menu item "Edit All in Scope". That will highlight all uses of the current identifier and allow you to edit all simultaneously.
Not exactly the same thing, but I find it very useful for the sort of case you're talking about. Even if I don't need to edit an identifier, it's a nice way to quickly see all the places its used.
If you select the word (⌥←,⌥⇧→) you can press ⌘ + E (Use Selection for Find) and then ⌘ + G (Find Next) to search for the next occurrence.
You can combine the command+e, command+g to a shortcut
Find a file IDETextKeyBindingSet.plist in directory "/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/"
Open this file by Xcode
Add a Dictionary named Customized under the Root
Add a String named Move to Next Instance under the Customized
and set the value to selectWord:, useSelectionForFind:, findNext:
IDETextKeyBindingSet.plist
Restart Xcode and set the Key Bindings
Find Move to Next Instance and set the key to option+↓ (or other key you prefered)
Key Bindings
To search a word in the currently opened file using Xcode 5 and above:
Double click the word and then
shift optioncommand E
Now you can move to the next/previous instance using:
command G
or
shiftcommandG
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 10 years ago.
What Xcode keyboard shortcuts do you use regularly?
I am a huge believer in using the keyboard as much as possible (its much faster that way), and I was hoping others could share some of the Xcode shortcuts they use.
I find the shortcuts to open & close various areas of the screen must useful.
Cmd + Shift + o opens the "Open quickly" dialog, where you can quickly find and open files that contain the text you enter.
Updated for newer versions:
Control + Command + ↑
Switches between corresponding .h / .m files or as Apple's own documentation, it means Jump to Counterpart
command + shift + j
Reveals the current file in the project navigator. Very useful if you use command + control + J to jump to a definition as Xcode won't automatically reveal the containing file in the navigator.
command /
Comment out the current line, or multiple lines if they're highlighted.
Comes in handy for quick commenting and uncommenting while experimenting with code.
Re-indent. It's in Edit > Format > Re-Indent and there's no shortcut by default (I use Command + Shift + L). It's a godsend.
command F Search in the File
option command F Search & Replace in the File
shift command F Search in the whole project
shift option command F Search & Replace in the whole project
Notice the pattern for easy memorizing.
Ctrl + Command + ↑ - Switch between header and implementation files.
Command + J
(Move focus to any section of the editor)
Control + Command + j
Highlight a keyword (method name) and jump to its definition. Also works for variables, #defines, etc.
Some of my favorite shortcuts are not keyboard shortcuts at all, but multitouch gestures. All Macbooks from early 2008 onward, and I would imagine desktops with a Magic Mouse or Magic Trackpad, support three-finger-swipe up and down to switch between the header and implementation, and three-finger-swipe left and right to navigate within the file history.
Command + Shift + Y for the console.
I find a cheat sheet next to the computer is the best way to pick up useful shortcuts. Cocoa Samurai has a good one.
Key Bindings to XCode Actions
Create your own keyboard shortcuts using the Text Key Bindings tab of the Key Bindings preference pane. A time-saver all its own. Just lookup your favourite actions and add/edit shortcuts!
Another thread you may find useful is here.
Just the basic emacs navigation. Feels so right.
I cannot live without three finger vertical swipe to switch between interface and implementation file. If you miss that in xcode-4/Lion, make sure to follow the following instructions:
http://geeksinkilts.com/?p=67
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Recently , I found some shortcut key really helpful which I never used before .
Such keys like F7 ,F3 ,Ctrl+g help me a lot when editing and debuging.
What are your most frequently used shortcut keys in visual studio?
including Resharper's shortcuts:
Ctrl-Shift-B (build)
F12 (go to definition)
Shift-F12 (find usages)
Ctrl-- (go to last location)
Alt-Shift-L (go to current file in the solution explorer)
Alt-\ (find member)
Ctrl-T (find type)
Ctrl-Shift-T (find file)
Shift-Esc (close current dialog)
Ctrl-Shift-S (save all files - VS tends to forget)
EDIT: added explanations
I always use the debugging keyboard shortcuts - F9 (toggle breakpoint), F10 (step over) and F11 (step into). I can't believe that some of my coworkers actually use the toolbar buttons for this - it's insanely more efficient to use the shortcuts.
Standard VS keys of F12 for going to the definition and then CTRL+- to go back to where I was before that.
Probably the two shortcuts that get me around VS and my code quicker than any other.
Ctrl + . for bringing up the smart tag for adding namespaces, renaming/refactoring, etc.
I also remapped Ctrl + B to build, Ctrl + Shift + P to Build Selection (in a sense, Build Project) and Ctrl + W to close window.
CTRL+K CTRL+C for comment selection and CTRL+K CTRL+U for uncomment selection (They may be mapped to CTRL+E CTRL+C and CTRL+E CTRL+C in some standard keyboard mappings, but the first two will generally still work...)
The most used keyboard shortcut is Ctrl-Tab to switch between tabs.
Another one I use alot is Ctrl-I to start incremental search.
Two more:
Alt+Ctrl+C for Call Stack
Alt+Ctrl+I for Immidiate window
(Both helpful while debugging)
The list is endless. To maximize readble code space, I've removed all my toolbars. If I want to do it, I have to know the keyboard shortcut for it.
Aside from the basics, I constantly use things like Ctrl-M,O, Ctrl-K,C, Ctrl-K,U, Ctrl-K,D, Ctrl-Alt-E, Ctrl-Alt-P. I have also made a little smiley-face button for "Remove and Sort Usings" because navigating through the right-click menu takes too long and it doesn't have a hotkey that I know of.
Ctrl+Shift+F9 to delete all the break points in a solution. Very handy when people leave them spattered all over the solution!
Shift + F6 to build current project, Shift +F5 to stop debugging
I use many, but most useful I think is
CTRL+K Kfor setting a bookmark
and CTRL+K N for going to next bookmark and CTRL+K P for previous
CTRL+D and then ">of $filename" (open filename),
CTRL+K+C (comment selection),
CTRL+K+F (format),
CTRL+X and CTRL+C on a line to cut
or copy the entire line
I use the bookmark shortcuts alot: Ctrl-K Ctrl-K to create a bookmark, Ctrl-K Ctrl-N to cycle through them.
Ctrl-Shift-B to build is probably the most executed though.
Ctrl + B
which for me is build current project.
I use it less in VS2008 SP1 with the error highlighting so
Ctrl + D
which for me is Go To Definition is starting to edge it out.
I never can remember shortcuts, but Ctrl + - . is one of the few I can remember and use often. With Resharper installed, Alt + Enter is Ctrl . on steroids. Both intelligently resolve a variety of errors or refactorings.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
Is there a keyboard shortcut for pasting the content of the clipboard into a command prompt window on Windows XP (instead of using the right mouse button)?
The typical Shift+Insert does not seem to work here.
Yes.. but awkward. Link
alt + Space, e, k <-- for copy and
alt + Space, e, p <-- for paste.
I personally use a little AutoHotkey script to remap certain keyboard functions, for the console window (CMD) I use:
; Redefine only when the active window is a console window
#IfWinActive ahk_class ConsoleWindowClass
; Close Command Window with Ctrl+w
$^w::
WinGetTitle sTitle
If (InStr(sTitle, "-")=0) {
Send EXIT{Enter}
} else {
Send ^w
}
return
; Ctrl+up / Down to scroll command window back and forward
^Up::
Send {WheelUp}
return
^Down::
Send {WheelDown}
return
; Paste in command window
^V::
; Spanish menu (Editar->Pegar, I suppose English version is the same, Edit->Paste)
Send !{Space}ep
return
#IfWinActive
Not really programming related, but I found this on Google, there is not a direct keyboard shortcut, but makes it a little quicker.
To enable or disable QuickEdit mode:
Open the MS-DOS program, or the command prompt.
Right-click the title bar and press Properties.
Select the Options tab.
Check or un-check the QuickEdit Mode box.
Press OK.
In the Apply Properties To Shortcut dialog, select the Apply properties to current window only if you wish to change the QuickEdit setting for this session of this window only, or select Modify shortcut that started this window to change the QuickEdit setting for all future invocations of the command prompt, or MS-DOS program.
To Copy text when QuickEdit is enabled:
Click and drag the mouse pointer over the text you want.
Press Enter (or right-click anywhere in the window) to copy the text to the clipboard.
To Paste text when QuickEdit is enabled:
Right-click anywhere in the window.
To Copy text when QuickEdit is disabled:
Right-click the title bar, press Edit on the menu, and press Mark.
Drag the mouse over the text you want to copy.
Press Enter (or right-click anywhere in the window) to copy the text to the clipboard.
To Paste text when QuickEdit is disabled:
Right-click the title bar, press Edit on the menu, and press Paste.
Thanks Pablo, just what I was looking for! However, if I can take the liberty of improving your script slightly, I suggest replacing your ^V macro with the following:
; Use backslash instead of backtick (yes, I am a C++ programmer).
#EscapeChar \
; Paste in command window.
^V::
StringReplace clipboard2, clipboard, \r\n, \n, All
SendInput {Raw}%clipboard2%
return
The advantage of using SendInput is that
it doesn't rely on the command prompt system menu having an "Alt+Space E P" menu item to do the pasting (works for English and Spanish, but not for all languages).
it avoids that nasty flicker you get as the menu is created and destroyed.
Note, it's important to include the "{Raw}" in the SendInput command, in case the clipboard happens to contain "!", "+", "^" or "#".
Note, it uses StringReplace to remove excess Windows carriage return characters. Thanks hugov for that suggestion!
There is also a great open source tool called clink, which extends cmd by many features. One of them is being able to use ctrl+v to insert text.
On Windows 10, you can enable Ctrl + C and Ctrl + V to work in the command prompt:
Here's a free tool that will do it on Windows. I prefer it to a script as it's easy to set up. It runs as a fast native app, works on XP and up, has configuration settings that allow to remap copy/paste/selection keys for command windows:
Plus I know the developers.
simplest method is just the copy the text that you want to paste it in cmd and open cmd goto "properties"---> "option" tab----> check the (give tick mark) "quickEdit mode" and click "ok" .....now you can paste any text from clipboard by doing right click from ur mouse.
Thank you..
Thanks, Pablo, for referring to AutoHotkey utility.
Since I have Launchy installed which uses Alt+Space I had to modify it a but to add Shift key as shown:
; Paste in command window
^V::
; Spanish menu (Editar->Pegar, I suppose English version is the same, Edit->Paste)
Send !+{Space}ep
return
This is not really a shortcut but just a quick access to the control menu: Alt-space E P
If you can use your mouse, right click on the cmd window works as paste when I tried it.
Theoretically, the application in DOS Prompt has its own clipboard and shortcuts. To import text from Windows clipboard is "extra". However you can use Alt-Space to open system menu of Prompt window, then press E, P to select Edit, Paste menu. However, MS could provide shortcut using Win-key. There is no chance to be used in DOS application.
It took me a small while to figure out why your AutoHotkey script does not work with me:
; Use backslash instead of backtick (yes, I am a C++ programmer).
#EscapeChar \
; Paste in command window.
^V::
StringReplace clipboard2, clipboard, \r\n, \n, All
SendInput {Raw}%clipboard2%
return
In fact, it relies on keystrokes and consequently on keyboard layout!
So when you are, as I am, unfortunate to have only an AZERTY keyboard, your suggestion just does not work. And worse, I found no easy way to replace SendInput method or twist its environment to fix this. For example SendInput "1" just does not send digit 1.
I had to turn every character into its unicode to make it work on my computer:
#EscapeChar \
; Paste in command window.
^V::
StringReplace clipboard2, clipboard, \r\n, \n, All
clipboard3 := ""
Loop {
if (a_index>strlen(clipboard2))
break
char_asc := Asc(SubStr(clipboard2, a_Index, 1))
if (char_asc > 127 and char_asc < 256)
add_zero := "0"
else
add_zero := ""
clipboard3 := clipboard3 . "{Asc " . add_zero . char_asc . "}"
}
SendInput %clipboard3%
return
Not very simple...
If you use the clipboard manager Ditto (open source, gratis), you can simply use the shortcut to paste from Ditto, and it will paste the clipboard in CMD for you.
I followed #PabloG's steps as follows
goto http://www.autohotkey.com/ - download autohotkey
follow simple installation steps
after installation create new *.ahk file as follows right click on desktop > new > Autohotkey Script > giveAnyFileName.ahk
right click on this file > Edit
copy paste autohotkey script given by #PabloG in his answer
save and close
double click on file to run
Done now you should be able to use Ctrl+v for paste in command prompt
You could try using Texter and create something unlikely like:
./p , triggered by space and replacing the text with %c
I just tested it and it works fine. The only gotcha is to use a rare sequence, as Texter cannot restrict this to just cmd.
There are probably other utilities of this kind which could work, and even AutoHotKey, upon which Texter is built could do it better, but Texter is easy :-)
A simpler way is to use windows powershell instead of cmd. itworks fine with texter.
I've recently found that command prompt has support for context menu via the right mouse click. You can find more details here: http://www.askdavetaylor.com/copy_paste_within_microsoft_windows_command_prompt.html
Pretty simple solution may be Console 2, redefine keys and you go.
If you're a Cygwin user, you can append the following to your ~/.bashrc file:
stty lnext ^q stop undef start undef
And the following to your ~/.inputrc file:
"\C-v": paste-from-clipboard
"\C-C": copy-to-clipboard
Restart your Cygwin terminal.
(Note, I've used an uppercase C for copy, since CTRL+c is assigned to the break function on most consoles. Season to taste.)
Source
Instead of "right click"....start your session (once you're in the command prompt window) by keying Alt/SpaceBar. That will open the Command Prompt window menu and you'll see your familiar, underlined keyboard command shortcuts, just like in Windows GUI.
Good luck!
Under VISTA Command prompt:
Click on the System Icon
Select Defaults from the Menu
On the Options tab in the Options group I have
"Quick Edit Mode", "Insert Mode", and "Auto Complete" selected
I think that "Quick Edit Mode" is what makes it work.
To paste whatever is in the Clipboard at the insertion point: Right Click.
To copy from the Command Window
Select by holding down the left mouse button and dragging the pointer across what you want to copy
Once selected, right click
To paste at the insertion point, right click again.