Shell/Bash: vim replace tabs with spaces Example

By

Shell/Bash Example: This is the "vim replace tabs with spaces" Example. compiled from many sources on the internet by SimpleTutorials.org

vim replace tabs with spaces

" Vi:

" To replace tabs with spaces whilst typing
set tabstop=4 shiftwidth=4 expandtab

python pad punctuation with spaces

# Basic syntax using regex:
import re
re.sub('characters_to_pad', r' \1 ', string_of_characters)
# Where you can specify which punctuation characters you want to pad in
#	characters_to_pad

# Example usage:
import re
your_string = 'bla. bla? bla.bla! bla...' # An intelligent sentence
your_string = re.sub('([.,!()])', r' \1 ', your_string)
# your_string is updated in place
print(your_string)
--> bla .  bla? bla . bla !  bla .  .  . 
# Notice that the '?' didn't have spaces added because it wasn't listed
#	among the characters_to_pad in the above function



* Summary: This "vim replace tabs with spaces" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!

Others