Skip to content

mau-mauricelim/VimGolf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Training to be a Vim Ninja 🥷

Challenges: https://www.vimgolf.com/

Bonus challenges 🎁

  • Get personal stats of your Played Challenges in a markdown table format
  • KdbGolf - useful for parsing files

VimGolf tips 💡

  1. Use the shortest command name possible. Check the help page for commands.
  2. Omit whitespace where possible.
  3. Chain commands with | delimiter.
  4. Use capital letter motion instead of double letter. E.g. Replace yy with Y.
  5. Use ZZ to quit vim instead of :x<CR> or :wq<CR>.
  6. Macros can be editted.
    1. Macros are stored into Vim registers, view them with :reg.
    2. Assuming the macro is in register q, paste the content of register q into the buffer using :pu q.
    3. Inspect and modify the line.
    4. Copy the macro into the desired register using "qyy (where q is the desired register here).
  7. Learn from others' solutions and try to understand the logic behind the solution.
  8. ``: To the position before the latest jump.
  9. G: Goto line [count], default last line, on the first non-blank character.
  10. X: Delete [count] characters before the cursor.
  11. gJ: Join [count] lines, with a minimum of two lines. Don't insert or remove any spaces.
  12. +/-: [count] lines downward/upward, on the first non-blank character linewise.
  13. Q: Ex mode is useful for chaining multiple commands. Use x/q to quit.
  14. norm followed by a number does not require a whitespace.

Useful Vim resources 📖

  • vim-galore Everything you need to know about Vim

KdbGolf tips 💡

  1. We Don't Need No Stinkin’ Brackets

NOTE: Golfing challenges and real world applications are different.

Vim motions ⚡

Left Middle Right
Top gg H
Middle 0 / ^ M g_ / $
Bottom G L

Sanitize challenge name 🧼

q)sanitize:{"_"sv("_"vs?[x in .Q.an;x;"_"])except enlist""}
q)sanitize"Harder than \"abcd > a b c d\""
"Harder_than_abcd_a_b_c_d"
q)sanitize"대법원 인명용 한자 바인딩(Combine Hangul and Chinese characters)"
"Combine_Hangul_and_Chinese_characters"

Happy golfing! ⛳

A compiled markdown eBook is available! 📖

Personal stats 🎯

https://www.vimgolf.com/45533/mau-mauricelim

Played Challenges Entries Best score Best player score Position Number of attempts
Reorganize Pokémon 57 18 18 #5 / 17 10
Markdown Blog Editing 197 30 36 #14 / 52 3
Fix timezone format 186 15 15 #10 / 61 5
Search different SQL column with similar where clause 116 22 22 #6 / 36 6
Poorly indented Python comments 1313 15 15 #55 / 220 11
hello-world-vimgolf 2490 10 10 #341 / 705 3
Contribute to keyboard mashing 890 17 18 #116 / 270 3
Reordering Lorem Ipsum 290 13 73 #41 / 66 3
Fill in the chess board 956 19 25 #63 / 183 6
Simple, Practical, and Common 33575 22 24 #3116 / 7406 3
One number per line 18709 14 21 #2581 / 3856 3
Applying same text modification in several lines 2869 12 15 #542 / 847 4
remove lines containing the word "reader" 3574 9 10 #857 / 1158 2
Com(m)a Trouble 3790 12 15 #450 / 857 4
Box it 7902 21 25 #1044 / 1874 5
Cool or not? 829 15 20 #166 / 230 2
Two pairs of cluster of letters creates word 749 17 24 #142 / 178 2
Just the middle 11423 7 8 #3200 / 4185 3
Basic renumbering 5645 11 11 #279 / 1263 1
ninja substitution 1420 14 18 #193 / 267 2
One to Ten 2209 12 12 #365 / 669 1
Increment each number 1023 15 21 #183 / 248 3
simple format (3) 86 34 57 #20 / 24 4
I forgot quotes 15967 10 15 #2386 / 4174 3
Words in parens 12928 13 14 #1177 / 3960 5
Resort and deup a CSV list 167 44 48 #24 / 43 6
Simple text editing with Vim 12680 13 13 #725 / 3665 2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •