forked from vimichael/floatingtodo.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.lua
More file actions
45 lines (34 loc) · 869 Bytes
/
Copy pathinit.lua
File metadata and controls
45 lines (34 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
local picker = require("quickbuffer.picker")
local buffer = require("quickbuffer.buffer")
local M = {}
local default_opts = {
target_file = "~/notes/todo.md",
border = "single",
width = 0.8,
height = 0.8,
bufferposition = "center",
pickerposition = "center-right",
project_folders = {},
keybinds = {
closepicker = "",
closebuffer = "",
gotopicker = "",
gotobuffer = "",
}
}
-- setup
local function setup_user_commands(opts)
opts = vim.tbl_deep_extend("force", default_opts, opts)
vim.api.nvim_create_user_command("Qb", function()
buffer.open_floating_file(opts)
end, {})
vim.api.nvim_create_user_command("Qp", function()
picker.open(opts, function(path)
buffer.switchBufFile(path, opts)
end)
end, {})
end
M.setup = function(opts)
setup_user_commands(opts)
end
return M