Skip to content

Instantly share code, notes, and snippets.

View yursan9's full-sized avatar

Yurizal Susanto yursan9

  • BIT
  • Tangerang, Indonesia
  • 20:41 (UTC +07:00)
View GitHub Profile
@numToStr
numToStr / au.lua
Last active August 20, 2023 05:15
Neovim autocmd in lua
--
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua
--
local cmd = vim.api.nvim_command
local function autocmd(this, event, spec)
local is_table = type(spec) == 'table'
local pattern = is_table and spec[1] or '*'
local action = is_table and spec[2] or spec
if type(action) == 'function' then