Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(module)!: rename module nvim-laurel to laurel #266

Merged
merged 8 commits into from
Apr 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ tmp-*
.test-deps/
*.spec

# For backward compatibility
fnl/nvim-laurel

### Generated by gibo (https://github.com/simonwhitaker/gibo)
### https://raw.github.com/github/gitignore/b0012e4930d0a8c350254a3caeedf7441ea286a3/Global/Vim.gitignore

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ help: ## Show this help
@egrep -h '^\S+: .*## \S+' $(MAKEFILE_LIST) | sed 's/: .*##/:/' | column -t -c 2 -s ':' | sed 's/^/ /'
@echo

fnl/nvim-laurel/: ## Create link for backward compatibility
@ln -dsvL "$(REPO_ROOT)/fnl/laurel" "$(REPO_ROOT)/fnl/nvim-laurel"

%_spec.lua: %_spec.fnl ## Compile fnl spec file into lua
@$(FENNEL) \
$(FNL_FLAGS) \
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ _inspired by the builtin Nvim Lua-Vimscript bridge on metatable and by good old
"aileot/nvim-laurel", {
-- v0.6.0 <= {version} < v0.7.0
version = "~v0.6.0",
-- (Optional) A workaround only for backward compatibility to
-- import laurel module from "nvim-laurel" instead.
-- See CHANGELOG.md to update to the exact module names all
-- over your config files.
build = "make fnl/nvim-laurel/",
},
... -- and other plugins
}, {
Expand All @@ -191,6 +196,11 @@ _inspired by the builtin Nvim Lua-Vimscript bridge on metatable and by good old
(lazy.setup [{1 :aileot/nvim-laurel
;; v0.6.0 <= {version} < v0.7.0
:version "~v0.6.0"
;; (Optional) A workaround only for backward compatibility to
;; import laurel module from "nvim-laurel" instead.
;; See CHANGELOG.md to update to the exact module names all
;; over your config files.
:build "make fnl/nvim-laurel/"
...] ;; and other plugins
{:defaults {:lazy true
;; Note: Not to remove nvim-laurel from &rtp, and not to encounter any
Expand Down Expand Up @@ -235,7 +245,7 @@ _inspired by the builtin Nvim Lua-Vimscript bridge on metatable and by good old
## Usage

```fennel
(import-macros {: set! : map! : augroup! : au! ...} :nvim-laurel.macros)
(import-macros {: set! : map! : augroup! : au! ...} :laurel.macros)
```

See [REFERENCE.md](./doc/REFERENCE.md) for each macro usage in details.
Expand Down
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ Note that quote position depends on where the wrapper macros are defined:

```fennel
;; in foobar.fnl
(import-macros {: map!} :nvim-laurel)
(import-macros {: map!} :laurel.macros)

(macro buf-map! [...]
`(map! &default-opts {:buffer 0} ,...))
Expand All @@ -202,7 +202,7 @@ Note that quote position depends on where the wrapper macros are defined:

```fennel
;; in my/macros.fnl
(local {: map!} (require :nvim-laurel))
(local {: map!} (require :laurel.macros))

(fn buf-map! [...]
(map! `&default-opts {:buffer 0} ...))
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/_wrapper_macros.fnl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
;; fennel-ls: macro-file
(local {: augroup! : autocmd! : set! : map! : command! : highlight!}
(require :nvim-laurel.macros))
(require :laurel.macros))

(fn my-autocmd! [...]
"Create an autocmd in predefined augroup, but the augroup MUST be defined
Expand Down
2 changes: 1 addition & 1 deletion test/autocmd_spec.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
: describe*
: it*} :test._busted_macros)

(import-macros {: augroup! : au! : autocmd!} :nvim-laurel.macros)
(import-macros {: augroup! : au! : autocmd!} :laurel.macros)
(import-macros {: my-autocmd!
: augroup+
: bufnr-suffixed-augroup!
Expand Down
2 changes: 1 addition & 1 deletion test/command_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(import-macros {: before-each : describe* : it*} :test._busted_macros)
(import-macros {: command!} :nvim-laurel.macros)
(import-macros {: command!} :laurel.macros)
(import-macros {: buf-command!/as-api-alias} :test._wrapper_macros)

(macro macro-callback []
Expand Down
2 changes: 1 addition & 1 deletion test/highlight_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(import-macros {: before-each : describe* : it*} :test._busted_macros)
(import-macros {: highlight!} :nvim-laurel.macros)
(import-macros {: highlight!} :laurel.macros)
(import-macros {: bold-highlight!} :test._wrapper_macros)

(macro get-hl-of-rgb-color [name]
Expand Down
2 changes: 1 addition & 1 deletion test/keymap_spec.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
: buf-map!/with-<buffer>=true}
:test._wrapper_macros)

(import-macros {: map! : unmap! : <C-u> : <Cmd>} :nvim-laurel.macros)
(import-macros {: map! : unmap! : <C-u> : <Cmd>} :laurel.macros)

(macro macro-callback []
`#:macro-callback)
Expand Down
2 changes: 1 addition & 1 deletion test/option_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(import-macros {: before-each : describe* : it*} :test._busted_macros)
(import-macros {: set+ : set- : set^} :test._wrapper_macros)
(import-macros {: let! : set! : setglobal! : setlocal! : bo! : wo!}
:nvim-laurel.macros)
:laurel.macros)

(macro get-o [name]
`(-> (. vim.opt ,name) (: :get)))
Expand Down
2 changes: 1 addition & 1 deletion test/variable_spec.fnl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(import-macros {: before-each : describe* : it*} :test._busted_macros)
(import-macros {: b! : env!} :nvim-laurel.macros)
(import-macros {: b! : env!} :laurel.macros)

(describe* :b!
(before-each (fn []
Expand Down