From fa184b3c4bba70f6ff374b09592fe7e9f7dec4bb Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 19 Jun 2022 20:59:28 +0800 Subject: [PATCH] feat(windisk): add windisk.lua --- lua/spacevim/plugin/windisk.lua | 43 +++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 lua/spacevim/plugin/windisk.lua diff --git a/lua/spacevim/plugin/windisk.lua b/lua/spacevim/plugin/windisk.lua new file mode 100644 index 000000000..1e6dc6fd8 --- /dev/null +++ b/lua/spacevim/plugin/windisk.lua @@ -0,0 +1,43 @@ +--============================================================================= +-- windisk.lua --- windisk plugin in lua +-- Copyright (c) 2016-2019 Wang Shidong & Contributors +-- Author: Wang Shidong < wsdjeg@outlook.com > +-- URL: https://spacevim.org +-- License: GPLv3 +--============================================================================= + + +local M = {} + + +local function get_disks() + +end + +function M.open() + local disks = get_disks() + if vim.fn.empty(disks) == 0 then + vim.cmd('noautocmd vsplit __windisk__') + vim.cmd('vertical resize 20') + local disk_buffer_nr = vim.fn.bufnr('%') + vim.cmd('set ft=SpaceVimWinDiskManager') + vim.cmd('setlocal buftype=nofile bufhidden=wipe nobuflisted nolist noswapfile nowrap cursorline nospell nonu norelativenumber winfixwidth') + vim.cmd('setlocal modifiable') + vim.fn.setline(1, lines) + vim.cmd('setlocal nomodifiable') + vim.cmd("nnoremap :lua require('spacevim.plugin.windisk').open_disk(vim.fn.getline('.'))") + end +end + +local function diskinfo() + if vim.fn.executable('wmic') == 0 then + return {} + end + local rst = vim.fn.systemlist('wmic LOGICALDISK LIST BRIEF') + local disk = {} + for _,line in pairs(rst) do + end +end + + +return M