b4 major changes
This commit is contained in:
parent
6ee690987a
commit
c0ea7b465b
4 changed files with 136 additions and 57 deletions
|
@ -29,6 +29,31 @@ vim.api.nvim_create_user_command("OP", function ()
|
|||
}):find()
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("OCC", function ()
|
||||
local folders = vim.fn.systemlist("\\ls -d $HOME/projects/cc/*/")
|
||||
for i, folder in ipairs(folders) do
|
||||
folders[i] = string.match(string.match(folder, "[^/]*/$"), "^[^/]*")
|
||||
end
|
||||
pickers.new({}, {
|
||||
prompt_title = "Open project",
|
||||
finder = finders.new_table {
|
||||
results = folders
|
||||
},
|
||||
sorter = conf.generic_sorter({}),
|
||||
attach_mappings = function (prompt_bufnr, map)
|
||||
actions.select_default:replace(function ()
|
||||
actions.close(prompt_bufnr)
|
||||
local selection = action_state.get_selected_entry()
|
||||
selection = selection[1]
|
||||
vim.cmd("cd $HOME/projects/cc/" .. selection)
|
||||
vim.cmd("Alpha")
|
||||
vim.cmd("BWipeout other")
|
||||
end)
|
||||
return true
|
||||
end
|
||||
}):find()
|
||||
end, {})
|
||||
|
||||
vim.api.nvim_create_user_command("OD", function ()
|
||||
local folders = vim.fn.systemlist("\\ls -d */")
|
||||
for i, folder in ipairs(folders) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue