Skip to content

Commit 153ec74

Browse files
committed
Merge 'upstream': move windows, conform format_on_save
- feat(keymap): move windows without `<C-w>` - changed Conform's format_on_save lambda so that buffers that match disable_filetypes return nil. This allows you to enable a formatter for langages in the disable_filetypes table to have a formatter that can be run manually with Leader-f but doesnt enable format_on_save for them
2 parents e63bee4 + e947649 commit 153ec74

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

lua/keymaps.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
3131
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
3232
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
3333

34+
-- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes
35+
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
36+
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
37+
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
38+
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
39+
3440
-- [[ Basic Autocommands ]]
3541
-- See `:help lua-guide-autocommands`
3642

lua/kickstart/plugins/conform.lua

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ return {
2020
-- have a well standardized coding style. You can add additional
2121
-- languages here or re-enable it for the disabled ones.
2222
local disable_filetypes = { c = true, cpp = true }
23-
local lsp_format_opt
2423
if disable_filetypes[vim.bo[bufnr].filetype] then
25-
lsp_format_opt = 'never'
24+
return nil
2625
else
27-
lsp_format_opt = 'fallback'
26+
return {
27+
timeout_ms = 500,
28+
lsp_format = 'fallback',
29+
}
2830
end
29-
return {
30-
timeout_ms = 500,
31-
lsp_format = lsp_format_opt,
32-
}
3331
end,
3432
formatters_by_ft = {
3533
lua = { 'stylua' },

0 commit comments

Comments
 (0)