Last active
January 22, 2019 09:52
-
-
Save ktnyt/8eeb3f2d07347628695c7f6d291a9dab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define-command -hidden -override c-family-insert-include-guards %{ | |
evaluate-commands %sh{ | |
case "${kak_opt_c_include_guard_style}" in | |
ifdef) | |
echo 'execute-keys ggi__<c-r>%__<ret><esc>gg/include/<ret>dggxs(/|\.)<ret>c_<esc><space>x~ggxyppI#ifndef<space><esc>jI#define<space><esc>jI#endif<space><space>//<space><esc>O<ret><ret><esc>' | |
;; | |
pragma) | |
echo 'execute-keys ggi#pragma<space>once<esc>' | |
;; | |
*);; | |
esac | |
} | |
} | |
define-command -params 1 -shell-script-candidates %{ find . -type f | grep -E '\.(h|hpp)$' | fzy -e "$1" } c-family-include %{ | |
evaluate-commands %sh{ | |
echo "execute-keys i#include<space>\"$1\"<ret><esc>" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment