From 350cb8780444d271fd3dfc938fe1ffe9fe870c51 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 6 Feb 2021 12:41:20 +0100 Subject: add init.lua and update usage information in Readme The init.lua file is only a thin wrapper around a dofile call which loads the actual plugin code in spellcheck.lua and returns the result. Closes #5. --- Readme.md | 4 ++-- init.lua | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 init.lua diff --git a/Readme.md b/Readme.md index 31a06fd..1600637 100644 --- a/Readme.md +++ b/Readme.md @@ -4,8 +4,8 @@ A spellchecking lua plugin for the [vis editor](https://github.com/martanne/vis) ## Installation -1. Download `spellcheck.lua` or clone this repository -2. Load the plugin in your `visrc.lua` with `require(path/to/plugin/spellcheck)` +1. Download `spellcheck.lua` or clone this repository into your plugin directory +2. Load the plugin in your `visrc.lua` with `require(plugins/vis-spellcheck)` ## Usage diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..40253f2 --- /dev/null +++ b/init.lua @@ -0,0 +1,6 @@ +-- Copyright (c) 2021 Florian Fischer. All rights reserved. +-- Use of this source code is governed by a MIT license found in the LICENSE file. +local source_str = debug.getinfo(1, "S").source:sub(2) +local script_path = source_str:match("(.*/)") + +return dofile(script_path .. 'spellcheck.lua') \ No newline at end of file -- cgit v1.2.3