Bind key to toggle config option #4436
-
How do I bind a key to toggle a config option? I found the page which shows how to bind custom commands. But I can't figure out how to toggle a config option. (What I'm trying to do: I found the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
I suppose you could use sed or awk scripts to change the value. (However, note that we currently don't recognize config changes while in the staging view, so you'd have to escape out of staging and enter it again for the change to take effect.) But I'd prefer to talk about the problem that you are trying to solve, and not about what you think the solution to that problem is:
Can you describe this more? Does this depend on the type of file? In that case, we might consider providing a map of file extension to wrapLinesInStagingView value. Or do you really want to toggle it for one and the same file? Can you describe a situation where this is useful? |
Beta Was this translation helpful? Give feedback.
Personally, that's where I would start to address the problem. At work we have a hard rule to not allow code lines longer than 90 characters, and we have pre-commit and pre-push hooks that enforce this.
For this, I'd recommend to look into using a pager that highlights word changes, so that it's less of a mess. I recommend delta, it is very good at this:
In general, it's a good idea to start by describing the problem you have, and not by asking how to do what you think the solution to that problem is.