aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2021-02-06 12:41:20 +0100
committerFlorian Fischer <florian.fl.fischer@fau.de>2021-02-06 12:43:24 +0100
commit350cb8780444d271fd3dfc938fe1ffe9fe870c51 (patch)
treef2cc0d42167297d9d83ac275f889263078b1d95b
parent8ceea17969a2a2aaa611a5f5c87a197dabfb005f (diff)
downloadvis-spellcheck-350cb8780444d271fd3dfc938fe1ffe9fe870c51.tar.gz
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.
-rw-r--r--Readme.md4
-rw-r--r--init.lua6
2 files changed, 8 insertions, 2 deletions
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