~havi/nvim.d

1a1e2b05142a192a786964fc4df833e83c22f868 — havi 5 months ago 7b6d461
feat(snippets/json): modeline snippets for lua file type
1 files changed, 31 insertions(+), 7 deletions(-)

M lua/snippets/json/lua.json
M lua/snippets/json/lua.json => lua/snippets/json/lua.json +31 -7
@@ 1,7 1,11 @@
{
  "describe": {
    "prefix": "describe",
    "body": ["describe('${1:Title}', function()", "\t${2}", "end)"]
    "body": [
      "describe('${1:Title}', function()",
      "\t${2}",
      "end)"
    ]
  },
  "doc": {
    "prefix": "doc",


@@ 13,23 17,33 @@
  },
  "apifun": {
    "prefix": "api.",
    "body": ["vim.api.nvim_${1:buf}_${2:get}_${3:name}"]
    "body": [
      "vim.api.nvim_${1:buf}_${2:get}_${3:name}"
    ]
  },
  "fn": {
    "prefix": "lfn",
    "body": ["local fn = vim.fn"]
    "body": [
      "local fn = vim.fn"
    ]
  },
  "api": {
    "prefix": "lapi",
    "body": ["local api = vim.api"]
    "body": [
      "local api = vim.api"
    ]
  },
  "fmt": {
    "prefix": "lfmt",
    "body": ["local fmt = string.format"]
    "body": [
      "local fmt = string.format"
    ]
  },
  "inspect": {
    "prefix": "vi",
    "body": ["print(\"${1}: \" .. vim.inspect(${1}))"]
    "body": [
      "print(\"${1}: \" .. vim.inspect(${1}))"
    ]
  },
  "for": {
    "body": "for ${1:i}=${2:1},${3:10} do\n\t${0:print(i)}\nend",


@@ 365,5 379,15 @@
    "prefix": "param",
    "body": "--- @param ${1:name} ${2:type}",
    "description": "Add annotation"
  },
  "modelines": {
    "prefix": "modelines",
    "body": [
      "-- vim: filetype=lua syntax=lua softtabstop=3 tabstop=3 shiftwidth=3 fileencoding=utf-8 smartindent autoindent expandtab",
      "-- code: language=lua insertSpaces=true tabSize=3",
      "",
      "$0"
    ],
    "description": "Add modelines for Vim and VScode"
  }
}
}
\ No newline at end of file