How do I advance to the next occurrence of a variable in R Studio IDE - r

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

Related

Atom: How do I create shortcut to select a word and search?

I got really used to cmnd+d, cmnd+g and cmnd+d, cmnd+shift+g workflow in sublime text. Is it possible to reproduce the same behavior in Atom using keymap.cson or some other tool?
Here is step by step description of the expected behavior:
I put my cursor on a word.
I press cmnd+d, the word gets highlighted and silently copied to search input. Not silently would be ok.
If I press cmnd+g, the selection goes to the next occurrence of the word. If I press cmnd+shift+g, the selection goes to the previous occurrence of the word.
If I press cmnd+d, I select the current and the next occurrence of the word.
I'm running Linux instead of Mac and I'm not sure what the differences are, but here's the closest method I've found:
Put your cursor on a word
Press Ctrl+F3 to select the next occurrence of the term or Ctrl+Shift+F3 to select the previous occurrence
I say "term" instead of "word" because its behaviour depends on whether whole word matches are enabled in the Ctrl+F menu.
Press Ctrl+D once to select the current word, and again to select the next occurrence of the word
Also:
Ctrl+F searches for whatever's selected
Alt+F3 selects all occurrences of the current word

How to customize the look of currently selected(highlighted) completion in zsh?

Main question
I would like to add powerline characters at the start and at the end of the selected completion, like this:
Started the completion menu by inserting c and pressing the TAB key.
Moved right in the completion menu by pressing the right arrow key.
Moved down in the completion menu by pressing the down arrow key.
Is there any way to make zsh look/behave like in the pictures?
Note
Added powerline triangle + blank character at the beginning and blank character + powerline triangle at the end should somehow be accounted when columns are created to keep the alignment correct.
Bonus
Add 2 blanks at the beginning of every completion in the list, so that when the completion is selected it doesn't look like the text was moved to the right.
( This issue can be seen by comparing the completion with and without the selection. )
Alternative question
In case that previously explained behavior is impossible to get without changing the zsh source code, is it at least possible to add powerline triangle only at the end of the selected completion?
My unsuccessful attempts
I have tried using the lc, rc, and ec variables in the list-colors style but that didn't help:
Completion list was badly aligned and it created all kinds of visual problems.
Symbols were inserted in all elements of the completion list, not just the selected one.
I have also tried using the ma variable, but I couldn't properly insert a character at the beginning:
The variable expects only a number that represents a color and it is probably wrapped in some escape sequences, so the output did not look as expected.
This works for me.
zstyle ":completion:*:default" list-colors ${(s.:.)LS_COLORS} "ma=48;5;153;1"
Uses my LS_COLORS and then ma sets the background of my selection to bold and color 153 from https://jonasjacek.github.io/colors/.
Found from https://www.zsh.org/mla/users/2010/msg00811.html

How to make backspace work in lc3 assembly

My code is,
LOOP TRAP x20 ;get c
TRAP x21 ;out
BRnzp LOOP
It will output any letter to the consoles, it will return carriage, tab, but it won't backspace, and the delete button doesn't even show up in a register. Backspace will just show some character, looks like []. Delete shows nothing.
I tried another version without inputs where I used the delete ascii value and the start of text ascii value to move the cursor and delete but it doesn't seem to do anything. Is this a bug or am I doing something wrong?
Is there another way to clear the console out? I could work around it if I spam a bunch of new lines until it's off screen but I would rather it work normally. Any ideas?
Putting out a backspace character won't do anything to the characters already outputted, because they're already there.
The best way to achieve this is usually by setting your console to VT100-compatible (often set by default) and using VT100 escape codes to move around the screen.

inserting line breaks after every record in the textpad

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.?

Text editing macros in Xcode 4?

I'm trying to figure out how to define a new text editing keystroke in Xcode 4.
To pick one example, Xcode does not appear to have the incredibly useful Emacs join-line function: delete the newline between the current line and the previous line AND ALSO delete any excess indentation whitespace at the beginning of the current line. ie, go in one keystroke from this:
_measurement =
[DPLMeasurement newWithDate:measureDate inManagedObjectContext:[datastore managedObjectContext]];
to this:
_measurement = [DPLMeasurement newWithDate:measureDate inManagedObjectContext:[datastore managedObjectContext]];
and NOT this:
_measurement = [DPLMeasurement newWithDate:measureDate inManagedObjectContext:[datastore managedObjectContext]];
I've seen instructions for user scripts that were apparently for Xcode 3. Does Xcode 4 no longer have anything like this?
Halley's answer to this question does ALMOST what I want:
Xcode duplicate line
Add the following to the plist file, /Developer/Library/PrivateFrameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist:
Join Previous Line
String
moveToBeginningOfLine:, moveWordRight:, moveWordLeft:, deleteToBeginningOfLine:, deleteBackward:
I say "almost" because it joins the two lines, and deletes whitespace at the beginning of the second line, but if the first line doesn't end with a space it just rams them together and I have to type in the required space. It also deletes punctuation (like open brackets) if they happen to fall at the beginning of the line. So I'm not quite there.

Resources