Skip to content

Map <leader>f to indentation#103

Open
limijd wants to merge 1 commit intomainfrom
codex/change-formatting-shortcut-to-f
Open

Map <leader>f to indentation#103
limijd wants to merge 1 commit intomainfrom
codex/change-formatting-shortcut-to-f

Conversation

@limijd
Copy link
Copy Markdown
Owner

@limijd limijd commented Oct 14, 2025

Summary

  • add a normal and visual mode mapping so <leader>f reuses the built-in = indentation operator for formatting selections

Testing

  • not run

https://chatgpt.com/codex/tasks/task_e_68edf3a600f8833184ba65a8fdfb0dde

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +15 to +19
map(
{ "n", "v" },
"<leader>f",
"=",
vim.tbl_extend("force", default_opts, { remap = true, noremap = false, desc = "Format/indent" })
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid overriding the <leader>f prefix

Binding <leader>f directly to the indent operator consumes the prefix that Telescope uses for its search mappings (<leader>ff, <leader>fg, … in lua/plugins/telescope.lua). After this change, pressing any of those shortcuts fires the new indent command as soon as <leader>f is pressed, leaving the existing search commands unreachable. Unless the intent is to drop all finder mappings, this should use another key or a different prefix.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant