I have a problem with the shortcut settings in Atom (Ubuntu 16.04). I'm looking for an option of switching between the tabs using "alt + tab". Somewhere I saw an info that it's already "packed in" but it's not true. So I've been told that I have to change the Keymap. I did it a couple of times using different instructions for example:
'body':
ctrl-tab ^ctrl': 'unset!'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab ^ctrl': 'unset!'
'ctrl-shift-tab': 'pane:show-previous-item'
but it failed...I mean - it is working only as long as the tab with the Keymap is open!?! (I've saved it of course before closing!)
and it is not working when I use the tab option "Split left, right or down" to get double or more views at one time.
Does anyone from You know how to solve this?
Thanks in advance!
Paweł
Related
When using the up and down arrow in my terminal (iTerm 2 on Mac OS Catalina), I can browse through my last commands using the up and down arrows.
I use ZSH (Oh-my-zsh to be precise) and if I type e.g. vim then press up, it will browse my history for any commands issued starting with vim.
I think it's annoying to have to move my hand to the arrow keys, so i wanted to bind ctrl-j and ctrl-k for browsing up and down.
I looked at bindkey and bound ^j to down-history and ^k to up-history. This allows me to browse my history, but not with the "smart" functionality (i'm not sure of the right terminology here) - It simply goes up and down in my history, without regards to my input.
I've looked through the standard widgets on the Zsh Line Editor manual, but I cannot find the right command for this.
Which command should I bind ^j and ^k to to get my desired result?
After some further digging, i ended up on the The Z-Shell Line Editor page at the section called "Prefix searching".
It revealed that the widget I was after, is called history-beginning-search-backward.
When using that widget, it works almost as I wanted it to, but not jumping to the end of the line.
A quick search lead me to another StackOverflow Question, that states that if you want to jump to the end of the line (as with the up arrow), it should be done as follows;
I had the same question and managed to find the solution with some experimentation.
I added the following to my .inputrc
"\eOA": history-search-backward # Up
"\eOB": history-search-forward # Down
"\C-P": "\eOA\C-E" # Ctrl-P
"\C-N": "\eOB\C-E" # Ctrl-N
This binds two hotkeys to Ctrl-P and Ctrl-N. One for history search, and the other Ctrl-E for end-of-line.
In Jupyter notebook, cntrl+ m L toggles code line numbers in current cell but how to bring the code line numbers in JupyterLab?
Referred a similar issue opened in github
https://github.com/jupyterlab/jupyterlab/issues/2395 - Shift+L toggles line number visibility.
you can turn this on by default by going into Settings --> Advanced Settings Editor:
As you can see from the screenshot, you can edit other features as well and easily set them back to default by deleting your 'User Overrides'
Go to Settings > Advanced configuration and add:
{
"codeCellConfig": {
"lineNumbers": true
}
}
You can go to View -> Show Line Numbers:
which will display line numbers in the notebook:
Late reply, but it'll still help others!
For Windows users, just hit Shift + L
In your Jupyter Lab, click the chain, View -> Line numbers. This solution is from this GitHub issue.
I'm new at this so don't flame me. But Frank said from View -> Show Line Numbers. I did this from main JupyterLab window. I'm using version 3.5.0.
I use Atom on Ubuntu 17.10 with wayland window manager.
I can create multiple cursors with CTRL+Mousclick or with CTRL+d to select the next same string.
But how can I for example mark some lines and create a cursor at the start of each line?
Also would be great to use search and find-all to select lots of results in a text to create a cursor at all these results.
I used this workaround at the moment by selecting the line-break and use CTRL+d to select the next linebreaks too with extra cursors, then go one left and Pos1 to have the cursors at the start of each line.
I wanted to select a string that repeats about 200 times in a dataset of 3000 text-blocks in a bunch of output and then I wanted to expand the selection to each of those blocks. That would have been really easy with multiple cursors. I solved this another way now, but for the next time I would like to see a complete instruction manual about how to create multiple cursors in the standard atom setting. I couldn't find this. Search-engines give me lots of plugins and solutions in different multicursor plugins.
I found the manual that explains it like in sublime (ctrl alt up and down):
Alt+Shift+Up and Down
see: https://flight-manual.atom.io/using-atom/sections/editing-and-deleting-text/#multiple-cursors-and-selections
What is missing in the manual is also a useful option:
use "find all" with the search tool in Atom (CTRL+F)
press Alt + Enter to create cursors at all the found locations.
see: https://discuss.atom.io/t/how-do-i-create-multiple-cursors-from-search-result/53231/5
I wanted to make it easy so I could just use alt+⬇️ or alt+⬆️ to have multiple cursors. This was my solution and I think its the easiest:
# From Atom -> Keymap add the following lines:
'.editor':
'alt-up': 'editor:add-selection-above'
'alt-down': 'editor:add-selection-below'
I have been moving from Webstorm and RubyMine to Atom and I really miss a feature from the Jetbrains editors where you select a code block and press CMD + - and it adds language specific comment character(s) to the beginning of each line. (# for ruby. // for js, /* for css etc.).
Is there a built in shortcut for Atom or a package which provides this feature?
According to this, cmd + / should do it.
And for Windows and Linux, it is ctrl + /.
Atom does not have a specific comment-block function, but if you select more rows and then use the normal ctrl-/ (Windows or Linux) cmd-/ (Mac), it will comment all the lines.
Command + / or Ctrl + shift + 7 doesn't work for me (debian + colombian keyboard).
In my case I changed the Atom keymap.cson file adding the following:
'.editor':
'ctrl-7': 'editor:toggle-line-comments'
and now it works!
Also, there are packages:
Comment package for atom (https://atom.io/packages/comment)
Block-comment-lines https://atom.io/packages/block-comment-lines
Sublime Block Comments
Pressing (Cmd + /) will create a single line comment. i.e. // Single line comment
Type (/** and press the Tab key) to create a block comment ala
/**
* Comment block
*/
with all my respect with the comments above, no need to use a package :
1) click on Atom
1.2) then ATL => the menu bar appear
1.3) File > Settings => settings appear
1.4) Keybindings > Search keybinding input => fill "comment"
1.5) you will see :
if you want to change the configuration, you just have to parameter your keymap file
You can use Ctrl + /. This works for me.
Multi-line comment can be made by selecting the lines and by pressing Ctrl+/ .
and Now you can have many plugins for comments
1) comment - https://atom.io/packages/comment
2) block-comment-lines - https://atom.io/packages/block-comment-lines
better one is block-comment try that..
Edit your keymap.cson file and add
Windows
'.platform-win32 .editor':
'ctrl-/': 'editor:toggle-line-comments'
Mac
'.platform-darwin .editor':
'cmd-/': 'editor:toggle-line-comments'
Now just highlight the text you want to comment and hit the keybinding.
You can use Ctrl + Shift + / for Windows.
Atom does not have block comment by default, so I would recommend searching for atom packages by "block comment" and install the one suits to you.
I prefer https://atom.io/packages/block-comment because is has the closest keyboard shortcut to line comment and it works as i need it to, meaning it would not comment the whole line but only the selected text.
line comment: CTRL+/
block comment: CTRL+SHIFT+/ (with the plugin installed)
Possible reason: watch out for overlapping keybindings. It has happened in my case and deactivated the initial toggle line comment binding:
The Keybindings you can find in the Edit -> Preferences -> Keybindings of the application navbar.
The solution was overriding binding for github:toggle-patch-selection-mode
On an belgium keyboard asserted on the mac
command + shift + / is the keystroke for commenting out a block.
CTRL+/ on windows, no need to select whole line, Just use key combination on line which you want to comment out.
first select your block of code then
press cmd + / for MacOS
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 4 years ago.
Improve this question
I want to comment out a block of multiple lines in Jupyter Notebook, but can't find out how to do that in this current version.
It used to be in one of the drop down menus but is no longer there.
How do you comment out multi-line blocks of code at once?
This is not a duplicate because the solution given in the following link doesn't seem to work anymore:
How can I block comment code in the IPython notebook?
Ctrl + / does nothing.
Ctrl + / works for me in Chrome browser in MS Windows. On a Mac, use Cmd + / (thanks Anton K).
Please note, if / did not work out of the box, try pressing the / key on the Numpad. Credit: #DreamFlasher in comments to this question.
I have not yet managed to find the best way possible. Since I am using a keyboard with Finnish layout, some of the answers do not work for me (e.g. user5036413's answer).
However, in the meantime, I have come up with a solution that at least helps me not to comment each and every line one by one. I am using Chrome browser in MS Windows and I have not checked other possibilities though.
The solution:
It uses the fact that you can have multiple line cursors in an Ipython Notebook.
Press the Alt button and keep holding it. The cursor should change its shape into a big plus sign. The next step is, using your mouse, to point to the beginning of the first line you want to comment and while holding the Alt button pull down your mouse until the last line you want to comment. Finally, you can release the Alt button and then use the # character to comment. Voila! You have now commented multiple lines.
Try using the / from the numeric keyboard.
Ctrl + / in Chrome wasn't working for me, but when I used the /(division symbol) from the numeric it worked.
Quick Addition to Top Answer: CTRL + / is nice because it toggles back and forth between adding and removing # at beginning of all selected lines. Didn't see that exact nuance mentioned so just wanted to add it here. (This worked in Firefox Developer Edition 54.0b12 on Windows 7).
On a Finnish keyboard use Ctrl + ' to comment on multiple lines and use the same keys to de-comment.
Ubuntu 14.04 Google Chrome
TL;DR:
Using MacBook Pro with Spanish - ISO Keyboard.
Solution: Ctrl + -
Full story
This is an old post but reading it got me thinking about possible shortcuts.
My keyboard is a Latin Apple MacBook Pro, which is called Spanish - ISO. I tried the changing keyboard distribution to U.S. solution... this works but with this solution I have to switch keyboards every time I want to comment which... sucks.
So I tried ctrl + - and it works. The - is where the / is located in an english keyboard but doing Cmd + - only changes the Chrome's zoom so I tried Ctrl which isn't as used as Cmd in macOS.
My takeaway with this would be: if I have more shortcut problems I might try the original shortcut but using the key where the U.S. keyboard would have it.
Select the lines you want to comment out. Then press:
Ctrl + #
I tried this on Mac OSX with Chrome 42.0.2311.90 (64-bit) and this works by using CMD + /
The version of the notebook server is 3.1.0-cbccb68 and is running on:
Python 2.7.9 |Anaconda 2.1.0 (x86_64)| (default, Dec 15 2014, 10:37:34)
[GCC 4.2.1 (Apple Inc. build 5577)]
Could it be a browser related problem? Did you try Firefox or IE?
Use triple single quotes ''' at the beginning and end. It will be ignored as a doc string within the function.
'''
This is how you would
write multiple lines of code
in Jupyter notebooks.
'''
I can't figure out how to print that in multiple lines but you can add a line anywhere in between those quotes and your code will be fine.
Fn + Cmd + / in Safari browser on MacOS
On MacOS 10.11 with Firefox and a German keyboard layout it is Ctrl + ?
Select the lines on windows jupyter notebook and then hit Ctrl+#.
I add the same situation and went in a couple of stackoverfow, github and tutorials showing complex solutions. Nothing simple though! Some with "Hold the alt key and move the mouse while the cursor shows a cross" which is not for laptop users (at least for me), some others with configuration files...
I found it after a good sleep night. My environment is laptop, ubuntu and Jupyter/Ipython 5.1.0 :
Just select/highlight one line, a block or something, and then "Ctrl"+"/" and it's magic :)
After searching for a while I have found a solution to comment on an AZERTY mac. The shortcut is Ctrl +/= key
I am using chrome, Linux Mint; and for commenting and dis-commenting bundle of lines:
Ctrl + /
For a Dutch keyboard layout (on Debian 9 in Chromium 57) it is Ctrl + °
Another thing to add, in the version I'm using, the code has to be initialized in order to be to comment it out using CTRL and / . If you haven't ran the code and the code isn't colorized it wont work.
If you have a Mac and not a English keyboard:
Cmd-/ is still easy to produce.
Follow the below steps:
Just go into the Mac's System Settings, Keyboard, tab "Input Sources" or whatever it might be called in English
Add the one for English (shows up as ABC, strange way to spell English).
Whenever you want a Cmd-/, you have to change to the ABC keyboard (in your menu row at the top of your screen,if you have ticked it to be shown there in the System Settings - Keyboard tab).
Cmd and the key to the left of the right "shift key" gives you Cmd-/.
P.S: Don't forget to switch back to your normal keyboard.