Sublime Text plugin for Portable Game Notation(PGN)

Sort:
shreyasminocha

If anyone else uses Sublime Text and finds themselves editing .pgn files manually, I've written a package to add syntax highlighting and snippets for the format.

Find it here: https://github.com/shreyasminocha/Sublime-PGN

dinosourd

Hey! I have a feature request happy.png

I prefer formatting with a lot more line breaks - each move gets a newline, and variations are indented. To me the increased readability is well worth the increase of vertical length. I've been banging my head against the regex to add the right whitespace but I'm not a programmer and I can't get it right. Could this be an additional feature in your plugin?

Thanks!

dinosourd

Just as an example, this:

{The benefit of the Four Knight's Scotch for a beginner is that you're always
trying to attack quickly, often with opportunities to attack Black's king,
giving experience in attack, positioning pieces, when to play fast vs. when to
play slowly.} 1. e4 e5 2. Nf3 Nc6 3. Nc3 Nf6 (3... Bc5 4. Nxe5 Nxe5 (4... Qf6 5.
Nf3) 5. d4 Bxd4 6. Qxd4 d6 7. Be3 ({Danya says f4 but the computer says Be3} 7.
f4 Qh4+ 8. Qf2 Qxf2+ 9. Kxf2 Ng4+ 10. Kf3)) 4. d4 exd4 (4... Bb4 5. Nxe5 Nxe4
(5... Bxc3+ 6. bxc3) (5... Nxe5 6. dxe5 Nxe4 7. Qg4 Nxc3 8. Qxb4 Nd5 9. Qg4 O-O
10. Bh6 g6 11. Bxf8 Qxf8) 6. Qf3 Nf6 7. Be3 d5 8. Bd3) 5. Nxd4 Bb4 (5... Bc5 6.
Nxc6 bxc6 7. Bd3 {Castles, Bg5, tuck your king away Kh1, e4 f4 e5...}) (5... d6
6. Bc4 Be7 7. O-O O-O 8. h3 Nxd4 9. Qxd4 c5 (9... Be6) (9... Nd7) (9... c6) 10.
Qd3 Bd7 11. Bf4 Bc6 12. Rad1 Ne8 13. Rfe1 {From here White has several good
attacking or positional ideas: Qg3 followed by e5, attacking the weak d6 pawn; a
Rook lift with Re3; or Nd5, choking out Black's position.})

Becomes:

{The benefit of the Four Knight's Scotch for a beginner is that you're always
trying to attack quickly, often with opportunities to attack Black's king,
giving experience in attack, positioning pieces, when to play fast vs. when to
play slowly.}
1. e4 e5
2. Nf3 Nc6
3. Nc3 Nf6 (
3... Bc5
4. Nxe5 Nxe5 (
4... Qf6 5. Nf3
)
5. d4 Bxd4
6. Qxd4 d6
7. Be3 (
7. f4 {Danya says f4 but the computer says Be3. Going Danya for now} Qh4+
8. Qf2 Qxf2+
9. Kxf2 Ng4+
10. Kf3
)
)
4. d4 exd4 (
4... Bb4
5. Nxe5 Nxe4 (
5... Bxc3+ 6. bxc3
) (
5... Nxe5
6. dxe5 Nxe4
7. Qg4 Nxc3
8. Qxb4 Nd5
9. Qg4 O-O
10. Bh6 g6
11. Bxf8 Qxf8
)
6. Qf3 Nf6
7. Be3 d5
8. Bd3
)
5. Nxd4 Bb4 (
5... Bc5
6. Nxc6 bxc6
7. Bd3 {Castles, Bg5, tuck your king away Kh1, e4 f4 e5...}
) (
5... d6
6. Bc4 Be7
7. O-O O-O
8. h3 Nxd4
9. Qxd4 c5 (
9... Be6) (9... Nd7) (9... c6) 10.
Qd3 Bd7 11. Bf4 Bc6 12. Rad1 Ne8 13. Rfe1 {From here White has several good
attacking or positional ideas: Qg3 followed by e5, attacking the weak d6 pawn; a
Rook lift with Re3; or Nd5, choking out Black's position.})

dinosourd

Ah, the forum stole my tabs, but you can imagine how each open parenthesis is followed by an indented section.

Guest7628664637
Please Sign Up to comment.

If you need help, please contact our Help and Support team.