snailed
/
taolf
Archived
2
0
Fork 0

rename module

This commit is contained in:
Luca Bilke 2024-01-29 00:45:42 +01:00
parent ac6c8bf9bb
commit 42a5903d57
No known key found for this signature in database
GPG Key ID: AD6630D0A1E650AC
5 changed files with 15 additions and 12 deletions

View File

@ -14,7 +14,7 @@ process with lazy.nvim a tiny bit.
Setup:
```lua
require("lf").setup({
require("taolf").setup({
default_cmd = "lf", -- The Command to start lf with
dir = "", -- The dir to start lf in. "gwd" expands to the git working directory
}
@ -32,16 +32,19 @@ lazy.nvim setup:
"ssnailed/taolf",
event = "VeryLazy",
opts = {
default_cmd = "lf", -- The Command to start lf with
-- The Command to start lf with
default_cmd = "lf",
-- "gwd" expands to the git working directory, and "cwd" to the directory of the open file
-- The path to start lf in.
-- "gwd" expands to the git working directory
-- "cwd" expands to the directory of the open file
dir = "", -- The path to start lf in.
},
dependencies = { "akinsho/toggleterm.nvim" },
keys = {
{ "<Leader>el", require("lf").start, desc = "Open Lf" },
{ "<Leader>ec", function() require("lf").start({ dir = "cwd" }) end, desc = "Open Lf in directory of open file" },
{ "<Leader>eg", function() require("lf").start({ dir = "gwd" }) end, desc = "Open Lf in git working directory" },
{ "<Leader>el", require("taolf").start, desc = "Open Lf" },
{ "<Leader>ec", function() require("taolf").start({ dir = "cwd" }) end, desc = "Open Lf in directory of open file" },
{ "<Leader>eg", function() require("taolf").start({ dir = "gwd" }) end, desc = "Open Lf in git working directory" },
}
}
```

View File

@ -1,6 +1,6 @@
local M = {}
local Config = require("lf.config")
local Config = require("taolf.config")
local api = vim.api
@ -31,7 +31,7 @@ function M.setup(cfg)
M.__conf = cfg
Config.init()
api.nvim_create_user_command("Lf", function(tbl)
require("lf").start(tbl.args)
require("taolf").start(tbl.args)
end, { nargs = "*", complete = "file" })
if Config.replace_netrw then
@ -70,7 +70,7 @@ function M.setup(cfg)
callback = function(a)
if become_dir_fman(a.buf) then
vim.defer_fn(function()
require("lf").start(a.file)
require("taolf").start(a.file)
end, 1)
end
end,
@ -83,7 +83,7 @@ end
---@param cfg? Lf.Config alternative configuration options
---@overload fun() Empty
function M.start(cfg)
local Lf = require("lf.main")
local Lf = require("taolf.main")
-- Only one argument was given
-- `path` is given as a table, which is treated as `cfg`

View File

@ -51,7 +51,7 @@ function Config.init()
return
end
local lf = require("lf")
local lf = require("taolf")
-- Keep options from the `lf.setup()` call
Config.data = vim.tbl_deep_extend("keep", lf.__conf or {}, default) --[[@as Lf.Config]]
validate(Config.data)

View File

@ -10,7 +10,7 @@ if not ok then
return
end
local Config = require("lf.config")
local Config = require("taolf.config")
local Terminal = require("toggleterm.terminal").Terminal