|
You're talking about how it's easy to move to a function or a file, and then you're "ready to edit", but edanm is talking about actually doing the editing. For example: say I jump to this function and want to fix a bug (the `search` should strip off the first two characters here, not just one). So I need to change `regex.search(s[1:], ...)` to `regex.search(s[2:], ...)`: def compile_hg_glob(line):
pat = glob_to_re(line)
# Mercurial ignore globs are quasi-rooted at directory boundaries or the
# beginning of the pattern.
pat = '(^|/)' + pat
# Mercurial globs also have to match to the end of the pattern.
pat = pat + '$'
try:
regex = re.compile(pat)
return lambda s: regex.search(s[1:] if s.startswith('./') else s)
except:
warn("could not parse hgignore pattern '%s'" % line)
return lambda s: True
If I've just used a fancy shortcut key to jump to this function, my cursor is probably on the function name. In Vim, I'd do `cinr2:<esc>`. Seven keystrokes. I could also do `/[<cr><ctrl-a>` which is only four keystrokes, but a little more awkward to reach. If I tried to do this editing with arrow keys and backspaces I'd need 12 down keystrokes just to get to the right line.Or suppose I'm looking at this and want to add a `,` character to the end of each of the type entries, because I forgot Python likes its commas: result = result | {
'a': TYPES_ALL
'e': TYPES_FILE_REAL
'x': TYPES_FILE_SYMLINK
'c': TYPES_DIR_REAL
'y': TYPES_DIR_SYMLINK
'f': TYPES_FILE
'd': TYPES_DIR
'r': TYPES_REAL
's': TYPES_SYMLINK
}[c.lower()]
In Vim I'd press `j` to get to the first entry, then `A,<esc>` to append the `,` after the first one, then `j.` to move down and repeat the action. I then press `j.` a bunch more times (which is really easy to do rapidly with your index and ring finger on Qwerty) and in 2 seconds I'm done. Vim's `.` to repeat the last action is really powerful and can save you a ton of time for small ad-hoc edit repetitions that don't warrant doing a full macro with `q`.These kinds of things happen constantly, and when you've got Vim burned into your fingers trying to edit text without it (actually edit text, not just jumping to something) feels like typing with oven mitts on. |
I've seen many Vim/Emacs-only devs being easily beaten in speed by others using modern IDEs that have tooling and functionality (auto formatting, refactoring, templating, etc) focused on actually getting things done.