1

I created a class in python that stores a database of ASCII art strings. I can do this reliably thanks to the triple quotation marks which allows me to use multiple lines. However, the problem with this is that when I attempt to paste the art into their designated variable name within the class, the art is left-aligned with the screen, and doesn't follow the same tab indention like everything else in the class (like I want it to, in other words). If I press Tab or Ctrl + ], it messes up the art by making sure that each line has has exactly 4 spaces, no less.. no more.. I want there to be at least 4 spaces, and if there is already a space between the first character and left side of the text editor window, to add the 4 spaces to it. I can do this manually, but it is quite the drag... any thoughts how to do this in Visual Code?

# how it is when pasting
mouseTalking = ("""    
  _   _
 (q\_/p)
  /. .\\
 =\_V_/=   __
  /   \   (
 ((   ))   )
 /\) (/\  /
 \  Y  /-'
 `""^""`       """)

# how I want it to be when pasted (indented)
mouseTalking = ("""    
      _   _
     (q\_/p)
      /. .\\
     =\_V_/=   __
      /   \   (
     ((   ))   )
     /\) (/\  /
     \  Y  /-'
     `""^""`       """)
# what occurs when I indent it using Tab or Ctrl + ]
    mouseTalking = ("""    
    _   _
    (q\_/p)
    /. .\\
    =\_V_/=   __
    /   \   (
    ((   ))   )
    /\) (/\  /
    \  Y  /-'
    `""^""`       """)


dv1651st
  • 45
  • 5

1 Answers1

0

Move your cursor just before the character (e.g. / \ ( ) ) and then press tab.

Also, you can put multiple cursors by pressing Alt and clicking the start of every lines' character and then press tab to indent then altogether.

Nishith Savla
  • 310
  • 2
  • 10