remove linebreaks user fun
This commit is contained in:
parent
d2309ca00a
commit
b019fc12d2
1 changed files with 17 additions and 8 deletions
|
|
@ -22,7 +22,7 @@ vim.opt.wrap = false
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = 'Makefile',
|
pattern = 'Makefile',
|
||||||
callback = function ()
|
callback = function()
|
||||||
vim.opt_local.expandtab = false
|
vim.opt_local.expandtab = false
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
@ -42,3 +42,12 @@ vim.api.nvim_create_autocmd('BufReadPost', {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command('RemoveLinebreaks',
|
||||||
|
function(opts)
|
||||||
|
local startline = opts.line1
|
||||||
|
local endline = opts.line2
|
||||||
|
local rangespec = startline .. "," .. endline
|
||||||
|
vim.cmd(rangespec .. "s/ \\?\\n \\?/ /g")
|
||||||
|
end,
|
||||||
|
{ range = true })
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue