This plugin adds Bun
subcommand and shows node_modules.bun
and bun.lockb
files
If test passed, it is highlighted with green, if it failed then with red
Examples:
using packer
use('nvim-treesitter/nvim-treesitter') -- this is a must for tests!
use('akinsho/toggleterm.nvim') -- this is a must!
use('Fire-The-Fox/bun.nvim')
using vim-plug
Plug 'nvim-treesitter/nvim-treesitter' " this is a must for tests!
Plug 'akinsho/toggleterm.nvim' " this is a must!
Plug 'Fire-The-Fox/bun.nvim'
require("bun").setup({
close_on_exit = true | false, -- if the terminal window should close instantly after bun exited
cwd = "current" | "relative", -- run_current's working directory
-- if "current" it will use current working directory of NeoVim
-- if "relative" it will use directory where the file is located
direction = "horizontal" | "float" -- float will create floating window and horizontal will put it under buffers
})
require("bun.tests").setup({
-- configure the test window
width = 0.9, -- range 0.0 <-> 1.0, if you want you can use % / 100 to get the value
height = 0.8, -- range 0.0 <-> 1.0, same as on top but
border = "none" | "single" | "double" | "rounded" | "solid" | "shadow" -- style of the border
})
local bun = require("bun")
-- setup it your way
bun.setup({})
-- in my case <leader> is spacebar, so i hit "spacebar + b + r" and it will run current file
vim.keymap.set("n", "<leader>br", bun.run_current)
local bun_test = require("bun.tests")
-- setup it your way
bun_test.setup({})
-- same as before
vim.keymap.set("n", "<leader>bt", bun_test.handler)