In Mac OS X Ctrl+Cmd+g replaces a word in the whole file. What's the alternative to that in Linux?
I tried to check the keybindings, but no luck.
You can use Command+. to active the Key Binding Resolver to look for the actual function bound to the shortcut on your Mac and search the function on Linux Atom to figure out what the key combination is.
Alternatively, your can search all your key binding here (see screenshot below) which accept both key combination and command name.
Using ctrl + e when you are on a word will open the find and replace panel for this word.
Then use tab to go into the "replace in current buffer field", type your replacement word.
Finally, hit enter to replace the occurrences one by one, or ctrl + enter to replace all.
Related
Example : the file "A.txt" contains several rows with phrases :
This is a phrase
Bla keyword blabla
This is another phrase
Desired results :
in A.txt :
This is a phrase
This is another phrase
in B.txt :
Bla keyword blabla
Then I use the option "Find" keyword then I use "Extract". It extracts the correct rows in a new document (B.txt) but how to also remove the full row(s) containing the selected keyword in "A.txt" ?
This can be easily done with EmEditor. I have provided two methods.
Method 1
Select a keyword, right-click on the selection, and select Filter Out.
Click Extract All on the Filter toolbar.
Save as a new file name.
Method 2
Select a keyword, right-click on the selection, and select Filter.
Make sure Block Multiline Changes is disabled on the Filter toolbar.
Press Ctrl + A to select all text.
Press Delete.
Click the Abort button on the Filter toolbar.
I do the same thing a lot in EmEditor and using only the keyboard, this is the quickest way I know.
Here are my steps:
Highlight the search string and open the Find dialogue Ctrl + F
Alt + T to Extract the lines into a new document/tab
Esc to close the Find dialogue (not needed if option Close when finished in the Find dialogue is active).
Go back to the original source document Ctrl + Tab
Re-open the Find dialogue Ctrl + F
Bookmark the lines Alt + B
Esc to close the Find dialogue (not needed if option Close when finished in the Find dialogue is active).
Delete the bookmarked lines Ctrl + Shift + Backspace
Steps 3 and 7 can be skipped if using the mouse to select the original source document. I just haven't figured how to activate it with the keyboard while the Find window is still open.
When I highlight any string of text in the R Studio console a rectangle is drawn around all other occurrences of this same string of text. How do I advance to the next occurrence of this arbitrary string of text? I'd like the keyboard shortcut.
CTRL-F3 is the closest shortcut I know. This takes the selected string of text, drops it into the Find dialog and jumps to the next occurrence (keep pressing CTRL-F3 to cycle through)
If you would like to move to the next occurrence of a word/variable and select it while also keeping the original selected, this command exists but does not have a default shortcut assigned to it.
The command is called 'Find and add next' (or 'Quick Add Next' in older versions). You can assign a shortcut to it by going into Preferences -> Code -> Modify_Keyboard_Shortcuts. I use Alt+Cmd+Right (on a Mac) as that is an unassigned key binding.
You can see bellow I have used the command twice to select three of the four instances.
On a Mac, I use command+f to call Find with a selected string and then use control+g to move onto the next match.
This needs to be over 30 characters, but only needs 2:
F3
I usually want to find and replace all, but it looks like it has been set to current/highlighted cell only (https://github.com/jupyter/notebook/pull/2131). jupyter also doesn't remember the option after the dialog goes away. Is there a way to change this behavior? Thanks.
Select all the cells where you want to perform Find/Replace
Shift + Arrow key Down or Up
and then,
Menu: Edit -> Find and Replace
Press ctrl+shift+F.
Then type "find and replace".
In order to rename a variable in all cells, click on the arrow as shown in the image
Steps
1.Go to edit -> Find and Replace -> click on it
See the highlighted option. Use this to replace in complete notebook.
I just had to do it urgently so shut down the notebook kernel did it from the terminal with sed like this:
sed -i "" 's/oldword/newword/g' mynotebook.ipynb
That was on a mac which am using at the moment, but if you do it on ordinary linux the "" should be left out ie
sed -i 's/oldword/newword/g' mynotebook.ipynb
First time I ever needed to do such a thing in years but if it happened more often would be good if it could be done from the browser.
First select all the cells (Esc->Ctrl+Shift+arrow_down_key).
Then Edit-> Find and Replace.
If only in one cell, then use the shortcut 'F' key.
Just do ctr+a outside the cell thats all:-
It will select all the cells and perform find and replace
I've just started programming in R and have discovered you make comments by using #.
I've never been too concerned with this key as I normally program using Matlab or C++.
I'm using Windows 8 on a Macbook Pro so the keyboard doesn't have a designated # key and the shortcut for an apple keyboard for the # key (which is alt+3) doesn't work.
I haven't been about to find a solution for this. Thanks.
On an Apple Keyboard, whilst using a third-party OS such as Windows, you type the # symbol by pressing the 2nd Alt key + 3.
The first (left hand side) Alt key doesn't have a shortcut function.
This applies to all programs (Visual Studio, R, Word etc).
When using Windows the keyboard reverts to a standard Windows keyboard layout, which is different from the Mac layout for some keys. So the hash key is mapped to what is marked as the backslash key \, to the left of the return, and the # key is mapped to the double inverted comma.
I've got an Apple "Magic Keyboard" on UK settings and can get the hash symbol by holding Command and pressing the Backslash key
I'm using Ubuntu Xfce on a Macbook, and none of the above answers helped me at all. Then I found I could type a hash character using SHIFT + RIGHT ALT + = twice. It makes sense, because a hash character looks like two '+' signs.
The RIGHT ALT key is listed in my Settings -> Keyboard -> Layout as the 'Compose Key', so if it doesn't work, check what your Compose Key is and try that.
I have a textpad file that has rows of text. For e.g.
Cat: Meaning - animal. The cat ran up the house
Rat: Meaning- rodent. The rat lives in the borough and feeds on leftovers
Word 3: Description
Word 4: Description
I have many such record in my file. I want to insert a line break at the end of every record for proper presentation. Doing it manually is tedious. Please help if you know an automated process to insert line break.
You can quickly do this by using a feature called "Regular Expressions" to find and add empty lines.
Open up the Find/Replace (Search menu > Replace)
In the "Find what" field, type the following: (^.+$)\n(^.+$)
In the "Replace with" field, type the following: \1\n\n\2
Tick the "Regular expression" checkbox
Click the Replace All button at least twice, but perhaps 3 times, until you get the message Cannot find the Regular Expression
Untick the "Regular expression" checkbox
Close the Replace dialog
Confirm the file is formatted as you are expecting
Save the file.
You can write a simple C# prgram that uses a loop that adds this code after every line :
But first add the namespace using System.Enviorment
Enviorment.NewLine;
If you have any more trouble i'll help with some code to get started
Open up the Find/Replace (Search menu > Replace)
In the "Find what" field, type the following so that the replace occurs at the end of each line: $
In the "Replace with" field, type the following. Note each 'n' represents a <return>. In this instance, I added a return at the end of a SQL statement, the word 'GO' on the next line and another <return>: \n\GO\n
Started with text file containing:
select * from <tablename>
select * from <tablename>
Ended with text file containing:
select * from <tablename
GO
select * from <tablename>
GO
Hope that helps.
from your text it is difficult to understand what you are intending to do. I'll give you some questions. The answers will help others to help you.
Do you really mean textpad as the product from company helios in UK or do you use this word as a general word for a class of tools (like notepad - but there is a general definition AND the tool as part of Windows).
Your file hase line breaks yet. You don't see them, but in the file itself they are present (in Unix systems line feed (hex code 0A) or in the windows world carriage return followed by line feed (hex code 0D 0A)).
Or would you like to publish your text in HTML? So you have to put the necessary tags around each line like paragraph, line break, list item etc.?