Jump back to previously edited line/word within word document - user-interface

While editing / reviewing a large word document (doc/docx) document, I was searching for a way to jump back to the previously edited text or line but couldn't find any button enabling me to do so.
Has anybody a solution for this?

You can use the predefined commands "Next Edit" and "Previous Edit". You can for example add these commands in one of the tabs of the ribbon.
For this, right-click the ribbon and select "Customize the Ribbon..."
Select to chhose the command from "All Commands" and use the right-hand side to define where the buttons for the commands shall be placed:

Related

What is the Visual Studio search/replace free entry "look in" field for?

In Visual Studio 2015 "Find and Replace" window, you can freely type anything you want into the "Look in" field:
The preset dropdown values are things like:
Current Window
All open documents
Entire solution
etc.
What is the purpose of allowing typing in this field? What could I possibly type in here which would make any sense?
And if I do type something like "foo bar" in there, what is the behavior when one of the "Find..." buttons is clicked? It seems to just search normally - maybe in the current solution (??).
Note - it even seems like mistaken entries can get stuck in there.
That allows one to specify directories. Or even multiple directories. Or even combinations of built in locations and directories. Separate each location with a semicolon.
Example:
Entire Solution;C:\Source\18.1
Then to remove an entry, click on the ... button. This will bring up a dialog box titled "Choose Search Folders". Then on the right hand side, selected the entry you wish to remove and then click on the button that looks like a less- than, or left-angle bracket. This will remove the entry.

Is there a way to indent lines (not format them) in Visual Studio?

In Eclipse, there are two distinct features: one to format a selection, one to just indent the lines, see e.g. Difference between Ctrl+Shift+F and Ctrl+I in Eclipse. I found the format feature in Visual Studio but how can I actually just indent the lines? Is there some built-in command for that or possibly a 3rd party add-on?
Note: I have asked a couple of friend that use VS daily and they all tried to persuade me that I am looking for the format feature. No I'm not. I tried to live with it for a while and it is just a different feature. I am after the indent/reindent only.
EDIT: I am looking for a clever indent, sometimes called reindent, which is different to just pressing Tab or Shift+Tab (increase/decrease indent level). The indent feature in Eclipse behaves like this:
It places a beginning of current line at the right position, no matter where that line was starting before. So instead of thinking whether you need to increase or descrease the indent level (Tab or Shift+Tab), you just invoke the indent command and it will do the right thing.
Invoking the indent command on an empty line places the caret at the right position for the user to start typing.
It never influences any character beyond the first non-whitespace character.
If you just want to indent some lines, you can
Select them.
Press Tab.
To un-indent them, replace the second step to: Shift+Tab.
You can find more VS shortcuts here.
There are toolbar buttons for this, with wonderfully inconsistent labels (at least in the Visual Studio 2013 I'm using)...
In the "Text Editor" toolbar (in my default setup), I have to buttons whose tooltips are:
"Decrease Line Indent"
"Increase Line Indent"
In the "Customize" dialog, on the "Commands" tab (with "Toolbar" set to "Text Editor") they appear in the list as:
"Line Unindent"
"Line Indent"
And finally, if you press the "Add Command..." button (on the "Customize" dialog) to produce the "Add Command" dialog and select the "Edit" category, you'll see these two entries:
"Outdent"
"Indent"
As far as I can tell, these are all the same two commands, which should do what you want.
They also appear in the Edit -> Advanced menu, at the very bottom.
----- Edit -----
I believe you might be able to turn off all of the "formatting" actions except for indentation, so that when you use the "auto-format" command, only the indentation is "formatted" for you. (Of course this prevents you from ever using the rest of the formatting features without turning them on again, but if you don't use them, this might work!)

Replace text only in one part of a page in Visual Studio 2012

I want to replace a word only in one particular paragraph of a .cs page. I select the paragraph, but when I go to find and replace the text get deselected and the word is highlighted everywhere on the page and not only in that paragraph. Is there a way to achieve what I want in VS or should I just copy the text in another page/text editor and do the replacing there?
Thank you.
Select the text, press Ctrl+Shift+H, make sure "Selection" is selected in the "Look in" window. While the Find and Replace window is open you should be able to select whatever you want from your code window and the original selection should not change. Copy what you want to replace and paste to Find what window. Set "Replace With" window with the text to replace and click the "Replace All" button.

How can I find and replace inside a selection in Xcode?

In Xcode < 4, you could hold the "option" key, and the "Replace All" button would change to "Replace in Selection". As of Xcode 4, this does nothing. Anyone know if there's a new way to do it, or is it bug filing time?
This appears to be working again now, at least in Xcode 4.4.1.
When the find/replace bar appears at the top of the editor, holding down the option key on the keyboard causes "Replace in Selection" to appear in lieu of "Replace All."
I'm glad, because this was an ANNOYING omission.
Another workaround:
In Xcode, select the text, press copy
In a terminal session:
pbpaste|sed 's/SOURCETEXT/NEWTEXT/g'|pbcopy
Return to Xcode window, press paste
Since the original should still be selected, it will just be replaced. You could probably build a simple shell script to do this.
Doug
An few images to supplement the chosen answer:
And holding down Option:
See also
Find/Replace in Xcode using Regular Expressions
Seems like missing functionality. You should file a bug report.
I'm upset that they took out this functionality, as I used it constantly, but here's my workaround. Copy your selected text from Xcode4 to TextEdit or some other word processor, do the find and replace there, and then copy the results back into Xcode.
It's not sexy but it's worth it if you do a lot of these "find and replace on my selection", and you leave the word processor open in Spaces as you work.
They should add "my selection" as an alternative to "workspace" and "my scope".
There is another way only replace the matches you find, rather than just this one or all of them.
I suggest you save a copy first, just in case....
In Find and Replace, Show Find Options (you can do this by pressing the magnifying glass).
Press Preview.
Uncheck all the ones you don't want replacing.
Press Replace
Hope that helps, it did me.
Not ideal, but not too bad:
Do a find and replace in workspace (cmd-opt-shift-f) enter your desired find/replace
Enter your desired search term and hit return
Select the range of replacements from the list of matches on the left
Hit replace (not replace all)
To replace text in a selection using Xcode 9
Press Option-Command-F to bring up the find/replace box.
Enter the search and replace string. Changing the search string will lose any existing selection, so..
Make your selection (again). (If you don't do this, the selection will be the first search string found only)
Hold down the key and "Replace All" will change to "Replace Selection", then click it.
Once you understand that you make your selection AFTER you have entered the search string, then this is not that clumbersome and works fine.
I find alt-command-f easier for local find and replace (4.3) and then working around your selection.
EthenA.Wilson asked in a comment to the OP a couple of days ago:
"Is there a way to do this in Xcode 5?"
For the benefit of those who, like me, had been searching for it, here's how:
After you put your Find and Replace terms in the bars at the top left-hand side of the editor page, select the text you want to search in, then look at the top right-hand side (same bar). You'll see where it says "All", right next to "Replace." Now press the Option key. "All" will change to "All in Selection." Click it, and you're done. Could be a bit more intuitive, but the functionality is there in Xcode 5.
Naturally, good idea to take a snapshot before you click!
HTH!
Not sure which feature prior to Xcode 4 you're referring to, but the shortcut Command+Shift+E gives you "Use Selection for Replace". If you're talking about "Find and Replace in Workspace" (Command+Option+Shift+F), then what you need to do is run your find and then hold down "Shift" or "Command" on the selections shown and then hit "Replace".

Textmate tab and de-tab selected block

Recently switched to Textmate on Mac for coding. On PC when ever I want to tab in or out a block of code I just highlight and press tab or shift+tab to move it in our out. It's very useful when you are adding an extra loop or conditional statement to a block of code to keep everything tidy and neatly indented.
On Textmate however when I try this it just replaces my selected text with a tab. So is there a way to do tab and de-tab lines of code in textmate?
Indent: Alt+Tab
Un-Indent: Shift+Alt+Tab
the hotkey is command-left bracket to move left and command-right bracket to move right
(the buttons next to 'p')
heres a link to more hotkeys and such
http://projects.serenity.de/textmate/tutorials/basics/
You can use Shift+Tab to decrease indent; You just need to make and assign a macro. You can reuse this technique to accomplish a great many things.
Enter some text, and intend them, this is mostly for feedback.
Click the Record Macro Button
Use ⇧+⌥+⇥ (aka; Shift + Option + Tab) to decrease the indentation.
Click the record button to stop recording the macro.
Use the Edit menu or ⌃+⌘+M to save your macro;
Saving will prompt you to create a new bundle*, or add your macro to an existing bundle.
Add a Key Equivalent by clicking in the field and pressing ⇧+⇥
Your bundle-macro should look like the one below, simply Save and you're done! TextMate will now decrease indent on ⇧+⇥
*: (as noted by u/PatrickT) Sadly the create new bundle functionality has not yet been implemented, and you must choose to add to an existing bundle. You can still create a bundle via Bundles -> Edit Bundles then Command + N.
As an alternative, you can change the keybindings, see Link
Here is what I did:
Install Link
Go to File -> Open -> User Key Bindings, this will create/edit ~/Libary/KeyBindings/DefaultKeyBinding.dict
Add a binding, for the action enter shiftRight: (indent) manually (this is a TextMate specific action and not in the pre-populated actions list)
Choose a shortcut, I used cmd+alt+right
Do the same for the action shiftLeft: (un-indent, I used cmd+alt+left)
Save and then restart TextMate
I used a shortcut with arrow keys as my right hand is already on the arrow keys when I am selecting multiple lines, so this is a good fit.
The reason why I did it was because I have a german keyboard and alt+tab/alt+shift+tab don't work for me since I am using Witch for app-switching using these exact shortcuts.
EDIT: cmd+alt+left/right don't work when you have multiple tabs open, as they are used for navigate to next or previous tab in TextMate... seems this cannot be changed or overridden (I tried Setting Shortcut Keys in Textmate). Looking for an alternative shortcut now.

Resources