LightTable: How to format code? - lighttable

How do you format code in the LightTable IDE? I'm talking about the equivalent of Ctrl + Shift + F in Eclipse.

You can do this by holding CTRL + SPACE and then searching for "Smart Indent".

Light table does not have all the features of a full IDE yet, the main feature it has is live editing

Related

Adding Russian yazerty keyboard prevents super + p and super + r to be effective

I have been running Awesome for quite a time with fcitx enabled for being able to use Japanese and French input. Everything was fine.
I have added Russian yazerty keyboard and then super + p and super + r are no longer effective while super + space or the other super shorcuts I use are fine.
What can I do to fix this annoying issue?
TIA
The solution is not to add Russian yazerty keyboard to fcitx but instead to as described https://simpleit.rocks/linux/switch-keyboard-layouts
So I have a script ~/bin/ruskey which reads as follow :
#!/bin/bash
setxkbmap -model pc105 -layout fr,ru -variant oss,phonetic_yazherty -option grp:ctrls_toggle

Is there a shortcut for deleting a line in Jupyter's edit mode?

In Jupyter's edit mode, is there a shortcut for deleting a line of text? Something like Ctrl + L in Visual Studio?
Shift + Delete or Ctrl + D or both, depending on version.
Ctrl + D is listed under Help → Keyboard Shortcuts in the notebook menu, but Shift + Delete seems to work despite being undocumented.
As for Jupyter notebook servion version 6.0.2 the command Ctrl + D works for me. This shortcut is listed in the shortcut documentation, that can be found under Help → Keyboard Shortcuts.
If you want to edit the shortcuts you can do this here: Help → Edit Keyboard Shortcuts
On Mac, use Cmd + D, instead of Ctrl + D.

Commenting out code blocks in Atom

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

How do I block comment in Jupyter notebook? [closed]

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.

Split Screen in Atom Editor

Is there a way (plugin or something) to use split screen in the Atom Editor?
I've looked inside the menus, but I can't find any related options.
Using the command palette
Open the command palette with cmd + shift + p (OSX) or ctrl + shift + p (Linux/Windows) and type "split". You'll see options for Up, Down, Left, and Right split.
Using keyboard shortcuts
Split the current tab in a direction with the following shortcuts
Up       cmd / ctrl + k then ↑
Down  cmd / ctrl + k then ↓
Left     cmd / ctrl + k then ←
Right   cmd / ctrl + k then →
You can close an active split pane with cmd / ctrl + k then cmd / ctrl + w.
Move between panes
If you want to move between open panes (with the keyboard) you have to modify your keymap file. Go to Atom -> Open Your Keymap and include this:
'body':
'cmd-alt left': 'window:focus-pane-on-left'
'cmd-alt right': 'window:focus-pane-on-right'
'cmd-alt up': 'window:focus-pane-above'
'cmd-alt down': 'window:focus-pane-below'
'cmd-alt-2': 'pane:split-right'
'cmd-alt-3': 'pane:split-down'
This is my personal setup. I was used to Sublime's default cmd + alt + arrow. Change the left side commands to your personal preference.
Note
You need to press cmd-alt once, release, and then press the arrow button. Otherwise it won't work.
I found this at Split Windows - issue #64:
It seems like Atom already has support for splitting windows (cmd-k + arrow key)
Right click anywhere on an open file, select "split left"
If it duplicates a file, "x" it out.
Result:
I have created a beginners cheat sheet for Atom that lists some introductory notes and keyboard shortcut commands etc. Its on github #
https://github.com/pd-gmit/atom-cheatsheet/blob/master/atom_cheatsheet.md
You could always just right click anywhere on the file and the split options are available in the context menu.

Resources