diff options
| author | 2025-05-02 16:05:47 +0300 | |
|---|---|---|
| committer | 2025-05-02 16:05:47 +0300 | |
| commit | 446d2716e7bb83e58fb516ec27e5c7750069e98c (patch) | |
| tree | 3e2bdee9d79cf8495fde84a559d2b05bf7ca45b8 /nvim/snippets/go.json | |
| parent | Сделал кейбинды (diff) | |
| download | dotfiles-446d2716e7bb83e58fb516ec27e5c7750069e98c.tar.gz dotfiles-446d2716e7bb83e58fb516ec27e5c7750069e98c.tar.bz2 dotfiles-446d2716e7bb83e58fb516ec27e5c7750069e98c.tar.xz dotfiles-446d2716e7bb83e58fb516ec27e5c7750069e98c.zip | |
Перешел на lazy nvim, навел порядок в плагинах
Diffstat (limited to 'nvim/snippets/go.json')
| -rw-r--r-- | nvim/snippets/go.json | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/nvim/snippets/go.json b/nvim/snippets/go.json new file mode 100644 index 0000000..73b79b6 --- /dev/null +++ b/nvim/snippets/go.json @@ -0,0 +1,23 @@ +{ + "package line": { + "body": ["package ${TM_DIRECTORY/.+\\/(.+)$/${1:/downcase}/}", "", "$0"], + "description": "package header", + "prefix": "pkg" + }, + "structure constructor": { + "body": [ + "// New$1 returns new $1.", + "func New${1:type}(${2}) *$1 {", + "\t$3", + "\treturn &$1{$4}", + "}" + ], + "description": "constructor for structure type", + "prefix": "construct" + }, + "if err := ...; err != nil": { + "prefix": "iferr", + "body": "if err := ${1}; err != nil {\n\t${2:return ${3:nil, }${4:err}}\n}", + "description": "Snippet for if err := ...; err != nil" + } +} |
