This question already has answers here:
What does ==$0 (double equals dollar zero) mean in Chrome Developer Tools?
(5 answers)
Closed 5 years ago.
When you click on "Inspect an element" or on an element in the console you can see == $0 next to him.
What does this stand for ? What is the utility ?
You can type $0 in the console and it will output the element but how are you suppose to use it ?
It's useful for debugging and playing around with elements using the Console API. If you select an element in the Elements panel, it gets added to a stack of index references. $0 refers to the last selected element, $1 is the one selected before that, and so on. It remembers the last five elements $0 - $4.
This means you can quickly call functions, or change attributes and properties of these previously selected elements without needing to use a selector like document.getElementById('hplogo'); or $('#hplogo'). Example below:
Related
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
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
This question already has answers here:
ending "+" prompt in R
(5 answers)
Closed 6 years ago.
After entering a complex code(where something was incorrect), instead of > sign R displays +. If I knew what is missing (oftentimes due to missing out (,),') it would be easy to fix, but I am not sure. Therefore I am "locked" with this + state and cannot escape it. Is there a way to kill it and revert back to the default prompt?
It depends on where R is running. Try CTRL+C on the keyboard, if you are running plain R. Some IDE (like RStudio) have a Stop button you can press to abort the command given.
Often Esc, the escape key works.
This question already has answers here:
Equivalent to unix "less" command within R console
(5 answers)
Closed 8 years ago.
Is there any command in R console which behaves same as "more" command in Linux?
Consider this
>x=list(seq(100000), seq(100000))
>x
It displays everything at one go and shows message at the end "reached getOption("max.print")". Scrolling back to top doesn't show me the first values. I need a command like more(x) which will show more and more by pressing space bar.
Would ?page do the trick? e.g., page(list(a = rnorm(1000), b=rnorm(1000)))
This question already has answers here:
Vim: underscore(_) automatically converted to (<-)
(4 answers)
Closed 8 years ago.
By default, the Vim-R-plugin inserts <- whenever I type or paste an underscore _. This creates problems when I paste stuff like geom_bar, which becomes geom <- bar. Is there a way to turn this short-cut off?
I tried looking at the manual (scroll down to Edit section) but couldn't figure out how to do it.
I'm using Vim-R-plugin Version 0.9.9.9
for Vim version 7.4.
From the help page of the plugin:
6.3. Assignment operator and Rnoweb completion of code block
...
To completely disable this feature, put in your vimrc:
let vimrplugin_assign = 0
--
EDIT: As of writing this (2019-10-25), add this to your vimrc instead:
6.4. Assignment operator and Rnoweb completion of code block
...
let R_assign = 0