nvim no-padding alacritty
This commit is contained in:
parent
72dbb80247
commit
ee0af49129
1 changed files with 12 additions and 16 deletions
|
@ -895,28 +895,24 @@ require('lazy').setup({
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|
||||||
-- Function to update padding in the Alacritty configuration
|
function Sad(line_nr, from, to, fname)
|
||||||
local function update_padding(line_nr, from, to, file_path)
|
vim.cmd(string.format("silent !sed -i '%ss/%s/%s/' %s", line_nr, from, to, fname))
|
||||||
vim.cmd(string.format("silent !sed -i '%ss/%s/%s/' %s", line_nr, from, to, file_path))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function to increase padding (on VimLeavePre)
|
function IncreasePadding()
|
||||||
local function increase_padding()
|
Sad('07', 0, 20, '~/dotfiles/alacritty/alacritty.windows.yml')
|
||||||
update_padding('07', '0', '20', '~/.config/alacritty/alacritty.yml')
|
Sad('08', 0, 20, '~/dotfiles/alacritty/alacritty.windows.yml')
|
||||||
update_padding('08', '0', '20', '~/.config/alacritty/alacritty.yml')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Function to decrease padding (on VimEnter)
|
function DecreasePadding()
|
||||||
local function decrease_padding()
|
Sad('07', 20, 0, '~/dotfiles/alacritty/alacritty.windows.yml')
|
||||||
update_padding('07', '20', '0', '~/.config/alacritty/alacritty.yml')
|
Sad('08', 20, 0, '~/dotfiles/alacritty/alacritty.windows.yml')
|
||||||
update_padding('08', '20', '0', '~/.config/alacritty/alacritty.yml')
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Autocommands to adjust padding on VimEnter and VimLeavePre
|
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
augroup ChangeAlacrittyPadding
|
augroup ChangeAlacrittyPadding
|
||||||
autocmd!
|
au!
|
||||||
autocmd VimEnter * lua decrease_padding()
|
au VimEnter * lua DecreasePadding()
|
||||||
autocmd VimLeavePre * lua increase_padding()
|
au VimLeavePre * lua IncreasePadding()
|
||||||
augroup END
|
augroup END
|
||||||
]]
|
]]
|
||||||
|
|
Loading…
Reference in a new issue