Python Forum
Re-arrange lines when adding new if statement
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Re-arrange lines when adding new if statement
#1
Hello;
As we know that spaces is important in the coding.
I am asking: when we need to add if statement or any control statement for existed code, that will require to do shifting for the ALL lines to be under this if statement (or for loop or any control statement), this is too much hard work and consuming time.
How to overcome this?
I am programming using vi editor in linux.
Regards
Bilal
Reply
#2
(Feb-20-2018, 03:32 PM)bghayad Wrote: this is too much hard work and consuming time.
well, in any decent IDE indent/dedent is just
1. select block of code
2. hit Tab/Shift+Tab
away.
Or some other dedicated key combination.

I don't use vi/vim, but this should help https://stackoverflow.com/a/235841/4046632
Reply
#3
In addition to @buran's post, you may want to see this
"As they say in Mexico 'dosvidaniya'. That makes two vidaniyas."
https://freedns.afraid.org
Reply
#4
In python-mode, vim is pretty friendly to auto-indent. https://wiki.python.org/moin/Vim
It should take almost no effort to indent your blocks.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Iterate 2 large text files across lines and replace lines in second file medatib531 13 5,814 Aug-10-2020, 11:01 PM
Last Post: medatib531
  Arrange my looped template data in rows JedBoyle 0 1,547 Feb-19-2020, 01:41 PM
Last Post: JedBoyle
  Adding markers to Folium map only adding last element. tantony 0 2,121 Oct-16-2019, 03:28 PM
Last Post: tantony
  Arrange list of tuple using loop batchenr 7 3,477 Jun-16-2019, 03:24 PM
Last Post: Abdullah
  Arrange lines in python pythonlover 11 7,226 Sep-15-2017, 11:34 PM
Last Post: pythonlover

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020