1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-17 11:30:02 +02:00

touching the nvim.

This commit is contained in:
Henrik Hautakoski 2024-04-13 14:40:38 +02:00
parent 15e6408670
commit 71717129e1
40 changed files with 1045 additions and 921 deletions

View file

@ -1,13 +1,11 @@
-- Nice command that creates all directores in the path
-- then creates the file and opens it.
vim.api.nvim_create_user_command('CreateFile',
function(opts)
local dir = vim.fs.dirname(opts.fargs[1])
vim.cmd(string.format("!mkdir -p %s\n !touch %s", dir, opts.fargs[1]))
vim.cmd.e(opts.fargs)
end,
{ nargs = 1, complete = "file" }
)
local createfile = function(opts)
local dir = vim.fs.dirname(opts.fargs[1])
vim.cmd(string.format("!mkdir -p %s\n !touch %s", dir, opts.fargs[1]))
vim.cmd.e(opts.fargs)
end
vim.api.nvim_create_user_command('CreateFile', createfile, { nargs = 1, complete = "file" })
vim.cmd("ca cf CreateFile")