Panda Code Snippet (v1.0.8)
Panda Code Snippet is a VS Code extension that brings Emmet-style abbreviations to C++ competitive programming (support for Java, Python, and more coming soon!).
Instead of typing out long boilerplate, vector declarations, or algorithms, you can type a shortcode like !cpp or !dijkstra and hit Tab to instantly expand it into full C++ code!
Features
- 60+ Abbreviations: Covers everything from basic boilerplate to advanced graph algorithms.
- Fast Expansion: Just hit
Tab after typing an abbreviation.
- Cheatsheet included: Press
Ctrl+Alt+H or click the 🐼 Panda Code Snippet button in the status bar to view all available shortcuts.
Categories
- Boilerplate:
!cpp, !cpp+, !vector
- Functions:
!f(name.ret.nargs) e.g., !f(addsum.int.2)
- Conditionals:
!if1, !if2, !ifelse1, !ifelse2 (supports N conditions)
- Loops:
!for1(i0+), !for*2(i0+,j0+) (Nested for loops)
- Data Structures:
!v, !v2, !map, !pq, !stack, !set, !llist, !dsu, !fenwick, !sparse
- Algorithms:
!bs (Binary Search), !2ptr, !window, !sort
- DP:
!dp1d, !dp2d
- Graph:
!graph, !bfs, !dfs, !dijkstra, !bellman, !floyd, !kruskal, !prim, !topo
- Strings:
!kmp, !rabin, !zfunc, !manacher
- Math/Number Theory:
!sieve, !gcd, !modpow, !ncr
- Trees:
!tree, !bst, !trie, !segtree
- Competitive/IO:
!tc, !freopen, !debug, !all
How to Use
- Open any
.cpp or .c file.
- Type an abbreviation (e.g.,
!cpp or //cpp).
- Press Tab to expand.
- Use Tab to jump between the variable placeholders (tab stops) in the generated code!
Troubleshooting
- If
Tab doesn't expand the code, ensure your file language is set to C++ in the bottom right corner of VS Code.
- You can use either
! or // as the prefix (e.g., !cpp and //cpp both work).
| |