Compare commits

..

3 Commits

Author SHA1 Message Date
Damjan 9000
153ec746bd 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
2025-03-24 22:13:34 +01:00
Sander
e947649cb0
feat(keymap): move windows without <C-w> (#1368) 2025-03-24 15:34:57 -04:00
RulentWave
5e2d7e184b
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 (#1395) 2025-03-24 15:33:53 -04:00
2 changed files with 11 additions and 7 deletions

View File

@ -31,6 +31,12 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- NOTE: Some terminals have coliding keymaps or are not able to send distinct keycodes
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
-- vim.keymap.set("n", "<C-S-j>", "<C-w>J", { desc = "Move window to the lower" })
-- vim.keymap.set("n", "<C-S-k>", "<C-w>K", { desc = "Move window to the upper" })
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`

View File

@ -20,16 +20,14 @@ return {
-- have a well standardized coding style. You can add additional
-- languages here or re-enable it for the disabled ones.
local disable_filetypes = { c = true, cpp = true }
local lsp_format_opt
if disable_filetypes[vim.bo[bufnr].filetype] then
lsp_format_opt = 'never'
return nil
else
lsp_format_opt = 'fallback'
end
return {
timeout_ms = 500,
lsp_format = lsp_format_opt,
lsp_format = 'fallback',
}
end
end,
formatters_by_ft = {
lua = { 'stylua' },