I am a beginner programmer as well as linux user. Before, I was using windows and the python IDLE was so good. I need not needed to press tab button after the "If" statement or any other loops.
Now, I am using Linux and started to write programs through the command line text editor of ubuntu called as "nano". Here, I need to press tab all the time i use "if" statement. It is very tedious. Especially when there is bunch of nested loops, it becomes difficult to remember the tabs count. And i was thinking if there was any idea to make it work like in the IDLE in windows. I also tried to google the problem but i couldn't explain it in few words. I hope you've got what my problem actually is. And i need a descent solution for this.
Try adding the following to ~/.nanorc
(you may need to create the file if it doesn't exist):
set autoindent
Note that nano is pretty lightweight editor, so it lacks a lot of features and customization that other editors provide. You might look into something like emacs
or vim
if you find yourself limited by your editor.
EDIT: More detail as requested:
Type nano ~/.nanorc
in your terminal to open the config file with nano.
Once inside nano, type set autoindent
to enable auto-indentation.
Then type Ctrl-o Ctrl-x to save the file.
When you run nano add -i
to the command (as in nano -i
).
Also you might find this useful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With