Adds CopyToPlayers command
This commit is contained in:
parent
132f9d0636
commit
6f74d3b3db
8 changed files with 66 additions and 18 deletions
19
.config/nvim/lua/functions/fs.lua
Normal file
19
.config/nvim/lua/functions/fs.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
local fs = {}
|
||||
|
||||
local function startswith(string, start)
|
||||
return string:sub(1, #start) == start
|
||||
end
|
||||
|
||||
function fs.getCurrentPath()
|
||||
local currentBuffer = vim.fn.expand("%")
|
||||
|
||||
if not startswith(currentBuffer, "neo-tree") then
|
||||
return currentBuffer
|
||||
end
|
||||
|
||||
local filesystemState = require("neo-tree.sources.manager").get_state("filesystem")
|
||||
local currentLine = vim.fn.getpos(".")[2]
|
||||
return filesystemState.tree:get_node(currentLine).path
|
||||
end
|
||||
|
||||
return fs
|
||||
Loading…
Add table
Add a link
Reference in a new issue