mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-24 17:58:46 +02:00
add: auto cmd for create folder and file
This commit is contained in:
parent
73fb95878b
commit
f99a244c36
3 changed files with 29 additions and 2 deletions
|
@ -16,3 +16,18 @@ local term_program = vim.fn.getenv("TERM_PROGRAM")
|
|||
if term_program == "WezTerm" then
|
||||
vim.cmd('silent !wezterm cli set-tab-title "' .. _get_folder_name() .. '"')
|
||||
end
|
||||
|
||||
-- vim.cmd([[
|
||||
-- function s:MkNonExDir(file, buf)
|
||||
-- if empty(getbufvar(a:buf, '&buftype')) && a:file!~#'\v^\w+\:\/'
|
||||
-- let dir=fnamemodify(a:file, ':h')
|
||||
-- if !isdirectory(dir)
|
||||
-- call mkdir(dir, 'p')
|
||||
-- endif
|
||||
-- endif
|
||||
-- endfunction
|
||||
-- augroup BWCCreateDir
|
||||
-- autocmd!
|
||||
-- autocmd BufWritePre * :call s:MkNonExDir(expand('<afile>'), +expand('<abuf>'))
|
||||
-- augroup END
|
||||
-- ]])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue