emacs-refactor
emacs-refactor copied to clipboard
Include guard refactors
- Add an include guard
- Remove an include guard
- Add #pragma once
- Remove #pragma once
- Toggle between include guards/#pragma once
- All of the above exposed in the menu, context sensitive (i.e. no "remove include guards" if there are none)
- Skips comments at the start and end of the buffer (i.e. copyright boilerplates, "LocalWords: ")
- A lot of customization options (custom include guard symbol generators, text
after
#endif
, spaces after#
, ...) - Handles lots of tricky edge cases:
#ifndef Q
#define Q
in\
t main() {}
#endif /* Q */```
->
```c++
#ifndef Q
#define Q
in\
t main() {}
#endif /* Q */
Fixes #62.