A special plugin for lazy people by using the fewest keystrokes in the normal syntax of C/C++/Java/JS/PHP.
LazyKey redefines the following keys:
spacecommasimicolondotleft square bracketright square bracketminusequalninezeroless
- Add
()afterif/for/while/foreach/switchby pressing space key for example, convertif|toif (|). (|is the current cursor)
- Add space character if this comma is inside the parentheses
- Convert
,,to<<with appropriate spaces
- Automatically add
;to the line end, unless the line ends with a comment - Insert next line after an exists
; - Insert next line if the current line already contains a
; - Ignore
for ( ; ; )
- Convert
.to->of C++/PHPclassandpointobjects - Convert between
.and->in any case
- Convert
[to{ }and automatically jump to the next line if the current line is missing a code block - Jump into the code block after
if/for/while/foreach/switchif already exists{ } - Add next line into a code block according to the above two behaviors if posible
- Convert
[to{ }and automatically break lines in a blank line (if wrong, undo twice) - Support both Lambda brackets,
[]and{}
- Jump out of
]or}after the cursor - Jump out of
}in following line, and add one line if necessary - Add another one line after
}
- Convert
-to_where the variable is declared - Convert
-to_if exists such variable - Automatically add spaces, such as
a-toa - - It doesn't affect variable decrement, like
a--
- Automatically add spaces, such as
a=toa =,a+=toa += - It doesn't affect multiple equal
- Convert
1=to!=with appropriate spaces
- Convert
9to(in the appropriate place
- Convert
0to)in the appropriate place- if need 0, such as
while (|), can insert space before
- if need 0, such as
- Automatically add spaces at left and right
You can decide the switch for each function.
This extension contributes the following settings:
- It may not work properly under certain circumstances, such as mixed indentation of tab and space.
- If there is a misjudgment, you can undo it (ctrl+z). Some may need to undo it twice
LazyKey may not work correctly in some cases, such as mixing tab and space.
And it may change your button habits and make you lazy.
- set
SemicolonNewLinetofalseby default
- support extension
Github Copilot
- support extension
tabnine - convert
-to_after(/[/{/-> - cancel
;auto add new line in same case
- support Verilog and SystemVerilog
- add
;after C++ class/struct/enum - discard to modify
=on"xxx"
add convert Chinese symbols to English symbols, such as ()【】《》,。、;‘’“”
Enjoy!

