Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d1aa1d9b8cb34093200039f

PEP8 Python Wrapping Comments and Code

According to PEP8, long flowy text and code should have different max line lengths. Code: 79 characters max Long flowy text: 72 characters max

Start file
class Rectangle(Blob):
   
"""
    According to PEP8: [P]lease limit all lines to a maximum of 79 characters. For flowing long blocks of text, limiting the length to 72 characters is recommended.

    This comment should have a max line width of 72. Note: (68 + 4 spaces for indent = 72)
    """


   
# Below code should have a max line width of 79
   
def __init__(self, width, height, color='black', emphasis=None, highlight=0):
       
Blob.__init__(self, width, height, color, emphasis, highlight)
End file
class Rectangle(Blob):
   
"""
    According to PEP8: [P]lease limit all lines to a maximum of 79
    characters. For flowing long blocks of text, limiting the length to
    72 characters is recommended.

    This comment should have a max line width of 72. Note: (68 + 4
    spaces for indent = 72)
    """


   
# Below code should have a max line width of 79
   
def __init__(self, width, height, color='black', emphasis=None,
                 highlight
=0):
       
Blob.__init__(self, width, height, color, emphasis, highlight)

View Diff

3c3,5
<     According to PEP8: [P]lease limit all lines to a maximum of 79 characters. For flowing long blocks of text, limiting the length to 72 characters is recommended.
---
>     According to PEP8: [P]lease limit all lines to a maximum of 79
>     characters. For flowing long blocks of text, limiting the length to
>     72 characters is recommended.
5c7,8
<     This comment should have a max line width of 72. Note: (68 + 4 spaces for indent = 72)
---
>     This comment should have a max line width of 72. Note: (68 + 4
>     spaces for indent = 72)
9c12,13
<     def __init__(self, width, height, color='black', emphasis=None, highlight=0):
---
>     def __init__(self, width, height, color='black', emphasis=None,
>                  highlight=0):

Solutions by @Tsimon-Dorakh:

Unlock 17 remaining solutions by signing in and submitting your own entry
Created by: @lionelyoung

68 active golfers, 217 entries

Solutions by @Tsimon-Dorakh:
23
#7 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:19PM

24
#>11 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:18PM

25
#>15 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:14PM

26
#>33 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:13PM

27
#>36 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:12PM

28
#>39 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:11PM

32
#>49 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:10PM

33
#>50 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:08PM

34
#>51 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:05PM

36
#>55 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:59PM

44
#>62 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 07:07PM

45
#>63 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:57PM

50
#>66 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:55PM

53
#>67 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:51PM

57
#>68 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:50PM

59
#>68 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:47PM

73
#>68 - Tsimon Dorakh / @Tsimon-Dorakh

10/10/2024 at 06:43PM