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.