mirror of
https://github.com/zoriya/auto-save.nvim.git
synced 2025-12-06 06:36:11 +00:00
16 lines
384 B
Lua
16 lines
384 B
Lua
local api = vim.api
|
|
|
|
-- original source: https://vim.fandom.com/wiki/Run_a_command_in_multiple_buffers
|
|
-- like bufdo but restore the current buffer.
|
|
api.nvim_exec(
|
|
[[
|
|
function! g:AutoSaveBufDo(command)
|
|
let currBuff=bufnr("%")
|
|
execute 'bufdo ' . a:command
|
|
execute 'buffer ' . currBuff
|
|
endfunction
|
|
com! -nargs=+ -complete=command Bufdo call BufDo(<q-args>)
|
|
]],
|
|
false
|
|
)
|