Is it possible to mark a block in Vim based on the indentation already in place? Similarly to v{ .
It would be extremely useful for programming languages with whitespace-sensitive syntax (like Haskell and Python).
For example mark everything between the first let and return in this function:
checkArg (com:arg) s d ns
| com == "add-source " = do
let s' = v ++ s
lift $ saveLinks s'
return (s', d)
| com == "remove-source" = do
let s' = filter (not . hasWord str) s
lift $ saveLinks s'
return (s', d)
I use the indent object plugin:
With this, you can select, delete, change, etc. blocks using the standard Vim text object commands, using “i” and “a” to refer to the block that you are in: “vii”, “dii”, etc.
It it language-agnostic, though is especially useful/relevant in whitespace-structured languages such as Python.