Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basics: enhance window resize logic #539

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lua/mini/basics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,10 @@ H.apply_mappings = function(config)
map('n', '<C-L>', '<C-w>l', { desc = 'Focus on right window' })

-- Window resize (respecting `v:count`)
map('n', '<C-Left>', '"<Cmd>vertical resize -" . v:count1 . "<CR>"', { expr = true, replace_keycodes = false, desc = 'Decrease window width' })
map('n', '<C-Down>', '"<Cmd>resize -" . v:count1 . "<CR>"', { expr = true, replace_keycodes = false, desc = 'Decrease window height' })
map('n', '<C-Up>', '"<Cmd>resize +" . v:count1 . "<CR>"', { expr = true, replace_keycodes = false, desc = 'Increase window height' })
map('n', '<C-Right>', '"<Cmd>vertical resize +" . v:count1 . "<CR>"', { expr = true, replace_keycodes = false, desc = 'Increase window width' })
map('n', '<C-Left>', '(v:count ? "" : 4) . (winnr() == winnr("l") ? "<C-w>>" : "<C-w><")', { expr = true, replace_keycodes = false, desc = 'Decrease window width' })
map('n', '<C-Down>', '(v:count ? "<C-w>-" : "1<C-w>-")', { expr = true, replace_keycodes = false, desc = 'Decrease window height' })
map('n', '<C-Up>', '(v:count ? "<C-w>+" : "1<C-w>+")', { expr = true, replace_keycodes = false, desc = 'Increase window height' })
map('n', '<C-Right>', '(v:count ? "" : 4) . (winnr() == winnr("l") ? "<C-w><" : "<C-w>>")', { expr = true, replace_keycodes = false, desc = 'Increase window width' })
end

if config.mappings.move_with_alt then
Expand Down
Loading