udayvir-singh / hibiscus.nvim Goto Github PK
View Code? Open in Web Editor NEW:hibiscus: Flavored Fennel Macros for Neovim
License: MIT License
:hibiscus: Flavored Fennel Macros for Neovim
License: MIT License
module = string or list -- Specifies Lua module names for require. When requiring a string which starts
-- with one of these module names, the plugin will be loaded.
Make the following possible
(set! wrap!)
(set! invwrap)
While :set
and thus set!
behave the same as :setl
for buffer-local options in appropriate context, :setlocal
is required if wanting to locally set global-local options. (setlocal! <opt> <val>)
(or setl!
) would be much more elegant than (tset vim.bo :<opt> <val>)
.
First of all, sorry if this is just some kind of missuderstanding on my end. I'm just learning how to use fennel.
I was trying the command!
macro and the following code:
(import-macros {: command!} :hibiscus.vim)
(command! [:buffer true] :Example #(print "hey"))
compiles to the lua code:
local function _1_()
return print "hey"
end
return vim.api.nvim_create_user_command("Example", _1_, { buffer = true, force = true })
The problem comes from the fact that nvim_create_user_command
doesn't accept a buffer
option (if you try to run this lua code, it will throw an error). Instead, the function nvim_buf_create_user_command
should be used.
Hello!
It would seems that set!
doesn't work for when a vim.opt
can take a table, be it just with single values or key-value pairs.
An easy example:
(set! backspace [ "eol" "start" "indent" ])
Will give an error:
Error detected while processing /Users/alec-s/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ...cache/nvim/hotpot/home/alec/.config/nvim/fnl/opts.lua:6: invalid value for option
stack traceback:
[C]: in function '__newindex'
...cache/nvim/hotpot/Users/alec-s/.config/nvim/fnl/opts.lua:6: in main chunk
[C]: in function 'require'
/Users/alec-s/.config/nvim/init.lua:37: in main chunk
Press ENTER or type command to continue
But with just using tset
:
(tset vim.opt "backspace" [ "eol" "start" "indent" ])
Works fine.
Hello!
I thought I'd make a possible suggestion for set!
and friends. In Emacs, setq
takes, as its signature describes:
(setq [SYM VAL]...)
and as the beginning of its docstring says:
Set each SYM to the value of its VAL.
So you can have
(setq abbrev-mode t
abbrev-file-name (concat my-local-dir "abbrev.el")
save-abbrevs 'silent
auto-insert-mode t
auto-insert-query nil)
Granted I don't really know if it's best that set!
is able to evaluate forms, but I think taking multiple "symbols" and values would be convenient.
nvim_create_autocmd()
supports a desc
field to be displayed when looking up aucmds, see sample below. It would be nice if this could be used with the augroup!
macro.
vim.api.nvim_create_augroup("d12bb", { clear = true })
vim.api.nvim_create_autocmd({ "BufEnter", "TermOpen" }, {
group = "d12bb",
pattern = "term://*",
desc = "Insert only for terminals",
command = "startinsert",
})
Thank you for the lovely library! Is there a chance we could get (setlocal+ ...)
and (setlocal^ ...)
macros, analogue to the non-local (set+ ...)
and (set^ ...)
? I've partially implemented these here, undocumented — I wasn't sure how to use the docgen script :p.
VimScript example:
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
hi all.
I have installed this plugin of latest version, and try to set!
lcs
, but I do not know how to use it correctly.
here is my code:
(import-macros {: set!} :hibiscus.vim)
(set! list true)
;; (set! listchars :eol "↵") ;; yes, it works
(set! listchars "tab:→") ;; but this line failed
(set! listchars "tab:→")
always failed, I also tried (tset vim.opt "listchars" {:eol "↵" :tab "→"})
, and didn't work either.
So how do I set listchars
correctly?
thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.