mirror of
https://github.com/pnx/dotfiles
synced 2026-06-17 11:30:02 +02:00
touched the nvim, alot.
This commit is contained in:
parent
4c1b128c96
commit
13e4207ef5
28 changed files with 288 additions and 145 deletions
13
nvim/lua/config/commands.lua
Normal file
13
nvim/lua/config/commands.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
|
||||
-- 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" }
|
||||
)
|
||||
|
||||
vim.cmd("ca cf CreateFile")
|
||||
Loading…
Add table
Add a link
Reference in a new issue