Fuzzy is Good? • Note that this is NOT an ambiguous command! • hlsearch. • /cau<CR> uniquely identifies 'cause' as the word you want to edit.
Fuzzy is Good? • But if we are lazy: /ca<CR> • it would be ambiguous! (demo hlsearch) • Question: What could go wrong?
Fuzzy is Good?
Fuzzy is Good?
Fuzzy is Good? goto for loop
Fuzzy is Good? goto for loop /for<CR> What could go wrong?
Fuzzy is Good? goto for loop /for<CR> What could go wrong? Code has repetition!
Fuzzy is Good? From Vim's Perspective
Fuzzy is Good? From Vim's Perspective
Fuzzy is Good?
Fuzzy is Good? I want to locate that for loop
Fuzzy is Good? Which for loop????
Fuzzy is Good? Which for loop????
Fuzzy is Good? Which for loop???? Ambiguity!!
Fuzzy is Good? Which for loop???? Ambiguity!! There is more than one way to interpret a description.
Fuzzy is Good? Which for loop???? Ambiguity!! There is more than one way to interpret a description.
Conventions (from last time) • We have three emphasis on commands for this course: 1. Clarity (no ambiguity!) 2. Ergonomics 3. Keystrokes
Conventions (from last time) • We have three emphasis on commands for this course: 1. Clarity (no ambiguity!) 2. Ergonomics 3. Keystrokes So how do we deal with it?
• A few loose ends... • Ambiguity • Ways to resolve it
Resolving Ambiguity (In decreasing use case): 1. Cheating 2. Distinctive features 3. Relative jumps
Cheating Well, it's one of them...
Cheating Well, it's one of them... Keep trying until you get to it!!
Cheating Emphasizing the idea that: "Well, my description is somewhat clear... So there wouldn't be that much ambiguity!"
Cheating • By default, /<pattern><CR> command finds the next closest match.
Cheating • By default, /<pattern><CR> command finds the next closest match. n • Finds the next match N • Finds the previous match
Cheating • Note: most of the time, we cheat because Vim matches things that we don't expect/know. (or we are unfamilar with the language) • Demo (trouble.cpp)
Recommend
More recommend