All Projects β†’ rktjmp β†’ hotpot.nvim

rktjmp / hotpot.nvim

Licence: MIT license
🍲 Carl Weathers #1 Neovim Plugin.

Programming Languages

Fennel
19 projects
shell
77523 projects

Projects that are alternatives of or similar to hotpot.nvim

paperplanes.nvim
Neovim ✈️ Pastebins
Stars: ✭ 50 (-72.68%)
Mutual labels:  neovim-plugin, fennel
nvim-tetris
Bringing emacs' greatest feature to neovim - Tetris!
Stars: ✭ 114 (-37.7%)
Mutual labels:  neovim-plugin, fennel
doctor.nvim
Emacs greatest feature, now also in neovim!
Stars: ✭ 27 (-85.25%)
Mutual labels:  neovim-plugin, fennel
vim-counterpoint
Cycle between file counterparts in vim or neovim.
Stars: ✭ 12 (-93.44%)
Mutual labels:  neovim-plugin
vim-tips-wiki
1500+ tips downloaded from Vim Tips Wiki, parsed and formatted to look and work like native Vim help files
Stars: ✭ 56 (-69.4%)
Mutual labels:  neovim-plugin
deoplete-solargraph
deoplete.nvim source for Ruby with solargraph.
Stars: ✭ 73 (-60.11%)
Mutual labels:  neovim-plugin
critiq.vim
Github code reviews from Neovim
Stars: ✭ 69 (-62.3%)
Mutual labels:  neovim-plugin
which-key.nvim
πŸ’₯ Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.
Stars: ✭ 2,043 (+1016.39%)
Mutual labels:  neovim-plugin
feline.nvim
A minimal, stylish and customizable statusline for Neovim written in Lua
Stars: ✭ 867 (+373.77%)
Mutual labels:  neovim-plugin
nvim-gomove
A complete plugin for moving and duplicating blocks and lines, with complete fold handling, reindenting, and undoing in one go.
Stars: ✭ 142 (-22.4%)
Mutual labels:  neovim-plugin
navigator.lua
Source code analysis & navigation plugin for Neovim. Navigate codes like a breeze🎐. Exploring LSP and 🌲Treesitter symbols a piece of 🍰. Take control like a boss 🦍.
Stars: ✭ 781 (+326.78%)
Mutual labels:  neovim-plugin
diffview.nvim
Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
Stars: ✭ 1,472 (+704.37%)
Mutual labels:  neovim-plugin
nvim-scrollbar
Extensible Neovim Scrollbar
Stars: ✭ 355 (+93.99%)
Mutual labels:  neovim-plugin
denops-docker.vim
Manage Docker in Vim/Neovim
Stars: ✭ 48 (-73.77%)
Mutual labels:  neovim-plugin
winshift.nvim
Rearrange your windows with ease.
Stars: ✭ 230 (+25.68%)
Mutual labels:  neovim-plugin
dial.nvim
enhanced increment/decrement plugin for Neovim.
Stars: ✭ 364 (+98.91%)
Mutual labels:  neovim-plugin
onestatus
an api to customize tmux from vim
Stars: ✭ 82 (-55.19%)
Mutual labels:  neovim-plugin
denops-gh.vim
Vim/Neovim plugin for GitHub
Stars: ✭ 27 (-85.25%)
Mutual labels:  neovim-plugin
dots
The dotfiles for my linux system β€’β€’β€’
Stars: ✭ 42 (-77.05%)
Mutual labels:  fennel
AbbrevMan.nvim
🍍 A NeoVim plugin for managing vim abbreviations.
Stars: ✭ 82 (-55.19%)
Mutual labels:  neovim-plugin
Hotpot Logo

🍲 Hotpot

You take this home, throw it in a pot, add some broth, some neovim... baby, you got a stew going!

~ Fennel Programmers (probably)

Hotpot is a Fennel compiler plugin for Neovim. Just (require :my-fennel) and Hotpot does the cooking for you 🍻. Seamlessly mix and match Fennel and Lua as little or as much as you want. Your Fennel code is only compiled when it (or a dependency such as a macro) are changed and everything is stored in a bytecode cache for super fast startup time. It can do ahead of time compilation too πŸ’Ύ.

;; ~/.config/nvim/fnl/is_neat.fnl
;; put your fennel code in fnl/
(fn [what] (print what "is neat!"))
-- and require it like normal in your lua file
local neat = require('is_neat') -- compiled & cached on demand
neat("fennel") -- => "fennel is neat!"

New in 0.3.0

Inline diagnostics, REPL like tooling, breaking changes. See the changelog.

TOC

Requirements

  • Neovim 0.7.2+
  • Fanatical devotion to parentheses.

Install

Hotpot can be installed via any package manager but you may prefer to manually install it and let your package manager update it. This allows you to configure your package manager with Fennel.

You must call require("hotpot") before you attempt to require any Fennel files. If you do not do this manually, Neovim will call it for you but the order and time that this occurs can be non-deterministic.

If you only want to experiment with Fennel, adding rktjmp/hotpot.nvim to your plugin manager is probably good enough.

Automatic Install & Update (Recommended)
-- ~/.config/nvim/init.lua

-- This init.lua file will clone hotpot into your plugins directory if
-- it is missing. Do not forget to also add hotpot to your plugin manager
-- or it may uninstall hotpot!

-- Consult your plugin-manager documentation for where it installs plugins.
-- packer.nvim
-- local hotpot_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/hotpot.nvim'
-- paq.nvim
local hotpot_path = vim.fn.stdpath('data') .. '/site/pack/paqs/start/hotpot.nvim'

if vim.fn.empty(vim.fn.glob(hotpot_path)) > 0 then
  print("Could not find hotpot.nvim, cloning new copy to", hotpot_path)
  vim.fn.system({'git', 'clone',
                 'https://github.com/rktjmp/hotpot.nvim', hotpot_path})
  vim.cmd("helptags " .. hotpot_path .. "/doc")
end

-- Enable fnl/ support
require("hotpot")

-- Now you can load fennel code, so you could put the rest of your
-- config in a separate `~/.config/nvim/fnl/my_config.fnl` or
-- `~/.config/nvim/fnl/plugins.fnl`, etc.
require("my_config")
Plugin Managers
-- example using paq.nvim
require "paq" {
  "rktjmp/hotpot.nvim"
}
Want to use an unreleased version of Fennel?

The nightly branch merges Fennel HEAD into Hotpot each day.

The main purpose of this is to run the test suite against upcoming releases. If the test suite fails, the changes will not be merged, so it should be reasonably stable to use day-to-day.

Because the nightly branch's primary purpose is to run tests, there is no guarantee that it wont be recreated, renamed or force-pushed onto at some point in the future, which would require you do manually force pull or create a fresh clone.

For a preview of upcoming Fennel features, you can view the changelog.

Windows

Windows installations may require additional setup depending on your account privileges.

Setup

Hotpot accepts the following configuration options, with defaults as shown.

You do not have to call setup unless you are altering a default option.

See h: hotpot-setup for more details.

require("hotpot").setup({
  -- allows you to call `(require :fennel)`.
  -- recommended you enable this unless you have another fennel in your path.
  -- you can always call `(require :hotpot.fennel)`.
  provide_require_fennel = false,
  -- show fennel compiler results in when editing fennel files
  enable_hotpot_diagnostics = true,
  -- compiler options are passed directly to the fennel compiler, see
  -- fennels own documentation for details.
  compiler = {
    -- options passed to fennel.compile for modules, defaults to {}
    modules = {
      -- not default but recommended, align lua lines with fnl source
      -- for more debuggable errors, but less readable lua.
      -- correlate = true
    },
    -- options passed to fennel.compile for macros, defaults as shown
    macros = {
      env = "_COMPILER" -- MUST be set along with any other options
    }
  }
})

Cookbook

See the Hotpot Cookbook for guides and examples about Hotpot Reflect, using the API, ahead of time compilation, commands, etc.

API

Hotpot provides a number of functions for evaluating and compiling Fennel code, including helpers to easily operate on strings, selections and buffers for example.

For complete details, see :h hotpot-api and Using the API.

How does Hotpot work?

Hotpot has three main systems, the lua cache, the bytecode cache and the module loader.

The lua cache contains our compiled fennel code. When requiring a fennel module, we must first compile that fennel code into lua, then save the result to disk. This allows the user to easily view the result of the compilation for debugging. See :h hotpot-cache.

The bytecode cache is a special file (normally called the index), loaded into memory when Neovim starts. It contains the machine readable code for every module that Neovim has previously loaded. By caching modules in-memory and in a machine readable format, we can find and resolve modules very quickly as most of the "heavy lifting" is already done. By maintaining a bytecode cache we can achieve up to 15x performance increases.

The bytecode cache contains information about when the cache was created for each module, so any modifications made to the original source files or dependencies can be detected and reloaded into the cache.

The module loader will find and load lua (or fennel) modules. First it will search the index and then Neovims runtime path for source files that match the requested module name. If a source file is found, it is compiled to lua (if needed), then the bytecode is saved to the index, then the module is returned to the user.

As an example, given require("my.module") Hotpot will check the following locations, in order, and return the first match.

  • index
  • $RUNTIMEPATH/lua/my/module.lua
  • $RUNTIMEPATH/lua/my/module/init.lua
  • $RUNTIMEPATH/fnl/my/module.fnl
  • $RUNTIMEPATH/fnl/my/module/init.fnl
  • <package.path>/my/module.lua
  • <package.path>/my/module.fnl

You can see that it will preference a bytecode cache, then .lua files over .fnl, if they exist.

Windows

Hotpot must be able to create symlinks for some core functionality which Windows may disallow by default, depending on your account type and Windows version.

To enable symlink creation without elevated privileges, you may have to enable "Developer Mode" in your account settings.

See "Enable your device for development" and "Symlinks in Windows 10".

License

Hotpot embeds fennel.lua, see lua/hotpot/fennel.lua for licensing information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].