If you are reading this, there is a pretty good chance that you are either using ST (Sublime Text) or are about to start using it. Whatever the case, I can assure you that its effing awesome !
So the first three shortcuts that anyone starting out with it should start using are :
Ctrl + G - Goto line numberCtrl + P - Open file by name (uses fuzzy search)Ctrl + R - Goto function (uses fuzzy search)
pprint is a very handy module for printing out objects in a humane form.
Unfortunately it doesnt prettyprint OrderedDict objects properly.
The following is a workaround for printing a OrderedDict object in a manner close to what pprint does for a regular dict
Use json module’s dumps method to print the OrderedDict
import json
od = <Your OrderedDict>
print(json.dumps(od, indent=4))
To stop tracking a file that was previously being tracked by git, do the following:
- add the filename to the
.gitignore file - execute the command
git rm --cached <filename>
Git shall now stop tracking the file
Sublime Text is an amazing text editor. To make it even more awesome, it has extensive support for all actions using keyboard only. This is the first post in my Keyboard Fu Series wherein I shall post random tips and tricks and shortcuts for using keyboard to do all sorts of action in Sublime Text.
So here is the first one.
To shift focus to the sidebar, use the keyboard shortcut
Ctrl+0
Now you can navigate the folder structure in the sidebar using arrow keys
To enable autologin in Xubuntu
- Open the file /etc/lightdm/lightdm.conf
- Modify the value of the string “autologin-user” with the required user name. Eg: autologin-user=MyLoginName
- Save the file
- Reboot
Note:
- Make sure the user is created before modifying the file.
- You can use any text editor instead of leafpad