camelcasemotion

camelcasemotion is a Vim script that offers mappings for motion through CamelCaseWords and underscore_notation.
Download

camelcasemotion Ranking & Summary

Advertisement

  • Rating:
  • License:
  • GPL
  • Price:
  • FREE
  • Publisher Name:
  • Ingo Karkat
  • Publisher web site:
  • http://www.vim.org/scripts/script.php?script_id=1690

camelcasemotion Tags


camelcasemotion Description

camelcasemotion is a Vim script that offers mappings for motion through CamelCaseWords and underscore_notation. camelcasemotion is a Vim script that offers mappings for motion through CamelCaseWords and underscore_notation.VIM provides many built-in motions, e.g. to move to the next word, or end of the current word. Most programming languages use either CamelCase ("anIdentifier") or underscore_notation ("an_identifier") naming conventions for identifiers. The best way to navigate inside those identifiers using VIM built-in motions is the 'f{char}' motion, i.e. 'f' or 'f_', respectively. But we can make this easier:This script defines motions ',w', ',b' and ',e' (similar to 'w', 'b', 'e'), which do not move word-wise (forward/backward), but Camel-wise; i.e. to word boundaries and uppercase letters. The motions also work on underscore notation, where words are delimited by underscore ('_') characters.USAGE:Use the new motions ',w', ',b' and ',e' in normal mode, operator-pending mode (cp. :help operator), and visual mode. For example, type 'bc,w' to change 'Camel' in 'CamelCase' to something else.EXAMPLE:Given the following CamelCase identifiers in a source code fragment:set Script31337PathAndNameWithoutExtension11=%~dpn0set Script31337PathANDNameWITHOUTExtension11=%~dpn0and the corresponding identifiers in underscore_notation: set script_31337_path_and_name_without_extension_11=%~dpn0set SCRIPT_31337_PATH_AND_NAME_WITHOUT_EXTENSION_11=%~dpn0,w moves to ( is cursor position): et, cript, 1337, ath, nd, ame, ithout, xtension, 1, pn0,b moves to: pn0, 1, xtension, ithout, ...,e moves to: se, scrip, 3133, pat, an, nam, withou, extensio, 1, dpnRequirements:· VimLimitations:· The operator-pending and visual mode motions are limited to a maximum of 9.INSTALLATION:Put the script into your user or system VIM plugin directory (e.g. ~/.vim/plugin).CONFIGURATION:If you want to use different mappings, map your keys to the CamelCaseMotion_? mapping targets _before_ sourcing this script (e.g. in your .vimrc).Example: Replace the default 'w', 'b' and 'e' mappings instead of defining additional mappings ',w', ',b' and ',e': map w CamelCaseMotion_w map b CamelCaseMotion_b map e CamelCaseMotion_e


camelcasemotion Related Software