How can I remove spaces in highlighted text with Sublime Text? - string

If I highlight some text, i.e "sally came from home", is there a way to remove all the spaces?

Press
ctrl + h
to bring up the find and replace menu
Then Click the following icon to only find in your current selection
Then enter in a space in the find and either click find_all and press delete, or add nothing to replace and click replace_all

Use the find panel. Select "In Selection" and search for a space. Hit "Find All" and delete.
Alternatively, you could use the find & replace panel and just replace the spaces with nothing.

Related

sublime text: how to make the cursor go to the beginning of a find text

In sublime text when i find some text using regex assuming START.*END where i want to find text between START and END words.
Now after findind we see the cursor is located after the END word. Is it possible to put the cursor before START word
Or is there a keyboard shortcut which can bring the cursor to ahead of START.
Because if i do CTRL + LEFT it will take me to the next . (dot) or space etc
If i do HOME then it will go to the beginning of the line
As user #OdatNurd mention in comments, after you search and select all occurrences, press Left or Right arrow to go to beginning or end of selection.
Example:
after selecting all occurrences, press Left to go to the beginning of a selection and edit.

Find and replace within selection in sublime text 3?

I've read this thread indicating how to find and replace within selection in ST2. Despite reading this thread but still cannot figure out if it's possible to do a simple find and replace within selection in ST3?
Ensure the find and replace panel is closed.
Select the text in which you want to perform the find/replace - i.e. define your selection.
Open the Find/Replace panel - if desired, you can use a keybinding to run the show_panel command by going to preferences -> keybindings, then adding this line to the user keybindings: { "keys": ["ctrl+shift+s"], "command": "show_panel", "args": { "panel": "replace", "in_selection": true } } to ensure that the "in selection" mode is active and skip the next step. (see the forums for more available args.)
Turn on "in selection" mode if it is not already active by clicking on the button in the panel.
Enter your find/replace terms and perform your find/replace
If you want to change the selection you are searching within, you will need to close and re-open the panel.
If the region/selection you are searching within always contains multiple lines, you may want to consider setting the following preference for convenience:
// When auto_find_in_selection is enabled, the "Find in Selection" flag
// will be enabled automatically when multiple lines of text are selected
"auto_find_in_selection": true,
Select the word by pressing CMD+D it selects 1 from whole file and show transparent selection of all related word you can press more times CMD+D for selecting all word then edit it all words take places
You can (using ctrl-h, then toggling the 'in selection' option from the dialog), but it's a bad design IMO. Firstly, if you have an area of text highlighted when you request 'replace', it should assume "replace in selection" automatically. Secondly, as soon as you choose 'replace' it thoughtfully cancels the text selection for you. The whole process ends up involving cumbersome repetition, or an illogical sequence of steps. Visual Studio gets the UI design right; Sublime does not.
Searching and/or replacing within only a selected area in Sublime is indeed possible.
If you have text selected, once you open the Find or Replace panels, you can select the button for Find in Selection (which is turned off by default unless you have the auto_find_in_selection turned on and select multiple lines) to have the operation you carry out only apply to the selected area.
In this example I'm doing the following:
Pressing Alt+F3 to select all instances of the word to, showing how many of them there are
Select the first paragraph and then open the Find and Replace panel with Ctrl+H
Turn on the option to operate within the selection
Replace all instances of the word to with the word FROM
Show that the instances of to outside of the selection are still there untouched.
Select the line/word/code and Press Ctrl+d.
Matched piece of text will be selected and will have cursor after them.
You can edit them together.
Ctrl+h is the shortcut for 'Copy and Replace' in all versions of Sublime.

Multiple cursors from find result

I have a regex in my find box and want a cursor at each found location (I'm actually trying to delete a load of new lines in paragraphs but there's far to many to do by hand).
How can I get a cursor at each location that matches [\w]$?
Click the "Find All" button at the far right of the find panel, and ST will select all the matches.
The shortcut Opt + Enter should work if you're looking to stay on the keyboard.
If you want to search for a simple string, you may select it right in editor and use Find All:
Windows/Linux: Alt+F3
Mac: ⌃+⌘+G

Incremental search in Idea the word under cursor

I would like to search in current file the word under cursor like Alt+F3, except manually selecting current word? Is there alike keyboard shortcut?
Not entirely sure what you are looking to do when you say "manually selecting current word", but F3 (Next) and Shift+F3 (previous) will search for the word under the cursor. You can use Ctrl+W (Extend selection) to select the word under the cursor. Finally Ctrl+F will open the find/search tool. More options are listed in help: https://www.jetbrains.com/help/idea/search.html
EDIT
I forgot to mention, if you first use the mouse or Ctrl+W to select the word, and then open the search bar using Ctrl+F, or search & replace using Ctrl+R, IDEA will populate the search field with the selected text.
Ctrl+F3 - Find Next
Unfortunately, I have failed to find any keyboard shortcut for Find Previous shortcut.

libreoffice massive text color change

Is there a way to change all occurrences of a specific color in a text in LibreOffice or Openoffice?
yes: With cursor in the find box:
hit "more options" in the Search & Replace dialogue;
click on "Format...";
select "Font effects";
select the color to search for;
Repeat the same for the replace box, selecting the desired new color (or "Automatic" to reset it to the default).
You can do it via AltSearch extension:

Resources