mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-04 16:34:02 +02:00
Initial revision
This commit is contained in:
commit
f5516d3335
IdeaVim.iprIdeaVim.iwsbuild.xml
docs
README.txt
vim
install
license
plugin.xmlsrc/com/maddyhome/idea/vim
KeyHandler.javaVimPlugin.javaVimTypedActionHandler.java
action
AbstractCommandAction.javaExEntryAction.javaResetModeAction.java
change
RedoAction.javaRepeatChangeAction.javaUndoAction.java
change
ChangeCaseLowerMotionAction.javaChangeCaseLowerVisualAction.javaChangeCaseToggleCharacterAction.javaChangeCaseToggleMotionAction.javaChangeCaseToggleVisualAction.javaChangeCaseUpperMotionAction.javaChangeCaseUpperVisualAction.javaChangeCharacterAction.javaChangeCharactersAction.javaChangeEndOfLineAction.javaChangeLineAction.javaChangeMotionAction.javaChangeReplaceAction.javaChangeVisualAction.javaChangeVisualCharacterAction.javaChangeVisualLinesAction.java
delete
DeleteCharacterAction.javaDeleteCharacterLeftAction.javaDeleteCharacterRightAction.javaDeleteEndOfLineAction.javaDeleteJoinLinesAction.javaDeleteJoinLinesSpacesAction.javaDeleteJoinVisualLinesAction.javaDeleteJoinVisualLinesSpacesAction.javaDeleteLineAction.javaDeleteMotionAction.javaDeleteVisualAction.javaDeleteVisualLinesAction.java
insert
InsertAfterCursorAction.javaInsertAfterLineEndAction.javaInsertAtPreviousInsertAction.javaInsertBeforeCursorAction.javaInsertBeforeFirstNonBlankAction.javaInsertCharacterAboveCursorAction.javaInsertCharacterBelowCursorAction.javaInsertDeletePreviousWordAction.javaInsertEnterAction.javaInsertExitModeAction.javaInsertInsertAction.javaInsertLineStartAction.javaInsertNewLineAboveAction.javaInsertNewLineBelowAction.javaInsertPreviousInsertAction.javaInsertPreviousInsertExitAction.javaInsertRegisterAction.javaInsertSingleCommandAction.java
shift
copy
133
IdeaVim.ipr
Normal file
133
IdeaVim.ipr
Normal file
@ -0,0 +1,133 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="3" relativePaths="false">
|
||||
<component name="ProjectRootManager" version="2">
|
||||
<jdk name="java version "1.4.1_01"" />
|
||||
<library name="IntelliJ" />
|
||||
<projectPath>
|
||||
<root type="composite">
|
||||
<root type="simple" url="file://$PROJECT_DIR$" />
|
||||
</root>
|
||||
</projectPath>
|
||||
<sourcePath>
|
||||
<root type="composite">
|
||||
<root type="simple" url="file://$PROJECT_DIR$/src" />
|
||||
<root type="jdk" rootType="sourcePath" name="java version "1.4.1_01"" />
|
||||
<root type="library" rootType="sourcePath" name="IntelliJ" />
|
||||
</root>
|
||||
</sourcePath>
|
||||
<classPath>
|
||||
<root type="composite">
|
||||
<root type="output" />
|
||||
<root type="jdk" rootType="classPath" name="java version "1.4.1_01"" />
|
||||
<root type="library" rootType="classPath" name="IntelliJ" />
|
||||
</root>
|
||||
</classPath>
|
||||
<excludePath>
|
||||
<root type="composite">
|
||||
<root type="excludedOutput" />
|
||||
</root>
|
||||
</excludePath>
|
||||
<javadocPath>
|
||||
<root type="composite">
|
||||
<root type="jdk" rootType="javadocPath" name="java version "1.4.1_01"" />
|
||||
<root type="library" rootType="javadocPath" name="IntelliJ" />
|
||||
</root>
|
||||
</javadocPath>
|
||||
<assert_keyword enabled="no" />
|
||||
<exclude_output enabled="yes" />
|
||||
</component>
|
||||
<component name="CompilerConfiguration">
|
||||
<option name="DEFAULT_COMPILER" value="Javac" />
|
||||
<option name="SYNCHRONIZE_OUTPUT_DIRECTORY" value="false" />
|
||||
<option name="DEFAULT_OUTPUT_PATH" value="$PROJECT_DIR$/classes" />
|
||||
<option name="OUTPUT_MODE" value="single" />
|
||||
<resourceExtensions>
|
||||
<entry name=".+\.(properties|xml|html)" />
|
||||
<entry name=".+\.(gif|png|jpeg|jpg)" />
|
||||
</resourceExtensions>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="DEBUGGING_INFO" value="true" />
|
||||
<option name="GENERATE_NO_WARNINGS" value="false" />
|
||||
<option name="DEPRECATION" value="true" />
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
|
||||
<option name="MAXIMUM_HEAP_SIZE" value="128" />
|
||||
</component>
|
||||
<component name="JikesSettings">
|
||||
<option name="JIKES_PATH" value="" />
|
||||
<option name="DEBUGGING_INFO" value="true" />
|
||||
<option name="DEPRECATION" value="true" />
|
||||
<option name="GENERATE_NO_WARNINGS" value="false" />
|
||||
<option name="GENERATE_MAKE_FILE_DEPENDENCIES" value="false" />
|
||||
<option name="DO_FULL_DEPENDENCE_CHECK" value="false" />
|
||||
<option name="IS_EMACS_ERRORS_MODE" value="true" />
|
||||
<option name="ADDITIONAL_OPTIONS_STRING" value="" />
|
||||
</component>
|
||||
<component name="AntConfiguration">
|
||||
<buildFile url="file://$PROJECT_DIR$/build.xml">
|
||||
<useEmacsModeOutput value="true" />
|
||||
<useCustomJdk value="false" />
|
||||
<treeView value="true" />
|
||||
<useJavaw value="false" />
|
||||
<verbose value="true" />
|
||||
<includeProjectClasspath value="true" />
|
||||
<includeParser value="true" />
|
||||
<maximumHeapSize value="128" />
|
||||
<viewClosedWhenNoErrors value="false" />
|
||||
<properties>
|
||||
<property name="idea.home" value="$APPLICATION_HOME_DIR$" />
|
||||
</properties>
|
||||
<targetFilters>
|
||||
<filter targetName="clean" isVisible="true" />
|
||||
<filter targetName="build" isVisible="true" />
|
||||
<filter targetName="deploy" isVisible="true" />
|
||||
<filter targetName="javadoc" isVisible="false" />
|
||||
</targetFilters>
|
||||
</buildFile>
|
||||
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||
<option name="FILTER_TARGETS" value="false" />
|
||||
</component>
|
||||
<component name="JavadocGenerationManager">
|
||||
<option name="OUTPUT_DIRECTORY" value="$PROJECT_DIR$/docs/javadoc" />
|
||||
<option name="OPTION_SCOPE" value="package" />
|
||||
<option name="OPTION_HIERARCHY" value="true" />
|
||||
<option name="OPTION_NAVIGATOR" value="true" />
|
||||
<option name="OPTION_INDEX" value="true" />
|
||||
<option name="OPTION_SEPARATE_INDEX" value="true" />
|
||||
<option name="OPTION_DOCUMENT_TAG_USE" value="true" />
|
||||
<option name="OPTION_DOCUMENT_TAG_AUTHOR" value="false" />
|
||||
<option name="OPTION_DOCUMENT_TAG_VERSION" value="true" />
|
||||
<option name="OPTION_DOCUMENT_TAG_DEPRECATED" value="true" />
|
||||
<option name="OPTION_DEPRECATED_LIST" value="true" />
|
||||
<option name="OTHER_OPTIONS" />
|
||||
<option name="HEAP_SIZE" />
|
||||
<option name="OPEN_IN_BROWSER" value="false" />
|
||||
</component>
|
||||
<component name="WebManager">
|
||||
<option enabled="false" />
|
||||
</component>
|
||||
<component name="WebRootContainer" />
|
||||
<component name="EjbManager" enabled="false" />
|
||||
<component name="JUnitProjectSettings">
|
||||
<option name="TEST_RUNNER" value="UI" />
|
||||
</component>
|
||||
<component name="EntryPointsManager">
|
||||
<entry_points />
|
||||
</component>
|
||||
<component name="EjbActionsConfiguration">
|
||||
<option name="NEW_MESSAGE_BEAN_LAST_PACKAGE" value="" />
|
||||
<option name="NEW_ENTITY_BEAN_LAST_PACKAGE" value="" />
|
||||
<option name="NEW_SESSION_BEAN_LAST_PACKAGE" value="" />
|
||||
</component>
|
||||
<component name="CodeStyleManager">
|
||||
<option name="USE_DEFAULT_CODE_STYLE_SCHEME" value="true" />
|
||||
<option name="CODE_STYLE_SCHEME" value="" />
|
||||
</component>
|
||||
<component name="ExportToHTMLSettings">
|
||||
<option name="PRINT_LINE_NUMBERS" value="false" />
|
||||
<option name="OPEN_IN_BROWSER" value="false" />
|
||||
<option name="OUTPUT_DIRECTORY" />
|
||||
</component>
|
||||
<component name="WebReferencesManager" />
|
||||
</project>
|
||||
|
519
IdeaVim.iws
Normal file
519
IdeaVim.iws
Normal file
@ -0,0 +1,519 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="3" relativePaths="false">
|
||||
<component name="WebReferencesConfigurable">
|
||||
<property name="CUSTOM_MAP_LOOKUP" type="list" />
|
||||
<property name="INTERFACE_POSTFIX" value="" type="string" />
|
||||
<property name="electric.home" value="/electric" type="string" />
|
||||
<property name="INTERFACE_PREFIX" value="I" type="string" />
|
||||
<property name="THROW_EXCEPTIONS" value="false" type="boolean" />
|
||||
<property name="ENABLED" value="false" type="boolean" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<history>
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/text/MotionWordEndRightAction.java" line="2" column="0" vertical-scroll-proportion="0.044378698" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/text/MotionWORDEndRightAction.java" line="2" column="0" vertical-scroll-proportion="0.044378698" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/text/MotionWordLeftAction.java" line="2" column="0" vertical-scroll-proportion="0.044378698" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/text/MotionWORDLeftAction.java" line="2" column="0" vertical-scroll-proportion="0.044378698" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/text/MotionWordRightAction.java" line="2" column="0" vertical-scroll-proportion="0.044378698" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/text/MotionWORDRightAction.java" line="2" column="0" vertical-scroll-proportion="0.044378698" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownFirstNonSpaceAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionDownLess1FirstNonSpaceAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineFirstAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastEndAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionGotoLineLastEndAppendAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionPercentOrMatchAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/updown/MotionUpFirstNonSpaceAction.java" line="26" column="13" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/visual/VisualExitModeAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/visual/VisualSelectPreviousAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/visual/VisualSwapEndsAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/visual/VisualSwapSelectionsAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/visual/VisualToggleCharacterModeAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/visual/VisualToggleLineModeAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/motion/MotionEditorAction.java" line="29" column="22" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.18246445" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/AbstractCommandAction.java" line="30" column="22" vertical-scroll-proportion="0.55473375" horizontal-scroll-proportion="0.18246445" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/ExEntryAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/action/ResetModeAction.java" line="27" column="13" vertical-scroll-proportion="0.5769231" horizontal-scroll-proportion="0.10781991" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/plugin.xml" line="0" column="0" vertical-scroll-proportion="0.0" horizontal-scroll-proportion="0.0" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/docs/README.txt" line="127" column="16" vertical-scroll-proportion="0.4535176" horizontal-scroll-proportion="0.13270143" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/install/vim.xml" line="16" column="31" vertical-scroll-proportion="0.30150753" horizontal-scroll-proportion="0.25710902" />
|
||||
<source-position-entry url="file://$PROJECT_DIR$/build.xml" line="34" column="0" vertical-scroll-proportion="0.6407035" horizontal-scroll-proportion="0.0" />
|
||||
</history>
|
||||
<open-files />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="3" y="0" width="1277" height="972" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="SQL" active="false" anchor="bottom" auto_hide="true" internal_type="sliding" type="sliding" visible="false" weight="0.33058822" order="9" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.32941177" order="2" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33058822" order="8" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.39983714" order="0" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="true" weight="0.25407165" order="0" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.4" order="3" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" />
|
||||
<window_info id="Struts Console" active="false" anchor="right" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.32980457" order="3" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.32941177" order="1" />
|
||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="true" internal_type="sliding" type="sliding" visible="false" weight="0.30941176" order="7" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="6" />
|
||||
<window_info id="Web" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.33" order="0" />
|
||||
<window_info id="EJB" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="4" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="5" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="Debugger">
|
||||
<line_breakpoints />
|
||||
<exception_breakpoints>
|
||||
<breakpoint_any>
|
||||
<option name="NOTIFY_CAUGHT" value="true" />
|
||||
<option name="NOTIFY_UNCAUGHT" value="true" />
|
||||
<option name="ENABLED" value="false" />
|
||||
<option name="SUSPEND_VM" value="true" />
|
||||
<option name="COUNT_FILTER_ENABLED" value="false" />
|
||||
<option name="COUNT_FILTER" value="0" />
|
||||
<option name="CONDITION_ENABLED" value="false" />
|
||||
<option name="CONDITION" />
|
||||
<option name="LOG_ENABLED" value="false" />
|
||||
<option name="LOG_EXPRESSION_ENABLED" value="false" />
|
||||
<option name="LOG_MESSAGE" />
|
||||
<option name="CLASS_FILTERS_ENABLED" value="false" />
|
||||
<option name="INVERSE_CLASS_FILLTERS" value="false" />
|
||||
<option name="SUSPEND_POLICY" value="SuspendAll" />
|
||||
</breakpoint_any>
|
||||
</exception_breakpoints>
|
||||
<field_breakpoints />
|
||||
<method_breakpoints />
|
||||
</component>
|
||||
<component name="DebuggerManager">
|
||||
<watch_expression value="CommandState.getInstance().getMode()" />
|
||||
</component>
|
||||
<component name="DebuggerSettings">
|
||||
<option name="TRACING_FILTERS_ENABLED" value="false" />
|
||||
<option name="TOSTRING_CLASSES_ENABLED" value="false" />
|
||||
<option name="VALUE_LOOKUP_DELAY" value="700" />
|
||||
<option name="DEBUGGER_TRANSPORT" value="0" />
|
||||
<option name="FORCE_CLASSIC_VM" value="true" />
|
||||
<option name="HIDE_DEBUGGER_ON_PROCESS_TERMINATION" value="false" />
|
||||
<option name="SKIP_SYNTHETIC_METHODS" value="true" />
|
||||
<option name="SKIP_CONSTRUCTORS" value="false" />
|
||||
<option name="STEP_THREAD_SUSPEND_POLICY" value="SuspendThread" />
|
||||
<option name="EVALUATION_TIMEOUT" value="1000" />
|
||||
<default_breakpoint_settings>
|
||||
<option name="NOTIFY_CAUGHT" value="true" />
|
||||
<option name="NOTIFY_UNCAUGHT" value="true" />
|
||||
<option name="WATCH_MODIFICATION" value="true" />
|
||||
<option name="WATCH_ACCESS" value="true" />
|
||||
<option name="WATCH_ENTRY" value="true" />
|
||||
<option name="WATCH_EXIT" value="true" />
|
||||
<option name="ENABLED" value="true" />
|
||||
<option name="SUSPEND_VM" value="true" />
|
||||
<option name="COUNT_FILTER_ENABLED" value="false" />
|
||||
<option name="COUNT_FILTER" value="0" />
|
||||
<option name="CONDITION_ENABLED" value="false" />
|
||||
<option name="CONDITION" />
|
||||
<option name="LOG_ENABLED" value="false" />
|
||||
<option name="LOG_EXPRESSION_ENABLED" value="false" />
|
||||
<option name="LOG_MESSAGE" />
|
||||
<option name="CLASS_FILTERS_ENABLED" value="false" />
|
||||
<option name="INVERSE_CLASS_FILLTERS" value="false" />
|
||||
<option name="SUSPEND_POLICY" value="SuspendAll" />
|
||||
</default_breakpoint_settings>
|
||||
<filter>
|
||||
<option name="PATTERN" value="com.sun.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</filter>
|
||||
<filter>
|
||||
<option name="PATTERN" value="java.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</filter>
|
||||
<filter>
|
||||
<option name="PATTERN" value="javax.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</filter>
|
||||
<filter>
|
||||
<option name="PATTERN" value="org.omg.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</filter>
|
||||
<filter>
|
||||
<option name="PATTERN" value="sun.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</filter>
|
||||
<filter>
|
||||
<option name="PATTERN" value="junit.*" />
|
||||
<option name="ENABLED" value="true" />
|
||||
</filter>
|
||||
</component>
|
||||
<component name="CompilerWorkspaceConfiguration">
|
||||
<option name="COMPILE_IN_BACKGROUND" value="false" />
|
||||
<option name="AUTO_SHOW_ERRORS_IN_EDITOR" value="true" />
|
||||
</component>
|
||||
<component name="ErrorTreeViewConfiguration">
|
||||
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||
<option name="HIDE_WARNINGS" value="false" />
|
||||
</component>
|
||||
<component name="DaemonCodeAnalyzer">
|
||||
<disable_hints />
|
||||
</component>
|
||||
<component name="StructureViewFactory">
|
||||
<option name="SORT_MODE" value="0" />
|
||||
<option name="GROUP_OVERRIDINGS" value="true" />
|
||||
<option name="GROUP_IMPLEMENTINGS" value="true" />
|
||||
<option name="AUTOSCROLL_MODE" value="true" />
|
||||
<option name="SHOW_METHODS" value="true" />
|
||||
<option name="SHOW_FIELDS" value="true" />
|
||||
<option name="AUTOSCROLL_FROM_SOURCE" value="false" />
|
||||
<option name="GROUP_GETTERS_AND_SETTERS" value="true" />
|
||||
</component>
|
||||
<component name="CvsConfiguration">
|
||||
<Checkout>
|
||||
<option name="DATE_TAG" value="" />
|
||||
<option name="REVISION_TAG" value="" />
|
||||
<option name="PRUNE_EMPTY_DIRS" value="true" />
|
||||
<option name="RESET_STICKY_TAGS" value="false" />
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="CREATE_WORKING_DIR" value="" />
|
||||
<option name="ADDITIONAL_OPTIONS" value="" />
|
||||
</Checkout>
|
||||
<Update>
|
||||
<option name="DATE_TAG" value="" />
|
||||
<option name="REVISION_TAG" value="" />
|
||||
<option name="PRUNE_EMPTY_DIRS" value="true" />
|
||||
<option name="RESET_STICKY_TAGS" value="false" />
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="CREATE_MISSING_DIRECTORIES" value="true" />
|
||||
<option name="DONT_CHANGE_FILES" value="false" />
|
||||
<option name="QUIET_MODE" value="false" />
|
||||
<option name="ADDITIONAL_OPTIONS" value="" />
|
||||
</Update>
|
||||
<Commit>
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="REVISION_TAG" value="" />
|
||||
<option name="LOG_MESSAGE" value="" />
|
||||
<option name="ADDITIONAL_OPTIONS" value="" />
|
||||
</Commit>
|
||||
<Diff>
|
||||
<option name="REVISION_TAG" value="HEAD" />
|
||||
<option name="DATE_TAG" value="" />
|
||||
<option name="IGNORE_WHITESPACE" value="false" />
|
||||
</Diff>
|
||||
<Add>
|
||||
<option name="ADD_AS_BINARY" value="false" />
|
||||
<option name="LOG_MESSAGE" value="" />
|
||||
</Add>
|
||||
<Status>
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="INCLUDE_TAGS" value="false" />
|
||||
</Status>
|
||||
<Edit>
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="FORCE_RECURSIVE" value="false" />
|
||||
<option name="EDIT" value="false" />
|
||||
<option name="UNEDIT" value="false" />
|
||||
<option name="COMMIT" value="false" />
|
||||
<option name="ALL" value="true" />
|
||||
<option name="NONE" value="false" />
|
||||
</Edit>
|
||||
<Remove>
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="FORCE_RECURSIVE" value="false" />
|
||||
<option name="DELETE_FILE" value="false" />
|
||||
</Remove>
|
||||
<Log>
|
||||
<option name="DEFAULT_BRANCH" value="false" />
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="QUIET_MODE" value="true" />
|
||||
<option name="ADDITIONAL_OPTIONS" value="" />
|
||||
</Log>
|
||||
<Editors>
|
||||
<option name="NON_RECURSIVE" value="false" />
|
||||
<option name="FORCE_RECURSIVE" value="false" />
|
||||
</Editors>
|
||||
<option name="CLIENT_PATH" value="" />
|
||||
<option name="EXTERNAL_DIFF_PATH" />
|
||||
<option name="USE_EXTERNAL_DIFF" value="false" />
|
||||
<option name="WORKING_FILES_READONLY" value="false" />
|
||||
<option name="COMPRESSION_LEVEL" value="0" />
|
||||
<option name="ADDITIONAL_OPTIONS" value="" />
|
||||
<option name="BINARY_FILES_EXTENSIONS" />
|
||||
<option name="REUSE_LAST_LOG_MESSAGE" value="false" />
|
||||
<option name="PUT_FOCUS_INTO_LOG_MESSAGE" value="false" />
|
||||
<option name="SHOW_UPDATE_OPTIONS" value="true" />
|
||||
<option name="SHOW_COMMIT_OPTIONS" value="true" />
|
||||
<option name="SHOW_DIFF_OPTIONS" value="true" />
|
||||
<option name="SHOW_ADD_OPTIONS" value="true" />
|
||||
<option name="SHOW_STATUS_OPTIONS" value="true" />
|
||||
<option name="SHOW_EDIT_OPTIONS" value="true" />
|
||||
<option name="SHOW_UNEDIT_OPTIONS" value="true" />
|
||||
<option name="SHOW_REMOVE_OPTIONS" value="true" />
|
||||
<option name="SHOW_LOG_OPTIONS" value="true" />
|
||||
<option name="SHOW_EDITORS_OPTIONS" value="true" />
|
||||
<option name="HIDE_UNKNOWN_FILES" value="false" />
|
||||
<option name="HIDE_MISSING_FILES" value="false" />
|
||||
<option name="HIDE_UP_TO_DATE_FILES" value="false" />
|
||||
</component>
|
||||
<component name="CvsVcs">
|
||||
<expanded_paths />
|
||||
</component>
|
||||
<component name="ProjectViewSettings">
|
||||
<navigator currentView="ProjectPane" flattenPackages="false" showMembers="false" showStructure="false" autoscrollToSource="false" splitterProportion="0.5" />
|
||||
<view id="ProjectPane">
|
||||
<expanded_node type="directory" url="file://$PROJECT_DIR$" />
|
||||
</view>
|
||||
<view id="SourcepathPane" />
|
||||
<view id="ClasspathPane" />
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<option name="SHOW_SETTINGS_BEFORE_RUNNING" value="true" />
|
||||
<option name="COMPILE_BEFORE_RUNNING" value="false" />
|
||||
<activeType name="Remote" />
|
||||
<configuration name="<template>" type="Application" default="true" selected="false">
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
</configuration>
|
||||
<configuration name="<template>" type="Applet" default="true" selected="false">
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="HTML_FILE_NAME" />
|
||||
<option name="HTML_USED" value="false" />
|
||||
<option name="WIDTH" value="400" />
|
||||
<option name="HEIGHT" value="300" />
|
||||
<option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
</configuration>
|
||||
<configuration name="<template>" type="JUnit" default="true" selected="false">
|
||||
<option name="PACKAGE_NAME" />
|
||||
<option name="MAIN_CLASS_NAME" />
|
||||
<option name="METHOD_NAME" />
|
||||
<option name="TEST_OBJECT" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
</configuration>
|
||||
<configuration name="<template>" type="Remote" default="true" selected="false">
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="5005" />
|
||||
</configuration>
|
||||
<configuration name="<template>" type="WebApp" default="true" selected="false">
|
||||
<WebServerIntegration name="" />
|
||||
<Host>localhost</Host>
|
||||
<Port>5050</Port>
|
||||
<LaunchServer>false</LaunchServer>
|
||||
</configuration>
|
||||
<configuration name="KeyTester" type="Application" default="false" selected="true">
|
||||
<option name="MAIN_CLASS_NAME" value="com.maddyhome.idea.vim.KeyTester" />
|
||||
<option name="VM_PARAMETERS" />
|
||||
<option name="PROGRAM_PARAMETERS" />
|
||||
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
|
||||
</configuration>
|
||||
<configuration name="MAIN" type="Remote" default="false" selected="true">
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" value="javadebug" />
|
||||
<option name="HOST" value="localhost" />
|
||||
<option name="PORT" value="5005" />
|
||||
</configuration>
|
||||
</component>
|
||||
<component name="BookmarkManager" />
|
||||
<component name="Commander">
|
||||
<leftPanel view="Project" />
|
||||
<rightPanel view="Project" />
|
||||
<splitter proportion="0.5" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="GoToClass.includeJavaFiles" value="false" />
|
||||
<property name="MemberChooser.copyJavadoc" value="false" />
|
||||
<property name="GoToClass.includeLibraries" value="false" />
|
||||
<property name="MemberChooser.showClasses" value="true" />
|
||||
<property name="MemberChooser.sorted" value="false" />
|
||||
<property name="GoToFile.includeJavaFiles" value="false" />
|
||||
<property name="GoToClass.toSaveIncludeLibraries" value="false" />
|
||||
</component>
|
||||
<component name="SelectInManager">
|
||||
<target name="Project" />
|
||||
<target name="EJB View" />
|
||||
<target name="File Structure" />
|
||||
<target name="Source" />
|
||||
<target name="Classpath View" />
|
||||
<target name="Commander" />
|
||||
</component>
|
||||
<component name="VssConfiguration">
|
||||
<CheckoutOptions>
|
||||
<option name="COMMENT" value="" />
|
||||
<option name="DO_NOT_GET_LATEST_VERSION" value="false" />
|
||||
<option name="REPLACE_WRITABLE" value="false" />
|
||||
<option name="RECURSIVE" value="false" />
|
||||
</CheckoutOptions>
|
||||
<CheckinOptions>
|
||||
<option name="COMMENT" value="" />
|
||||
<option name="KEEP_CHECKED_OUT" value="false" />
|
||||
<option name="RECURSIVE" value="false" />
|
||||
</CheckinOptions>
|
||||
<AddOptions>
|
||||
<option name="COMMENT" value="" />
|
||||
<option name="STORE_ONLY_LATEST_VERSION" value="false" />
|
||||
<option name="CHECK_OUT_IMMEDIATELY" value="false" />
|
||||
<option name="FILE_TYPE" value="0" />
|
||||
</AddOptions>
|
||||
<UndocheckoutOptions>
|
||||
<option name="MAKE_WRITABLE" value="false" />
|
||||
<option name="REPLACE_LOCAL_COPY" value="0" />
|
||||
<option name="RECURSIVE" value="false" />
|
||||
</UndocheckoutOptions>
|
||||
<DiffOptions>
|
||||
<option name="IGNORE_WHITE_SPACE" value="false" />
|
||||
<option name="IGNORE_CASE" value="false" />
|
||||
</DiffOptions>
|
||||
<GetOptions>
|
||||
<option name="REPLACE_WRITABLE" value="0" />
|
||||
<option name="MAKE_WRITABLE" value="false" />
|
||||
<option name="RECURSIVE" value="false" />
|
||||
</GetOptions>
|
||||
<option name="CLIENT_PATH" value="" />
|
||||
<option name="SRCSAFEINI_PATH" value="" />
|
||||
<option name="USER_NAME" value="" />
|
||||
<option name="PWD" value="" />
|
||||
<option name="SHOW_CHECKOUT_OPTIONS" value="true" />
|
||||
<option name="SHOW_CHECKIN_OPTIONS" value="true" />
|
||||
<option name="SHOW_ADD_OPTIONS" value="true" />
|
||||
<option name="SHOW_UNDOCHECKOUT_OPTIONS" value="true" />
|
||||
<option name="SHOW_DIFF_OPTIONS" value="true" />
|
||||
<option name="SHOW_GET_OPTIONS" value="true" />
|
||||
<option name="USE_EXTERNAL_DIFF" value="false" />
|
||||
<option name="EXTERNAL_DIFF_PATH" value="" />
|
||||
<option name="REUSE_LAST_COMMENT" value="false" />
|
||||
<option name="PUT_FOCUS_INTO_COMMENT" value="false" />
|
||||
</component>
|
||||
<component name="HierarchyBrowserManager">
|
||||
<option name="SHOW_PACKAGES" value="false" />
|
||||
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
|
||||
<option name="SORT_ALPHABETICALLY" value="false" />
|
||||
</component>
|
||||
<component name="WebViewSettings">
|
||||
<webview flattenPackages="false" showMembers="false" autoscrollToSource="false" />
|
||||
</component>
|
||||
<component name="EjbViewSettings">
|
||||
<EjbView showMembers="false" autoscrollToSource="false" />
|
||||
</component>
|
||||
<component name="LvcsConfiguration">
|
||||
<option name="LOCAL_VCS_ENABLED" value="true" />
|
||||
<option name="LOCAL_VCS_PURGING_PERIOD" value="259200000" />
|
||||
<option name="ADD_LABEL_ON_PROJECT_OPEN" value="true" />
|
||||
<option name="ADD_LABEL_ON_PROJECT_COMPILATION" value="true" />
|
||||
<option name="ADD_LABEL_ON_FILE_PACKAGE_COMPILATION" value="true" />
|
||||
<option name="ADD_LABEL_ON_PROJECT_MAKE" value="true" />
|
||||
<option name="ADD_LABEL_ON_RUNNING" value="true" />
|
||||
<option name="ADD_LABEL_ON_DEBUGGING" value="true" />
|
||||
<option name="ADD_LABEL_ON_UNIT_TEST" value="true" />
|
||||
<option name="MARK_EXTERNAL_CHANGES_AS_UP_TO_DATE" value="true" />
|
||||
</component>
|
||||
<component name="InspectionManager">
|
||||
<option name="AUTOSCROLL_TO_SOURCE" value="false" />
|
||||
<option name="SPLITTER_PROPORTION" value="0.5" />
|
||||
<inspection_tool class="Unused declaration" enabled="true">
|
||||
<option name="ADD_MAINS_TO_ENTRIES" value="true" />
|
||||
<option name="ADD_JUNIT_TO_ENTRIES" value="true" />
|
||||
<option name="ADD_EJB_TO_ENTRIES" value="true" />
|
||||
<option name="ADD_APPLET_TO_ENTRIES" value="true" />
|
||||
<option name="ADD_SERVLET_TO_ENTRIES" value="true" />
|
||||
<option name="ADD_NONJAVA_TO_ENTRIES" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Declaration access can be weaker" enabled="true">
|
||||
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
|
||||
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="true" />
|
||||
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Declaration can have static modifier" enabled="true" />
|
||||
<inspection_tool class="Declaration can have final modifier" enabled="true">
|
||||
<option name="REPORT_CLASSES" value="true" />
|
||||
<option name="REPORT_METHODS" value="true" />
|
||||
<option name="REPORT_FIELDS" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Unused method parameters" enabled="true" />
|
||||
<inspection_tool class="Actual method parameter is the same constant" enabled="true" />
|
||||
<inspection_tool class="Unused method return value" enabled="true" />
|
||||
<inspection_tool class="Method returns the same value" enabled="true" />
|
||||
<inspection_tool class="Empty method" enabled="true" />
|
||||
<inspection_tool class="Redundant throws clause" enabled="true" />
|
||||
<inspection_tool class="Constant conditions & exceptions" enabled="true" />
|
||||
<inspection_tool class="Unused assignment" enabled="true" />
|
||||
<inspection_tool class="Redundant type cast" enabled="true" />
|
||||
<inspection_tool class="Local variable or parameter can be final" enabled="true">
|
||||
<option name="REPORT_VARIABLES" value="true" />
|
||||
<option name="REPORT_PARAMETERS" value="true" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Declaration has javadoc problems" enabled="true">
|
||||
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="package" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="INNER_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="private" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="METHOD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="private" />
|
||||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="FIELD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="package" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="Deprecated API usage" enabled="true" />
|
||||
<inspection_tool class="equals() and hashCode() not paired" enabled="true" />
|
||||
<group name="Local Code Analysis" />
|
||||
<group name="Declaration Redundancy" />
|
||||
<profile name="Full" />
|
||||
</component>
|
||||
<component name="TodoView" selected-index="0">
|
||||
<todo-panel id="selected-file">
|
||||
<are-packages-shown value="false" />
|
||||
<flatten-packages value="false" />
|
||||
<is-autoscroll-to-source value="true" />
|
||||
</todo-panel>
|
||||
<todo-panel id="all">
|
||||
<are-packages-shown value="true" />
|
||||
<flatten-packages value="false" />
|
||||
<is-autoscroll-to-source value="true" />
|
||||
<todo-filter name="FIXES" />
|
||||
</todo-panel>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ACTIVE_VCS_NAME" value="" />
|
||||
</component>
|
||||
<component name="StarteamConfiguration">
|
||||
<option name="SERVER" value="" />
|
||||
<option name="PORT" value="49201" />
|
||||
<option name="USER" value="" />
|
||||
<option name="PASSWORD" value="" />
|
||||
<option name="PROJECT" value="" />
|
||||
<option name="VIEW" value="" />
|
||||
<option name="ALTERNATIVE_WORKING_PATH" value="" />
|
||||
</component>
|
||||
<component name="SQL">
|
||||
<htmlExport table="border: 1px solid black; border-spacing:0px" cell="border: 1px solid black" header="background: darkgrey; font-weight:bold; text-align: center" row1="background: white" row2="background: lightgrey" alternate="true" interval="1" />
|
||||
<csvExport delimiter="," text=""" />
|
||||
<partialExecute value="0" />
|
||||
<rowLimit enabled="true" value="1000" />
|
||||
<primaryKeyCols enabled="true" />
|
||||
<savePasswords enabled="false" />
|
||||
</component>
|
||||
</project>
|
||||
|
92
build.xml
Normal file
92
build.xml
Normal file
@ -0,0 +1,92 @@
|
||||
<project name="IdeaVim" default="build" basedir=".">
|
||||
<!--
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
-->
|
||||
|
||||
<!--
|
||||
External Properties (set in IntelliJ project):
|
||||
idea.home - $APPLICATION_HOME_DIR$
|
||||
-->
|
||||
<property name="src" value="src" />
|
||||
<property name="classes" value="classes" />
|
||||
<property name="javadoc" value="docs/javadoc" />
|
||||
<property name="install" value="install" />
|
||||
<property name="dist" value="dist" />
|
||||
<!-- Update to your IntelliJ installtion -->
|
||||
<property name="idea.home" value="/opt/IntelliJ" />
|
||||
|
||||
<property name="project" value="IdeaVIM" />
|
||||
<!-- Update this prior to building a new distribution -->
|
||||
<property name="version" value="0.1.0" />
|
||||
|
||||
<path id="build.classpath">
|
||||
<pathelement path="${idea.home}/lib/openapi.jar" />
|
||||
<pathelement path="${idea.home}/lib/jdom.jar" />
|
||||
<pathelement path="${classes}"/>
|
||||
</path>
|
||||
|
||||
<target name="clean" description="Removes all generated files" >
|
||||
<delete dir="${classes}"/>
|
||||
<delete dir="${javadoc}"/>
|
||||
<delete dir="${project}"/>
|
||||
<delete file="${install}/${project}.jar" />
|
||||
</target>
|
||||
|
||||
<target name="build" description="Compiles all source code and created plugin jar file" >
|
||||
<mkdir dir="${classes}"/>
|
||||
<javac destdir="${classes}" debug="on" classpathref="build.classpath" >
|
||||
<src path="${src}"/>
|
||||
</javac>
|
||||
<mkdir dir="${classes}/META-INF"/>
|
||||
<copy file="plugin.xml" todir="${classes}/META-INF"/>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${classes}" excludes="**/*.java"/>
|
||||
</copy>
|
||||
<jar basedir="${classes}" jarfile="${install}/${project}.jar" compress="yes"/>
|
||||
</target>
|
||||
|
||||
<target name="deploy" depends="build" description="Copies plugin to IntelliJ plugin directory" >
|
||||
<mkdir dir="${idea.home}/plugins"/>
|
||||
<copy file="${install}/${project}.jar" todir="${idea.home}/plugins/" />
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="clean, build" description="Creates a tar file containing the plugin distribution" >
|
||||
<delete dir="${project}" />
|
||||
<mkdir dir="${project}"/>
|
||||
<copy todir="${project}">
|
||||
<fileset dir="." includes="license/**"/>
|
||||
<fileset dir="${install}" includes="**"/>
|
||||
</copy>
|
||||
<copy todir="${project}/docs">
|
||||
<filterset>
|
||||
<filter token="NAME" value="${project}" />
|
||||
<filter token="VERSION" value="${version}" />
|
||||
</filterset>
|
||||
<fileset dir="docs" includes="*,vim/*.txt" excludes="javadoc" />
|
||||
</copy>
|
||||
<copy file="docs/README.txt" tofile="${project}/README" />
|
||||
<mkdir dir="${dist}"/>
|
||||
<tar basedir="." destfile="${dist}/${project}-${version}.tar.gz" compression="gzip" includes="${project}/**" />
|
||||
</target>
|
||||
|
||||
<target name="javadoc" depends="build" description="Generates Javadoc for all source code" >
|
||||
<delete dir="${javadoc}"/>
|
||||
<mkdir dir="${javadoc}" />
|
||||
<javadoc classpathref="build.classpath" access="protected" destdir="${javadoc}" packagenames="com.*" sourcepath="src" use="true" />
|
||||
</target>
|
||||
</project>
|
150
docs/README.txt
Normal file
150
docs/README.txt
Normal file
@ -0,0 +1,150 @@
|
||||
@NAME@ - Version @VERSION@
|
||||
|
||||
This plugin attempts to emulate the functionality of VIM within IDEA. It
|
||||
actually emulates 'gvim' more than 'vim' since IDEA is a graphical IDE (of
|
||||
course).
|
||||
|
||||
|
||||
Installation
|
||||
|
||||
UNIX/Linux
|
||||
|
||||
Copy @NAME@.jar to $IDEA_HOME/plugins where IDEA_HOME is where IntelliJ IDEA
|
||||
has been installed.
|
||||
|
||||
Copy vim.xml to $HOME/.IntelliJIdea/config/keymaps
|
||||
|
||||
Windows
|
||||
|
||||
Copy @NAME@.jar to %IDEA_HOME%/plugins where IDEA_HOME is where IntelliJ IDEA
|
||||
has been installed.
|
||||
|
||||
Copy vim.xml to C:\Documents and Settings\<user>\.IntelliJIdea\config\keymaps
|
||||
|
||||
|
||||
Starting
|
||||
|
||||
Once the files have been installed into their proper locations, start IDEA
|
||||
normally and then perform the following steps. These only need to be done the
|
||||
first time:
|
||||
|
||||
1) Select the "Tools" menu. There should be a new menu option labeled
|
||||
"VimPlugin Toggle". This should have a checkmark next to it. If not, please
|
||||
select this menu to check it. If this menu option is not available, you did
|
||||
not copy @NAME@.jar into the correct location.
|
||||
2) Select the "Options|Keymaps" menu. There should be a new keymap labeled "vim"
|
||||
listed in the top listbox. If there is no such keymap listed you did not
|
||||
install the vim.xml file in the proper location. Please highlight "vim" and
|
||||
click on the "Set Active" button. Click "OK" to save these changes.
|
||||
|
||||
At this point you must use VIM keystrokes in all editors.
|
||||
|
||||
|
||||
Disabling the @NAME@ Plugin
|
||||
|
||||
If you wish to disable the plugin, select the "Tools|VimPlugin Toggle" menu so
|
||||
it is unchecked. You must also select "Options|Keymaps" and make a keymap other
|
||||
than "vim" the active keymap. At this point IDEA will work with it's regular
|
||||
keyboard shortcuts.
|
||||
|
||||
|
||||
Changes to IDEA
|
||||
|
||||
Undo/Redo
|
||||
|
||||
The @NAME@ plugin uses it's own undo/redo functionality so it is important
|
||||
that you use the standard VIM keys 'u' and 'Ctrl-R' for undo/redo instead of
|
||||
the built in undo/redo. An exception might be if you wish to undo the creation
|
||||
of a new class. For this you must select the Edit|Undo menu since @NAME@
|
||||
doesn't support this feature. Using the built in undo/redo while editing a
|
||||
file will result in strange behavior and you will most likely lose changes.
|
||||
|
||||
Escape
|
||||
|
||||
In IDEA, the Escape key is used during editing to cancel code completion
|
||||
windows and parameter tooltips. While in VIM Insert mode, Escape is used to
|
||||
return back to Normal mode. If you are typing in Insert mode and a code
|
||||
completion window is popped up, pressing Escape will both cancel the window
|
||||
and exit Insert mode. If a parameter tooltip appears, pressing Escape will not
|
||||
make the tooltip go away whether in Insert or Normal mode. The only way to make
|
||||
the tooltip disappear is to move the cursor outside of the parameter area of
|
||||
the method call. (I would love to receive solutions for both of these issues.)
|
||||
|
||||
Menu Changes
|
||||
|
||||
In order to emulate the keystrokes used by VIM, several of the default hotkeys
|
||||
used by IDEA had to be changed. Below is a list of IDEA menus, their default
|
||||
keyboard shortcuts, and their new VIM keystrokes.
|
||||
|
||||
File
|
||||
Save All Ctrl-S :w
|
||||
|
||||
Edit
|
||||
Undo Ctrl-Z u
|
||||
Redo Ctrl-Shift-Z Ctrl-R
|
||||
Cut Ctrl-X "+x
|
||||
Copy Ctrl-C "+y
|
||||
Paste Ctrl-V "+P
|
||||
Select All Ctrl-A ggVG
|
||||
|
||||
Search
|
||||
Find Ctrl-F /
|
||||
Replace Ctrl-R :s
|
||||
Find Next F3 n
|
||||
Find Previous Shift-F3 N
|
||||
|
||||
View
|
||||
Quick JavaDoc Ctrl-Q K
|
||||
Parameter Info Ctrl-P Ctrl-Shift-P
|
||||
Swap Panels Ctrl-U <None>
|
||||
Recent Files... Ctrl-E <None>
|
||||
Type Hierarchy Ctrl-H Ctrl-Alt-Shift-H
|
||||
|
||||
Goto
|
||||
Class... Ctrl-N Alt-Shift-N
|
||||
Line... Ctrl-G G
|
||||
Declaration Ctrl-B gd
|
||||
Super Method Ctrl-U Ctrl-Shift-U
|
||||
|
||||
Code
|
||||
Override Methods... Ctrl-O Ctrl-Shift-O
|
||||
Implement Methods... Ctrl-I Ctrl-Shift-I
|
||||
Complete Code (Only in Insert mode)
|
||||
Basic Ctrl-Space Ctrl-Space or Ctrl-N or Ctrl-P
|
||||
Smart Type Ctrl-Shift-Space Ctrl-Shift-Space
|
||||
Class Name Ctrl-Alt-Space Ctrl-Alt-Space
|
||||
Insert Live Template Ctrl-J Ctrl-]
|
||||
|
||||
Tools
|
||||
Version Control
|
||||
Check In Project Ctrl-K <None>
|
||||
|
||||
|
||||
Summary of Supported/Unsupported VIM Features
|
||||
|
||||
Supported
|
||||
|
||||
Motion keys
|
||||
Deletion/Changing
|
||||
Insert mode commands
|
||||
Marks
|
||||
Registers
|
||||
VIM undo/redo
|
||||
Visual mode commands
|
||||
Some Ex commands
|
||||
|
||||
Not Supported (yet)
|
||||
Keymaps
|
||||
Diagraphs
|
||||
Various, lesser used (by me anyway), commands
|
||||
Jumplists
|
||||
macros
|
||||
Window commands
|
||||
Command line history
|
||||
Search history
|
||||
Search and Search/Replace still use the standard IDEA dialogs. This will be the
|
||||
case until either the JDK regexp library supported backward searches or the
|
||||
IDEA openapi provides access to their builtin search and replace.
|
||||
|
||||
Please see the file 'index.txt' for a complete list of supported, soon-to-be
|
||||
supported, and never-to-be supported commands.
|
1415
docs/vim/index.txt
Normal file
1415
docs/vim/index.txt
Normal file
File diff suppressed because it is too large
Load Diff
888
docs/vim/todo/autocmd.txt
Normal file
888
docs/vim/todo/autocmd.txt
Normal file
@ -0,0 +1,888 @@
|
||||
*autocmd.txt* For Vim version 6.1. Last change: 2002 Feb 04
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Automatic commands *autocommand*
|
||||
|
||||
For a basic explanation, see section |40.3| in the user manual.
|
||||
|
||||
1. Introduction |autocmd-intro|
|
||||
2. Defining autocommands |autocmd-define|
|
||||
3. Removing autocommands |autocmd-remove|
|
||||
4. Listing autocommands |autocmd-list|
|
||||
5. Events |autocmd-events|
|
||||
6. Patterns |autocmd-patterns|
|
||||
7. Groups |autocmd-groups|
|
||||
8. Executing autocommands |autocmd-execute|
|
||||
9. Using autocommands |autocmd-use|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *autocmd-intro*
|
||||
|
||||
You can specify commands to be executed automatically for when reading or
|
||||
writing a file, when entering or leaving a buffer or window, and when exiting
|
||||
Vim. For example, you can create an autocommand to set the 'cindent' option
|
||||
for files matching *.c. You can also use autocommands to implement advanced
|
||||
features, such as editing compressed files (see |gzip-example|). The usual
|
||||
place to put autocommands is in your .vimrc or .exrc file.
|
||||
|
||||
*E203* *E204* *E143*
|
||||
WARNING: Using autocommands is very powerful, and may lead to unexpected side
|
||||
effects. Be careful not to destroy your text.
|
||||
- It's a good idea to do some testing on an expendable copy of a file first.
|
||||
For example: If you use autocommands to decompress a file when starting to
|
||||
edit it, make sure that the autocommands for compressing when writing work
|
||||
correctly.
|
||||
- Be prepared for an error halfway through (e.g., disk full). Vim will mostly
|
||||
be able to undo the changes to the buffer, but you may have to clean up the
|
||||
changes to other files by hand (e.g., compress a file that has been
|
||||
decompressed).
|
||||
- If the BufRead* events allow you to edit a compressed file, the FileRead*
|
||||
events should do the same (this makes recovery possible in some rare cases).
|
||||
It's a good idea to use the same autocommands for the File* and Buf* events
|
||||
when possible.
|
||||
|
||||
The |+autocmd| feature is only included if it has not been disabled at compile
|
||||
time.
|
||||
|
||||
==============================================================================
|
||||
2. Defining autocommands *autocmd-define*
|
||||
|
||||
Note: The ":autocmd" command cannot be followed by another command, since any
|
||||
'|' is considered part of the command.
|
||||
|
||||
*:au* *:autocmd*
|
||||
:au[tocmd] [group] {event} {pat} [nested] {cmd}
|
||||
Add {cmd} to the list of commands that Vim will
|
||||
execute automatically on {event} for a file matching
|
||||
{pat}. Vim always adds the {cmd} after existing
|
||||
autocommands, so that the autocommands execute in the
|
||||
order in which they were given. See |autocmd-nested|
|
||||
for [nested].
|
||||
|
||||
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
|
||||
arguments are not expanded when the autocommand is defined. These will be
|
||||
expanded when the Event is recognized, and the {cmd} is executed. The only
|
||||
exception is that "<sfile>" is expanded when the autocmd is defined. Example:
|
||||
>
|
||||
:au BufNewFile,BufRead *.html so <sfile>:h/html.vim
|
||||
|
||||
Here Vim expands <sfile> to the name of the file containing this line.
|
||||
|
||||
When your .vimrc file is sourced twice, the autocommands will appear twice.
|
||||
To avoid this, put this command in your .vimrc file, before defining
|
||||
autocommands:
|
||||
>
|
||||
:autocmd! " Remove ALL autocommands for the current group.
|
||||
|
||||
If you don't want to remove all autocommands, you can instead use a variable
|
||||
to ensure that Vim includes the autocommands only once:
|
||||
>
|
||||
:if !exists("autocommands_loaded")
|
||||
: let autocommands_loaded = 1
|
||||
: au ...
|
||||
:endif
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group]. Note
|
||||
that [group] must have been defined before. You cannot define a new group
|
||||
with ":au group ..."; use ":augroup" for that.
|
||||
|
||||
While testing autocommands, you might find the 'verbose' option to be useful: >
|
||||
:set verbose=9
|
||||
This setting makes Vim echo the autocommands as it executes them.
|
||||
|
||||
When defining an autocommand in a script, it will be able to call functions
|
||||
local to the script and use mappings local to the script. When the event is
|
||||
triggered and the command executed, it will run in the context of the script
|
||||
it was defined in. This matters if |<SID>| is used in a command.
|
||||
|
||||
When executing the commands, the messages from one command overwrites a
|
||||
previous message. This is different from when executing the commands
|
||||
manually. Mostly the screen will not scroll up, thus there is no hit-enter
|
||||
prompt. When one command outputs two messages this can happen anyway.
|
||||
|
||||
==============================================================================
|
||||
3. Removing autocommands *autocmd-remove*
|
||||
|
||||
:au[tocmd]! [group] {event} {pat} [nested] {cmd}
|
||||
Remove all autocommands associated with {event} and
|
||||
{pat}, and add the command {cmd}. See
|
||||
|autocmd-nested| for [nested].
|
||||
|
||||
:au[tocmd]! [group] {event} {pat}
|
||||
Remove all autocommands associated with {event} and
|
||||
{pat}.
|
||||
|
||||
:au[tocmd]! [group] * {pat}
|
||||
Remove all autocommands associated with {pat} for all
|
||||
events.
|
||||
|
||||
:au[tocmd]! [group] {event}
|
||||
Remove ALL autocommands for {event}.
|
||||
|
||||
:au[tocmd]! [group] Remove ALL autocommands.
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
||||
|
||||
==============================================================================
|
||||
4. Listing autocommands *autocmd-list*
|
||||
|
||||
:au[tocmd] [group] {event} {pat}
|
||||
Show the autocommands associated with {event} and
|
||||
{pat}.
|
||||
|
||||
:au[tocmd] [group] * {pat}
|
||||
Show the autocommands associated with {pat} for all
|
||||
events.
|
||||
|
||||
:au[tocmd] [group] {event}
|
||||
Show all autocommands for {event}.
|
||||
|
||||
:au[tocmd] [group] Show all autocommands.
|
||||
|
||||
If you provide the [group] argument, Vim lists only the autocommands for
|
||||
[group]; otherwise, Vim lists the autocommands for ALL groups. Note that this
|
||||
argument behavior differs from that for defining and removing autocommands.
|
||||
|
||||
==============================================================================
|
||||
5. Events *autocmd-events* *E215* *E216*
|
||||
|
||||
*autocommand-events* *{event}*
|
||||
Vim recognizes the following events. Vim ignores the case of event names
|
||||
(e.g., you can use "BUFread" or "bufread" instead of "BufRead").
|
||||
|
||||
*BufNewFile*
|
||||
BufNewFile When starting to edit a file that doesn't
|
||||
exist. Can be used to read in a skeleton
|
||||
file.
|
||||
*BufReadPre* *E200* *E201*
|
||||
BufReadPre When starting to edit a new buffer, before
|
||||
reading the file into the buffer. Not used
|
||||
if the file doesn't exist.
|
||||
*BufRead* *BufReadPost*
|
||||
BufRead or BufReadPost When starting to edit a new buffer, after
|
||||
reading the file into the buffer, before
|
||||
executing the modelines. This does NOT work
|
||||
for ":r file". Not used when the file doesn't
|
||||
exist. Also used after successfully recovering
|
||||
a file.
|
||||
*BufReadCmd*
|
||||
BufReadCmd Before starting to edit a new buffer. Should
|
||||
read the file into the buffer. |Cmd-event|
|
||||
*BufFilePre*
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufFilePost*
|
||||
BufFilePost After changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*FileReadPre*
|
||||
FileReadPre Before reading a file with a ":read" command.
|
||||
*FileReadPost*
|
||||
FileReadPost After reading a file with a ":read" command.
|
||||
Note that Vim sets the '[ and '] marks to the
|
||||
first and last line of the read. This can be
|
||||
used to operate on the lines just read.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
*FilterReadPre* *E135*
|
||||
FilterReadPre Before reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
*FilterReadPost*
|
||||
FilterReadPost After reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterReadPre.
|
||||
*FileType*
|
||||
FileType When the 'filetype' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'filetype'.
|
||||
See |filetypes|.
|
||||
*Syntax*
|
||||
Syntax When the 'syntax' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*StdinReadPre*
|
||||
StdinReadPre Before reading from stdin into the buffer.
|
||||
Only used when the "-" argument was used when
|
||||
Vim was started |--|.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
when the "-" argument was used when Vim was
|
||||
started |--|.
|
||||
*BufWrite* *BufWritePre*
|
||||
BufWrite or BufWritePre Before writing the whole buffer to a file.
|
||||
*BufWritePost*
|
||||
BufWritePost After writing the whole buffer to a file
|
||||
(should undo the commands for BufWritePre).
|
||||
*BufWriteCmd*
|
||||
BufWriteCmd Before writing the whole buffer to a file.
|
||||
Should do the writing of the file and reset
|
||||
'modified' if successful. The buffer contents
|
||||
should not be changed. |Cmd-event|
|
||||
*FileWritePre*
|
||||
FileWritePre Before writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWritePost*
|
||||
FileWritePost After writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWriteCmd*
|
||||
FileWriteCmd Before writing to a file, when not writing the
|
||||
whole buffer. Should do the writing to the
|
||||
file. Should not change the buffer.
|
||||
|Cmd-event|
|
||||
*FileAppendPre*
|
||||
FileAppendPre Before appending to a file.
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
appending to the file. |Cmd-event|
|
||||
*FilterWritePre*
|
||||
FilterWritePre Before writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
*FileChangedShell*
|
||||
FileChangedShell When Vim notices that the modification time of
|
||||
a file has changed since editing started.
|
||||
|timestamp|
|
||||
Mostly triggered after executing a shell
|
||||
command, but also with a |:checktime| command
|
||||
or when Vim regains input focus.
|
||||
This autocommand is triggered for each changed
|
||||
file. It is not used when 'autoread' is set
|
||||
and the buffer was not changed. If a
|
||||
FileChangedShell autocommand is present the
|
||||
warning message and prompt is not given.
|
||||
This is useful for reloading related buffers
|
||||
which are affected by a single command.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer that was changed "<afile>".
|
||||
NOTE: The commands must not change the current
|
||||
buffer, jump to another buffer or delete a
|
||||
buffer. *E246*
|
||||
NOTE: This event never nests, to avoid an
|
||||
endless loop.
|
||||
*FileChangedRO*
|
||||
FileChangedRO Before making the first change to a read-only
|
||||
file. Can be used to check-out the file from
|
||||
a source control system. Not triggered when
|
||||
the change was caused by an autocommand.
|
||||
WARNING: This event is triggered when making a
|
||||
change, just before the change is applied to
|
||||
the text. If the autocommand moves the cursor
|
||||
the effect of the change is undefined.
|
||||
*FocusGained*
|
||||
FocusGained When Vim got input focus. Only for the GUI
|
||||
version and a few console versions where this
|
||||
can be detected.
|
||||
*FocusLost*
|
||||
FocusLost When Vim lost input focus. Only for the GUI
|
||||
version and a few console versions where this
|
||||
can be detected.
|
||||
*FuncUndefined*
|
||||
FuncUndefined When a user function is used but it isn't
|
||||
defined. Useful for defining a function only
|
||||
when it's used. Both <amatch> and <afile> are
|
||||
set to the name of the function.
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
until the user has pressed a key (i.e. doesn't
|
||||
fire every 'updatetime' ms if you leave Vim to
|
||||
make some coffee. :) See |CursorHold-example|
|
||||
for previewing tags.
|
||||
Note: Interactive commands cannot be used for
|
||||
this event. There is no hit-enter prompt,
|
||||
the screen is updated directly (when needed).
|
||||
Note: In the future there will probably be
|
||||
another option to set the time.
|
||||
Hint: to force an update of the status lines
|
||||
use: >
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer, after the
|
||||
BufReadPost autocommands.
|
||||
*BufLeave*
|
||||
BufLeave Before leaving to another buffer. Also when
|
||||
leaving or closing the current window and the
|
||||
new current window is not for the same buffer.
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*BufWinEnter*
|
||||
BufWinEnter After a buffer is displayed in a window. This
|
||||
can be when the buffer is loaded (after
|
||||
processing the modelines), when a hidden
|
||||
buffer is displayed in a window (and is no
|
||||
longer hidden) or a buffer already visible in
|
||||
a window is also displayed in another window.
|
||||
*BufWinLeave*
|
||||
BufWinLeave Before a buffer is removed from a window.
|
||||
Not when it's still visible in another window.
|
||||
Also triggered when exiting. It's triggered
|
||||
before BufUnload or BufHidden.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufUnload*
|
||||
BufUnload Before unloading a buffer. This is when the
|
||||
text in the buffer is going to be freed. This
|
||||
may be after a BufWritePost and before a
|
||||
BufDelete. Also used for all buffers that are
|
||||
loaded when Vim is going to exit.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufNew*
|
||||
BufNew Just after creating a new buffer. Also used
|
||||
just after a buffer has been renamed. When
|
||||
the buffer is added to the buffer list BufAdd
|
||||
will be triggered too.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufCreate* *BufAdd*
|
||||
BufAdd or BufCreate Just after creating a new buffer which is
|
||||
added to the buffer list, or adding a buffer
|
||||
to the buffer list.
|
||||
Also used just after a buffer in the buffer
|
||||
list has been renamed.
|
||||
The BufCreate event is for historic reasons.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufDelete*
|
||||
BufDelete Before deleting a buffer from the buffer list.
|
||||
The BufUnload may be called first (if the
|
||||
buffer was loaded).
|
||||
Also used just before a buffer in the buffer
|
||||
list is renamed.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufWipeout*
|
||||
BufWipeout Before completely deleting a buffer. The
|
||||
BufUnload and BufDelete events may be called
|
||||
first (if the buffer was loaded and was in the
|
||||
buffer list). Also used just before a buffer
|
||||
is renamed (also when it's not in the buffer
|
||||
list).
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*WinEnter*
|
||||
WinEnter After entering another window. Not done for
|
||||
the first window, when Vim has just started.
|
||||
Useful for setting the window height.
|
||||
If the window is for another buffer, Vim
|
||||
executes the BufEnter autocommands after the
|
||||
WinEnter autocommands.
|
||||
Note: When using ":split fname" the WinEnter
|
||||
event is triggered after the split but before
|
||||
the file "fname" is loaded.
|
||||
*WinLeave*
|
||||
WinLeave Before leaving a window. If the window to be
|
||||
entered next is for a different buffer, Vim
|
||||
executes the BufLeave autocommands before the
|
||||
WinLeave autocommands (but not for ":new").
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
this special type of window. This is
|
||||
triggered _instead_ of BufEnter and WinEnter.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinLeave*
|
||||
CmdwinLeave Before leaving the command-line window.
|
||||
Useful to clean up any global setting done
|
||||
with CmdwinEnter. This is triggered _instead_
|
||||
of BufLeave and WinLeave.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*GUIEnter*
|
||||
GUIEnter After starting the GUI successfully, and after
|
||||
opening the window. It is triggered before
|
||||
VimEnter when using gvim. Can be used to
|
||||
position the window from a .gvimrc file: >
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
< *VimEnter*
|
||||
VimEnter After doing all the startup stuff, including
|
||||
loading .vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeavePre*
|
||||
VimLeavePre Before exiting Vim, just before writing the
|
||||
.viminfo file. This is executed only once,
|
||||
if there is a match with the name of what
|
||||
happens to be the current buffer when exiting.
|
||||
Mostly useful with a "*" pattern. >
|
||||
:autocmd VimLeavePre * call CleanupStuff()
|
||||
< To detect an abnormal exit use |v:dying|.
|
||||
*VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.viminfo file. Executed only once, like
|
||||
VimLeavePre.
|
||||
To detect an abnormal exit use |v:dying|.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off when the 'encoding' option is
|
||||
changed. Useful to set up fonts, for example.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|.
|
||||
<amatch> is equal to the {serverid} from which
|
||||
the reply was sent, and <afile> is the actual
|
||||
reply string.
|
||||
Note that even if an auto command is defined,
|
||||
the reply should be read with |remote_read()|
|
||||
to consume it.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version.
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user hits CTRL-C. Just kidding! :-)
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
":doautocmd".
|
||||
|
||||
|
||||
For READING FILES there are three possible pairs of events. Vim uses only one
|
||||
pair at a time:
|
||||
BufNewFile starting to edit a non-existent file
|
||||
BufReadPre BufReadPost starting to edit an existing file
|
||||
FilterReadPre FilterReadPost read the temp file with filter output
|
||||
FileReadPre FileReadPost any other file read
|
||||
|
||||
Note that the autocommands for the *ReadPre events and all the Filter events
|
||||
are not allowed to change the current buffer (you will get an error message if
|
||||
this happens). This is to prevent the file to be read into the wrong buffer.
|
||||
|
||||
Note that the 'modified' flag is reset AFTER executing the BufReadPost
|
||||
and BufNewFile autocommands. But when the 'modified' option was set by the
|
||||
autocommands, this doesn't happen.
|
||||
|
||||
You can use the 'eventignore' option to ignore a number of events or all
|
||||
events.
|
||||
|
||||
==============================================================================
|
||||
6. Patterns *autocmd-patterns*
|
||||
|
||||
The file pattern {pat} is tested for a match against the file name in one of
|
||||
two ways:
|
||||
1. When there is no '/' in the pattern, Vim checks for a match against only
|
||||
the tail part of the file name (without its leading directory path).
|
||||
2. When there is a '/' in the pattern, Vim checks for a match against the
|
||||
both short file name (as you typed it) and the full file name (after
|
||||
expanding it to a full path and resolving symbolic links).
|
||||
|
||||
Examples: >
|
||||
:autocmd BufRead *.txt set et
|
||||
Set the 'et' option for all text files. >
|
||||
|
||||
:autocmd BufRead /vim/src/*.c set cindent
|
||||
Set the 'cindent' option for C files in the /vim/src directory. >
|
||||
|
||||
:autocmd BufRead /tmp/*.c set ts=5
|
||||
If you have a link from "/tmp/test.c" to "/home/nobody/vim/src/test.c", and
|
||||
you start editing "/tmp/test.c", this autocommand will match.
|
||||
|
||||
Note: To match part of a path, but not from the root directory, use a '*' as
|
||||
the first character. Example: >
|
||||
:autocmd BufRead */doc/*.txt set tw=78
|
||||
This autocommand will for example be executed for "/tmp/doc/xx.txt" and
|
||||
"/usr/home/piet/doc/yy.txt". The number of directories does not matter here.
|
||||
|
||||
|
||||
The file name that the pattern is matched against is after expanding
|
||||
wildcards. Thus is you issue this command: >
|
||||
:e $ROOTDIR/main.$EXT
|
||||
The argument is first expanded to: >
|
||||
/usr/root/main.py
|
||||
Before it's matched with the pattern of the autocommand. Careful with this
|
||||
when using events like FileReadCmd, the value of <amatch> may not be what you
|
||||
expect.
|
||||
|
||||
|
||||
Environment variables can be used in a pattern: >
|
||||
:autocmd BufRead $VIMRUNTIME/doc/*.txt set expandtab
|
||||
And ~ can be used for the home directory (if $HOME is defined): >
|
||||
:autocmd BufWritePost ~/.vimrc so ~/.vimrc
|
||||
:autocmd BufRead ~archive/* set readonly
|
||||
The environment variable is expanded when the autocommand is defined, not when
|
||||
the autocommand is executed. This is different from the command!
|
||||
|
||||
*file-pattern*
|
||||
The pattern is interpreted like mostly used in file names:
|
||||
* matches any sequence of characters
|
||||
? matches any single character
|
||||
\? matches a '?'
|
||||
. matches a '.'
|
||||
~ matches a '~'
|
||||
, separates patterns
|
||||
\, matches a ','
|
||||
{ } like \( \) in a |pattern|
|
||||
, inside { }: like \| in a |pattern|
|
||||
\ special meaning like in a |pattern|
|
||||
[ch] matches 'c' or 'h'
|
||||
|
||||
Note that for all systems the '/' character is used for path separator (even
|
||||
MS-DOS and OS/2). This was done because the backslash is difficult to use
|
||||
in a pattern and to make the autocommands portable across different systems.
|
||||
|
||||
|
||||
Matching with the pattern is done when an event is triggered. Changing the
|
||||
buffer name in one of the autocommands, or even deleting the buffer, does not
|
||||
change which autocommands will be executed. Example: >
|
||||
|
||||
au BufEnter *.foo bdel
|
||||
au BufEnter *.foo set modified
|
||||
|
||||
This will delete the current buffer and then set 'modified' in what has become
|
||||
the current buffer instead. Vim doesn't take into account that "*.foo"
|
||||
doesn't match with that buffer name. It matches "*.foo" with the name of the
|
||||
buffer at the moment the event was triggered.
|
||||
|
||||
==============================================================================
|
||||
7. Groups *autocmd-groups*
|
||||
|
||||
Autocommands can be put together in a group. This is useful for removing or
|
||||
executing a group of autocommands. For example, all the autocommands for
|
||||
syntax highlighting are put in the "highlight" group, to be able to execute
|
||||
":doautoall highlight BufRead" when the GUI starts.
|
||||
|
||||
When no specific group is selected, Vim uses the default group. The default
|
||||
group does not have a name. You cannot execute the autocommands from the
|
||||
default group separately; you can execute them only by executing autocommands
|
||||
for all groups.
|
||||
|
||||
Normally, when executing autocommands automatically, Vim uses the autocommands
|
||||
for all groups. The group only matters when executing autocommands with
|
||||
":doautocmd" or ":doautoall", or when defining or deleting autocommands.
|
||||
|
||||
The group name can contain any characters except white space. The group name
|
||||
"end" is reserved (also in uppercase). The group name is case sensitive.
|
||||
|
||||
*:aug* *:augroup*
|
||||
:aug[roup] {name} Define the autocmd group name for the
|
||||
following ":autocmd" commands. The name "end"
|
||||
or "END" selects the default group.
|
||||
|
||||
*:augroup-delete* *E367*
|
||||
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
|
||||
this if there is still an autocommand using
|
||||
this group! This is not checked.
|
||||
|
||||
To enter autocommands for a specific group, use this method:
|
||||
1. Select the group with ":augroup {name}".
|
||||
2. Delete any old autocommands with ":au!".
|
||||
3. Define the autocommands.
|
||||
4. Go back to the default group with "augroup END".
|
||||
|
||||
Example: >
|
||||
:augroup uncompress
|
||||
: au!
|
||||
: au BufEnter *.gz %!gunzip
|
||||
:augroup END
|
||||
|
||||
This prevents having the autocommands defined twice (e.g., after sourcing the
|
||||
.vimrc file again).
|
||||
|
||||
==============================================================================
|
||||
8. Executing autocommands *autocmd-execute*
|
||||
|
||||
Vim can also execute Autocommands non-automatically. This is useful if you
|
||||
have changed autocommands, or when Vim has executed the wrong autocommands
|
||||
(e.g., the file pattern match was wrong).
|
||||
|
||||
Note that the 'eventignore' option applies here too. Events listed in this
|
||||
option will not cause any commands to be executed.
|
||||
|
||||
*:do* *:doautocmd* *E217*
|
||||
:do[autocmd] [group] {event} [fname]
|
||||
Apply the autocommands matching [fname] (default:
|
||||
current file name) for {event} to the current buffer.
|
||||
You can use this when the current file name does not
|
||||
match the right pattern, after changing settings, or
|
||||
to execute autocommands for a certain event.
|
||||
It's possible to use this inside an autocommand too,
|
||||
so you can base the autocommands for one extension on
|
||||
another extension. Example: >
|
||||
:au Bufenter *.cpp so ~/.vimrc_cpp
|
||||
:au Bufenter *.cpp doau BufEnter x.c
|
||||
< Be careful to avoid endless loops. See
|
||||
|autocmd-nested|.
|
||||
|
||||
When the [group] argument is not given, Vim executes
|
||||
the autocommands for all groups. When the [group]
|
||||
argument is included, Vim executes only the matching
|
||||
autocommands for that group. Note: if you use an
|
||||
undefined group name, Vim gives you an error message.
|
||||
|
||||
*:doautoa* *:doautoall*
|
||||
:doautoa[ll] [group] {event} [fname]
|
||||
Like ":doautocmd", but apply the autocommands to each
|
||||
loaded buffer. Careful: Don't use this for
|
||||
autocommands that delete a buffer, change to another
|
||||
buffer or change the contents of a buffer; the result
|
||||
is unpredictable. This command is intended for
|
||||
autocommands that set options, change highlighting,
|
||||
and things like that.
|
||||
|
||||
==============================================================================
|
||||
9. Using autocommands *autocmd-use*
|
||||
|
||||
For WRITING FILES there are four possible sets of events. Vim uses only one
|
||||
of these sets for a write command:
|
||||
|
||||
BufWriteCmd BufWritePre BufWritePost writing the whole buffer
|
||||
FilterWritePre FilterWritePost writing to filter temp file
|
||||
FileAppendCmd FileAppendPre FileAppendPost appending to a file
|
||||
FileWriteCmd FileWritePre FileWritePost any other file write
|
||||
|
||||
When there is a matching "*Cmd" autocommand, it is assumed it will do the
|
||||
writing. No further writing is done and the other events are not triggered.
|
||||
|Cmd-event|
|
||||
|
||||
Note that the *WritePost commands should undo any changes to the buffer that
|
||||
were caused by the *WritePre commands; otherwise, writing the file will have
|
||||
the side effect of changing the buffer.
|
||||
|
||||
Before executing the autocommands, the buffer from which the lines are to be
|
||||
written temporarily becomes the current buffer. Unless the autocommands
|
||||
change the current buffer or delete the previously current buffer, the
|
||||
previously current buffer is made the current buffer again.
|
||||
|
||||
The *WritePre and *AppendPre autocommands must not delete the buffer from
|
||||
which the lines are to be written.
|
||||
|
||||
The '[ and '] marks have a special position:
|
||||
- Before the *ReadPre event the '[ mark is set to the line just above where
|
||||
the new lines will be inserted.
|
||||
- Before the *ReadPost event the '[ mark is set to the first line that was
|
||||
just read, the '] mark to the last line.
|
||||
- Before executing the *WritePre and *AppendPre autocommands the '[ mark is
|
||||
set to the first line that will be written, the '] mark to the last line.
|
||||
Careful: '[ and '] change when using commands that change the buffer.
|
||||
|
||||
In commands which expect a file name, you can use "<afile>" for the file name
|
||||
that is being read |:<afile>| (you can also use "%" for the current file
|
||||
name). "<abuf>" can be used for the buffer number of the currently effective
|
||||
buffer. This also works for buffers that doesn't have a name. But it doesn't
|
||||
work for files without a buffer (e.g., with ":r file").
|
||||
|
||||
*gzip-example*
|
||||
Examples for reading and writing compressed files: >
|
||||
:augroup gzip
|
||||
: autocmd!
|
||||
: autocmd BufReadPre,FileReadPre *.gz set bin
|
||||
: autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
|
||||
: autocmd BufReadPost,FileReadPost *.gz set nobin
|
||||
: autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
|
||||
: autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
|
||||
: autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
|
||||
|
||||
: autocmd FileAppendPre *.gz !gunzip <afile>
|
||||
: autocmd FileAppendPre *.gz !mv <afile>:r <afile>
|
||||
: autocmd FileAppendPost *.gz !mv <afile> <afile>:r
|
||||
: autocmd FileAppendPost *.gz !gzip <afile>:r
|
||||
:augroup END
|
||||
|
||||
The "gzip" group is used to be able to delete any existing autocommands with
|
||||
":autocmd!", for when the file is sourced twice.
|
||||
|
||||
("<afile>:r" is the file name without the extension, see |:_%:|)
|
||||
|
||||
The commands executed for the BufNewFile, BufRead/BufReadPost, BufWritePost,
|
||||
FileAppendPost and VimLeave events do not set or reset the changed flag of the
|
||||
buffer. When you decompress the buffer with the BufReadPost autocommands, you
|
||||
can still exit with ":q". When you use ":undo" in BufWritePost to undo the
|
||||
changes made by BufWritePre commands, you can still do ":q" (this also makes
|
||||
"ZZ" work). If you do want the buffer to be marked as modified, set the
|
||||
'modified' option.
|
||||
|
||||
To execute Normal mode commands from an autocommand, use the ":normal"
|
||||
command. Use with care! If the Normal mode command is not finished, the user
|
||||
needs to type characters (e.g., after ":normal m" you need to type a mark
|
||||
name).
|
||||
|
||||
If you want the buffer to be unmodified after changing it, reset the
|
||||
'modified' option. This makes it possible to exit the buffer with ":q"
|
||||
instead of ":q!".
|
||||
|
||||
*autocmd-nested* *E218*
|
||||
By default, autocommands do not nest. If you use ":e" or ":w" in an
|
||||
autocommand, Vim does not execute the BufRead and BufWrite autocommands for
|
||||
those commands. If you do want this, use the "nested" flag for those commands
|
||||
in which you want nesting. For example: >
|
||||
:autocmd FileChangedShell *.c nested e!
|
||||
The nesting is limited to 10 levels to get out of recursive loops.
|
||||
|
||||
It's possible to use the ":au" command in an autocommand. This can be a
|
||||
self-modifying command! This can be useful for an autocommand that should
|
||||
execute only once.
|
||||
|
||||
There is currently no way to disable the autocommands. If you want to write a
|
||||
file without executing the autocommands for that type of file, write it under
|
||||
another name and rename it with a shell command.
|
||||
|
||||
Note: When reading a file (with ":read file" or with a filter command) and the
|
||||
last line in the file does not have an <EOL>, Vim remembers this. At the next
|
||||
write (with ":write file" or with a filter command), if the same line is
|
||||
written again as the last line in a file AND 'binary' is set, Vim does not
|
||||
supply an <EOL>. This makes a filter command on the just read lines write the
|
||||
same file as was read, and makes a write command on just filtered lines write
|
||||
the same file as was read from the filter. For example, another way to write
|
||||
a compressed file: >
|
||||
|
||||
:autocmd FileWritePre *.gz set bin|'[,']!gzip
|
||||
:autocmd FileWritePost *.gz undo|set nobin
|
||||
<
|
||||
*autocommand-pattern*
|
||||
You can specify multiple patterns, separated by commas. Here are some
|
||||
examples: >
|
||||
|
||||
:autocmd BufRead * set tw=79 nocin ic infercase fo=2croq
|
||||
:autocmd BufRead .letter set tw=72 fo=2tcrq
|
||||
:autocmd BufEnter .letter set dict=/usr/lib/dict/words
|
||||
:autocmd BufLeave .letter set dict=
|
||||
:autocmd BufRead,BufNewFile *.c,*.h set tw=0 cin noic
|
||||
:autocmd BufEnter *.c,*.h abbr FOR for (i = 0; i < 3; ++i)<CR>{<CR>}<Esc>O
|
||||
:autocmd BufLeave *.c,*.h unabbr FOR
|
||||
|
||||
For makefiles (makefile, Makefile, imakefile, makefile.unix, etc.): >
|
||||
|
||||
:autocmd BufEnter ?akefile* set include=^s\=include
|
||||
:autocmd BufLeave ?akefile* set include&
|
||||
|
||||
To always start editing C files at the first function: >
|
||||
|
||||
:autocmd BufRead *.c,*.h 1;/^{
|
||||
|
||||
Without the "1;" above, the search would start from wherever the file was
|
||||
entered, rather than from the start of the file.
|
||||
|
||||
*skeleton* *template*
|
||||
To read a skeleton (template) file when opening a new file: >
|
||||
|
||||
:autocmd BufNewFile *.c 0r ~/vim/skeleton.c
|
||||
:autocmd BufNewFile *.h 0r ~/vim/skeleton.h
|
||||
:autocmd BufNewFile *.java 0r ~/vim/skeleton.java
|
||||
|
||||
To insert the current date and time in a *.html file when writing it: >
|
||||
|
||||
:autocmd BufWritePre,FileWritePre *.html ks|call LastMod()|'s
|
||||
:fun LastMod()
|
||||
: if line("$") > 20
|
||||
: let l = 20
|
||||
: else
|
||||
: let l = line("$")
|
||||
: endif
|
||||
: exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " .
|
||||
: \ strftime("%Y %b %d")
|
||||
:endfun
|
||||
|
||||
You need to have a line "Last modified: <date time>" in the first 20 lines
|
||||
of the file for this to work. Vim replaces <date time> (and anything in the
|
||||
same line after it) with the current date and time. Explanation:
|
||||
ks mark current position with mark 's'
|
||||
call LastMod() call the LastMod() function to do the work
|
||||
's return the cursor to the old position
|
||||
The LastMod() function checks if the file is shorter than 20 lines, and then
|
||||
uses the ":g" command to find lines that contain "Last modified: ". For those
|
||||
lines the ":s" command is executed to replace the existing date with the
|
||||
current one. The ":execute" command is used to be able to use an expression
|
||||
for the ":g" and ":s" commands. The date is obtained with the strftime()
|
||||
function. You can change its argument to get another date string.
|
||||
|
||||
When entering :autocmd on the command-line, completion of events and command
|
||||
names may be done (with <Tab>, CTRL-D, etc.) where appropriate.
|
||||
|
||||
Vim executes all matching autocommands in the order that you specify them.
|
||||
It is recommended that your first autocommand be used for all files by using
|
||||
"*" as the file pattern. This means that you can define defaults you like
|
||||
here for any settings, and if there is another matching autocommand it will
|
||||
override these. But if there is no other matching autocommand, then at least
|
||||
your default settings are recovered (if entering this file from another for
|
||||
which autocommands did match). Note that "*" will also match files starting
|
||||
with ".", unlike Unix shells.
|
||||
|
||||
*autocmd-searchpat*
|
||||
Autocommands do not change the current search patterns. Vim saves the current
|
||||
search patterns before executing autocommands then restores them after the
|
||||
autocommands finish. This means that autocommands do not affect the strings
|
||||
highlighted with the 'hlsearch' option. Within autocommands, you can still
|
||||
use search patterns normally, e.g., with the "n" command.
|
||||
If you want an autocommand to set the search pattern, such that it is used
|
||||
after the autocommand finishes, use the ":let @/ =" command.
|
||||
The search-highlighting cannot be switched off with ":nohlsearch" in an
|
||||
autocommand. Use the 'h' flag in the 'viminfo' option to disable search-
|
||||
highlighting when starting Vim.
|
||||
|
||||
*Cmd-event*
|
||||
When using one of the "*Cmd" events, the matching autocommands are expected to
|
||||
do the file reading or writing. This can be used when working with a special
|
||||
kind of file, for example on a remote system.
|
||||
CAREFUL: If you use these events in a wrong way, it may have the effect of
|
||||
making it impossible to read or write the matching files! Make sure you test
|
||||
your autocommands properly. Best is to use a pattern that will never match a
|
||||
normal file name, for example "ftp://*".
|
||||
|
||||
When defining a BufReadCmd it will be difficult for Vim to recover a crashed
|
||||
editing session. When recovering from the original file, Vim reads only those
|
||||
parts of a file that are not found in the swap file. Since that is not
|
||||
possible with a BufReadCmd, use the |:preserve| command to make sure the
|
||||
original file isn't needed for recovery. You might want to do this only when
|
||||
you expect the file to be modified.
|
||||
|
||||
The |v:cmdarg| variable holds the "++enc=" and "++ff=" argument that are
|
||||
effective. These should be used for the command that reads/writes the file.
|
||||
|
||||
See the $VIMRUNTIME/plugin/netrw.vim for examples.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1362
docs/vim/todo/change.txt
Normal file
1362
docs/vim/todo/change.txt
Normal file
File diff suppressed because it is too large
Load Diff
945
docs/vim/todo/cmdline.txt
Normal file
945
docs/vim/todo/cmdline.txt
Normal file
@ -0,0 +1,945 @@
|
||||
*cmdline.txt* For Vim version 6.1. Last change: 2002 Jan 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
*Cmdline-mode* *Command-line-mode*
|
||||
Command-line mode *Cmdline* *Command-line* *mode-cmdline* *:*
|
||||
|
||||
Command-line mode is used to enter Ex commands (":"), search patterns
|
||||
("/" and "?"), and filter commands ("!").
|
||||
|
||||
Basic command line editing is explained in chapter 20 of the user manual
|
||||
|usr_20.txt|.
|
||||
|
||||
1. Command-line editing |cmdline-editing|
|
||||
2. Command-line completion |cmdline-completion|
|
||||
3. Ex command-lines |cmdline-lines|
|
||||
4. Ex command-line ranges |cmdline-ranges|
|
||||
5. Ex special characters |cmdline-special|
|
||||
6. Command-line window |cmdline-window|
|
||||
|
||||
==============================================================================
|
||||
1. Command-line editing *cmdline-editing*
|
||||
|
||||
Normally characters are inserted in front of the cursor position. You can
|
||||
move around in the command-line with the left and right cursor keys. With the
|
||||
<Insert> key, you can toggle between inserting and overstriking characters.
|
||||
{Vi: can only alter the last character in the line}
|
||||
|
||||
Note that if your keyboard does not have working cursor keys or any of the
|
||||
other special keys, you can use ":cnoremap" to define another key for them.
|
||||
For example, to define tcsh style editing keys: *tcsh-style* >
|
||||
:cnoremap <C-A> <Home>
|
||||
:cnoremap <C-F> <Right>
|
||||
:cnoremap <C-B> <Left>
|
||||
:cnoremap <Esc>b <S-Left>
|
||||
:cnoremap <Esc>f <S-Right>
|
||||
(<> notation |<>|; type all this literally)
|
||||
|
||||
*cmdline-too-long*
|
||||
When the command line is getting longer than what fits on the screen, only the
|
||||
part that fits will be shown. The cursor can only move in this visible part,
|
||||
thus you cannot edit beyond that.
|
||||
|
||||
*cmdline-history* *history*
|
||||
The command-lines that you enter are remembered in a history table. You can
|
||||
recall them with the up and down cursor keys. There are actually four
|
||||
history tables:
|
||||
- one for ':' commands
|
||||
- one for search strings
|
||||
- one for expressions
|
||||
- one for input lines, typed for the |input()| function.
|
||||
These are completely separate. Each history can only be accessed when
|
||||
entering the same type of line.
|
||||
Use the 'history' option to set the number of lines that are remembered
|
||||
(default: 20).
|
||||
Notes:
|
||||
- When you enter a command-line that is exactly the same as an older one, the
|
||||
old one is removed (to avoid repeated commands moving older commands out of
|
||||
the history).
|
||||
- Only commands that are typed are remembered. Ones that completely come from
|
||||
mappings are not put in the history
|
||||
- All searches are put in the search history, including the ones that come
|
||||
from commands like "*" and "#". But for a mapping, only the last search is
|
||||
remembered (to avoid that long mappings trash the history).
|
||||
{Vi: no history}
|
||||
{not available when compiled without the |+cmdline_hist| feature}
|
||||
|
||||
There is an automatic completion of names on the command-line; see
|
||||
|cmdline-completion|.
|
||||
|
||||
*c_CTRL-V*
|
||||
CTRL-V Insert next non-digit literally. Up to three digits form the
|
||||
decimal value of a single byte. The non-digit and the three
|
||||
digits are not considered for mapping. This works the same
|
||||
way as in Insert mode (see above, |i_CTRL-V|).
|
||||
Note: Under Windows CTRL-V is often mapped to paste text.
|
||||
Use CTRL-Q instead then.
|
||||
*c_CTRL-Q*
|
||||
CTRL-Q Same as CTRL-V. But with some terminals it is used for
|
||||
control flow, it doesn't work then.
|
||||
|
||||
*c_<Left>*
|
||||
<Left> cursor left
|
||||
*c_<Right>*
|
||||
<Right> cursor right
|
||||
*c_<S-Left>*
|
||||
<S-Left> or <C-Left> *c_<C-Left>*
|
||||
cursor one WORD left
|
||||
*c_<S-Right>*
|
||||
<S-Right> or <C-Right> *c_<C-Right>*
|
||||
cursor one WORD right
|
||||
CTRL-B or <Home> *c_CTRL-B* *c_<Home>*
|
||||
cursor to beginning of command-line
|
||||
CTRL-E or <End> *c_CTRL-E* *c_<End>*
|
||||
cursor to end of command-line
|
||||
|
||||
*c_<LeftMouse>*
|
||||
<LeftMouse> cursor to position of mouse click.
|
||||
|
||||
CTRL-H *c_<BS>* *c_CTRL-H*
|
||||
<BS> delete the character in front of the cursor (see |:fixdel| if
|
||||
your <BS> key does not do what you want).
|
||||
*c_<Del>*
|
||||
<Del> delete the character under the cursor (at end of line:
|
||||
character before the cursor) (see |:fixdel| if your <Del>
|
||||
key does not do what you want).
|
||||
*c_CTRL-W*
|
||||
CTRL-W delete the word before the cursor
|
||||
*c_CTRL-U*
|
||||
CTRL-U remove all characters between the cursor position and
|
||||
the beginning of the line. Previous versions of vim
|
||||
deleted all characters on the line. If that is the
|
||||
preferred behavior, add the following to your .vimrc: >
|
||||
:cnoremap <C-U> <C-E><C-U>
|
||||
<
|
||||
Note: if the command-line becomes empty with one of the
|
||||
delete commands, Command-line mode is quit.
|
||||
*c_<Insert>*
|
||||
<Insert> Toggle between insert and overstrike. {not in Vi}
|
||||
|
||||
{char1} <BS> {char2} or *c_digraph*
|
||||
CTRL-K {char1} {char2} *c_CTRL-K*
|
||||
enter digraph (see |digraphs|). When {char1} is a special
|
||||
key, the code for that key is inserted in <> form. {not in Vi}
|
||||
|
||||
CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
|
||||
Insert the contents of a numbered or named register. Between
|
||||
typing CTRL-R and the second character '"' will be displayed
|
||||
to indicate that you are expected to enter the name of a
|
||||
register.
|
||||
The text is inserted as if you typed it, but mappings and
|
||||
abbreviations are not used. Command-line completion through
|
||||
'wildchar' is not triggered though. And characters that end
|
||||
the command line are inserted literally (<Esc>, <CR>, <NL>,
|
||||
<C-C>). A <BS> or CTRL-W could still end the command line
|
||||
though, and remaining characters will then be interpreted in
|
||||
another mode, which might not be what you intended.
|
||||
Special registers:
|
||||
'"' the unnamed register, containing the text of
|
||||
the last delete or yank
|
||||
'%' the current file name
|
||||
'#' the alternate file name
|
||||
'*' the clipboard contents
|
||||
'/' the last search pattern
|
||||
':' the last command-line
|
||||
'-' the last small (less than a line) delete
|
||||
'.' the last inserted text
|
||||
'=' the expression register: you are prompted to
|
||||
enter an expression (see |expression|)
|
||||
See |registers| about registers. {not in Vi}
|
||||
|
||||
CTRL-R CTRL-F *c_CTRL-R_CTRL-F* *c_<C-R>_<C-F>*
|
||||
CTRL-R CTRL-P *c_CTRL-R_CTRL-P* *c_<C-R>_<C-P>*
|
||||
CTRL-R CTRL-W *c_CTRL-R_CTRL-W* *c_<C-R>_<C-W>*
|
||||
CTRL-R CTRL-A *c_CTRL-R_CTRL-A* *c_<C-R>_<C-A>*
|
||||
Insert the object under the cursor:
|
||||
CTRL-F the Filename under the cursor
|
||||
CTRL-P the Filename under the cursor, expanded with
|
||||
'path' as in |gf|
|
||||
CTRL-W the Word under the cursor
|
||||
CTRL-A the WORD under the cursor; see |WORD|
|
||||
{not in Vi}
|
||||
CTRL-F and CTRL-P: {only when +file_in_path feature is
|
||||
included}
|
||||
|
||||
*c_CTRL-R_CTRL-R* *c_<C-R>_<C-R>*
|
||||
*c_CTRL-R_CTRL-O* *c_<C-R>_<C-O>*
|
||||
CTRL-R CTRL-R {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
|
||||
CTRL-R CTRL-O {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
|
||||
Insert register or object under the cursor. Works like
|
||||
|c_CTRL-R| but inserts the text literally. For example, if
|
||||
register a contains "xy^Hz" (where ^H is a backspace),
|
||||
"CTRL-R a" will insert "xz" while "CTRL-R CTRL-R a" will
|
||||
insert "xy^Hz".
|
||||
|
||||
*c_CTRL-Y*
|
||||
CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
If there is no selection CTRL-Y is inserted as a character.
|
||||
|
||||
CTRL-J *c_CTRL-J* *c_<NL>* *c_<CR>*
|
||||
<CR> or <NL> start entered command
|
||||
*c_<Esc>*
|
||||
<Esc> When typed and 'x' not present in 'cpoptions', quit
|
||||
Command-line mode without executing. In macros or when 'x'
|
||||
present in 'cpoptions', start entered command.
|
||||
*c_CTRL-C*
|
||||
CTRL-C quit command-line without executing
|
||||
|
||||
*c_<Up>*
|
||||
<Up> recall older command-line from history, whose beginning
|
||||
matches the current command-line (see below).
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
*c_<Down>*
|
||||
<Down> recall more recent command-line from history, whose beginning
|
||||
matches the current command-line (see below).
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
|
||||
*c_<S-Up>* *c_<PageUp>*
|
||||
<S-Up> or <PageUp>
|
||||
recall older command-line from history
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
*c_<S-Down>* *c_<PageDown>*
|
||||
<S-Down> or <PageDown>
|
||||
recall more recent command-line from history
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
|
||||
CTRL-D command-line completion (see |cmdline-completion|)
|
||||
'wildchar' option
|
||||
command-line completion (see |cmdline-completion|)
|
||||
CTRL-N command-line completion (see |cmdline-completion|)
|
||||
CTRL-P command-line completion (see |cmdline-completion|)
|
||||
CTRL-A command-line completion (see |cmdline-completion|)
|
||||
CTRL-L command-line completion (see |cmdline-completion|)
|
||||
|
||||
*c_CTRL-_*
|
||||
CTRL-_ a - switch between Hebrew and English keyboard mode, which is
|
||||
private to the command-line and not related to hkmap.
|
||||
This is useful when Hebrew text entry is required in the
|
||||
command-line, searches, abbreviations, etc. Applies only if
|
||||
Vim is compiled with the |+rightleft| feature and the
|
||||
'allowrevins' option is set.
|
||||
See |rileft.txt|.
|
||||
|
||||
b - switch between Farsi and English keyboard mode, which is
|
||||
private to the command-line and not related to fkmap. In
|
||||
Farsi keyboard mode the characters are inserted in reverse
|
||||
insert manner. This is useful when Farsi text entry is
|
||||
required in the command-line, searches, abbreviations, etc.
|
||||
Applies only if Vim is compiled with the |+farsi| feature.
|
||||
See |farsi.txt|.
|
||||
|
||||
*c_CTRL-^*
|
||||
CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
|
||||
Method.
|
||||
When typing a pattern for a search command and 'imsearch' is
|
||||
not -1, VAL is the value of 'imsearch', otherwise VAL is the
|
||||
value of 'iminsert'.
|
||||
When language mappings are defined:
|
||||
- If VAL is 1 (langmap mappings used) it becomes 0 (no langmap
|
||||
mappings used).
|
||||
- If VAL was not 1 it becomes 1, thus langmap mappings are
|
||||
enabled.
|
||||
When no language mappings are defined:
|
||||
- If VAL is 2 (Input Method is used) it becomes 0 (no input
|
||||
method used)
|
||||
- If VAL has another value it becomes 2, thus the Input Method
|
||||
is enabled.
|
||||
These language mappings are normally used to type characters
|
||||
that are different from what the keyboard produces. The
|
||||
'keymap' option can be used to install a whole number of them.
|
||||
When entering a command line, langmap mappings are switched
|
||||
off, since you are expected to type a command. After
|
||||
switching it on with CTRL-^, the new state is not used again
|
||||
for the next command or Search pattern.
|
||||
{not in Vi}
|
||||
|
||||
For Emacs-style editing on the command-line see |emacs-keys|.
|
||||
|
||||
The <Up> and <Down> keys take the current command-line as a search string.
|
||||
The beginning of the next/previous command-lines are compared with this
|
||||
string. The first line that matches is the new command-line. When typing
|
||||
these two keys repeatedly, the same string is used again. For example, this
|
||||
can be used to find the previous substitute command: Type ":s" and then <Up>.
|
||||
The same could be done by typing <S-Up> a number of times until the desired
|
||||
command-line is shown. (Note: the shifted arrow keys do not work on all
|
||||
terminals)
|
||||
|
||||
*his* *:history*
|
||||
:his[tory] Print the history of last entered commands.
|
||||
{not in Vi}
|
||||
{not available when compiled without the |+cmdline_hist|
|
||||
feature}
|
||||
|
||||
:his[tory] [{name}] [{first}][, [{last}]]
|
||||
List the contents of history {name} which can be:
|
||||
c[md] or : command-line history
|
||||
s[earch] or / search string history
|
||||
e[xpr] or = expression register history
|
||||
i[nput] or @ input line history
|
||||
a[ll] all of the above
|
||||
{not in Vi}
|
||||
|
||||
If the numbers {first} and/or {last} are given, the respective
|
||||
range of entries from a history is listed. These numbers can
|
||||
be specified in the following form:
|
||||
*:history-indexing*
|
||||
A positive number represents the absolute index of an entry
|
||||
as it is given in the first column of a :history listing.
|
||||
This number remains fixed even if other entries are deleted.
|
||||
|
||||
A negative number means the relative position of an entry,
|
||||
counted from the newest entry (which has index -1) backwards.
|
||||
|
||||
Examples:
|
||||
List entries 6 to 12 from the search history: >
|
||||
:history / 6,12
|
||||
<
|
||||
List the recent five entries from all histories: >
|
||||
:history all -5,
|
||||
|
||||
==============================================================================
|
||||
2. Command-line completion *cmdline-completion*
|
||||
|
||||
When editing the command-line, a few commands can be used to complete the
|
||||
word before the cursor. This is available for:
|
||||
|
||||
- Command names: At the start of the command-line.
|
||||
- Tags: Only after the ":tag" command.
|
||||
- File names: Only after a command that accepts a file name or a setting for
|
||||
an option that can be set to a file name. This is called file name
|
||||
completion.
|
||||
- Options: Only after the ":set" command.
|
||||
- Mappings: Only after a ":map" or similar command.
|
||||
- Variable and function names: Only after a ":if", ":call" or similar command.
|
||||
|
||||
When Vim was compiled with the |+cmdline_compl| feature disabled, only file
|
||||
names, directories and help items can be completed.
|
||||
|
||||
These are the commands that can be used:
|
||||
|
||||
*c_CTRL-D*
|
||||
CTRL-D List names that match the pattern in front of the cursor.
|
||||
When showing file names, directories are highlighted (see
|
||||
'highlight' option). Names where 'suffixes' matches are moved
|
||||
to the end.
|
||||
*c_CTRL-I* *c_wildchar* *c_<Tab>*
|
||||
'wildchar' option
|
||||
A match is done on the pattern in front of the cursor. The
|
||||
match (if there are several, the first match) is inserted
|
||||
in place of the pattern. (Note: does not work inside a
|
||||
macro, because <Tab> or <Esc> are mostly used as 'wildchar',
|
||||
and these have a special meaning in some macros.) When typed
|
||||
again and there were multiple matches, the next
|
||||
match is inserted. After the last match, the first is used
|
||||
again (wrap around).
|
||||
The behavior can be changed with the 'wildmode' option.
|
||||
*c_CTRL-N*
|
||||
CTRL-N After using 'wildchar' which got multiple matches, go to next
|
||||
match. Otherwise recall more recent command-line from history.
|
||||
<S-Tab> *c_CTRL-P* *c_<S-Tab>*
|
||||
CTRL-P After using 'wildchar' which got multiple matches, go to
|
||||
previous match. Otherwise recall older command-line from
|
||||
history. <S-Tab> only works with the GUI, on the Amiga and
|
||||
with MS-DOS.
|
||||
*c_CTRL-A*
|
||||
CTRL-A All names that match the pattern in front of the cursor are
|
||||
inserted.
|
||||
*c_CTRL-L*
|
||||
CTRL-L A match is done on the pattern in front of the cursor. If
|
||||
there is one match, it is inserted in place of the pattern.
|
||||
If there are multiple matches the longest common part is
|
||||
inserted in place of the pattern. If the result is shorter
|
||||
than the pattern, no completion is done.
|
||||
|
||||
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
|
||||
a previous version <Esc> was used). In the pattern standard wildcards '*' and
|
||||
'?' are accepted. '*' matches any string, '?' matches exactly one character.
|
||||
|
||||
If you like tcsh's autolist completion, you can use this mapping:
|
||||
:cnoremap X <C-L><C-D>
|
||||
(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
|
||||
This will find the longest match and then list all matching files.
|
||||
|
||||
If you like tcsh's autolist completion, you can use the 'wildmode' option to
|
||||
emulate it. For example, this mimics autolist=ambiguous:
|
||||
:set wildmode=longest,list
|
||||
This will find the longest match with the first 'wildchar', then list all
|
||||
matching files with the next.
|
||||
|
||||
*suffixes*
|
||||
For file name completion you can use the 'suffixes' option to set a priority
|
||||
between files with almost the same name. If there are multiple matches,
|
||||
those files with an extension that is in the 'suffixes' option are ignored.
|
||||
The default is ".bak,~,.o,.h,.info,.swp", which means that files ending in
|
||||
".bak", "~", ".o", ".h", ".info" and ".swp" are sometimes ignored. It is
|
||||
impossible to ignore suffixes with two dots. Examples:
|
||||
|
||||
pattern: files: match: ~
|
||||
test* test.c test.h test.o test.c
|
||||
test* test.h test.o test.h and test.o
|
||||
test* test.i test.h test.c test.i and test.c
|
||||
|
||||
If there is more than one matching file (after ignoring the ones matching
|
||||
the 'suffixes' option) the first file name is inserted. You can see that
|
||||
there is only one match when you type 'wildchar' twice and the completed
|
||||
match stays the same. You can get to the other matches by entering
|
||||
'wildchar', CTRL-N or CTRL-P. All files are included, also the ones with
|
||||
extensions matching the 'suffixes' option.
|
||||
|
||||
To completely ignore files with some extension use 'wildignore'.
|
||||
|
||||
The old value of an option can be obtained by hitting 'wildchar' just after
|
||||
the '='. For example, typing 'wildchar' after ":set dir=" will insert the
|
||||
current value of 'dir'. This overrules file name completion for the options
|
||||
that take a file name.
|
||||
|
||||
If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
|
||||
your .cshrc: >
|
||||
xmodmap -e "keysym Tab = Tab Find"
|
||||
And this in your .vimrc: >
|
||||
:cmap <Esc>[1~ <C-P>
|
||||
|
||||
==============================================================================
|
||||
3. Ex command-lines *cmdline-lines*
|
||||
|
||||
The Ex commands have a few specialties:
|
||||
|
||||
*:quote*
|
||||
'"' at the start of a line causes the whole line to be ignored. '"'
|
||||
after a command causes the rest of the line to be ignored. This can be used
|
||||
to add comments. Example: >
|
||||
:set ai "set 'autoindent' option
|
||||
It is not possible to add a comment to a shell command ":!cmd" or to the
|
||||
":map" command and friends, because they see the '"' as part of their
|
||||
argument.
|
||||
|
||||
*:bar* *:\bar*
|
||||
'|' can be used to separate commands, so you can give multiple commands in one
|
||||
line. If you want to use '|' in an argument, precede it with '\'.
|
||||
|
||||
These commands see the '|' as their argument, and can therefore not be
|
||||
followed by another command:
|
||||
:argdo
|
||||
:autocmd
|
||||
:bufdo
|
||||
:command
|
||||
:cscope
|
||||
:debug
|
||||
:folddoopen
|
||||
:folddoclosed
|
||||
:global
|
||||
:help
|
||||
:helpfind
|
||||
:make
|
||||
:normal
|
||||
:perl
|
||||
:perldo
|
||||
:promptfind
|
||||
:promptrepl
|
||||
:pyfile
|
||||
:python
|
||||
:registers
|
||||
:read !
|
||||
:scscope
|
||||
:tcl
|
||||
:tcldo
|
||||
:tclfile
|
||||
:vglobal
|
||||
:windo
|
||||
:write !
|
||||
:[range]!
|
||||
a user defined command without the "-bar" argument |:command|
|
||||
|
||||
Note that this is confusing (inherited from Vi): With ":g" the '|' is included
|
||||
in the command, with ":s" it is not.
|
||||
|
||||
To be able to use another command anyway, use the ":execute" command.
|
||||
Example (append the output of "ls" and jump to the first line): >
|
||||
:execute 'r !ls' | '[
|
||||
|
||||
There is one exception: When the 'b' flag is present in 'cpoptions', with the
|
||||
":map" and ":abbr" commands and friends CTRL-V needs to be used instead of
|
||||
'\'. You can also use "<Bar>" instead. See also |map_bar|.
|
||||
|
||||
Examples: >
|
||||
:!ls | wc view the output of two commands
|
||||
:r !ls | wc insert the same output in the text
|
||||
:%g/foo/p|> moves all matching lines one shiftwidth
|
||||
:%s/foo/bar/|> moves one line one shiftwidth
|
||||
:map q 10^V| map "q" to "10|"
|
||||
:map q 10\| map \ l map "q" to "10\" and map "\" to "l"
|
||||
(when 'b' is present in 'cpoptions')
|
||||
|
||||
You can also use <NL> to separate commands in the same way as with '|'. To
|
||||
insert a <NL> use CTRL-V CTRL-J. "^@" will be shown. Using '|' is the
|
||||
preferred method. But for external commands a <NL> must be used, because a
|
||||
'|' is included in the external command. To avoid the special meaning of <NL>
|
||||
it must be preceded with a backslash. Example: >
|
||||
:r !date<NL>-join
|
||||
This reads the current date into the file and joins it with the previous line.
|
||||
|
||||
Note that when the command before the '|' generates an error, the following
|
||||
commands will not be executed.
|
||||
|
||||
|
||||
Because of Vi compatibility the following strange commands are supported: >
|
||||
:| print current line (like ":p")
|
||||
:3| print line 3 (like ":3p")
|
||||
:3 goto line 3
|
||||
|
||||
A colon is allowed between the range and the command name. It is ignored
|
||||
(this is Vi compatible). For example: >
|
||||
:1,$:s/pat/string
|
||||
|
||||
When the character '%' or '#' is used where a file name is expected, they are
|
||||
expanded to the current and alternate file name (see the chapter "editing
|
||||
files" |:_%| |:_#|).
|
||||
|
||||
Embedded spaces in file names are allowed on the Amiga if one file name is
|
||||
expected as argument. Trailing spaces will be ignored, unless escaped with a
|
||||
backslash or CTRL-V. Note that the ":next" command uses spaces to separate
|
||||
file names. Escape the spaces to include them in a file name. Example: >
|
||||
:next foo\ bar goes\ to school\
|
||||
starts editing the three files "foo bar", "goes to" and "school ".
|
||||
|
||||
When you want to use the special characters '"' or '|' in a command, or want
|
||||
to use '%' or '#' in a file name, precede them with a backslash. The
|
||||
backslash is not required in a range and in the ":substitute" command.
|
||||
|
||||
*:_!*
|
||||
The '!' (bang) character after an Ex command makes the command behave in a
|
||||
different way. The '!' should be placed immediately after the command, without
|
||||
any blanks in between. If you insert blanks the '!' will be seen as an
|
||||
argument for the command, which has a different meaning. For example:
|
||||
:w! name write the current buffer to file "name", overwriting
|
||||
any existing file
|
||||
:w !name send the current buffer as standard input to command
|
||||
"name"
|
||||
|
||||
==============================================================================
|
||||
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16*
|
||||
|
||||
Some Ex commands accept a line range in front of them. This is noted as
|
||||
[range]. It consists of one or more line specifiers, separated with ',' or
|
||||
';'.
|
||||
|
||||
The basics are explained in section |10.3| of the user manual.
|
||||
|
||||
*:,* *:;*
|
||||
When separated with ';' the cursor position will be set to that line
|
||||
before interpreting the next line specifier. This doesn't happen for ','.
|
||||
Examples: >
|
||||
4,/this line/
|
||||
< from line 4 till match with "this line" after the cursor line. >
|
||||
5;/that line/
|
||||
< from line 5 till match with "that line" after line 5.
|
||||
|
||||
The default line specifier for most commands is the cursor position, but the
|
||||
commands ":write" and ":global" have the whole file (1,$) as default.
|
||||
|
||||
If more line specifiers are given than required for the command, the first
|
||||
one(s) will be ignored.
|
||||
|
||||
Line numbers may be specified with: *:range* *E14* *{address}*
|
||||
{number} an absolute line number
|
||||
. the current line *:.*
|
||||
$ the last line in the file *:$*
|
||||
% equal to 1,$ (the entire file) *:%*
|
||||
't position of mark t (lowercase) *:'*
|
||||
/{pattern}[/] the next line where {pattern} matches *:/*
|
||||
?{pattern}[?] the previous line where {pattern} matches *:?*
|
||||
\/ the next line where the previously used search
|
||||
pattern matches
|
||||
\? the previous line where the previously used search
|
||||
pattern matches
|
||||
\& the next line where the previously used substitute
|
||||
pattern matches
|
||||
|
||||
Each may be followed (several times) by '+' or '-' and an optional number.
|
||||
This number is added or subtracted from the preceding line number. If the
|
||||
number is omitted, 1 is used.
|
||||
|
||||
The "/" and "?" after {pattern} are required to separate the pattern from
|
||||
anything that follows.
|
||||
|
||||
The "/" and "?" may be preceded with another address. The search starts from
|
||||
there. The difference from using ';' is that the cursor isn't moved.
|
||||
Examples: >
|
||||
/pat1//pat2/ Find line containing "pat2" after line containing
|
||||
"pat1", without moving the cursor.
|
||||
7;/pat2/ Find line containing "pat2", after line 7, leaving
|
||||
the cursor in line 7.
|
||||
|
||||
The {number} must be between 0 and the number of lines in the file. When
|
||||
using a 0 (zero) this is interpreted as a 1 by most commands. Commands that
|
||||
use it as a count do use it as a zero (|:tag|, |:pop|, etc). Some commands
|
||||
interpret the zero as "before the first line" (|:read|, search pattern, etc).
|
||||
|
||||
Examples: >
|
||||
.+3 three lines below the cursor
|
||||
/that/+1 the line below the next line containing "that"
|
||||
.,$ from current line until end of file
|
||||
0;/that the first line containing "that", also matches in the
|
||||
first line.
|
||||
1;/that the first line after line 1 containing "that"
|
||||
|
||||
Some commands allow for a count after the command. This count is used as the
|
||||
number of lines to be used, starting with the line given in the last line
|
||||
specifier (the default is the cursor line). The commands that accept a count
|
||||
are the ones that use a range but do not have a file name argument (because
|
||||
a file name can also be a number).
|
||||
|
||||
Examples: >
|
||||
:s/x/X/g 5 substitute 'x' by 'X' in the current line and four
|
||||
following lines
|
||||
:23d 4 delete lines 23, 24, 25 and 26
|
||||
|
||||
A range should have the lower line number first. If this is not the case, Vim
|
||||
will ask you if it should swap the line numbers. This is not done within the
|
||||
global command ":g".
|
||||
|
||||
*N:*
|
||||
When giving a count before entering ":", this is translated into:
|
||||
:.,.+(count - 1)
|
||||
In words: The 'count' lines at and after the cursor. Example: To delete
|
||||
three lines: >
|
||||
3:d<CR> is translated into: .,.+2d<CR>
|
||||
<
|
||||
*v_:*
|
||||
{Visual}: Starts a command-line with the Visual selected lines as a
|
||||
range. The code ":'<,'>" is used for this range, which makes
|
||||
it possible to select a similar line from the command-line
|
||||
history for repeating a command on different Visually selected
|
||||
lines.
|
||||
|
||||
==============================================================================
|
||||
5. Ex special characters *cmdline-special*
|
||||
|
||||
In Ex commands, at places where a file name can be used, the following
|
||||
characters have a special meaning. These can also be used in the expression
|
||||
function expand() |expand()|.
|
||||
% is replaced with the current file name *:_%*
|
||||
# is replaced with the alternate file name *:_#*
|
||||
#n (where n is a number) is replaced with the file name of
|
||||
buffer n. "#0" is the same as "#"
|
||||
## is replaced with all names in the argument list *:_##*
|
||||
concatenated, separated by spaces. Each space in a name
|
||||
is preceded with a backslash.
|
||||
Note that these give the file name as it was typed. If an absolute path is
|
||||
needed (when using the file name from a different directory), you need to add
|
||||
":p". See |filename-modifiers|.
|
||||
|
||||
To avoid the special meaning of '%' and '#' insert a backslash before it.
|
||||
Detail: The special meaning is always escaped when there is a backslash before
|
||||
it, no matter how many backslashes.
|
||||
you type: result ~
|
||||
# alternate.file
|
||||
\# #
|
||||
\\# \#
|
||||
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
|
||||
Note: these are typed literally, they are not special keys!
|
||||
<cword> is replaced with the word under the cursor (like |star|)
|
||||
<cWORD> is replaced with the WORD under the cursor (see |WORD|)
|
||||
<cfile> is replaced with the path name under the cursor (like what
|
||||
|gf| uses)
|
||||
<afile> when executing autocommands, is replaced with the file name
|
||||
for a file read or write
|
||||
<abuf> when executing autocommands, is replaced with the currently
|
||||
effective buffer number (for ":r file" it is the current
|
||||
buffer, the file being read is not in a buffer).
|
||||
<amatch> when executing autocommands, is replaced with the match for
|
||||
which this autocommand was executed. It differs form
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType and Syntax events).
|
||||
<sfile> when executing a ":source" command, is replaced with the
|
||||
file name of the sourced file;
|
||||
when executing a function, is replaced with
|
||||
"function {function-name}"; function call nesting is
|
||||
indicated like this:
|
||||
"function {function-name1}->{function-name2}". Note that
|
||||
filename-modifiers are useless when <sfile> is used inside
|
||||
a function.
|
||||
|
||||
*filename-modifiers*
|
||||
*:_%:* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs*
|
||||
The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
|
||||
"<afile>" or "<abuf>". They are also used with the |fnamemodify()| function.
|
||||
These are not available when Vim has been compiled without the |+modify_fname|
|
||||
feature.
|
||||
These modifiers can be given, in this order:
|
||||
:p Make file name a full path. Must be the first modifier. Also
|
||||
changes "~/" (and "~user/" for Unix and VMS) to the path for
|
||||
the home directory. If the name is a directory a path
|
||||
separator is added at the end. For a file name that does not
|
||||
exist and does not have an absolute path the result is
|
||||
unpredictable.
|
||||
:~ Reduce file name to be relative to the home directory, if
|
||||
possible. File name is unmodified if it is not below the home
|
||||
directory.
|
||||
:. Reduce file name to be relative to current directory, if
|
||||
possible. File name is unmodified if it is not below the
|
||||
current directory.
|
||||
For maximum shortness, use ":~:.".
|
||||
:h Head of the file name (the last component and any separators
|
||||
removed). Cannot be used with :e, :r or :t.
|
||||
Can be repeated to remove several components at the end.
|
||||
When the file name ends in a path separator, only the path
|
||||
separator is removed. Thus ":p:h" on a directory name results
|
||||
on the directory name itself (without trailing slash).
|
||||
When the file name is an absolute path (starts with "/" for
|
||||
Unix; "x:\" for MS-DOS, WIN32, OS/2; "drive:" for Amiga), that
|
||||
part is not removed. When there is no head (path is relative
|
||||
to current directory) the result is empty.
|
||||
:t Tail of the file name (last component of the name). Must
|
||||
precede any :r or :e.
|
||||
:r Root of the file name (the last extension removed). When
|
||||
there is only an extension (file name that starts with '.',
|
||||
e.g., ".vimrc"), it is not removed. Can be repeated to remove
|
||||
several extensions (last one first).
|
||||
:e Extension of the file name. Only makes sense when used alone.
|
||||
When there is no extension the result is empty.
|
||||
When there is only an extension (file name that starts with
|
||||
'.'), the result is empty. Can be repeated to include more
|
||||
extensions. If there are not enough extensions (but at least
|
||||
one) as much as possible are included.
|
||||
:s?pat?sub?
|
||||
Substitute the first occurrence of "pat" with "sub". This
|
||||
works like the |:s| command. "pat" is a regular expression.
|
||||
Any character can be used for '?', but it must not occur in
|
||||
"pat" or "sub".
|
||||
After this, the previous modifiers can be used again. For
|
||||
example ":p", to make a full path after the substitution.
|
||||
:gs?pat?sub?
|
||||
Substitute all occurrences of "path" with "sub". Otherwise
|
||||
this works like ":s".
|
||||
|
||||
Examples, when the file name is "src/version.c", current dir
|
||||
"/home/mool/vim": >
|
||||
:p /home/mool/vim/src/version.c
|
||||
:p:. src/version.c
|
||||
:p:~ ~/vim/src/version.c
|
||||
:h src
|
||||
:p:h /home/mool/vim/src
|
||||
:p:h:h /home/mool/vim
|
||||
:t version.c
|
||||
:p:t version.c
|
||||
:r src/version
|
||||
:p:r /home/mool/vim/src/version
|
||||
:t:r version
|
||||
:e c
|
||||
:s?version?main? src/main.c
|
||||
:s?version?main?:p /home/mool/vim/src/main.c
|
||||
:p:gs?/?\\? \home\mool\vim\src\version.c
|
||||
|
||||
Examples, when the file name is "src/version.c.gz": >
|
||||
:p /home/mool/vim/src/version.c.gz
|
||||
:e gz
|
||||
:e:e c.gz
|
||||
:e:e:e c.gz
|
||||
:e:e:r c
|
||||
:r src/version.c
|
||||
:r:e c
|
||||
:r:r src/version
|
||||
:r:r:r src/version
|
||||
<
|
||||
*extension-removal* *:_%<*
|
||||
If a "<" is appended to "%", "#", "#n" or "CTRL-V p" the extension of the file
|
||||
name is removed (everything after and including the last '.' in the file
|
||||
name). This is included for backwards compatibility with version 3.0, the
|
||||
":r" form is preferred. Examples: >
|
||||
|
||||
% current file name
|
||||
%< current file name without extension
|
||||
# alternate file name for current window
|
||||
#< idem, without extension
|
||||
#31 alternate file number 31
|
||||
#31< idem, without extension
|
||||
<cword> word under the cursor
|
||||
<cWORD> WORD under the cursor (see |WORD|)
|
||||
<cfile> path name under the cursor
|
||||
<cfile>< idem, without extension
|
||||
|
||||
Note: Where a file name is expected wildcards expansion is done. On Unix the
|
||||
shell is used for this, unless it can be done internally (for speed).
|
||||
Backticks also work, like in >
|
||||
:n `echo *.c`
|
||||
(backtick expansion is not possible in |restricted-mode|)
|
||||
But expansion is only done if there are any wildcards before expanding the
|
||||
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
|
||||
want to expand the result of <cfile>, add a wildcard character to it.
|
||||
Examples: (alternate file name is "?readme?")
|
||||
command expands to ~
|
||||
:e # :e ?readme?
|
||||
:e `ls #` :e {files matching "?readme?"}
|
||||
:e #.* :e {files matching "?readme?.*"}
|
||||
:cd <cfile> :cd {file name under cursor}
|
||||
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
|
||||
|
||||
When the expanded argument contains a "!" and it is used for a shell command
|
||||
(":!cmd", ":r !cmd" or ":w !cmd"), it is escaped with a backslash to avoid it
|
||||
being expanded into a previously used command. When the 'shell' option
|
||||
contains "sh", this is done twice, to avoid the shell trying to expand the
|
||||
"!".
|
||||
|
||||
*filename-backslash*
|
||||
For filesystems that use a backslash as directory separator (MS-DOS, Windows,
|
||||
OS/2), it's a bit difficult to recognize a backslash that is used to escape
|
||||
the special meaning of the next character. The general rule is: If the
|
||||
backslash is followed by a normal file name character, it does not have a
|
||||
special meaning. Therefore "\file\foo" is a valid file name, you don't have
|
||||
to type the backslash twice.
|
||||
|
||||
An exception is the '$' sign. It is a valid character in a file name. But
|
||||
to avoid a file name like "$home" to be interpreted as an environment variable,
|
||||
it needs to be preceded by a backslash. Therefore you need to use "/\$home"
|
||||
for the file "$home" in the root directory. A few examples:
|
||||
|
||||
FILE NAME INTERPRETED AS ~
|
||||
$home expanded to value of environment var $home
|
||||
\$home file "$home" in current directory
|
||||
/\$home file "$home" in root directory
|
||||
\\$home file "\\", followed by expanded $home
|
||||
|
||||
==============================================================================
|
||||
6. Command-line window *cmdline-window* *cmdwin*
|
||||
|
||||
In the command-line window the command line can be edited just like editing
|
||||
text in any window. It is a special kind of window, because you cannot leave
|
||||
it in a normal way.
|
||||
{not available when compiled without the |+cmdline_hist| or |+vertsplit|
|
||||
feature}
|
||||
|
||||
|
||||
OPEN
|
||||
|
||||
There are two ways to open the command-line window:
|
||||
1. From Command-line mode, use the key specified with the 'cedit' option.
|
||||
The default is CTRL-F when 'compatible' is not set.
|
||||
2. From Normal mode, use the "q:", "q/" or "q?" command. *q:* *q/* *q?*
|
||||
This starts editing an Ex command-line ("q:") or search string ("q/" or
|
||||
"q?"). Note that this is not possible while recording is in progress (the
|
||||
"q" stops recording then).
|
||||
|
||||
When the window opens it is filled with the command-line history. The last
|
||||
line contains the command as typed so far. The left column will show a
|
||||
character that indicates the type of command-line being edited, see
|
||||
|cmdwin-char|.
|
||||
|
||||
Vim will be in Normal mode when the editor is opened, except when 'insertmode'
|
||||
is set.
|
||||
|
||||
The height of the window is specified with 'cmdwinheight' (or smaller if there
|
||||
is no room). The window is always full width and is positioned just above the
|
||||
command-line.
|
||||
|
||||
|
||||
EDIT
|
||||
|
||||
You can now use commands to move around and edit the text in the window. Both
|
||||
in Normal mode and Insert mode.
|
||||
|
||||
It is possible to use ":", "/" and other commands that use the command-line,
|
||||
but it's not possible to open another command-line window then. There is no
|
||||
nesting.
|
||||
*E11*
|
||||
It is not possible to move to another window or edit another buffer. All
|
||||
commands that would do this are disabled in the command-line window.
|
||||
|
||||
|
||||
CLOSE *E199*
|
||||
|
||||
There are three ways to leave the command-line window:
|
||||
|
||||
<CR> Execute the command-line under the cursor. Works both in
|
||||
Insert and in Normal mode.
|
||||
CTRL-C Continue in Command-line mode. The command-line under the
|
||||
cursor is used as the command-line. Works both in Insert and
|
||||
in Normal mode. ":close" also works. There is no redraw,
|
||||
thus the window will remain visible.
|
||||
:quit Discard the command line and go back to Normal mode.
|
||||
":exit", ":xit" and CTRL-\ CTRL-N also work.
|
||||
:qall Quit Vim, unless there are changes in some buffer.
|
||||
:qall! Quit Vim, discarding changes to any buffer.
|
||||
|
||||
Once the command-line window is closed the old window sizes are restored. The
|
||||
executed command applies to the window and buffer where the command-line was
|
||||
started from. This works as if the command-line window was not there, except
|
||||
that there will be an extra screen redraw.
|
||||
The buffer used for the command-line window is deleted. Any changes to lines
|
||||
other than the one that is executed with <CR> are lost.
|
||||
|
||||
|
||||
VARIOUS
|
||||
|
||||
The command-line window cannot be used:
|
||||
- when there already is a command-line window (no nesting)
|
||||
- for entering a encryption key or when using inputsecret()
|
||||
- when Vim was not compiled with the +vertsplit feature
|
||||
|
||||
Some options are set when the command-line window is opened:
|
||||
'filetype' "vim", when editing an Ex command-line; this starts Vim syntax
|
||||
highlighting if it was enabled
|
||||
'rightleft' off
|
||||
'modifiable' on
|
||||
'buftype' "nofile"
|
||||
'swapfile' off
|
||||
|
||||
It is allowed to write the buffer contents to a file. This is an easy way to
|
||||
save the command-line history and read it back later.
|
||||
|
||||
If the 'wildchar' option is set to <Tab>, and the command-line window is used
|
||||
for an Ex command, then two mappings will be added to use <Tab> for completion
|
||||
in the command-line window, like this: >
|
||||
:imap <buffer> <Tab> <C-X><C-V>
|
||||
:nmap <buffer> <Tab> a<C-X><C-V>
|
||||
Note that hitting <Tab> in Normal mode will do completion on the next
|
||||
character. That way it works at the end of the line.
|
||||
If you don't want these mappings, disable them with: >
|
||||
au CmdwinEnter [:>] iunmap <Tab>
|
||||
au CmdwinEnter [:>] nunmap <Tab>
|
||||
You could put these lines in your vimrc file.
|
||||
|
||||
While in the command-line window you cannot use the mouse to put the cursor in
|
||||
another window, or drag statuslines of other windows. You can drag the
|
||||
statusline of the command-line window itself. If you drag it all the way up,
|
||||
the statusline of the window above it will move, thus creating more room in
|
||||
the command-line window.
|
||||
|
||||
|
||||
AUTOCOMMANDS
|
||||
|
||||
Two autocommand events are used: |CmdwinEnter| and |CmdwinLeave|. Since this
|
||||
window is of a special type, the WinEnter, WinLeave, BufEnter and BufLeave
|
||||
events are not triggered. You can use the Cmdwin events to do settings
|
||||
specifically for the command-line window. Be careful not to cause side
|
||||
effects!
|
||||
Example: >
|
||||
:au CmdwinEnter : let b:cpt_save = &cpt | set cpt=v
|
||||
:au CmdwinLeave : let &cpt = b:cpt_save
|
||||
This sets 'complete' to use command-line completion in Insert mode for CTRL-N.
|
||||
Another example: >
|
||||
:au CmdwinEnter [/?] startinsert
|
||||
This will make Vim start in Insert mode in the command-line window.
|
||||
|
||||
*cmdwin-char*
|
||||
The character used for the pattern indicates the type of command-line:
|
||||
: normal Ex command
|
||||
> debug mode command |debug-mode|
|
||||
/ forward search string
|
||||
? backward search string
|
||||
= expression for "= |expr-register|
|
||||
@ string for |input()|
|
||||
- text for |:insert| or |:append|
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
322
docs/vim/todo/digraph.txt
Normal file
322
docs/vim/todo/digraph.txt
Normal file
@ -0,0 +1,322 @@
|
||||
*digraph.txt* For Vim version 6.1. Last change: 2001 Sep 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Digraphs *digraphs* *Digraphs*
|
||||
|
||||
Digraphs are used to enter characters that normally cannot be entered by
|
||||
an ordinary keyboard. These are mostly accented characters which have the
|
||||
eighth bit set. The digraphs are easier to remember than the decimal number
|
||||
that can be entered with CTRL-V (see |i_CTRL-V|).
|
||||
|
||||
There is a brief introduction on digraphs in the user manual: |24.9|
|
||||
An alternative is using the 'keymap' option.
|
||||
|
||||
1. Defining digraphs |digraphs-define|
|
||||
2. Using digraphs |digraphs-use|
|
||||
3. Default digraphs |digraphs-default|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Defining digraphs *digraphs-define*
|
||||
|
||||
*:dig* *:digraphs*
|
||||
:dig[raphs] show currently defined digraphs.
|
||||
*E104* *E39*
|
||||
:dig[raphs] {char1}{char2} {number} ...
|
||||
Add digraph {char1}{char2} to the list. {number} is
|
||||
the decimal representation of the character.
|
||||
Example: >
|
||||
:digr e: 235 a: 228
|
||||
< Avoid defining a digraph with '_' (underscore) as the
|
||||
first character, it has a special meaning in the
|
||||
future.
|
||||
|
||||
Vim is normally compiled with the |+digraphs| feature. If the feature is
|
||||
disabled, the ":digraph" command will display an error message.
|
||||
|
||||
Example of the output of ":digraphs": >
|
||||
TH Þ 222 ss ß 223 a! à 224 a' á 225 a> â 226 a? ã 227 a: ä 228
|
||||
|
||||
The first two characters in each column are the characters you have to type to
|
||||
enter the digraph.
|
||||
|
||||
In the middle of each column is the resulting character. This may be mangled
|
||||
if you look at it on a system that does not support digraphs or if you print
|
||||
this file.
|
||||
|
||||
The decimal number is the number of the character.
|
||||
|
||||
==============================================================================
|
||||
2. Using digraphs *digraphs-use*
|
||||
|
||||
There are two methods to enter digraphs: *i_digraph*
|
||||
CTRL-K {char1} {char2} or
|
||||
{char1} <BS> {char2}
|
||||
The first is always available; the second only when the 'digraph' option is
|
||||
set.
|
||||
|
||||
If a digraph with {char1}{char2} does not exist, Vim searches for a digraph
|
||||
{char2}{char1}. This helps when you don't remember which character comes
|
||||
first.
|
||||
|
||||
Note that when you enter CTRL-K {char1}, where {char1} is a special key, Vim
|
||||
enters the code for that special key. This is not a digraph.
|
||||
|
||||
Once you have entered the digraph, Vim treats the character like a normal
|
||||
character that occupies only one character in the file and on the screen.
|
||||
Example: >
|
||||
'B' <BS> 'B' will enter the broken '|' character (166)
|
||||
'a' <BS> '>' will enter an 'a' with a circumflex (226)
|
||||
CTRL-K '-' '-' will enter a soft hyphen (173)
|
||||
|
||||
The current digraphs are listed with the ":digraphs" command. Some of the
|
||||
default ones are listed below |digraph-table|.
|
||||
|
||||
For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will enter
|
||||
{char} with the highest bit set. You can use this to enter meta-characters.
|
||||
|
||||
The <Esc> character cannot be part of a digraph. When hitting <Esc>, Vim
|
||||
stops digraph entry and ends Insert mode or Command-line mode, just like
|
||||
hitting an <Esc> out of digraph context. Use CTRL-V 155 to enter meta-ESC
|
||||
(CSI).
|
||||
|
||||
If you accidentally typed an 'a' that should be an 'e', you will type 'a' <BS>
|
||||
'e'. But that is a digraph, so you will not get what you want. To correct
|
||||
this, you will have to type <BS> e again. To avoid this don't set the
|
||||
'digraph' option and use CTRL-K to enter digraphs.
|
||||
|
||||
You may have problems using Vim with characters which have an ASCII value
|
||||
above 128. For example: You insert ue (u-umlaut) and the editor echoes \334
|
||||
in Insert mode. After leaving the Insert mode everything is fine. Note that
|
||||
fmt removes all characters with ASCII codes above 128 from the text being
|
||||
formatted. On some Unix systems this means you have to define the
|
||||
environment-variable LC_CTYPE. If you are using csh, then put the following
|
||||
line in your .cshrc: >
|
||||
setenv LC_CTYPE iso_8859_1
|
||||
|
||||
==============================================================================
|
||||
3. Default digraphs *digraphs-default*
|
||||
|
||||
Vim comes with a set of default digraphs. Check the output of ":digraphs" to
|
||||
see them.
|
||||
|
||||
On most systems Vim uses the same digraphs. They work for the Unicode and
|
||||
ISO-8859-1 character sets. These default digraphs are taken from the RFC1345
|
||||
mnemonics. To make it easy to remember the mnemonic, the second character has
|
||||
a standard meaning:
|
||||
|
||||
char name char meaning ~
|
||||
Exclamation mark ! Grave
|
||||
Apostrophe ' Acute accent
|
||||
Greater-Than sign > Circumflex accent
|
||||
Question Mark ? tilde
|
||||
Hyphen-Minus - Macron
|
||||
Left parenthesis ( Breve
|
||||
Full Stop . Dot Above
|
||||
Colon : Diaeresis
|
||||
Comma , Cedilla
|
||||
Underline _ Underline
|
||||
Solidus / Stroke
|
||||
Quotation mark " Double acute accent
|
||||
Semicolon ; Ogonek
|
||||
Less-Than sign < Caron
|
||||
Zero 0 Ring above
|
||||
Two 2 Hook
|
||||
Nine 9 Horn
|
||||
|
||||
Equals = Cyrillic
|
||||
Asterisk * Greek
|
||||
Percent sign % Greek/Cyrillic special
|
||||
Plus + smalls: Arabic, capitals: Hebrew
|
||||
Three 3 some Latin/Greek/Cyrillic letters
|
||||
Four 4 Bopomofo
|
||||
Five 5 Hiragana
|
||||
Six 6 Katakana
|
||||
|
||||
Example: a: is ä and o: is ö
|
||||
|
||||
These are the RFC1345 digraphs for the one-byte characters. See the output of
|
||||
":digraphs" for the others. The characters above 255 are only available when
|
||||
Vim was compiled with the |+multi_byte| feature.
|
||||
*digraph-table*
|
||||
char digraph hex dec official name ~
|
||||
^@ NU 0x00 0 NULL (NUL)
|
||||
^A SH 0x01 1 START OF HEADING (SOH)
|
||||
^B SX 0x02 2 START OF TEXT (STX)
|
||||
^C EX 0x03 3 END OF TEXT (ETX)
|
||||
^D ET 0x04 4 END OF TRANSMISSION (EOT)
|
||||
^E EQ 0x05 5 ENQUIRY (ENQ)
|
||||
^F AK 0x06 6 ACKNOWLEDGE (ACK)
|
||||
^G BL 0x07 7 BELL (BEL)
|
||||
^H BS 0x08 8 BACKSPACE (BS)
|
||||
^I HT 0x09 9 CHARACTER TABULATION (HT)
|
||||
^@ LF 0x0a 10 LINE FEED (LF)
|
||||
^K VT 0x0b 11 LINE TABULATION (VT)
|
||||
^L FF 0x0c 12 FORM FEED (FF)
|
||||
^M CR 0x0d 13 CARRIAGE RETURN (CR)
|
||||
^N SO 0x0e 14 SHIFT OUT (SO)
|
||||
^O SI 0x0f 15 SHIFT IN (SI)
|
||||
^P DL 0x10 16 DATALINK ESCAPE (DLE)
|
||||
^Q D1 0x11 17 DEVICE CONTROL ONE (DC1)
|
||||
^R D2 0x12 18 DEVICE CONTROL TWO (DC2)
|
||||
^S D3 0x13 19 DEVICE CONTROL THREE (DC3)
|
||||
^T D4 0x14 20 DEVICE CONTROL FOUR (DC4)
|
||||
^U NK 0x15 21 NEGATIVE ACKNOWLEDGE (NAK)
|
||||
^V SY 0x16 22 SYNCRONOUS IDLE (SYN)
|
||||
^W EB 0x17 23 END OF TRANSMISSION BLOCK (ETB)
|
||||
^X CN 0x18 24 CANCEL (CAN)
|
||||
^Y EM 0x19 25 END OF MEDIUM (EM)
|
||||
^Z SB 0x1a 26 SUBSTITUTE (SUB)
|
||||
^[ EC 0x1b 27 ESCAPE (ESC)
|
||||
^\ FS 0x1c 28 FILE SEPARATOR (IS4)
|
||||
^] GS 0x1d 29 GROUP SEPARATOR (IS3)
|
||||
^^ RS 0x1e 30 RECORD SEPARATOR (IS2)
|
||||
^_ US 0x1f 31 UNIT SEPARATOR (IS1)
|
||||
SP 0x20 32 SPACE
|
||||
# Nb 0x23 35 NUMBER SIGN
|
||||
$ DO 0x24 36 DOLLAR SIGN
|
||||
@ At 0x40 64 COMMERCIAL AT
|
||||
[ <( 0x5b 91 LEFT SQUARE BRACKET
|
||||
\ // 0x5c 92 REVERSE SOLIDUS
|
||||
] )> 0x5d 93 RIGHT SQUARE BRACKET
|
||||
^ '> 0x5e 94 CIRCUMFLEX ACCENT
|
||||
` '! 0x60 96 GRAVE ACCENT
|
||||
{ (! 0x7b 123 LEFT CURLY BRACKET
|
||||
| !! 0x7c 124 VERTICAL LINE
|
||||
} !) 0x7d 125 RIGHT CURLY BRACKET
|
||||
~ '? 0x7e 126 TILDE
|
||||
^? DT 0x7f 127 DELETE (DEL)
|
||||
~@ PA 0x80 128 PADDING CHARACTER (PAD)
|
||||
~A HO 0x81 129 HIGH OCTET PRESET (HOP)
|
||||
~B BH 0x82 130 BREAK PERMITTED HERE (BPH)
|
||||
~C NH 0x83 131 NO BREAK HERE (NBH)
|
||||
~D IN 0x84 132 INDEX (IND)
|
||||
~E NL 0x85 133 NEXT LINE (NEL)
|
||||
~F SA 0x86 134 START OF SELECTED AREA (SSA)
|
||||
~G ES 0x87 135 END OF SELECTED AREA (ESA)
|
||||
~H HS 0x88 136 CHARACTER TABULATION SET (HTS)
|
||||
~I HJ 0x89 137 CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
|
||||
~J VS 0x8a 138 LINE TABULATION SET (VTS)
|
||||
~K PD 0x8b 139 PARTIAL LINE FORWARD (PLD)
|
||||
~L PU 0x8c 140 PARTIAL LINE BACKWARD (PLU)
|
||||
~M RI 0x8d 141 REVERSE LINE FEED (RI)
|
||||
~N S2 0x8e 142 SINGLE-SHIFT TWO (SS2)
|
||||
~O S3 0x8f 143 SINGLE-SHIFT THREE (SS3)
|
||||
~P DC 0x90 144 DEVICE CONTROL STRING (DCS)
|
||||
~Q P1 0x91 145 PRIVATE USE ONE (PU1)
|
||||
~R P2 0x92 146 PRIVATE USE TWO (PU2)
|
||||
~S TS 0x93 147 SET TRANSMIT STATE (STS)
|
||||
~T CC 0x94 148 CANCEL CHARACTER (CCH)
|
||||
~U MW 0x95 149 MESSAGE WAITING (MW)
|
||||
~V SG 0x96 150 START OF GUARDED AREA (SPA)
|
||||
~W EG 0x97 151 END OF GUARDED AREA (EPA)
|
||||
~X SS 0x98 152 START OF STRING (SOS)
|
||||
~Y GC 0x99 153 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
|
||||
~Z SC 0x9a 154 SINGLE CHARACTER INTRODUCER (SCI)
|
||||
~[ CI 0x9b 155 CONTROL SEQUENCE INTRODUCER (CSI)
|
||||
~\ ST 0x9c 156 STRING TERMINATOR (ST)
|
||||
~] OC 0x9d 157 OPERATING SYSTEM COMMAND (OSC)
|
||||
~^ PM 0x9e 158 PRIVACY MESSAGE (PM)
|
||||
~_ AC 0x9f 159 APPLICATION PROGRAM COMMAND (APC)
|
||||
| NS 0xa0 160 NO-BREAK SPACE
|
||||
¡ !I 0xa1 161 INVERTED EXCLAMATION MARK
|
||||
¢ Ct 0xa2 162 CENT SIGN
|
||||
£ Pd 0xa3 163 POUND SIGN
|
||||
¤ Cu 0xa4 164 CURRENCY SIGN
|
||||
¥ Ye 0xa5 165 YEN SIGN
|
||||
¦ BB 0xa6 166 BROKEN BAR
|
||||
§ SE 0xa7 167 SECTION SIGN
|
||||
¨ ': 0xa8 168 DIAERESIS
|
||||
© Co 0xa9 169 COPYRIGHT SIGN
|
||||
ª -a 0xaa 170 FEMININE ORDINAL INDICATOR
|
||||
« << 0xab 171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
¬ NO 0xac 172 NOT SIGN
|
||||
-- 0xad 173 SOFT HYPHEN
|
||||
® Rg 0xae 174 REGISTERED SIGN
|
||||
¯ 'm 0xaf 175 MACRON
|
||||
° DG 0xb0 176 DEGREE SIGN
|
||||
± +- 0xb1 177 PLUS-MINUS SIGN
|
||||
² 2S 0xb2 178 SUPERSCRIPT TWO
|
||||
³ 3S 0xb3 179 SUPERSCRIPT THREE
|
||||
´ '' 0xb4 180 ACUTE ACCENT
|
||||
µ My 0xb5 181 MICRO SIGN
|
||||
¶ PI 0xb6 182 PILCROW SIGN
|
||||
· .M 0xb7 183 MIDDLE DOT
|
||||
¸ ', 0xb8 184 CEDILLA
|
||||
¹ 1S 0xb9 185 SUPERSCRIPT ONE
|
||||
º -o 0xba 186 MASCULINE ORDINAL INDICATOR
|
||||
» >> 0xbb 187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
¼ 14 0xbc 188 VULGAR FRACTION ONE QUARTER
|
||||
½ 12 0xbd 189 VULGAR FRACTION ONE HALF
|
||||
¾ 34 0xbe 190 VULGAR FRACTION THREE QUARTERS
|
||||
¿ ?I 0xbf 191 INVERTED QUESTION MARK
|
||||
À A! 0xc0 192 LATIN CAPITAL LETTER A WITH GRAVE
|
||||
Á A' 0xc1 193 LATIN CAPITAL LETTER A WITH ACUTE
|
||||
 A> 0xc2 194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
|
||||
à A? 0xc3 195 LATIN CAPITAL LETTER A WITH TILDE
|
||||
Ä A: 0xc4 196 LATIN CAPITAL LETTER A WITH DIAERESIS
|
||||
Å AA 0xc5 197 LATIN CAPITAL LETTER A WITH RING ABOVE
|
||||
Æ AE 0xc6 198 LATIN CAPITAL LETTER AE
|
||||
Ç C, 0xc7 199 LATIN CAPITAL LETTER C WITH CEDILLA
|
||||
È E! 0xc8 200 LATIN CAPITAL LETTER E WITH GRAVE
|
||||
É E' 0xc9 201 LATIN CAPITAL LETTER E WITH ACUTE
|
||||
Ê E> 0xca 202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
|
||||
Ë E: 0xcb 203 LATIN CAPITAL LETTER E WITH DIAERESIS
|
||||
Ì I! 0xcc 204 LATIN CAPITAL LETTER I WITH GRAVE
|
||||
Í I' 0xcd 205 LATIN CAPITAL LETTER I WITH ACUTE
|
||||
Î I> 0xce 206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
|
||||
Ï I: 0xcf 207 LATIN CAPITAL LETTER I WITH DIAERESIS
|
||||
Ð D- 0xd0 208 LATIN CAPITAL LETTER ETH (Icelandic)
|
||||
Ñ N? 0xd1 209 LATIN CAPITAL LETTER N WITH TILDE
|
||||
Ò O! 0xd2 210 LATIN CAPITAL LETTER O WITH GRAVE
|
||||
Ó O' 0xd3 211 LATIN CAPITAL LETTER O WITH ACUTE
|
||||
Ô O> 0xd4 212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
|
||||
Õ O? 0xd5 213 LATIN CAPITAL LETTER O WITH TILDE
|
||||
Ö O: 0xd6 214 LATIN CAPITAL LETTER O WITH DIAERESIS
|
||||
× *X 0xd7 215 MULTIPLICATION SIGN
|
||||
Ø O/ 0xd8 216 LATIN CAPITAL LETTER O WITH STROKE
|
||||
Ù U! 0xd9 217 LATIN CAPITAL LETTER U WITH GRAVE
|
||||
Ú U' 0xda 218 LATIN CAPITAL LETTER U WITH ACUTE
|
||||
Û U> 0xdb 219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
|
||||
Ü U: 0xdc 220 LATIN CAPITAL LETTER U WITH DIAERESIS
|
||||
Ý Y' 0xdd 221 LATIN CAPITAL LETTER Y WITH ACUTE
|
||||
Þ TH 0xde 222 LATIN CAPITAL LETTER THORN (Icelandic)
|
||||
ß ss 0xdf 223 LATIN SMALL LETTER SHARP S (German)
|
||||
à a! 0xe0 224 LATIN SMALL LETTER A WITH GRAVE
|
||||
á a' 0xe1 225 LATIN SMALL LETTER A WITH ACUTE
|
||||
â a> 0xe2 226 LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
ã a? 0xe3 227 LATIN SMALL LETTER A WITH TILDE
|
||||
ä a: 0xe4 228 LATIN SMALL LETTER A WITH DIAERESIS
|
||||
å aa 0xe5 229 LATIN SMALL LETTER A WITH RING ABOVE
|
||||
æ ae 0xe6 230 LATIN SMALL LETTER AE
|
||||
ç c, 0xe7 231 LATIN SMALL LETTER C WITH CEDILLA
|
||||
è e! 0xe8 232 LATIN SMALL LETTER E WITH GRAVE
|
||||
é e' 0xe9 233 LATIN SMALL LETTER E WITH ACUTE
|
||||
ê e> 0xea 234 LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
ë e: 0xeb 235 LATIN SMALL LETTER E WITH DIAERESIS
|
||||
ì i! 0xec 236 LATIN SMALL LETTER I WITH GRAVE
|
||||
í i' 0xed 237 LATIN SMALL LETTER I WITH ACUTE
|
||||
î i> 0xee 238 LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
ï i: 0xef 239 LATIN SMALL LETTER I WITH DIAERESIS
|
||||
ð d- 0xf0 240 LATIN SMALL LETTER ETH (Icelandic)
|
||||
ñ n? 0xf1 241 LATIN SMALL LETTER N WITH TILDE
|
||||
ò o! 0xf2 242 LATIN SMALL LETTER O WITH GRAVE
|
||||
ó o' 0xf3 243 LATIN SMALL LETTER O WITH ACUTE
|
||||
ô o> 0xf4 244 LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
õ o? 0xf5 245 LATIN SMALL LETTER O WITH TILDE
|
||||
ö o: 0xf6 246 LATIN SMALL LETTER O WITH DIAERESIS
|
||||
÷ -: 0xf7 247 DIVISION SIGN
|
||||
ø o/ 0xf8 248 LATIN SMALL LETTER O WITH STROKE
|
||||
ù u! 0xf9 249 LATIN SMALL LETTER U WITH GRAVE
|
||||
ú u' 0xfa 250 LATIN SMALL LETTER U WITH ACUTE
|
||||
û u> 0xfb 251 LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
ü u: 0xfc 252 LATIN SMALL LETTER U WITH DIAERESIS
|
||||
ý y' 0xfd 253 LATIN SMALL LETTER Y WITH ACUTE
|
||||
þ th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic)
|
||||
ÿ y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1406
docs/vim/todo/editing.txt
Normal file
1406
docs/vim/todo/editing.txt
Normal file
File diff suppressed because it is too large
Load Diff
396
docs/vim/todo/filetype.txt
Normal file
396
docs/vim/todo/filetype.txt
Normal file
@ -0,0 +1,396 @@
|
||||
*filetype.txt* For Vim version 6.1. Last change: 2002 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Filetypes *filetype* *file-type*
|
||||
|
||||
1. Filetypes |filetypes|
|
||||
2. Filetype plugin |filetype-plugin|
|
||||
3. Docs for the default filetype plugins. |ftplugin-docs|
|
||||
|
||||
Also see |autocmd.txt|.
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Filetypes *filetypes* *file-types*
|
||||
|
||||
Vim can detect the type of file that is edited. This is done by checking the
|
||||
file name and sometimes by inspecting the contents of the file for specific
|
||||
text.
|
||||
|
||||
*:filetype* *:filet*
|
||||
To enable file type detection, use this command in your vimrc: >
|
||||
:filetype on
|
||||
Each time a new or existing file is edited, Vim will try to recognize the type
|
||||
of the file and set the 'filetype' option. This will trigger the FileType
|
||||
event, which can be used to set the syntax highlighting, set options, etc.
|
||||
|
||||
NOTE: Filetypes and 'compatible' don't work together well, since being Vi
|
||||
compatible means options are global. Resetting 'compatible' is recommended,
|
||||
if you didn't do that already.
|
||||
|
||||
Detail: The ":filetype on" command will load one of these files:
|
||||
Amiga $VIMRUNTIME/filetype.vim
|
||||
Mac $VIMRUNTIME:filetype.vim
|
||||
MS-DOS $VIMRUNTIME\filetype.vim
|
||||
RiscOS Vim:Filetype
|
||||
Unix $VIMRUNTIME/filetype.vim
|
||||
VMS $VIMRUNTIME/filetype.vim
|
||||
This file is a Vim script that defines autocommands for the
|
||||
BufNewFile and BufRead events. If the file type is not found by the
|
||||
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
||||
contents of the file.
|
||||
|
||||
To add your own file types, see |new-filetype| below.
|
||||
|
||||
If the file type is not detected automatically, or it finds the wrong type,
|
||||
you can either set the 'filetype' option manually, or add a modeline to your
|
||||
file. Example, for in an IDL file use the command: >
|
||||
:set filetype=idl
|
||||
or add this |modeline| to the file: >
|
||||
/* vim: set filetype=idl : */
|
||||
<
|
||||
*:filetype-plugin-on*
|
||||
You can enable loading the plugin files for specific file types with: >
|
||||
:filetype plugin on
|
||||
If filetype detection was not switched on yet, it will be as well.
|
||||
This actually loads the file "ftplugin.vim" in 'runtimepath'.
|
||||
The result is that when a file is edited its plugin file is loaded (if there
|
||||
is one for the detected filetype). |filetype-plugin|
|
||||
|
||||
*:filetype-plugin-off*
|
||||
You can disable it again with: >
|
||||
:filetype plugin off
|
||||
The filetype detection is not switched off then. But if you do switch off
|
||||
filetype detection, the plugins will not be loaded either.
|
||||
This actually loads the file "ftplugof.vim" in 'runtimepath'.
|
||||
|
||||
*:filetype-indent-on*
|
||||
You can enable loading the indent file for specific file types with: >
|
||||
:filetype indent on
|
||||
If filetype detection was not switched on yet, it will be as well.
|
||||
This actually loads the file "indent.vim" in 'runtimepath'.
|
||||
The result is that when a file is edited its indent file is loaded (if there
|
||||
is one for the detected filetype). |indent-expression|
|
||||
|
||||
*:filetype-indent-off*
|
||||
You can disable it again with: >
|
||||
:filetype indent off
|
||||
The filetype detection is not switched off then. But if you do switch off
|
||||
filetype detection, the indent files will not be loaded either.
|
||||
This actually loads the file "indoff.vim" in 'runtimepath'.
|
||||
|
||||
*:filetype-off*
|
||||
To disable file type detection, use this command: >
|
||||
:filetype off
|
||||
This will keep the flags for "plugin" and "indent", but since no file types
|
||||
are being detected, they won't work until the next ":filetype on".
|
||||
|
||||
|
||||
Overview: *:filetype-overview*
|
||||
|
||||
command detection plugin indent ~
|
||||
:filetype on on unchanged unchanged
|
||||
:filetype off off unchanged unchanged
|
||||
:filetype plugin on on on unchanged
|
||||
:filetype plugin off unchanged off unchanged
|
||||
:filetype indent on on unchanged on
|
||||
:filetype indent off unchanged unchanged off
|
||||
:filetype plugin indent on on on on
|
||||
:filetype plugin indent off unchanged off off
|
||||
|
||||
To see the current status, type: >
|
||||
:filetype
|
||||
The output looks something like this: >
|
||||
filetype detection:ON plugin:ON indent:OFF
|
||||
|
||||
The file types are also used for syntax highlighting. If the ":syntax on"
|
||||
command is used, the file type detection is installed too. There is no need
|
||||
to do ":filetype on" after ":syntax on".
|
||||
|
||||
To disable one of the file types, add a line in the your filetype file, see
|
||||
|remove-filetype|.
|
||||
|
||||
*filetype-detect*
|
||||
To detect the file type again: >
|
||||
:filetype detect
|
||||
Use this if you started with an empty file and typed text that makes it
|
||||
possible to detect the file type. For example, when you entered this in a
|
||||
shell script: "#!/bin/csh".
|
||||
When filetype detection was off, it will be enabled first, like the "on"
|
||||
argument was used.
|
||||
|
||||
*filetype-overrule*
|
||||
When the same extension is used for two filetypes, Vim tries to guess what
|
||||
kind of file it is. This doesn't always work. A number of global variables
|
||||
can be used to overrule the filetype used for certain extensions:
|
||||
|
||||
file name variable ~
|
||||
*.asa g:filetype_asa |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asp g:filetype_asp |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asm g:asmsyntax |asm-syntax|
|
||||
*.prg g:filetype_prg
|
||||
*.pl g:filetype_pl
|
||||
*.inc g:filetype_inc
|
||||
*.w g:filetype_w |cweb-syntax|
|
||||
*.i g:filetype_i |progress-syntax|
|
||||
*.p g:filetype_p |pascal-syntax|
|
||||
*.sh g:bash_is_sh |sh-syntax|
|
||||
|
||||
*new-filetype*
|
||||
If a file type that you want to use is not detected yet, there are two ways to
|
||||
add it. In any way, it's better not modify the $VIMRUNTIME/filetype.vim file.
|
||||
It will be overwritten when installing a new version of Vim.
|
||||
|
||||
A. If your file type can be detected by the file name.
|
||||
1. Create your user runtime directory. You would normally use the first
|
||||
item of the 'runtimepath' option. Example for Unix: >
|
||||
:!mkdir ~/.vim
|
||||
<
|
||||
2. Create a file that contains autocommands to detect the file type.
|
||||
Example: >
|
||||
" my filetype file
|
||||
if exists("did_load_filetypes")
|
||||
finish
|
||||
endif
|
||||
augroup filetypedetect
|
||||
au! BufRead,BufNewFile *.mine setfiletype mine
|
||||
au! BufRead,BufNewFile *.xyz setfiletype drawing
|
||||
augroup END
|
||||
< Write this file as "filetype.vim" in your user runtime directory. For
|
||||
example, for Unix: >
|
||||
:w ~/.vim/filetype.vim
|
||||
|
||||
< 3. To use the new filetype detection you must restart Vim.
|
||||
|
||||
Your filetype.vim will be sourced before the default FileType autocommands
|
||||
have been installed. Your autocommands will match first, and the
|
||||
":setfiletype" command will make sure that no other autocommands will set
|
||||
'filetype' after this.
|
||||
*new-filetype-scripts*
|
||||
B. If your filetype can only be detected by inspecting the contents of the
|
||||
file.
|
||||
|
||||
1. Create your user runtime directory. You would normally use the first
|
||||
item of the 'runtimepath' option. Example for Unix: >
|
||||
:!mkdir ~/.vim
|
||||
<
|
||||
2. Create a vim script file for doing this. Example: >
|
||||
if did_filetype() " filetype already set..
|
||||
finish " ..don't do these checks
|
||||
endif
|
||||
if getline(1) =~ '^#!.*\<mine\>'
|
||||
setfiletype mine
|
||||
elseif getline(1) =~? '\<drawing\>'
|
||||
setfiletype drawing
|
||||
endif
|
||||
< See $VIMRUNTIME/scripts.vim for more examples.
|
||||
Write this file as "scripts.vim" in your user runtime directory. For
|
||||
example, for Unix: >
|
||||
:w ~/.vim/scripts.vim
|
||||
<
|
||||
3. The detection will work right away, no need to restart Vim.
|
||||
|
||||
Your scripts.vim is loaded before the default checks for file types, which
|
||||
means that your rules override the default rules in
|
||||
$VIMRUNTIME/scripts.vim.
|
||||
|
||||
*remove-filetype*
|
||||
If a file type is detected that is wrong for you, install a filetype.vim or
|
||||
scripts.vim to catch it (see above). You can set 'filetype' to a non-existing
|
||||
name to avoid that it will be set later anyway: >
|
||||
:set filetype=ignored
|
||||
|
||||
If you are setting up a system with many users, and you don't want each user
|
||||
to add/remove the same filetypes, consider writing the filetype.vim and
|
||||
scripts.vim files in a runtime directory that is used for everybody. Check
|
||||
the 'runtimepath' for a directory to use. If there isn't one, set
|
||||
'runtimepath' in the |system-vimrc|. Be careful to keep the default
|
||||
directories!
|
||||
|
||||
|
||||
*autocmd-osfiletypes*
|
||||
On operating systems which support storing a file type with the file, you can
|
||||
specify that an autocommand should only be executed if the file is of a
|
||||
certain type.
|
||||
|
||||
The actual type checking depends on which platform you are running Vim
|
||||
on; see your system's documentation for details.
|
||||
|
||||
To use osfiletype checking in an autocommand you should put a list of types to
|
||||
match in angle brackets in place of a pattern, like this: >
|
||||
|
||||
:au BufRead *.html,<&faf;HTML> so $VIMRUNTIME/syntax/html.vim
|
||||
|
||||
This will match:
|
||||
|
||||
- Any file whose name ends in `.html'
|
||||
- Any file whose type is `&faf' or 'HTML', where the meaning of these types
|
||||
depends on which version of Vim you are using.
|
||||
Unknown types are considered NOT to match.
|
||||
|
||||
You can also specify a type and a pattern at the same time (in which case they
|
||||
must both match): >
|
||||
|
||||
:au BufRead <&fff>diff*
|
||||
|
||||
This will match files of type `&fff' whose names start with `diff'.
|
||||
|
||||
Note that osfiletype checking is skipped if Vim is compiled without the
|
||||
|+osfiletype| feature.
|
||||
|
||||
*plugin-details*
|
||||
The "plugin" directory can be in any of the directories in the 'runtimepath'
|
||||
option. All of these directories will be searched for plugins and they are
|
||||
all loaded. For example, if this command: >
|
||||
|
||||
set runtimepath
|
||||
|
||||
produces this output: >
|
||||
|
||||
runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60
|
||||
|
||||
then Vim will load all plugins in these directories: >
|
||||
|
||||
/etc/vim/plugin/
|
||||
~/.vim/plugin/
|
||||
/usr/local/share/vim/vim60/plugin/
|
||||
|
||||
Note that the last one is the value of $VIMRUNTIME which has been expanded.
|
||||
|
||||
What if it looks like your plugin is not being loaded? You can find out what
|
||||
happens when Vim starts up by using the |-V| argument: >
|
||||
vim -V1
|
||||
You will see a lot of messages, in between them is a remark about loading the
|
||||
plugins. It starts with: >
|
||||
Searching for "plugin/*.vim" in
|
||||
There you can see where Vim looks for your plugin scripts.
|
||||
|
||||
==============================================================================
|
||||
2. Filetype plugin *filetype-plugins*
|
||||
|
||||
When loading filetype plugins has been enabled |:filetype-plugin-on|, options
|
||||
will be set and mappings defined. These are all local to the buffer, they
|
||||
will not be used for other files.
|
||||
|
||||
Defining mappings for a filetype may get in the way of the mappings you
|
||||
define yourself. There are a few ways to avoid this:
|
||||
1. Set the "maplocalleader" variable to the key sequence you want the mappings
|
||||
to start with. Example: >
|
||||
:let maplocalleader = ","
|
||||
< All mappings will then start with a comma instead of the default, which
|
||||
is a backslash. Also see |<LocalLeader>|.
|
||||
|
||||
2. Define your own mapping. Example: >
|
||||
:map ,p <Plug>MailQuote
|
||||
< You need to check the description of the plugin file below for the
|
||||
functionality it offers and the string to map to.
|
||||
You need to define your own mapping before the plugin is loaded (before
|
||||
editing a file of that type). The plugin will then skip installing the
|
||||
default mapping.
|
||||
|
||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||
which contains the name of the filetype. For the "mail" filetype this
|
||||
would be: >
|
||||
:let no_mail_maps = 1
|
||||
|
||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||
:let no_plugin_maps = 1
|
||||
<
|
||||
|
||||
*ftplugin-overrule*
|
||||
If a global filetype plugin does not do exactly what you want, there are three
|
||||
ways to change this:
|
||||
|
||||
1. Add a few settings.
|
||||
You must create a new filetype plugin in a directory early in
|
||||
'runtimepath'. For Unix, for example you could use this file: >
|
||||
vim ~/.vim/ftplugin/fortran.vim
|
||||
< You can set those settings and mappings that you would like to add. Note
|
||||
that the global plugin will be loaded after this, it may overrule the
|
||||
settings that you do here. If this is the case, you need to use one of the
|
||||
following two methods.
|
||||
|
||||
2. Make a copy of the plugin and change it.
|
||||
You must put the copy in a directory early in 'runtimepath'. For Unix, for
|
||||
example, you could do this: >
|
||||
cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim
|
||||
< Then you can edit the copied file to your liking. Since the b:did_ftplugin
|
||||
variable will be set, the global plugin will not be loaded.
|
||||
A disadvantage of this method is that when the distributed plugin gets
|
||||
improved, you will have to copy and modify it again.
|
||||
|
||||
3. Overrule the settings after loading the global plugin.
|
||||
You must create a new filetype plugin in a directory from the end of
|
||||
'runtimepath'. For Unix, for example, you could use this file: >
|
||||
vim ~/.vim/after/ftplugin/fortran.vim
|
||||
< In this file you can change just those settings that you want to change.
|
||||
|
||||
==============================================================================
|
||||
3. Docs for the default filetype plugins. *ftplugin-docs*
|
||||
|
||||
|
||||
FORTRAN *fortran-plugin*
|
||||
|
||||
Options:
|
||||
'expandtab' is switched on to avoid tabs as required by the Fortran
|
||||
standards unless the user has set fortran_have_tabs in .vimrc.
|
||||
'textwidth' is set to 72 for fixed source format as required by the
|
||||
Fortran standards and to 80 for free source format.
|
||||
'formatoptions' is set to break code and comment lines and to preserve long
|
||||
lines. You can format comments with |gq|.
|
||||
For further discussion of fortran_have_tabs and the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
|
||||
|
||||
MAIL *mail-plugin*
|
||||
|
||||
Options:
|
||||
'modeline' is switched off to avoid the danger of trojan horses, and to
|
||||
avoid that a Subject line with "Vim:" in it will cause an
|
||||
error message.
|
||||
'textwidth' is set to 72. This is often recommended for e-mail.
|
||||
'formatoptions' is set to break text lines and to repeat the comment leader
|
||||
in new lines, so that a leading ">" for quotes is repeated.
|
||||
You can also format quoted text with |gq|.
|
||||
|
||||
Local mappings:
|
||||
<LocalLeader>q or \\MailQuote
|
||||
Quotes the text selected in Visual mode, or from the cursor position
|
||||
to the end of the file in Normal mode. This means "> " is inserted in
|
||||
each line.
|
||||
|
||||
MAN *man-plugin*
|
||||
|
||||
Displays a manual page in a nice way.
|
||||
|
||||
To start using the ":Man" command before any manual page was loaded, source
|
||||
this script from your startup vimrc file: >
|
||||
|
||||
runtime ftplugin/man.vim
|
||||
|
||||
Options:
|
||||
'iskeyword' the '.' character is added to be able to use CTRL-] on the
|
||||
manual page name.
|
||||
|
||||
Commands:
|
||||
Man {name} Display the manual page for {name} in a window.
|
||||
|
||||
Global mapping:
|
||||
<Leader>K Displays the manual page for the word under the cursor.
|
||||
|
||||
Local mappings:
|
||||
CTRL-] Jump to the manual page for the word under the cursor.
|
||||
CTRL-T Jump back to the previous manual page.
|
||||
|
||||
|
||||
RPM SPEC *spec-plugin*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |pi_spec.txt|.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
570
docs/vim/todo/fold.txt
Normal file
570
docs/vim/todo/fold.txt
Normal file
@ -0,0 +1,570 @@
|
||||
*fold.txt* For Vim version 6.1. Last change: 2002 Mar 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Folding *Folding* *folding*
|
||||
|
||||
You can find an introduction on folding in chapter 28 of the user manual.
|
||||
|usr_28.txt|
|
||||
|
||||
1. Fold methods |fold-methods|
|
||||
2. Fold commands |fold-commands|
|
||||
3. Fold options |fold-options|
|
||||
4. Behavior of folds |fold-behavior|
|
||||
|
||||
{Vi has no Folding}
|
||||
{not available when compiled without the +folding feature}
|
||||
|
||||
==============================================================================
|
||||
1. Fold methods *fold-methods*
|
||||
|
||||
The folding method can be set with the 'foldmethod' option.
|
||||
|
||||
When setting 'foldmethod' to a value other than "manual", all folds are
|
||||
deleted and new ones created. Switching to the "manual" method doesn't remove
|
||||
the existing folds. This can be used to first define the folds automatically
|
||||
and then change them manually.
|
||||
|
||||
There are six methods to select folds:
|
||||
manual manually define folds
|
||||
indent more indent means a higher fold level
|
||||
expr specify an expression to define folds
|
||||
syntax folds defined by syntax highlighting
|
||||
diff folds for unchanged text
|
||||
marker folds defined by markers in the text
|
||||
|
||||
|
||||
MANUAL *fold-manual*
|
||||
|
||||
Use commands to manually define the fold regions. This can also be used by a
|
||||
script that parses text to find folds.
|
||||
|
||||
The level of a fold is only defined by its nesting. To increase the fold
|
||||
level of a fold for a range of lines, define a fold inside it that has the
|
||||
same lines.
|
||||
|
||||
The manual folds are lost when you abandon the file. To save the folds use
|
||||
the |:mkview| command. The view can be restored later with |:loadview|.
|
||||
|
||||
|
||||
INDENT *fold-indent*
|
||||
|
||||
The folds are automatically defined by the indent of the lines.
|
||||
|
||||
The foldlevel is computed from the indent of the line, divided by the
|
||||
'shiftwidth' (rounded down). A sequence of lines with the same or higher fold
|
||||
level form a fold, with the lines with a higher level forming a nested fold.
|
||||
|
||||
The nesting of folds is limited with 'foldnestmax'.
|
||||
|
||||
Some lines are ignored and get the fold level of the line above or below it,
|
||||
whatever is the lowest. These are empty or white lines and lines starting
|
||||
with a character in 'foldignore'. White space is skipped before checking for
|
||||
characters in 'foldignore'. For C use "#" to ignore preprocessor lines.
|
||||
|
||||
When you want to ignore lines in another way, use the 'expr' method. The
|
||||
|indent()| function can be used in 'foldexpr' to get the indent of a line.
|
||||
|
||||
|
||||
EXPR *fold-expr*
|
||||
|
||||
The folds are automatically defined by their foldlevel, like with the "indent"
|
||||
method. The value of the 'foldexpr' option is evaluated to get the foldlevel
|
||||
of a line. Examples:
|
||||
This will create a fold for all consecutive lines that start with a Tab: >
|
||||
:set foldexpr=getline(v:lnum)[0]==\"\\t\"
|
||||
This will call a function to compute the fold level: >
|
||||
:set foldexpr=MyFoldLevel(v:lnum)
|
||||
This will make a fold out of paragraphs separated by blank lines: >
|
||||
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
|
||||
this does the same: >
|
||||
:set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
|
||||
|
||||
Note that backslashes must be used to escape characters that ":set" handles
|
||||
differently (space, backslash, double quote, etc., see |option-backslash|).
|
||||
|
||||
These are the conditions with which the expression is evaluated:
|
||||
- The current buffer and window are set for the line.
|
||||
- The variable "v:lnum" is set to the line number.
|
||||
- The result is used for the fold level in this way:
|
||||
value meaning ~
|
||||
0 the line is not in a fold
|
||||
1, 2, .. the line is in a fold with this level
|
||||
-1 the fold level is undefined, use the fold level of a
|
||||
line before or after this line, whichever is the
|
||||
lowest.
|
||||
"=" use fold level from the previous line
|
||||
"a1", "a2", .. add one, two, .. to the fold level of the previous
|
||||
line
|
||||
"s1", "s2", .. subtract one, two, .. from the fold level of the
|
||||
previous line
|
||||
"<1", "<2", .. a fold with this level ends at this line
|
||||
">1", ">2", .. a fold with this level starts at this line
|
||||
|
||||
It is not required to mark the start (end) of a fold with ">1" ("<1"), a fold
|
||||
will also start (end) when the fold level is higher (lower) than the fold
|
||||
level of the previous line.
|
||||
|
||||
There must be no side effects from the expression. The text in the buffer,
|
||||
cursor position, the search patterns, options etc. must not be changed.
|
||||
|
||||
If there is some error in the expression, or the resulting value isn't
|
||||
recognized, there is no error message and the fold level will be zero.
|
||||
For debugging the 'debug' option can be set to "msg", the error messages will
|
||||
be visible then.
|
||||
|
||||
Note: Since the expression has to be evaluated for every line, this fold
|
||||
method can be very slow!
|
||||
|
||||
Try to avoid the "=", "a" and "s" return values, since Vim often has to search
|
||||
backwards for a line for which the fold level is defined. Using foldlevel()
|
||||
can help here. Example: >
|
||||
" extra is level compared to previous line
|
||||
let lvl = foldlevel(v:lnum - 1)
|
||||
if lvl >= 0
|
||||
return lvl + extra
|
||||
endif
|
||||
" return "=", "a" or "s"
|
||||
|
||||
|
||||
SYNTAX *fold-syntax*
|
||||
|
||||
A fold is defined by syntax items that have the "fold" argument. |:syn-fold|
|
||||
|
||||
The fold level is defined by nesting folds. The nesting of folds is limited
|
||||
with 'foldnestmax'.
|
||||
|
||||
|
||||
DIFF *fold-diff*
|
||||
|
||||
The folds are automatically defined for text that is not part of a change or
|
||||
close to a change.
|
||||
|
||||
This method only works properly when the 'diff' option is set for the current
|
||||
window and changes are being displayed. Otherwise the whole buffer will be
|
||||
one big fold.
|
||||
|
||||
The 'diffopt' option can be used to specify the context. That is, the number
|
||||
of lines between the fold and a change that are not included in the fold. For
|
||||
example, to use a context of 8 lines: >
|
||||
:set diffopt=filler,context:8
|
||||
The default context is six lines.
|
||||
|
||||
|
||||
MARKER *fold-marker*
|
||||
|
||||
Markers in the text tell where folds start and end. This allows you to
|
||||
precisely specify the folds. This will allow deleting and putting a fold,
|
||||
without the risk of including the wrong lines. The 'foldtext' option is
|
||||
normally set such that the text before the marker shows up in the folded line.
|
||||
This makes it possible to give a name to the fold.
|
||||
|
||||
Markers can have a level included, or can use matching pairs. Including a
|
||||
level is easier, you don't have to add end markers and avoid problems with
|
||||
non-matching marker pairs. Example: >
|
||||
/* global variables {{{1 */
|
||||
int varA, varB;
|
||||
|
||||
/* functions {{{1 */
|
||||
/* funcA() {{{2 */
|
||||
void funcA() {}
|
||||
|
||||
/* funcB() {{{2 */
|
||||
void funcB() {}
|
||||
|
||||
A fold starts at a "{{{" marker. The following number specifies the fold
|
||||
level. What happens depends on the difference between the current fold level
|
||||
and the level given by the marker:
|
||||
1. If a marker with the same fold level is encountered, the previous fold
|
||||
ends and another fold with the same level starts.
|
||||
2. If a marker with a higher fold level is found, a nested fold is started.
|
||||
3. if a marker with a lower fold level is found, all folds up to and including
|
||||
this level end and a fold with the specified level starts.
|
||||
|
||||
The number indicates the fold level. A zero cannot be used.
|
||||
You can use "}}}" with a digit to indicate the level of the fold that
|
||||
ends. The fold level of the following line will be one less than the
|
||||
indicated level. Note that Vim doesn't look back to the level of the matching
|
||||
marker (that would take too much time). Example: >
|
||||
|
||||
{{{1
|
||||
fold level here is 1
|
||||
{{{3
|
||||
fold level here is 3
|
||||
}}}3
|
||||
fold level here is 2
|
||||
|
||||
You can also use matching pairs of "{{{" and "}}}" markers to define folds.
|
||||
Each "{{{" increases the fold level by one, each "}}}" decreases the fold
|
||||
level by one. Be careful to keep the markers matching! Example: >
|
||||
|
||||
{{{
|
||||
fold level here is 1
|
||||
{{{
|
||||
fold level here is 2
|
||||
}}}
|
||||
fold level here is 1
|
||||
|
||||
You can mix using markers with a number and without a number. A useful way of
|
||||
doing this is to use numbered markers for large folds, and unnumbered markers
|
||||
locally in a function. For example use level one folds for the sections of
|
||||
your file like "structure definitions", "local variables" and "functions".
|
||||
Use level 2 markers for each definition and function, Use unnumbered markers
|
||||
inside functions. When you make changes in a function to split up folds, you
|
||||
don't have to renumber the markers.
|
||||
|
||||
The markers can be set with the 'foldmarker' option. It is recommended to
|
||||
keep this at the default value of "{{{,}}}", so that files can be exchanged
|
||||
between Vim users. Only change it when it is required for the file (e.g., it
|
||||
contains markers from another folding editor, or the default markers cause
|
||||
trouble for the language of the file).
|
||||
|
||||
*fold-create-marker*
|
||||
"zf" can be used to create a fold defined by markers. Vim will insert the
|
||||
markers for you. Vim will append the start and end marker, as specified with
|
||||
'foldmarker'. The markers are appended to the end of the line.
|
||||
'commentstring' is used if it isn't empty.
|
||||
This does not work properly when:
|
||||
- The line already contains a marker with a level number. Vim then doesn't
|
||||
know what to do.
|
||||
- Folds nearby use a level number in their marker which gets in the way.
|
||||
- The line is inside a comment, 'commentstring' isn't empty and nested
|
||||
comments don't work. For example with C: adding /* {{{ */ inside a comment
|
||||
will truncate the existing comment. Either put the marker before or after
|
||||
the comment, or add the marker manually.
|
||||
Generally it's not a good idea to let Vim create markers when you already have
|
||||
markers with a level number.
|
||||
|
||||
*fold-delete-marker*
|
||||
"zd" can be used to delete a fold defined by markers. Vim will delete the
|
||||
markers for you. Vim will search for the start and end markers, as specified
|
||||
with 'foldmarker', at the start and end of the fold. When the text around the
|
||||
marker matches with 'commentstring', that text is deleted as well.
|
||||
This does not work properly when:
|
||||
- A line contains more than one marker and one of them specifies a level.
|
||||
Only the first one is removed, without checking if this will have the
|
||||
desired effect of deleting the fold.
|
||||
- The marker contains a level number and is used to start or end several folds
|
||||
at the same time.
|
||||
|
||||
==============================================================================
|
||||
2. Fold commands *fold-commands*
|
||||
|
||||
All folding commands start with "z". Hint: the "z" looks like a folded piece
|
||||
of paper, if you look at it from the side.
|
||||
|
||||
|
||||
CREATING AND DELETING FOLDS ~
|
||||
*zf* *E350*
|
||||
zf{motion} or
|
||||
{Visual}zf Operator to create a fold.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
The new fold will be closed for the "manual" method.
|
||||
'foldenable' will be set.
|
||||
Also see |fold-create-marker|.
|
||||
|
||||
*zF*
|
||||
zF Create a fold for N lines. Works like "zf".
|
||||
|
||||
:{range}fo[ld] *:fold* *:fo*
|
||||
Create a fold for the lines in {range}. Works like "zf".
|
||||
|
||||
*zd* *E351*
|
||||
zd Delete one fold at the cursor. When the cursor is on folded
|
||||
line, that fold is deleted. Nested folds are moved one level
|
||||
up. In Visual mode all folds (partially) in the selected area
|
||||
are deleted. Careful: This easily deletes more folds than you
|
||||
expect and there is no undo.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
Also see |fold-delete-marker|.
|
||||
|
||||
*zD*
|
||||
zD Delete folds recursively at the cursor. In Visual mode all
|
||||
folds (partially) in the selected area and all nested folds in
|
||||
them are deleted.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
Also see |fold-delete-marker|.
|
||||
|
||||
*zE* *E352*
|
||||
zE Eliminate all folds in the window.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
Also see |fold-delete-marker|.
|
||||
|
||||
|
||||
OPENING AND CLOSING FOLDS ~
|
||||
|
||||
A fold smaller than 'foldminlines' will always be displayed like it was open.
|
||||
Therefore the commands below may work differently on small folds.
|
||||
|
||||
*zo*
|
||||
zo Open one fold under the cursor. When a count is given, that
|
||||
many folds deep will be opened. In Visual mode one level of
|
||||
folds is opened for all lines in the selected area.
|
||||
|
||||
*zO*
|
||||
zO Open all folds under the cursor recursively. In Visual mode
|
||||
it opens all folds that are in the selected area, also those
|
||||
that are only partly selected.
|
||||
|
||||
*zc*
|
||||
zc Close one fold under the cursor. When a count is given, that
|
||||
many folds deep are closed. In Visual mode one level of folds
|
||||
is closed for all lines in the selected area.
|
||||
'foldenable' will be set.
|
||||
|
||||
*zC*
|
||||
zC Close all folds under the cursor recursively. In Visual mode
|
||||
it closes all folds that are in the selected area, also those
|
||||
that are only partly selected.
|
||||
'foldenable' will be set.
|
||||
|
||||
*za*
|
||||
za When on a closed fold: open it. When folds are nested, you
|
||||
may have to use "za" several times. When a count is given,
|
||||
that many closed folds are opened.
|
||||
When on an open fold: close it and set 'foldenable'. This
|
||||
will only close one level, since using "za" again will open
|
||||
the fold. When a count is given that many folds will be
|
||||
closed (that's not the same as repeating "za" that many
|
||||
times).
|
||||
|
||||
*zA*
|
||||
zA When on a closed fold: open it recursively.
|
||||
When on an open fold: close it recursively and set
|
||||
'foldenable'.
|
||||
|
||||
*zv*
|
||||
zv View cursor line: Open just enough folds to make the line in
|
||||
which the cursor is located not folded.
|
||||
|
||||
*zx*
|
||||
zx Update folds: Undo manually opened and closed folds: re-apply
|
||||
'foldlevel', then do "zv": View cursor line.
|
||||
|
||||
*zX*
|
||||
zX Undo manually opened and closed folds: re-apply 'foldlevel'.
|
||||
|
||||
*zm*
|
||||
zm Fold more: Subtract one from 'foldlevel'. If 'foldlevel' was
|
||||
already zero nothing happens.
|
||||
'foldenable' will be set.
|
||||
|
||||
*zM*
|
||||
zM Close all folds: set 'foldlevel' to 0.
|
||||
'foldenable' will be set.
|
||||
|
||||
*zr*
|
||||
zr Reduce folding: Add one to 'foldlevel'.
|
||||
|
||||
*zR*
|
||||
zR Open all folds. This sets 'foldlevel' to highest fold level.
|
||||
|
||||
*:foldo* *:foldopen*
|
||||
:{range}foldo[pen][!]
|
||||
Open folds in {range}. When [!] is added all folds are
|
||||
opened. Useful to see all the text in {range}. Without [!]
|
||||
one level of folds is opened.
|
||||
|
||||
*:foldc* *:foldclose*
|
||||
:{range}foldc[lose][!]
|
||||
Close folds in {range}. When [!] is added all folds are
|
||||
closed. Useful to hide all the text in {range}. Without [!]
|
||||
one level of folds is closed.
|
||||
|
||||
*zn*
|
||||
zn Fold none: reset 'foldenable'. All folds will be open.
|
||||
|
||||
*zN*
|
||||
zN Fold normal: set 'foldenable'. All folds will be as they
|
||||
were before.
|
||||
|
||||
*zi*
|
||||
zi Invert 'foldenable'.
|
||||
|
||||
|
||||
MOVING OVER FOLDS ~
|
||||
*[z*
|
||||
[z Move to the start of the current open fold. If already at the
|
||||
start, move to the start of the fold that contains it. If
|
||||
there is no containing fold, the command fails.
|
||||
When a count is used, repeats the command N times.
|
||||
|
||||
*]z*
|
||||
]z Move to the end of the current open fold. If already at the
|
||||
end, move to the end of the fold that contains it. If there
|
||||
is no containing fold, the command fails.
|
||||
When a count is used, repeats the command N times.
|
||||
|
||||
*zj*
|
||||
zj Move downwards. to the start of the next fold. A closed fold
|
||||
is counted as one fold.
|
||||
When a count is used, repeats the command N times.
|
||||
|
||||
*zk*
|
||||
zk Move upwards to the end of the previous fold. A closed fold
|
||||
is counted as one fold.
|
||||
When a count is used, repeats the command N times.
|
||||
|
||||
|
||||
EXECUTING COMMANDS ON FOLDS ~
|
||||
|
||||
:[range]foldd[oopen] {cmd} *:foldd* *:folddoopen*
|
||||
Execute {cmd} on all lines that are not in a closed fold.
|
||||
When [range] is given, only these lines are used.
|
||||
Each time {cmd} is executed the cursor is positioned on the
|
||||
line it is executed for.
|
||||
This works like the ":global" command: First all lines that
|
||||
are not in a closed fold are marked. Then the {cmd} is
|
||||
executed for all marked lines. Thus when {cmd} changes the
|
||||
folds, this has no influence on where it is executed (except
|
||||
when lines are deleted, of course).
|
||||
Example: >
|
||||
:folddoopen s/end/loop_end/ge
|
||||
< Note the use of the "e" flag to avoid getting an error message
|
||||
where "end" doesn't match.
|
||||
|
||||
:[range]folddoc[losed] {cmd} *:folddoc* *:folddoclosed*
|
||||
Execute {cmd} on all lines that are in a closed fold.
|
||||
Otherwise like ":folddoopen".
|
||||
|
||||
==============================================================================
|
||||
3. Fold options *fold-options*
|
||||
|
||||
COLORS *fold-colors*
|
||||
|
||||
The colors of a closed fold are set with the Folded group |hl-Folded|. The
|
||||
colors of the fold column are set with the FoldColumn group |hl-FoldColumn|.
|
||||
Example to set the colors: >
|
||||
|
||||
:highlight Folded guibg=grey guifg=blue
|
||||
:highlight FoldColumn guibg=darkgrey guifg=white
|
||||
|
||||
|
||||
FOLDLEVEL *fold-foldlevel*
|
||||
|
||||
'foldlevel' is a number option: The higher the more folded regions are open.
|
||||
When 'foldlevel' is 0, all folds are closed.
|
||||
When 'foldlevel' is positive, some folds closed.
|
||||
When 'foldlevel' is very high, all folds are open.
|
||||
'foldlevel' is applied when it is changed. After that manually folds can be
|
||||
opened and closed.
|
||||
When increased, folds above the new level are opened. No manually opened
|
||||
folds will be closed.
|
||||
When decreased, folds above the new level are closed. No manually closed
|
||||
folds will be opened.
|
||||
|
||||
|
||||
FOLDTEXT *fold-foldtext*
|
||||
|
||||
'foldtext' is a string option that specifies an expression. This expression
|
||||
is evaluated to obtain the text displayed for a closed fold. Example: >
|
||||
|
||||
:set foldtext=v:folddashes.substitute(getline(v:foldstart),'/\\*\\\|\\*/\\\|{{{\\d\\=','','g')
|
||||
|
||||
This shows the first line of the fold, with "/*", "*/" and "{{{" removed.
|
||||
Note the use of backslashes to avoid some characters to be interpreted by the
|
||||
":set" command. It's simpler to define a function and call that: >
|
||||
|
||||
:set foldtext=MyFoldText()
|
||||
:function MyFoldText()
|
||||
: let line = getline(v:foldstart)
|
||||
: let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||
: return v:folddashes . sub
|
||||
:endfunction
|
||||
|
||||
Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
|
||||
the window that displays the line. Errors are ignored.
|
||||
|
||||
The default value is |foldtext()|. This returns a reasonable text for most
|
||||
types of folding. If you don't like it, you can specify your own 'foldtext'
|
||||
expression. It can use these special Vim variables:
|
||||
v:foldstart line number of first line in the fold
|
||||
v:foldend line number of last line in the fold
|
||||
v:folddashes a string that contains dashes to represent the
|
||||
foldlevel.
|
||||
v:foldlevel the foldlevel of the fold
|
||||
|
||||
In the result a TAB is replaced with a space and unprintable characters are
|
||||
made into printable characters.
|
||||
|
||||
The resulting line is truncated to fit in the window, it never wraps.
|
||||
When there is room after the text, it is filled with the character specified
|
||||
by 'fillchars'.
|
||||
|
||||
Note that backslashes need to be used for characters that the ":set" command
|
||||
handles differently: Space, backslash and double-quote. |option-backslash|
|
||||
|
||||
|
||||
FOLDCOLUMN *fold-foldcolumn*
|
||||
|
||||
'foldcolumn' is a number, which sets the width for a column on the side of the
|
||||
window to indicate folds. When it is zero, there is no foldcolumn. A normal
|
||||
value is 4 or 5. The minimal useful value is 2. The maximum is 12.
|
||||
|
||||
An open fold is indicated with a column that has a '-' at the top and '|'
|
||||
characters below it. This column stops where the open fold stops. When folds
|
||||
nest, the nested fold is one character right of the fold it's contained in.
|
||||
|
||||
A closed fold is indicated with a '+'.
|
||||
|
||||
Where the fold column is too narrow to display all nested folds, digits are
|
||||
shown to indicate the nesting level.
|
||||
|
||||
The mouse can also be used to open and close folds by clicking in the
|
||||
fold column:
|
||||
- Click on a '+' to open the closed fold at this row.
|
||||
- Click on any other non-blank character to close the open fold at this row
|
||||
|
||||
|
||||
OTHER OPTIONS
|
||||
|
||||
'foldenable' 'fen': Open all folds while set.
|
||||
'foldexpr' 'fde': Expression used for "expr" folding.
|
||||
'foldignore' 'fdi': Characters used for "indent" folding.
|
||||
'foldmarker' 'fmr': Defined markers used for "marker" folding.
|
||||
'foldmethod' 'fdm': Name of the current folding method.
|
||||
'foldminlines' 'fml': Minimum number of screen lines for a fold to be
|
||||
displayed closed.
|
||||
'foldnestmax' 'fdn': Maximum nesting for "indent" and "syntax" folding.
|
||||
'foldopen' 'fdo': Which kinds of commands open closed folds.
|
||||
'foldclose' 'fcl': When the folds not under the cursor are closed.
|
||||
|
||||
==============================================================================
|
||||
4. Behavior of folds *fold-behavior*
|
||||
|
||||
When moving the cursor upwards or downwards and when scrolling, the cursor
|
||||
will move to the first line of a sequence of folded lines. When the cursor is
|
||||
already on a folded line, it moves to the next unfolded line or the next
|
||||
closed fold.
|
||||
|
||||
While the cursor is on folded lines, the cursor is always displayed in the
|
||||
first column. The ruler does show the actual cursor position, but since the
|
||||
line is folded, it cannot be displayed there.
|
||||
|
||||
Movement commands handle a sequence of folded lines like an empty line. For
|
||||
example, the "w" command stops once in the first column.
|
||||
|
||||
When in Insert mode, the cursor line is never folded. That allows you to see
|
||||
what you type!
|
||||
|
||||
When using an operator, a closed fold is included as a whole. Thus "dl"
|
||||
deletes the whole closed fold under the cursor.
|
||||
|
||||
For Ex commands the range is adjusted to always start at the first line of a
|
||||
fold and end at the last line of a fold. Thus this command: >
|
||||
:s/foo/bar/g
|
||||
when used with the cursor on a closed fold, will replace "foo" with "bar" in
|
||||
all lines of the fold.
|
||||
This does not happen for |:folddoopen| and |:folddoclosed|.
|
||||
|
||||
When editing a buffer that has been edited before, the last used folding
|
||||
settings are used again. For manual folding the defined folds are restored.
|
||||
For all folding methods the manually opened and closed folds are restored.
|
||||
If this buffer has been edited in this window, the values from back then are
|
||||
used. Otherwise the values from the window where the buffer was edited last
|
||||
are used.
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
47
docs/vim/todo/help.txt
Normal file
47
docs/vim/todo/help.txt
Normal file
@ -0,0 +1,47 @@
|
||||
*help.txt* For @NAME@ version @VERSION@. Last change: 2003 Apr 14
|
||||
|
||||
@NAME@ - main help file
|
||||
|
||||
VIM stands for Vi IMproved. @NAME@ was made by Rick Maddy, but only
|
||||
through the help of many others. See |credits|.
|
||||
------------------------------------------------------------------------------
|
||||
*doc-file-list* *Q_ct*
|
||||
BASIC:
|
||||
|quickref| Overview of the most common commands you will use
|
||||
|copying| About copyrights
|
||||
|www| IdeaVim on the World Wide Web
|
||||
|bugs| Where to send bug reports
|
||||
|
||||
REFERENCE MANUAL: These files explain every detail of Vim.
|
||||
|
||||
General subjects ~
|
||||
|intro.txt| general introduction to Vim; notation used in help files
|
||||
|help.txt| overview and quick reference (this file)
|
||||
|index.txt| alphabetical index of all commands
|
||||
|help-tags| all the tags you can jump to (index of tags)
|
||||
|todo.txt| known problems and desired extensions
|
||||
|
||||
Basic editing ~
|
||||
|editing.txt| editing and writing files
|
||||
|motion.txt| commands for moving around
|
||||
|scroll.txt| scrolling the text in the window
|
||||
|insert.txt| Insert and Replace mode
|
||||
|change.txt| deleting and replacing text
|
||||
|indent.txt| automatic indenting for C and other languages
|
||||
|undo.txt| Undo and Redo
|
||||
|repeat.txt| repeating commands, Vim scripts and debugging
|
||||
|visual.txt| using the Visual mode (selecting a text area)
|
||||
|various.txt| various remaining commands
|
||||
|
||||
Advanced editing ~
|
||||
|cmdline.txt| Command-line editing
|
||||
|options.txt| description of all options
|
||||
|pattern.txt| regexp patterns and search commands
|
||||
|map.txt| key mapping and abbreviations
|
||||
|windows.txt| commands for using multiple windows and buffers
|
||||
|autocmd.txt| automatically executing commands on an event
|
||||
|filetype.txt| settings done specifically for a type of file
|
||||
|fold.txt| hide (fold) ranges of lines
|
||||
|
||||
Special issues ~
|
||||
|digraph.txt| list of available digraphs
|
474
docs/vim/todo/indent.txt
Normal file
474
docs/vim/todo/indent.txt
Normal file
@ -0,0 +1,474 @@
|
||||
*indent.txt* For Vim version 6.1. Last change: 2001 Nov 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
This file is about indenting C programs and other files.
|
||||
|
||||
1. Indenting C programs |C-indenting|
|
||||
2. Indenting by expression |indent-expression|
|
||||
|
||||
==============================================================================
|
||||
1. Indenting C programs *C-indenting*
|
||||
|
||||
The basics for C indenting are explained in section |30.2| of the user manual.
|
||||
|
||||
Vim has options for automatically indenting C program files. These options
|
||||
affect only the indent and do not perform other formatting. For comment
|
||||
formatting, see |format-comments|.
|
||||
|
||||
Note that this will not work when the |+smartindent| or |+cindent| features
|
||||
have been disabled at compile time.
|
||||
|
||||
There are in fact four methods available for indentation:
|
||||
'autoindent' uses the indent from the previous line.
|
||||
'smartindent' is like 'autoindent' but also recognizes some C syntax to
|
||||
increase/reduce the indent where appropriate.
|
||||
'cindent' Works more cleverly than the other two and is configurable to
|
||||
different indenting styles.
|
||||
'indentexpr' The most flexible of all: Evaluates an expression to compute
|
||||
the indent of a line. When non-empty this method overrides
|
||||
the other ones. See |indent-expression|.
|
||||
The rest of this section describes the 'cindent' option.
|
||||
|
||||
Note that 'cindent' indenting does not work for every code scenario. Vim
|
||||
is not a C compiler: it does not recognize all syntax.
|
||||
|
||||
These four options control C program indenting:
|
||||
'cindent' Enables Vim to perform C program indenting automatically.
|
||||
'cinkeys' Specifies which keys trigger reindenting in insert mode.
|
||||
'cinoptions' Sets your preferred indent style.
|
||||
'cinwords' Defines keywords that start an extra indent in the next line.
|
||||
|
||||
If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
|
||||
Vim's built-in algorithm rather than calling an external program.
|
||||
|
||||
See |autocommand| for how to set the 'cindent' option automatically for C code
|
||||
files and reset it for others.
|
||||
|
||||
*cinkeys-format* *indentkeys-format*
|
||||
The 'cinkeys' option is a string that controls Vim's indenting in response to
|
||||
typing certain characters or commands in certain contexts. Note that this not
|
||||
only triggers C-indenting. When 'indentexpr' is not empty 'indentkeys' is
|
||||
used instead. The format of 'cinkeys' and 'indentkeys' is equal.
|
||||
|
||||
The default is "0{,0},0),:,0#,!^F,o,O,e" which specifies that indenting occurs
|
||||
as follows:
|
||||
|
||||
"0{" if you type '{' as the first character in a line
|
||||
"0}" if you type '}' as the first character in a line
|
||||
"0)" if you type ')' as the first character in a line
|
||||
":" if you type ':' after a label or case statement
|
||||
"0#" if you type '#' as the first character in a line
|
||||
"!^F" if you type CTRL-F (which is not inserted)
|
||||
"o" if you type a <CR> anywhere or use the "o" command (not in
|
||||
insert mode!)
|
||||
"O" if you use the "O" command (not in insert mode!)
|
||||
"e" if you type the second 'e' for an "else" at the start of a
|
||||
line
|
||||
|
||||
Characters that can precede each key:
|
||||
! When a '!' precedes the key, Vim will not insert the key but will
|
||||
instead reindent the current line. This allows you to define a
|
||||
command key for reindenting the current line. CTRL-F is the default
|
||||
key for this. Be careful if you define CTRL-I for this because CTRL-I
|
||||
is the ASCII code for <Tab>.
|
||||
* When a '*' precedes the key, Vim will reindent the line before
|
||||
inserting the key. If 'cinkeys' contains "*<Return>", Vim reindents
|
||||
the current line before opening a new line.
|
||||
0 When a zero precedes the key (but appears after '!' or '*') Vim will
|
||||
reindent the line only if the key is the first character you type in
|
||||
the line. When used before "=" Vim will only reindent the line if
|
||||
there is only white space before the word.
|
||||
|
||||
When neither '!' nor '*' precedes the key, Vim reindents the line after you
|
||||
type the key. So ';' sets the indentation of a line which includes the ';'.
|
||||
|
||||
Special key names:
|
||||
<> Angle brackets mean spelled-out names of keys. For example: "<Up>",
|
||||
"<Ins>" (see |key-notation|).
|
||||
^ Letters preceded by a caret (^) are control characters. For example:
|
||||
"^F" is CTRL-F.
|
||||
o Reindent a line when you use the "o" command or when Vim opens a new
|
||||
line below the current one (e.g., when you type <Enter> in insert
|
||||
mode).
|
||||
O Reindent a line when you use the "O" command.
|
||||
e Reindent a line that starts with "else" when you type the second 'e'.
|
||||
: Reindent a line when a ':' is typed which is after a label or case
|
||||
statement. Don't reindent for a ":" in "class::method" for C++. To
|
||||
Reindent for any ":", use "<:>".
|
||||
=word Reindent when typing the last character of "word". "word" may
|
||||
actually be part of another word. Thus "=end" would cause reindenting
|
||||
when typing the "d" in "endif" or "endwhile". But not when typing
|
||||
"bend". Also reindent when completion produces a word that starts
|
||||
with "word". "0=word" reindents when there is only white space before
|
||||
the word.
|
||||
=~word Like =word, but ignore case.
|
||||
|
||||
If you really want to reindent when you type 'o', 'O', 'e', '0', '<', '>',
|
||||
'*', ':' or '!', use "<o>", "<O>", "<e>", "<0>", "<<>", "<>>", "<*>", "<:>" or
|
||||
"<!>", respectively, for those keys.
|
||||
|
||||
For an emacs-style indent mode where lines aren't indented every time you
|
||||
press Enter but only if you press Tab, I suggest:
|
||||
:set cinkeys=0{,0},:,0#,!<Tab>,!^F
|
||||
You might also want to switch off 'autoindent' then.
|
||||
|
||||
Note: If you change the current line's indentation manually, Vim ignores the
|
||||
cindent settings for that line. This prevents vim from reindenting after you
|
||||
have changed the indent by typing <BS>, <Tab>, or <Space> in the indent or
|
||||
used CTRL-T or CTRL-D.
|
||||
|
||||
*cinoptions-values*
|
||||
The 'cinoptions' option sets how Vim performs indentation. In the list below,
|
||||
"N" represents a number of your choice (the number can be negative). When
|
||||
there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
|
||||
"1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc. You can use a
|
||||
decimal point, too: "-0.5s" is minus half a 'shiftwidth'. The examples below
|
||||
assume a 'shiftwidth' of 4.
|
||||
|
||||
>N Amount added for "normal" indent. Used after a line that should
|
||||
increase the indent (lines starting with "if", an opening brace,
|
||||
etc.). (default 'shiftwidth').
|
||||
|
||||
cino= cino=>2 cino=>2s >
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
foo; foo; foo;
|
||||
} } }
|
||||
<
|
||||
eN Add N to the prevailing indent inside a set of braces if the
|
||||
opening brace at the End of the line (more precise: is not the
|
||||
first character in a line). This is useful if you want a
|
||||
different indent when the '{' is at the start of the line from
|
||||
when '{' is at the end of the line. (default 0).
|
||||
|
||||
cino= cino=e2 cino=e-2 >
|
||||
if (cond) { if (cond) { if (cond) {
|
||||
foo; foo; foo;
|
||||
} } }
|
||||
else else else
|
||||
{ { {
|
||||
bar; bar; bar;
|
||||
} } }
|
||||
<
|
||||
nN Add N to the prevailing indent for a statement after an "if",
|
||||
"while", etc., if it is NOT inside a set of braces. This is
|
||||
useful if you want a different indent when there is no '{'
|
||||
before the statement from when there is a '{' before it.
|
||||
(default 0).
|
||||
|
||||
cino= cino=n2 cino=n-2 >
|
||||
if (cond) if (cond) if (cond)
|
||||
foo; foo; foo;
|
||||
else else else
|
||||
{ { {
|
||||
bar; bar; bar;
|
||||
} } }
|
||||
<
|
||||
fN Place the first opening brace of a function or other block in
|
||||
column N. This applies only for an opening brace that is not
|
||||
inside other braces and is at the start of the line. What comes
|
||||
after the brace is put relative to this brace. (default 0).
|
||||
|
||||
cino= cino=f.5s cino=f1s >
|
||||
func() func() func()
|
||||
{ { {
|
||||
int foo; int foo; int foo;
|
||||
<
|
||||
{N Place opening braces N characters from the prevailing indent.
|
||||
This applies only for opening braces that are inside other
|
||||
braces. (default 0).
|
||||
|
||||
cino= cino={.5s cino={1s >
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
foo; foo; foo;
|
||||
<
|
||||
}N Place closing braces N characters from the matching opening
|
||||
brace. (default 0).
|
||||
|
||||
cino= cino={2,}-0.5s cino=}2 >
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
foo; foo; foo;
|
||||
} } }
|
||||
<
|
||||
^N Add N to the prevailing indent inside a set of braces if the
|
||||
opening brace is in column 0. This can specify a different
|
||||
indent for whole of a function (some may like to set it to a
|
||||
negative number). (default 0).
|
||||
|
||||
cino= cino=^-2 cino=^-s >
|
||||
func() func() func()
|
||||
{ { {
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
a = b; a = b; a = b;
|
||||
} } }
|
||||
} } }
|
||||
<
|
||||
:N Place case labels N characters from the indent of the switch().
|
||||
(default 'shiftwidth').
|
||||
|
||||
cino= cino=:0 >
|
||||
switch (x) switch(x)
|
||||
{ {
|
||||
case 1: case 1:
|
||||
a = b; a = b;
|
||||
default: default:
|
||||
} }
|
||||
<
|
||||
=N Place statements occurring after a case label N characters from
|
||||
the indent of the label. (default 'shiftwidth').
|
||||
|
||||
cino= cino==10 >
|
||||
case 11: case 11: a = a + 1;
|
||||
a = a + 1; b = b + 1;
|
||||
<
|
||||
lN If N != 0 Vim will align with a case label instead of the
|
||||
statement after it.
|
||||
|
||||
cino= cino=l1 >
|
||||
switch (a) { switch (a) {
|
||||
case 1: { case 1: {
|
||||
break; break;
|
||||
} }
|
||||
<
|
||||
gN Place C++ scope declarations N characters from the indent of the
|
||||
block they are in. (default 'shiftwidth'). A scope declaration
|
||||
can be "public:", "protected:" or "private:".
|
||||
|
||||
cino= cino=g0 >
|
||||
{ {
|
||||
public: public:
|
||||
a = b; a = b;
|
||||
private: private:
|
||||
} }
|
||||
<
|
||||
hN Place statements occurring after a C++ scope declaration N
|
||||
characters from the indent of the label. (default
|
||||
'shiftwidth').
|
||||
|
||||
cino= cino=h10 >
|
||||
public: public: a = a + 1;
|
||||
a = a + 1; b = b + 1;
|
||||
<
|
||||
pN Parameter declarations for K&R-style function declarations will
|
||||
be indented N characters from the margin. (default
|
||||
'shiftwidth').
|
||||
|
||||
cino= cino=p0 cino=p2s >
|
||||
func(a, b) func(a, b) func(a, b)
|
||||
int a; int a; int a;
|
||||
char b; char b; char b;
|
||||
<
|
||||
tN Indent a function return type declaration N characters from the
|
||||
margin. (default 'shiftwidth').
|
||||
|
||||
cino= cino=t0 cino=t7 >
|
||||
int int int
|
||||
func() func() func()
|
||||
<
|
||||
+N Indent a continuation line (a line that spills onto the next) N
|
||||
additional characters. (default 'shiftwidth').
|
||||
|
||||
cino= cino=+10 >
|
||||
a = b + 9 * a = b + 9 *
|
||||
c; c;
|
||||
<
|
||||
cN Indent comment lines after the comment opener, when there is no
|
||||
other text with which to align, N characters from the comment
|
||||
opener. (default 3). See also |format-comments|.
|
||||
|
||||
cino= cino=c5 >
|
||||
/* /*
|
||||
text. text.
|
||||
*/ */
|
||||
<
|
||||
CN When N is non-zero, indent comment lines by the amount specified
|
||||
with the c flag above even if there is other text behind the
|
||||
comment opener. (default 0).
|
||||
|
||||
cino=c0 cino=c0,C1 >
|
||||
/******** /********
|
||||
text. text.
|
||||
********/ ********/
|
||||
< (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
|
||||
|
||||
(N When in unclosed parentheses, indent N characters from the line
|
||||
with the unclosed parentheses. Add a 'shiftwidth' for every
|
||||
unclosed parentheses. When N is 0 or the unclosed parentheses
|
||||
is the first non-white character in its line, line up with the
|
||||
next non-white character after the unclosed parentheses.
|
||||
(default 'shiftwidth' * 2).
|
||||
|
||||
cino= cino=(0 >
|
||||
if (c1 && (c2 || if (c1 && (c2 ||
|
||||
c3)) c3))
|
||||
foo; foo;
|
||||
if (c1 && if (c1 &&
|
||||
(c2 || c3)) (c2 || c3))
|
||||
{ {
|
||||
<
|
||||
uN Same as (N, but for one level deeper. (default 'shiftwidth').
|
||||
|
||||
cino= cino=u2 >
|
||||
if (c123456789 if (c123456789
|
||||
&& (c22345 && (c22345
|
||||
|| c3)) || c3))
|
||||
<
|
||||
UN When N is non-zero, do not ignore the indenting specified by
|
||||
( or u in case that the unclosed parentheses is the first
|
||||
non-white character in its line. (default 0).
|
||||
|
||||
cino= or cino=(s cino=(s,U1 >
|
||||
c = c1 && c = c1 &&
|
||||
( (
|
||||
c2 || c2 ||
|
||||
c3 c3
|
||||
) && c4; ) && c4;
|
||||
<
|
||||
wN When in unclosed parentheses and N is non-zero and either
|
||||
using "(0" or "u0", respectively, or using "U0" and the unclosed
|
||||
parentheses is the first non-white character in its line, line
|
||||
up with the character immediately after the unclosed parentheses
|
||||
rather than the first non-white character. (default 0).
|
||||
|
||||
cino=(0 cino=(0,w1 >
|
||||
if ( c1 if ( c1
|
||||
&& ( c2 && ( c2
|
||||
|| c3)) || c3))
|
||||
foo; foo;
|
||||
<
|
||||
mN When N is non-zero, line up a line starting with a closing
|
||||
parentheses with the first character of the line with the
|
||||
matching opening parentheses. (default 0).
|
||||
|
||||
cino=(s cino=(s,m1 >
|
||||
c = c1 && ( c = c1 && (
|
||||
c2 || c2 ||
|
||||
c3 c3
|
||||
) && c4; ) && c4;
|
||||
if ( if (
|
||||
c1 && c2 c1 && c2
|
||||
) )
|
||||
foo; foo;
|
||||
<
|
||||
*java-cinoptions* *java-indenting*
|
||||
jN Indent java anonymous classes correctly. The value 'N' is
|
||||
currently unused but must be non-zero (e.g. 'j1'). 'j1' will
|
||||
indent for example the following code snippet correctly: >
|
||||
|
||||
object.add(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
do_something();
|
||||
}
|
||||
});
|
||||
<
|
||||
)N Vim searches for unclosed parentheses at most N lines away.
|
||||
This limits the time needed to search for parentheses. (default
|
||||
20 lines).
|
||||
|
||||
*N Vim searches for unclosed comments at most N lines away. This
|
||||
limits the time needed to search for the start of a comment.
|
||||
(default 30 lines).
|
||||
|
||||
|
||||
The defaults, spelled out in full, are:
|
||||
cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us,
|
||||
\U0,w0,m0,j0,)20,*30
|
||||
|
||||
Vim puts a line in column 1 if:
|
||||
- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
|
||||
- It starts with a label (a keyword followed by ':', other than "case" and
|
||||
"default").
|
||||
- Any combination of indentations causes the line to have less than 0
|
||||
indentation.
|
||||
|
||||
==============================================================================
|
||||
2. Indenting by expression *indent-expression*
|
||||
|
||||
The basics for using flexible indenting are explained in section |30.3| of the
|
||||
user manual.
|
||||
|
||||
If you want to write your own indent file, it must set the 'indentexpr'
|
||||
option. Setting the 'indentkeys' option is often useful. See the
|
||||
$VIMRUNTIME/indent directory for examples.
|
||||
|
||||
|
||||
REMARKS ABOUT SPECIFIC INDENT FILES ~
|
||||
|
||||
|
||||
FORTRAN *fortran-indent*
|
||||
|
||||
Block if, select case, and where constructs are indented. Comments, labelled
|
||||
statements and continuation lines are indented if the Fortran is in free
|
||||
source form, whereas they are not indented if the Fortran is in fixed source
|
||||
form because of the left margin requirements. Hence manual indent corrections
|
||||
will be necessary for labelled statements and continuation lines when fixed
|
||||
source form is being used. For further discussion of the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
|
||||
Do loops ~
|
||||
All do loops are left unindented by default. Do loops can be unstructured in
|
||||
Fortran with (possibly multiple) loops ending on a labelled executable
|
||||
statement of almost arbitrary type. Correct indentation requires
|
||||
compiler-quality parsing. Old code with do loops ending on labelled statements
|
||||
of arbitrary type can be indented with elaborate programs such as Tidy
|
||||
(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
|
||||
also left unindented because continue statements are also used for purposes
|
||||
other than ending a do loop. Programs such as Tidy can convert structured
|
||||
do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
|
||||
be indented. If you use only structured loops of the do/enddo form, you should
|
||||
declare this by setting the fortran_do_enddo variable in your .vimrc as
|
||||
follows >
|
||||
|
||||
let fortran_do_enddo=1
|
||||
|
||||
in which case do loops will be indented. If all your loops are of do/enddo
|
||||
type only in, say, .f90 files, then you should set a buffer flag with an
|
||||
autocommand such as >
|
||||
|
||||
au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1
|
||||
|
||||
to get do loops indented in .f90 files and left alone in Fortran files with
|
||||
other extensions such as .for.
|
||||
|
||||
|
||||
VERILOG *verilog-indent*
|
||||
|
||||
General block statements such as if, for, case, always, initial, function,
|
||||
specify and begin, etc., are indented. The module block statements (first
|
||||
level blocks) are not indented by default. you can turn on the indent with
|
||||
setting a variable in the .vimrc as follows: >
|
||||
|
||||
let b:verilog_indent_modules = 1
|
||||
|
||||
then the module blocks will be indented. To stop this, remove the variable: >
|
||||
|
||||
:unlet b:verilog_indent_modules
|
||||
|
||||
To set the variable only for Verilog file. The following statements can be
|
||||
used: >
|
||||
|
||||
au BufReadPost * if exists("b:current_syntax")
|
||||
au BufReadPost * if b:current_syntax == "verilog"
|
||||
au BufReadPost * let b:verilog_indent_modules = 1
|
||||
au BufReadPost * endif
|
||||
au BufReadPost * endif
|
||||
|
||||
Furthermore, setting the variable b:verilog_indent_width to change the
|
||||
indenting width (default is 'shiftwidth'): >
|
||||
|
||||
let b:verilog_indent_width = 4
|
||||
let b:verilog_indent_width = &sw * 2
|
||||
|
||||
In addition, you can turn the verbose mode for debug issue: >
|
||||
|
||||
let b:verilog_indent_verbose = 1
|
||||
|
||||
Make sure to do ":set cmdheight=2" first to allow the display of the message.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1036
docs/vim/todo/insert.txt
Normal file
1036
docs/vim/todo/insert.txt
Normal file
File diff suppressed because it is too large
Load Diff
877
docs/vim/todo/intro.txt
Normal file
877
docs/vim/todo/intro.txt
Normal file
@ -0,0 +1,877 @@
|
||||
*intro.txt* For Vim version 6.1. Last change: 2002 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Introduction to Vim *ref* *reference*
|
||||
|
||||
1. Introduction |intro|
|
||||
2. Vim on the internet |internet|
|
||||
3. Credits |credits|
|
||||
4. Notation |notation|
|
||||
5. Modes, introduction |vim-modes-intro|
|
||||
6. Switching from mode to mode |mode-switching|
|
||||
7. The window contents |window-contents|
|
||||
8. Definitions |definitions|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *intro*
|
||||
|
||||
Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many
|
||||
improvements that a name change was appropriate. Vim is a text editor which
|
||||
includes almost all the commands from the Unix program "Vi" and a lot of new
|
||||
ones. It is very useful for editing programs and other plain text.
|
||||
All commands are given with the keyboard. This has the advantage that you
|
||||
can keep your fingers on the keyboard and your eyes on the screen. For those
|
||||
who want it, there is mouse support and a GUI version with scrollbars and
|
||||
menus (see |gui.txt|).
|
||||
|
||||
An overview of this manual can be found in the file "help.txt", |help.txt|.
|
||||
It can be accessed from within Vim with the <Help> or <F1> key and with the
|
||||
|:help| command (just type ":help", without the bars or quotes).
|
||||
The 'helpfile' option can be set to the name of the help file, in case it
|
||||
is not located in the default place. You can jump to subjects like with tags:
|
||||
Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back.
|
||||
|
||||
Throughout this manual the differences between Vi and Vim are mentioned in
|
||||
curly braces, like this: {Vi does not have on-line help}. See |vi_diff.txt|
|
||||
for a summary of the differences between Vim and Vi.
|
||||
|
||||
This manual refers to Vim on various machines. There may be small differences
|
||||
between different computers and terminals. Besides the remarks given in this
|
||||
document, there is a separate document for each supported system, see
|
||||
|sys-file-list|.
|
||||
|
||||
This manual is a reference for all the Vim commands and options. This is not
|
||||
an introduction to the use of Vi or Vim, it gets a bit complicated here and
|
||||
there. For beginners, there is a hands-on |tutor|. To learn using Vim, read
|
||||
the user manual |usr_toc.txt|.
|
||||
|
||||
*book*
|
||||
There are many books on Vi that contain a section for beginners. There are
|
||||
two books I can recommend:
|
||||
|
||||
"Vim - Vi Improved" by Steve Oualline
|
||||
|
||||
This is the very first book completely dedicated to Vim. It is very good for
|
||||
beginners. The most often used commands are explained with pictures and
|
||||
examples. The less often used commands are also explained, the more advanced
|
||||
features are summarized. There is a comprehensive index and a quick
|
||||
reference. Parts of this book have been included in the user manual
|
||||
|frombook|.
|
||||
Published by New Riders Publishing. ISBN: 0735710015
|
||||
For more information try one of these:
|
||||
http://vim.iccf-holland.org
|
||||
http://www.vim.org/iccf/click5.html
|
||||
|
||||
"Learning the Vi editor" by Linda Lamb and Arnold Robbins
|
||||
|
||||
This is a book about Vi that includes a chapter on Vim (in the sixth edition).
|
||||
The first steps in Vi are explained very well. The commands that Vim adds are
|
||||
only briefly mentioned. There is also a German translation.
|
||||
Published by O'Reilly. ISBN: 1-56592-426-6.
|
||||
|
||||
==============================================================================
|
||||
2. Vim on the internet *internet*
|
||||
|
||||
*www* *faq* *FAQ* *distribution* *download*
|
||||
The Vim pages contain the most recent information about Vim. They also
|
||||
contain links to the most recent version of Vim. The FAQ is a list of
|
||||
Frequently Asked Questions. Read this if you have problems.
|
||||
|
||||
VIM home page: http://vim.sf.net/
|
||||
Sven's VIM pages: http://www.vim.org/
|
||||
Latest news: http://www.vim.org/news.html
|
||||
VIM FAQ: http://www.vim.org/faq/
|
||||
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
|
||||
|
||||
|
||||
Usenet News group where Vim is discussed: *news* *usenet*
|
||||
comp.editors
|
||||
See http://www.vim.org/usenet.html. This group is also for other editors. If
|
||||
you write about Vim, don't forget to mention that.
|
||||
|
||||
*mail-list* *maillist*
|
||||
There are several mailing lists for Vim:
|
||||
<vim@vim.org>
|
||||
For discussions about using existing versions of Vim: Useful mappings,
|
||||
questions, answers, where to get a specific version, etc.
|
||||
<vim-dev@vim.org> *vim-dev* *vimdev*
|
||||
For discussions about changing Vim: New features, porting, patches,
|
||||
beta-test versions, etc.
|
||||
<vim-announce@vim.org> *vim-announce*
|
||||
Announcements about new versions of Vim; also for beta-test versions
|
||||
and ports to different systems.
|
||||
<vim-multibyte@vim.org> *vim-multibyte*
|
||||
For discussions about using and improving the multi-byte aspects of
|
||||
Vim.
|
||||
<vim-mac@vim.org> *vim-mac*
|
||||
For discussions about using and improving the Macintosh version of
|
||||
Vim.
|
||||
|
||||
See http://www.vim.org/mail.html.
|
||||
|
||||
NOTE:
|
||||
- You can only send messages to these lists if you have subscribed!
|
||||
- You need to send the messages from the same location as where you subscribed
|
||||
from (to avoid spam mail).
|
||||
- Maximum message size is 40000 characters.
|
||||
|
||||
*subscribe-maillist*
|
||||
If you want to join, send a message to
|
||||
<vim-help@vim.org>
|
||||
Make sure that your "From:" address is correct. Then the list server will
|
||||
give you help on how to subscribe.
|
||||
|
||||
You can retrieve old messages from the maillist software, and an index of
|
||||
messages. Ask vim-help for instructions.
|
||||
|
||||
Archives are kept at: *maillist-archive*
|
||||
http://groups.yahoo.com/group/vim
|
||||
http://groups.yahoo.com/group/vimdev
|
||||
http://groups.yahoo.com/group/vimannounce
|
||||
http://groups.yahoo.com/group/vim-multibyte
|
||||
http://groups.yahoo.com/group/vim-mac
|
||||
|
||||
Another archive is at http://www.somelist.com in the "Editeurs" section (the
|
||||
site is in French, the messages are in English).
|
||||
|
||||
|
||||
Additional maillists:
|
||||
|
||||
<vim-fr@club.voila.fr> *french-maillist*
|
||||
Vim list in the French language. Subscribe by sending a message to
|
||||
<vim-fr-subscribe@club.voila.fr>
|
||||
Or go to http://groups.yahoo.com/group/vim-fr.
|
||||
|
||||
|
||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
||||
|
||||
Send bug reports to: Vim bugs <bugs@vim.org>
|
||||
This is not a maillist but the message is redirected to the Vim maintainer.
|
||||
Please be brief; all the time that is spent on answering mail is subtracted
|
||||
from the time that is spent on improving Vim! Always give a reproducible
|
||||
example and try to find out which settings or other things influence the
|
||||
appearance of the bug. Try different machines, if possible. Send me patches
|
||||
if you can!
|
||||
|
||||
In case of doubt, use: >
|
||||
:so $VIMRUNTIME/bugreport.vim
|
||||
This will create a file "bugreport.txt" in the current directory, with a lot
|
||||
of information of your environment. Before sending this out, check if it
|
||||
doesn't contain any confidential information!
|
||||
|
||||
*debug-vim*
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes:
|
||||
|
||||
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
|
||||
which you can uncomment).
|
||||
|
||||
2. Execute these commands (replace "11" with the test that fails): >
|
||||
cd testdir
|
||||
gdb ../vim
|
||||
run -u unix.vim -U NONE -s dotest.in test11.in
|
||||
|
||||
3. Check where Vim crashes, gdb should give a message for this.
|
||||
|
||||
4. Get a stack trace from gdb with this command: >
|
||||
where
|
||||
< You can check out different places in the stack trace with: >
|
||||
frame 3
|
||||
< Replace "3" with one of the numbers in the stack trace.
|
||||
|
||||
*year-2000* *Y2K*
|
||||
Since Vim internally doesn't use dates for editing, there is no year 2000
|
||||
problem to worry about. Vim does use the time in the form of seconds since
|
||||
January 1st 1970. It is used for a time-stamp check of the edited file and
|
||||
the swap file, which is not critical and should only cause warning messages.
|
||||
|
||||
There might be a year 2038 problem, when the seconds don't fit in a 32 bit int
|
||||
anymore. This depends on the compiler, libraries and operating system.
|
||||
Specifically, time_t and the ctime() function are used. And the time_t is
|
||||
stored in four bytes in the swap file. But that's only used for printing a
|
||||
file date/time for recovery, it will never affect normal editing.
|
||||
|
||||
The Vim strftime() function directly uses the strftime() system function.
|
||||
localtime() uses the time() system function. getftime() uses the time
|
||||
returned by the stat() system function. If your system libraries are year
|
||||
2000 compliant, Vim is too.
|
||||
|
||||
The user may create scripts for Vim that use external commands. These might
|
||||
introduce Y2K problems, but those are not really part of Vim itself.
|
||||
|
||||
==============================================================================
|
||||
3. Credits *credits* *author*
|
||||
|
||||
Most of Vim was written by Bram Moolenaar <Bram@vim.org>.
|
||||
|
||||
Parts of the documentation come from several Vi manuals, written by:
|
||||
W.N. Joy
|
||||
Alan P.W. Hewett
|
||||
Mark Horton
|
||||
|
||||
The Vim editor is based on Stevie and includes (ideas from) other software,
|
||||
worked on by the people mentioned here. Other people helped by sending me
|
||||
patches, suggestions and giving feedback about what is good and bad in Vim.
|
||||
|
||||
Vim would never have become what it is now, without the help of these people!
|
||||
|
||||
Ron Aaron Win32 GUI changes
|
||||
Zoltan Arpadffy work on VMS port
|
||||
Tony Andrews Stevie
|
||||
Gert van Antwerpen changes for DJGPP on MS-DOS
|
||||
Berkeley DB(3) ideas for swap file implementation
|
||||
Keith Bostic Nvi
|
||||
Walter Briscoe Makefile updates, various patches
|
||||
Ralf Brown SPAWNO library for MS-DOS
|
||||
Robert Colon many useful remarks
|
||||
Marcin Dalecki GTK+ GUI port, toolbar icons, gettext()
|
||||
Kayhan Demirel sent me news in Uganda
|
||||
Chris & John Downey xvi (ideas for multi-windows version)
|
||||
Henk Elbers first VMS port
|
||||
Eric Fischer Mac port, 'cindent', and other improvements
|
||||
Benji Fisher Answering lots of user questions
|
||||
Bill Foster Athena GUI port
|
||||
Loic Grenie xvim (ideas for multi windows version)
|
||||
Sven Guckes Vim WWW page maintainer
|
||||
Darren Hiebert Exuberant ctags
|
||||
Bruce Hunsaker improvements for VMS port
|
||||
Andy Kahn Cscope support, GTK+ GUI port
|
||||
Oezguer Kesim Maintainer of Vim Mailing Lists
|
||||
Axel Kielhorn work on the Macintosh port
|
||||
Steve Kirkendall Elvis
|
||||
Roger Knobbe original port to Windows NT
|
||||
Sergey Laskavy Vim's help from Moscow
|
||||
Felix von Leitner Maintainer of Vim Mailing Lists
|
||||
David Leonard Port of Python extensions to Unix
|
||||
Avner Lottem Edit in right-to-left windows
|
||||
Flemming Madsen X11 client-server, various features and patches
|
||||
MicroSoft Gave me a copy of DevStudio to compile Vim with
|
||||
Paul Moore Python interface extensions, many patches
|
||||
Katsuhito Nagano Work on multi-byte versions
|
||||
Sung-Hyun Nam Work on multi-byte versions
|
||||
Vince Negri Win32 GUI and generic console enhancements
|
||||
Steve Oualline Author of the first Vim book |frombook|
|
||||
George V. Reilly Win32 port, Win32 GUI start-off
|
||||
Stephen Riehm bug collector
|
||||
Stefan Roemer various patches and help to users
|
||||
Ralf Schandl IBM OS/390 port
|
||||
Olaf Seibert DICE and BeBox version, regexp improvements
|
||||
Mortaza Shiran Farsi patches
|
||||
Peter da Silva termlib
|
||||
Paul Slootman OS/2 port
|
||||
Henry Spencer regular expressions
|
||||
Dany St-Amant Macintosh port
|
||||
Tim Thompson Stevie
|
||||
G. R. (Fred) Walter Stevie
|
||||
Sven Verdoolaege Perl interface
|
||||
Robert Webb Command-line completion, GUI versions, and
|
||||
lots of patches
|
||||
Ingo Wilken Tcl interface
|
||||
Mike Williams PostScript printing
|
||||
Juergen Weigert Lattice version, AUX improvements, UNIX and
|
||||
MS-DOS ports, autoconf
|
||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||
|
||||
I wish to thank all the people that sent me bug reports and suggestions. The
|
||||
list is too long to mention them all here. Vim would not be the same without
|
||||
the ideas from all these people: They keep Vim alive!
|
||||
|
||||
|
||||
In this documentation there are several references to other versions of Vi:
|
||||
*Vi*
|
||||
Vi "the original". Without further remarks this is the version
|
||||
of Vi that appeared in Sun OS 4.x. ":version" returns
|
||||
"Version 3.7, 6/7/85". Sometimes other versions are referred
|
||||
to. Only runs under Unix. Source code only available with a
|
||||
license. More information on Vi can be found through:
|
||||
http://vi-editor.org
|
||||
*Posix*
|
||||
Posix From the IEEE standard 1003.2, Part 2: Shell and utilities.
|
||||
Generally known as "Posix". This is a textual description of
|
||||
how Vi is supposed to work.
|
||||
The version used is a draft from beginning 1996, so all remarks are
|
||||
"expected to comply to" this. Anything can change though...
|
||||
*Nvi*
|
||||
Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD.
|
||||
Very good compatibility with the original Vi, with a few extensions.
|
||||
The version used is 1.79. ":version" returns "Version 1.79
|
||||
(10/23/96)". There has been no release the last few years, although
|
||||
there is a development version 1.81.
|
||||
Source code is freely available.
|
||||
*Elvis*
|
||||
Elvis Another Vi clone, made by Steve Kirkendall. Very compact but isn't
|
||||
as flexible as Vim.
|
||||
The version used is 2.1. It is still being developed. Source code is
|
||||
freely available.
|
||||
|
||||
==============================================================================
|
||||
4. Notation *notation*
|
||||
|
||||
When syntax highlighting is used to read this, text that is not typed
|
||||
literally is often highlighted with the Special group. These are items in [],
|
||||
{} and <>, and CTRL-X.
|
||||
|
||||
Note that Vim uses all possible characters in commands. Sometimes the [], {}
|
||||
and <> are part of what you type, the context should make this clear.
|
||||
|
||||
|
||||
[] Characters in square brackets are optional.
|
||||
|
||||
*count* *[count]*
|
||||
[count] An optional number that may precede the command to multiply
|
||||
or iterate the command. If no number is given, a count of one
|
||||
is used, unless otherwise noted. Note that in this manual the
|
||||
[count] is not mentioned in the description of the command,
|
||||
but only in the explanation. This was done to make the
|
||||
commands easier to look up. If the 'showcmd' option is on,
|
||||
the (partially) entered count is shown at the bottom of the
|
||||
window. You can use <Del> to erase the last digit (|N<Del>|).
|
||||
|
||||
*[quotex]*
|
||||
["x] An optional register designation where text can be stored.
|
||||
See |registers|. The x is a single character between 'a' and
|
||||
'z' or 'A' and 'Z' or '"', and in some cases (with the put
|
||||
command) between '0' and '9', '%', '#', or others. The
|
||||
uppercase and lowercase letter designate the same register,
|
||||
but the lowercase letter is used to overwrite the previous
|
||||
register contents, while the uppercase letter is used to
|
||||
append to the previous register contents. Without the ""x" or
|
||||
with """" the stored text is put into the unnamed register.
|
||||
|
||||
*{}*
|
||||
{} Curly braces denote parts of the command which must appear,
|
||||
but which can take a number of different values. The
|
||||
differences between Vim and Vi are also given in curly braces
|
||||
(this will be clear from the context).
|
||||
|
||||
*{char1-char2}*
|
||||
{char1-char2} A single character from the range char1 to char2. For
|
||||
example: {a-z} is a lowercase letter. Multiple ranges may be
|
||||
concatenated. For example, {a-zA-Z0-9} is any alphanumeric
|
||||
character.
|
||||
|
||||
*{motion}*
|
||||
{motion} A command that moves the cursor. These are explained in
|
||||
|motion.txt|. Examples:
|
||||
w to start of next word
|
||||
4j four lines down
|
||||
/The<CR> to next occurrence of "The"
|
||||
This is used after an |operator| command to move over the text
|
||||
that is to be operated upon.
|
||||
- If the motion includes a count and the operator also had a
|
||||
count, the two counts are multiplied. For example: "2d3w"
|
||||
deletes six words.
|
||||
- The motion can also be a mouse click. The mouse is not
|
||||
supported in every terminal though.
|
||||
- The ":omap" command can be used to map characters while an
|
||||
operator is pending.
|
||||
- Ex commands can be used to move the cursor. This can be
|
||||
used to call a function that does some complicated motion.
|
||||
The motion is always characterwise exclusive, no matter
|
||||
what ":" command is used. This means it's impossible to
|
||||
include the last character of a line without the line break
|
||||
(unless 'virtualedit' is set).
|
||||
If the Ex command changes the text before where the operator
|
||||
start or jumps to another buffer the result is
|
||||
unpredictable. It is possible to change the text further
|
||||
down. Jumping to another buffer is possible if the current
|
||||
buffer is not unloaded.
|
||||
|
||||
*{Visual}*
|
||||
{Visual} A selected text area. It is started with the "v", "V", or
|
||||
CTRL-V command, then any cursor movement command can be used
|
||||
to change the end of the selected text.
|
||||
This is used before an |operator| command to highlight the
|
||||
text that is to be operated upon.
|
||||
See |Visual-mode|.
|
||||
|
||||
*<character>*
|
||||
<character> A special character from the table below, optionally with
|
||||
modifiers, or a single ASCII character with modifiers.
|
||||
|
||||
*'character'*
|
||||
'c' A single ASCII character.
|
||||
|
||||
*CTRL-{char}*
|
||||
CTRL-{char} {char} typed as a control character; that is, typing {char}
|
||||
while holding the CTRL key down. The case of {char} does not
|
||||
matter; thus CTRL-A and CTRL-a are equivalent. But on some
|
||||
terminals, using the SHIFT key will produce another code,
|
||||
don't use it then.
|
||||
|
||||
*'option'*
|
||||
'option' An option, or parameter, that can be set to a value, is
|
||||
enclosed in single quotes. See |options|.
|
||||
|
||||
*quotecommandquote*
|
||||
"command" A reference to a command that you can type is enclosed in
|
||||
double quotes.
|
||||
|
||||
*key-notation* *key-codes* *keycodes*
|
||||
These names for keys are used in the documentation. They can also be used
|
||||
with the ":map" command.
|
||||
|
||||
notation meaning equivalent decimal value(s) ~
|
||||
-----------------------------------------------------------------------
|
||||
<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
|
||||
<BS> backspace CTRL-H 8 *backspace*
|
||||
<Tab> tab CTRL-I 9 *tab* *Tab*
|
||||
*linefeed*
|
||||
<NL> linefeed CTRL-J 10 (used for <Nul>)
|
||||
<FF> formfeed CTRL-L 12 *formfeed*
|
||||
<CR> carriage return CTRL-M 13 *carriage-return*
|
||||
<Return> same as <CR> *<Return>*
|
||||
<Enter> same as <CR> *<Enter>*
|
||||
<Esc> escape CTRL-[ 27 *escape* *<Esc>*
|
||||
<Space> space 32 *space*
|
||||
<lt> less-than < 60 *<lt>*
|
||||
<Bslash> backslash \ 92 *backslash* *<Bslash>*
|
||||
<Bar> vertical bar | 124 *<Bar>*
|
||||
<Del> delete 127
|
||||
<CSI> command sequence intro ALT-Esc 155 *<CSI>*
|
||||
<xCSI> CSI when typed in the GUI *<xCSI>*
|
||||
|
||||
<EOL> end-of-line (can be <CR>, <LF> or <CR><LF>,
|
||||
depends on system and 'fileformat') *<EOL>*
|
||||
|
||||
<Up> cursor-up *cursor-up* *cursor_up*
|
||||
<Down> cursor-down *cursor-down* *cursor_down*
|
||||
<Left> cursor-left *cursor-left* *cursor_left*
|
||||
<Right> cursor-right *cursor-right* *cursor_right*
|
||||
<S-Up> shift-cursor-up
|
||||
<S-Down> shift-cursor-down
|
||||
<S-Left> shift-cursor-left
|
||||
<S-Right> shift-cursor-right
|
||||
<C-Left> control-cursor-left
|
||||
<C-Right> control-cursor-right
|
||||
<F1> - <F12> function keys 1 to 12 *function_key* *function-key*
|
||||
<S-F1> - <S-F12> shift-function keys 1 to 12 *<S-F1>*
|
||||
<Help> help key
|
||||
<Undo> undo key
|
||||
<Insert> insert key
|
||||
<Home> home *home*
|
||||
<End> end *end*
|
||||
<PageUp> page-up *page_up* *page-up*
|
||||
<PageDown> page-down *page_down* *page-down*
|
||||
<kHome> keypad home (upper left) *keypad-home*
|
||||
<kEnd> keypad end (lower left) *keypad-end*
|
||||
<kPageUp> keypad page-up (upper right) *keypad-page-up*
|
||||
<kPageDown> keypad page-down (lower right) *keypad-page-down*
|
||||
<kPlus> keypad + *keypad-plus*
|
||||
<kMinus> keypad - *keypad-minus*
|
||||
<kMultiply> keypad * *keypad-multiply*
|
||||
<kDivide> keypad / *keypad-divide*
|
||||
<kEnter> keypad Enter *keypad-enter*
|
||||
<kPoint> keypad Decimal point *keypad-point*
|
||||
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
|
||||
<S-...> shift-key *shift* *<S-*
|
||||
<C-...> control-key *control* *ctrl* *<C-*
|
||||
<M-...> alt-key or meta-key *meta* *alt* *<M-*
|
||||
<A-...> same as <M-...> *<A-*
|
||||
<D-...> command-key (Macintosh only) *<D-*
|
||||
<t_xx> key with "xx" entry in termcap
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
Note: The shifted cursor keys, the help key, and the undo key are only
|
||||
available on a few terminals. On the Amiga, shifted function key 10 produces
|
||||
a code (CSI) that is also used by key sequences. It will be recognized only
|
||||
after typing another key.
|
||||
|
||||
Note: There are two codes for the delete key. 127 is the decimal ASCII value
|
||||
for the delete key, which is always recognized. Some delete keys send another
|
||||
value, in which case this value is obtained from the termcap entry "kD". Both
|
||||
values have the same effect. Also see |:fixdel|.
|
||||
|
||||
Note: The keypad keys are used in the same way as the corresponding "normal"
|
||||
keys. For example, <kHome> has the same effect as <Home>. If a keypad key
|
||||
sends the same raw key code as it non-keypad equivalent, it will be recognized
|
||||
as the non-keypad code. For example, when <kHome> sends the same code as
|
||||
<Home>, when pressing <kHome> Vim will think <Home> was pressed. Mapping
|
||||
<kHome> will not work then.
|
||||
|
||||
*<>*
|
||||
Examples are often given in the <> notation. Sometimes this is just to make
|
||||
clear what you need to type, but often it can be typed literally, e.g., with
|
||||
the ":map" command. The rules are:
|
||||
1. Any printable characters are typed directly, except backslash and '<'
|
||||
2. A backslash is represented with "\\", double backslash, or "<Bslash>".
|
||||
3. A real '<' is represented with "\<" or "<lt>". When there is no
|
||||
confusion possible, a '<' can be used directly.
|
||||
4. "<key>" means the special key typed. This is the notation explained in
|
||||
the table above. A few examples:
|
||||
<Esc> Escape key
|
||||
<C-G> CTRL-G
|
||||
<Up> cursor up key
|
||||
<C-LeftMouse> Control- left mouse click
|
||||
<S-F11> Shifted function key 11
|
||||
<M-a> Meta- a ('a' with bit 8 set)
|
||||
<M-A> Meta- A ('A' with bit 8 set)
|
||||
<t_kd> "kd" termcap entry (cursor down key)
|
||||
|
||||
If you want to use the full <> notation in Vim, you have to make sure the '<'
|
||||
flag is excluded from 'cpoptions' (when 'compatible' is not set, it already is
|
||||
by default). >
|
||||
:set cpo-=<
|
||||
The <> notation uses <lt> to escape the special meaning of key names. Using a
|
||||
backslash also works, but only when 'cpoptions' does not include the 'B' flag.
|
||||
|
||||
Examples for mapping CTRL-H to the six characters "<Home>": >
|
||||
:imap <C-H> \<Home>
|
||||
:imap <C-H> <lt>Home>
|
||||
The first one only works when the 'B' flag is not in 'cpoptions'. The second
|
||||
one always works.
|
||||
To get a literal "<lt>" in a mapping: >
|
||||
:map <C-L> <lt>lt>
|
||||
|
||||
For mapping, abbreviation and menu commands you can then copy-paste the
|
||||
examples and use them directly. Or type them literally, including the '<' and
|
||||
'>' characters. This does NOT work for other commands, like ":set" and
|
||||
":autocmd"!
|
||||
|
||||
==============================================================================
|
||||
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
||||
|
||||
Vim has six BASIC modes:
|
||||
|
||||
*Normal* *Normal-mode* *command-mode*
|
||||
Normal mode In Normal mode you can enter all the normal editor
|
||||
commands. If you start the editor you are in this
|
||||
mode (unless you have set the 'insertmode' option,
|
||||
see below). This is also known as command mode.
|
||||
|
||||
Visual mode This is like Normal mode, but the movement commands
|
||||
extend a highlighted area. When a non-movement
|
||||
command is used, it is executed for the highlighted
|
||||
area. See |Visual-mode|.
|
||||
If the 'showmode' option is on "-- VISUAL --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
Select mode This looks most like the MS-Windows selection mode.
|
||||
Typing a printable character deletes the selection
|
||||
and starts Insert mode. See |Select-mode|.
|
||||
If the 'showmode' option is on "-- SELECT --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
Insert mode In Insert mode the text you type is inserted into the
|
||||
buffer. See |Insert-mode|.
|
||||
If the 'showmode' option is on "-- INSERT --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
Command-line mode In Command-line mode (also called Cmdline mode) you
|
||||
Cmdline mode can enter one line of text at the bottom of the
|
||||
window. This is for the Ex commands, ":", the pattern
|
||||
search commands, "?" and "/", and the filter command,
|
||||
"!". |Cmdline-mode|
|
||||
|
||||
Ex mode Like Command-line mode, but after entering a command
|
||||
you remain in Ex mode. Very limited editing of the
|
||||
command line. |Ex-mode|
|
||||
|
||||
There are five ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
|
||||
*Operator-pending* *Operator-pending-mode*
|
||||
Operator-pending mode This is like Normal mode, but after an operator
|
||||
command has started, and Vim is waiting for a {motion}
|
||||
to specify the text that the operator will work on.
|
||||
|
||||
Replace mode Replace mode is a special case of Insert mode. You
|
||||
can do the same things as in Insert mode, but for
|
||||
each character you enter, one character of the existing
|
||||
text is deleted. See |Replace-mode|.
|
||||
If the 'showmode' option is on "-- REPLACE --" is
|
||||
shown at the bottom of the window.
|
||||
|
||||
Insert Normal mode Entered when CTRL-O given in Insert mode. This is
|
||||
like Normal mode, but after executing one command Vim
|
||||
returns to Insert mode.
|
||||
If the 'showmode' option is on "-- (insert) --" is
|
||||
shown at the bottom of the window.
|
||||
|
||||
Insert Visual mode Entered when starting a Visual selection from Insert
|
||||
mode, e.g., by using CTRL-O and then "v", "V" or
|
||||
CTRL-V. When the Visual selection ends, Vim returns
|
||||
to Insert mode.
|
||||
If the 'showmode' option is on "-- (insert) VISUAL --"
|
||||
is shown at the bottom of the window.
|
||||
|
||||
Insert Select mode Entered when starting Select mode from Insert mode.
|
||||
E.g., by dragging the mouse or <S-Right>.
|
||||
When the Select mode ends, Vim returns to Insert mode.
|
||||
If the 'showmode' option is on "-- (insert) SELECT --"
|
||||
is shown at the bottom of the window.
|
||||
|
||||
==============================================================================
|
||||
6. Switching from mode to mode *mode-switching*
|
||||
|
||||
If for any reason you do not know which mode you are in, you can always get
|
||||
back to Normal mode by typing <Esc> twice. This doesn't work for Ex mode
|
||||
though, use ":visual".
|
||||
You will know you are back in Normal mode when you see the screen flash or
|
||||
hear the bell after you type <Esc>. However, when pressing <Esc> after using
|
||||
CTRL-O in Insert mode you get a beep but you are still in Insert mode, type
|
||||
<Esc> again.
|
||||
|
||||
*i_esc*
|
||||
TO mode ~
|
||||
Normal Visual Select Insert Replace Cmd-line Ex ~
|
||||
FROM mode ~
|
||||
Normal v V ^V *4 *1 R : / ? ! Q
|
||||
Visual *2 ^G c C -- : --
|
||||
Select *5 ^O ^G *6 -- -- --
|
||||
Insert <Esc> -- -- <Insert> -- --
|
||||
Replace <Esc> -- -- <Insert> -- --
|
||||
Command-line *3 -- -- :start -- --
|
||||
Ex :vi -- -- -- -- --
|
||||
|
||||
- NA
|
||||
-- not possible
|
||||
|
||||
*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
|
||||
"A", "o", "O", "c", "C", "s" or S".
|
||||
*2 Go from Visual mode to Normal mode by giving a non-movement command, which
|
||||
causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
|
||||
(see |v_v|), which just stops Visual mode without side effects.
|
||||
*3 Go from Command-line mode to Normal mode by:
|
||||
- Hitting <CR> or <NL>, which causes the entered command to be executed.
|
||||
- Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
|
||||
- Hitting CTRL-C or <Esc>, which quits the command-line without executing
|
||||
the command.
|
||||
In the last case <Esc> may be the character defined with the 'wildchar'
|
||||
option, in which case it will start command-line completion. You can
|
||||
ignore that and type <Esc> again. {Vi: when hitting <Esc> the command-line
|
||||
is executed. This is unexpected for most people; therefore it was changed
|
||||
in Vim. But when the <Esc> is part of a mapping, the command-line is
|
||||
executed. If you want the Vi behaviour also when typing <Esc>, use ":cmap
|
||||
^V<Esc> ^V^M"}
|
||||
*4 Go from Normal to Select mode by:
|
||||
- use the mouse to select text while 'selectmode' contains "mouse"
|
||||
- use a non-printable command to move the cursor while keeping the Shift
|
||||
key pressed, and the 'selectmode' option contains "key"
|
||||
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
|
||||
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
|
||||
*5 Go from Select mode to Normal mode by using a non-printable command to move
|
||||
the cursor, without keeping the Shift key pressed.
|
||||
*6 Go from Select mode to Insert mode by typing a printable character. The
|
||||
selection is deleted and the character is inserted.
|
||||
|
||||
If the 'insertmode' option is on, editing a file will start in Insert mode.
|
||||
|
||||
*CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *v_CTRL-\_CTRL-N*
|
||||
Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to
|
||||
Normal mode from any other mode. This can be used to make sure Vim is in
|
||||
Normal mode, without causing a beep like <Esc> would.
|
||||
|
||||
|
||||
*Q* *mode-Ex* *Ex-mode* *Ex* *EX*
|
||||
Q Switch to "Ex" mode. This is a bit like typing ":"
|
||||
commands one after another, except:
|
||||
- You don't have to keep pressing ":".
|
||||
- The screen doesn't get updated after each command.
|
||||
- There is no normal command-line editing.
|
||||
- Mappings and abbreviations are not used.
|
||||
In fact, you are editing the lines with the "standard"
|
||||
line-input editing commands (<Del> or <BS> to erase,
|
||||
CTRL-U to kill the whole line).
|
||||
Vim will enter this mode by default if it's invoked as
|
||||
"ex" on the command-line.
|
||||
Use the ":vi" command |:visual| to exit "Ex" mode.
|
||||
Note: In older versions of Vim "Q" formatted text,
|
||||
that is now done with |gq|.
|
||||
|
||||
*gQ*
|
||||
gQ Switch to "Ex" mode, but really behave like typing ":"
|
||||
commands after another. All command line editing,
|
||||
completion etc. is available.
|
||||
Use the ":vi" command |:visual| to exit "Ex" mode.
|
||||
{not in Vi}
|
||||
|
||||
==============================================================================
|
||||
7. The window contents *window-contents*
|
||||
|
||||
In Normal mode and Insert/Replace mode the screen window will show the current
|
||||
contents of the buffer: What You See Is What You Get. There are two
|
||||
exceptions:
|
||||
- When the 'cpoptions' option contains '$', and the change is within one line,
|
||||
the text is not directly deleted, but a '$' is put at the last deleted
|
||||
character.
|
||||
- When inserting text in one window, other windows on the same text are not
|
||||
updated until the insert is finished.
|
||||
{Vi: The screen is not always updated on slow terminals}
|
||||
|
||||
Lines longer than the window width will wrap, unless the 'wrap' option is off
|
||||
(see below). The 'linebreak' option can be set to wrap at a blank character.
|
||||
|
||||
If the window has room after the last line of the buffer, Vim will show '~' in
|
||||
the first column of the last lines in the window, like this: >
|
||||
|
||||
some line
|
||||
last line
|
||||
~
|
||||
~
|
||||
|
||||
Thus the '~' lines indicate that the end of the buffer was reached.
|
||||
|
||||
If the last line in a window doesn't fit, Vim will indicate this with a '@' in
|
||||
the first column of the last lines in the window, like this: >
|
||||
|
||||
first line
|
||||
second line
|
||||
@
|
||||
@
|
||||
|
||||
Thus the '@' lines indicate that there is a line that doesn't fit in the
|
||||
window.
|
||||
|
||||
When the "lastline" flag is present in the 'display' option, you will not see
|
||||
'@' characters at the left side of window. If the last line doesn't fit
|
||||
completely, only the part that fits is shown, and the last three characters of
|
||||
the last line are replaced with "@@@", like this: >
|
||||
|
||||
first line
|
||||
second line
|
||||
a very long line that d
|
||||
oesn't fit in the wi@@@
|
||||
|
||||
If there is a single line that is too long to fit in the window, this is a
|
||||
special situation. Vim will show only part of the line, around where the
|
||||
cursor is. There are no special characters shown, so that you can edit all
|
||||
parts of this line.
|
||||
{Vi: gives an "internal error" on lines that do not fit in the window}
|
||||
|
||||
The '@' occasion in the 'highlight' option can be used to set special
|
||||
highlighting for the '@' and '~' characters. This makes it possible to
|
||||
distinguish them from real characters in the buffer.
|
||||
|
||||
The 'showbreak' option contains the string to put in front of wrapped lines.
|
||||
|
||||
*wrap-off*
|
||||
If the 'wrap' option is off, long lines will not wrap. Only the part that
|
||||
fits on the screen is shown. If the cursor is moved to a part of the line
|
||||
that is not shown, the screen is scrolled horizontally. The advantage of
|
||||
this method is that columns are shown as they are and lines that cannot fit
|
||||
on the screen can be edited. The disadvantage is that you cannot see all the
|
||||
characters of a line at once. The 'sidescroll' option can be set to the
|
||||
minimal number of columns to scroll. {Vi: has no 'wrap' option}
|
||||
|
||||
All normal ASCII characters are displayed directly on the screen. The <Tab>
|
||||
is replaced with the number of spaces that it represents. Other non-printing
|
||||
characters are replaced with "^{char}", where {char} is the non-printing
|
||||
character with 64 added. Thus character 7 (bell) will be shown as "^G".
|
||||
Characters between 127 and 160 are replaced with "~{char}", where {char} is
|
||||
the character with 64 subtracted. These characters occupy more than one
|
||||
position on the screen. The cursor can only be positioned on the first one.
|
||||
|
||||
If you set the 'number' option, all lines will be preceded with their
|
||||
number. Tip: If you don't like wrapping lines to mix with the line numbers,
|
||||
set the 'showbreak' option to eight spaces:
|
||||
":set showbreak=\ \ \ \ \ \ \ \ "
|
||||
|
||||
If you set the 'list' option, <Tab> characters will not be shown as several
|
||||
spaces, but as "^I". A '$' will be placed at the end of the line, so you can
|
||||
find trailing blanks.
|
||||
|
||||
In Command-line mode only the command-line itself is shown correctly. The
|
||||
display of the buffer contents is updated as soon as you go back to Command
|
||||
mode.
|
||||
|
||||
The last line of the window is used for status and other messages. The
|
||||
status messages will only be used if an option is on:
|
||||
|
||||
status message option default Unix default ~
|
||||
current mode 'showmode' on on
|
||||
command characters 'showcmd' on off
|
||||
cursor position 'ruler' off off
|
||||
|
||||
The current mode is "-- INSERT --" or "-- REPLACE --", see |'showmode'|. The
|
||||
command characters are those that you typed but were not used yet. {Vi: does
|
||||
not show the characters you typed or the cursor position}
|
||||
|
||||
If you have a slow terminal you can switch off the status messages to speed
|
||||
up editing:
|
||||
:set nosc noru nosm
|
||||
|
||||
If there is an error, an error message will be shown for at least one second
|
||||
(in reverse video). {Vi: error messages may be overwritten with other
|
||||
messages before you have a chance to read them}
|
||||
|
||||
Some commands show how many lines were affected. Above which threshold this
|
||||
happens can be controlled with the 'report' option (default 2).
|
||||
|
||||
On the Amiga Vim will run in a CLI window. The name Vim and the full name of
|
||||
the current file name will be shown in the title bar. When the window is
|
||||
resized, Vim will automatically redraw the window. You may make the window as
|
||||
small as you like, but if it gets too small not a single line will fit in it.
|
||||
Make it at least 40 characters wide to be able to read most messages on the
|
||||
last line.
|
||||
|
||||
On most Unix systems, resizing the window is recognized and handled correctly
|
||||
by Vim. {Vi: not ok}
|
||||
|
||||
==============================================================================
|
||||
8. Definitions *definitions*
|
||||
|
||||
screen The whole area that Vim uses to work in. This can be
|
||||
a terminal emulator window. Also called "the Vim
|
||||
window".
|
||||
window A view on a buffer.
|
||||
|
||||
A screen contains one or more windows, separated by status lines and with the
|
||||
command line at the bottom.
|
||||
|
||||
+-------------------------------+
|
||||
screen | window 1 | window 2 |
|
||||
| | |
|
||||
| | |
|
||||
|= status line =|= status line =|
|
||||
| window 3 |
|
||||
| |
|
||||
| |
|
||||
|==== status line ==============|
|
||||
|command line |
|
||||
+-------------------------------+
|
||||
|
||||
The command line is also used for messages. It scrolls up the screen when
|
||||
there is not enough room in the command line.
|
||||
|
||||
A difference is made between four types of lines:
|
||||
|
||||
buffer lines The lines in the buffer. This is the same as the
|
||||
lines as they are read from/written to a file. They
|
||||
can be thousands of characters long.
|
||||
logical lines The buffer lines with folding applied. Buffer lines
|
||||
in a closed fold are changed to a single logical line:
|
||||
"+-- 99 lines folded". They can be thousands of
|
||||
characters long.
|
||||
window lines The lines displayed in a window: A range of logical
|
||||
lines with wrapping, line breaks, etc. applied. They
|
||||
can only be as long as the width of the window allows,
|
||||
longer lines are wrapped or truncated.
|
||||
screen lines The lines of the screen that Vim uses. Consists of
|
||||
the window lines of all windows, with status lines
|
||||
and the command line added. They can only be as long
|
||||
as the width of the screen allows. When the command
|
||||
line gets longer it wraps and lines are scrolled to
|
||||
make room.
|
||||
|
||||
buffer lines logical lines window lines screen lines ~
|
||||
|
||||
1. one 1. one 1. +-- folded 1. +-- folded
|
||||
2. two 2. +-- folded 2. five 2. five
|
||||
3. three 3. five 3. six 3. six
|
||||
4. four 4. six 4. seven 4. seven
|
||||
5. five 5. seven 5. === status line ===
|
||||
6. six 6. aaa
|
||||
7. seven 7. bbb
|
||||
8. ccc ccc c
|
||||
1. aaa 1. aaa 1. aaa 9. cc
|
||||
2. bbb 2. bbb 2. bbb 10. ddd
|
||||
3. ccc ccc ccc 3. ccc ccc ccc 3. ccc ccc c 11. ~
|
||||
4. ddd 4. ddd 4. cc 12. === status line ===
|
||||
5. ddd 13. (command line)
|
||||
6. ~
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1032
docs/vim/todo/map.txt
Normal file
1032
docs/vim/todo/map.txt
Normal file
File diff suppressed because it is too large
Load Diff
688
docs/vim/todo/message.txt
Normal file
688
docs/vim/todo/message.txt
Normal file
@ -0,0 +1,688 @@
|
||||
*message.txt* For Vim version 6.1. Last change: 2002 Feb 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
This file contains an alphabetical list of messages and error messages that
|
||||
Vim produces. You can use this if you don't understand what the message
|
||||
means. It is not complete though.
|
||||
|
||||
1. Old messages |:messages|
|
||||
2. Error messages |error-messages|
|
||||
3. Messages |messages|
|
||||
|
||||
==============================================================================
|
||||
1. Old messages *:messages* *:mes* *message-history*
|
||||
|
||||
The ":messages" command can be used to view previously given messages. This
|
||||
is especially useful when messages have been overwritten or truncated. This
|
||||
depends on the 'shortmess' option.
|
||||
|
||||
The number of remembered messages is fixed at 20.
|
||||
|
||||
If you are using translated messages, the first printed line tells who
|
||||
maintains the messages or the translations. You can use this to contact the
|
||||
maintainer when you spot a mistake.
|
||||
|
||||
If you want to find help on a specific (error) message, use the ID at the
|
||||
start of the message. For example, to get help on the message: >
|
||||
|
||||
E72: Close error on swap file
|
||||
|
||||
or (translated): >
|
||||
|
||||
E72: Errore durante chiusura swap file
|
||||
|
||||
Use: >
|
||||
|
||||
:help E72
|
||||
|
||||
If you are lazy, it also works without the shift key: >
|
||||
|
||||
:help e72
|
||||
|
||||
==============================================================================
|
||||
2. Error messages *error-messages*
|
||||
|
||||
When an error message is displayed, but it is removed before you could read
|
||||
it, you can see it again with: >
|
||||
:echo errmsg
|
||||
or view a list of recent messages with: >
|
||||
:messages
|
||||
|
||||
|
||||
LIST OF MESSAGES
|
||||
*E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317*
|
||||
*E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322*
|
||||
*E323* *E341* >
|
||||
Add to read buffer
|
||||
makemap: Illegal mode
|
||||
Cannot create BalloonEval with both message and callback
|
||||
Hangul automata ERROR
|
||||
block was not locked
|
||||
Didn't get block nr {N}?
|
||||
ml_timestamp: Didn't get block 0??
|
||||
pointer block id wrong {N}
|
||||
Updated too many blocks?
|
||||
get_varp ERROR
|
||||
u_undo: line numbers wrong
|
||||
undo list corrupt
|
||||
undo line missing
|
||||
ml_get: cannot find line {N}
|
||||
cannot find line {N}
|
||||
line number out of range: {N} past the end
|
||||
line count wrong in block {N}
|
||||
|
||||
This is an internal error. If you can reproduce it, please send in a bug
|
||||
report. |bugs|
|
||||
|
||||
>
|
||||
ATTENTION
|
||||
Found a swap file by the name ...
|
||||
|
||||
See |ATTENTION|.
|
||||
|
||||
*E92* >
|
||||
Buffer {N} not found
|
||||
|
||||
The buffer you requested does not exist. This can also happen when you have
|
||||
wiped out a buffer which contains a mark or is referenced in another way.
|
||||
|:bwipeout|
|
||||
|
||||
*E95* >
|
||||
Buffer with this name already exists
|
||||
|
||||
You cannot have two buffers with the same name.
|
||||
|
||||
*E72* >
|
||||
Close error on swap file
|
||||
|
||||
The |swap-file|, that is used to keep a copy of the edited text, could not be
|
||||
closed properly. Mostly harmless.
|
||||
|
||||
*E169* >
|
||||
Command too recursive
|
||||
|
||||
This happens when an Ex command executes an Ex command that executes an Ex
|
||||
command, etc. This is only allowed 200 times. When it's more there probably
|
||||
is an endless loop. Probably a |:execute| or |:source| command is involved.
|
||||
|
||||
*E254* >
|
||||
Cannot allocate color {name}
|
||||
|
||||
The color name {name} is unknown. See |gui-colors| for a list of colors that
|
||||
are available on most systems.
|
||||
|
||||
*E458* >
|
||||
Cannot allocate colormap entry for "xxxx"
|
||||
Cannot allocate colormap entry, some colors may be incorrect
|
||||
|
||||
This means that there are not enough colors available for Vim. It will still
|
||||
run, but some of the colors will not appear in the specified color. Try
|
||||
stopping other applications that use many colors, or start them after starting
|
||||
gvim.
|
||||
Netscape is known to consume a lot of colors. You can avoid this by telling
|
||||
it to use its own colormap: >
|
||||
netscape -install
|
||||
Or tell it to limit to a certain number of colors (64 should work well): >
|
||||
netscape -ncols 64
|
||||
This can also be done with a line in your Xdefaults file: >
|
||||
Netscape*installColormap: Yes
|
||||
or >
|
||||
Netscape*maxImageColors: 64
|
||||
<
|
||||
*E79* >
|
||||
Cannot expand wildcards
|
||||
|
||||
A filename contains a strange combination of characters, which causes Vim to
|
||||
attempt expanding wildcards but this fails. This does NOT mean that no
|
||||
matching file names could be found, but that the pattern was illegal.
|
||||
|
||||
*E190* *E212* >
|
||||
Cannot open "{filename}" for writing
|
||||
Can't open file for writing
|
||||
|
||||
For some reason the file you are writing to cannot be created or overwritten.
|
||||
The reason could be that you do not have permission to write in the directory
|
||||
or the file name is not valid.
|
||||
|
||||
*E166* >
|
||||
Can't open linked file for writing
|
||||
|
||||
You are trying to write to a file which can't be overwritten, and the file is
|
||||
a link (either a hard link or a symbolic link). Writing might still be
|
||||
possible if the directory that contains the link or the file is writable, but
|
||||
Vim now doesn't know if you want to delete the link and write the file in its
|
||||
place, or if you want to delete the file itself and write the new file in its
|
||||
place. If you really want to write the file under this name, you have to
|
||||
manually delete the link or the file, or change the permissions so that Vim
|
||||
can overwrite.
|
||||
|
||||
*E46* >
|
||||
Cannot set read-only variable "{name}"
|
||||
|
||||
You are trying to assign a value to an argument of a function |a:var| or a Vim
|
||||
internal variagble |v:var| which is read-only.
|
||||
|
||||
*E90* >
|
||||
Cannot unload last buffer
|
||||
|
||||
Vim always requires one buffer to be loaded, otherwise there would be nothing
|
||||
to display in the window.
|
||||
|
||||
*E40* >
|
||||
Can't open errorfile <filename>
|
||||
|
||||
When using the ":make" or ":grep" commands: The file used to save the error
|
||||
messages or grep output cannot be opened. This can have several causes:
|
||||
- 'shellredir' has a wrong value.
|
||||
- The shell changes directory, causing the error file to be written in another
|
||||
directory. This could be fixed by changing 'makeef', but then the make
|
||||
command is still executed in the wrong directory.
|
||||
- 'makeef' has a wrong value.
|
||||
- The 'grepprg' or 'makeprg' could not be executed. This cannot always be
|
||||
detected (especially on MS-Windows). Check your $PATH.
|
||||
|
||||
>
|
||||
Can't open file C:\TEMP\VIoD243.TMP
|
||||
|
||||
On MS-Windows, this message appears when the output of an external command was
|
||||
to be read, but the command didn't run successfully. This can be caused by
|
||||
many things. Check the 'shell', 'shellquote', 'shellxquote', 'shellslash' and
|
||||
related options. It might also be that the external command was not found,
|
||||
there is no different error message for that.
|
||||
|
||||
*E12* >
|
||||
Command not allowed from exrc/vimrc in current dir or tag search
|
||||
|
||||
Some commands are not allowed for security reasons. These commands mostly
|
||||
come from a .exrc or .vimrc file in the current directory, or from a tags
|
||||
file. Also see 'secure'.
|
||||
|
||||
*E74* >
|
||||
Command too complex
|
||||
|
||||
A mapping resulted in a very long command string. Could be caused by a
|
||||
mapping that indirectly calls itself.
|
||||
|
||||
>
|
||||
CONVERSION ERROR
|
||||
|
||||
When writing a file and the text "CONVERSION ERROR" appears, this means that
|
||||
some bits were lost when converting text from the internally used UTF-8 to the
|
||||
format of the file. The file will not be marked unmodified. If you care
|
||||
about the loss of information, set the 'fileencoding' option to another value
|
||||
that can handle the characters in the buffer and write again. If you don't
|
||||
care, you can abandon the buffer or reset the 'modified' option.
|
||||
|
||||
*E302* >
|
||||
Could not rename swap file
|
||||
|
||||
When the file name changes, Vim tries to rename the |swap-file| as well.
|
||||
This failed and the old swap file is now still used. Mostly harmless.
|
||||
|
||||
*E43* *E44* >
|
||||
Damaged match string
|
||||
Corrupted regexp program
|
||||
|
||||
Something inside Vim went wrong and resulted in a corrupted regexp. If you
|
||||
know how to reproduce this problem, please report it. |bugs|
|
||||
|
||||
*E208* *E209* *E210* >
|
||||
Error writing to "{filename}"
|
||||
Error closing "{filename}"
|
||||
Error reading "{filename}"
|
||||
|
||||
This occurs when Vim is trying to rename a file, but a simple change of file
|
||||
name doesn't work. Then the file will be copied, but somehow this failed.
|
||||
The result may be that both the original file and the destination file exist
|
||||
and the destination file may be incomplete.
|
||||
|
||||
>
|
||||
Vim: Error reading input, exiting...
|
||||
|
||||
This occurs when Vim cannot read typed characters while input is required.
|
||||
Vim got stuck, the only thing it can do is exit. This can happen when both
|
||||
stdin and stderr are redirected and executing a script that doesn't exit Vim.
|
||||
|
||||
*E47* >
|
||||
Error while reading errorfile
|
||||
|
||||
Reading the error file was not possible. This is NOT caused by an error
|
||||
message that was not recognized.
|
||||
|
||||
*E80* >
|
||||
Error while writing
|
||||
|
||||
Writing a file was not completed successfully. The file is probably
|
||||
incomplete.
|
||||
|
||||
*E13* *E189* >
|
||||
File exists (use ! to override)
|
||||
"{filename}" exists (use ! to override)
|
||||
|
||||
You are protected from accidentally overwriting a file. When you want to
|
||||
write anyway, use the same command, but add a "!" just after the command.
|
||||
Example: >
|
||||
:w /tmp/test
|
||||
changes to: >
|
||||
:w! /tmp/test
|
||||
<
|
||||
*E139* >
|
||||
File is loaded in another buffer
|
||||
|
||||
You are trying to write a file under a name which is also used in another
|
||||
buffer. This would result in two versions of the same file.
|
||||
|
||||
*E142* >
|
||||
File not written: Writing is disabled by 'write' option
|
||||
|
||||
The 'write' option is off. This makes all commands that try to write a file
|
||||
generate this message. This could be caused by a |-m| commandline argument.
|
||||
You can switch the 'write' option on with ":set write".
|
||||
|
||||
*E25* >
|
||||
GUI cannot be used: Not enabled at compile time
|
||||
|
||||
You are running a version of Vim that doesn't include the GUI code. Therefore
|
||||
"gvim" and ":gui" don't work.
|
||||
|
||||
*E49* >
|
||||
Invalid scroll size
|
||||
|
||||
This is caused by setting an invalid value for the 'scroll', 'scrolljump' or
|
||||
'scrolloff' options.
|
||||
|
||||
*E17* >
|
||||
"{filename}" is a directory
|
||||
|
||||
You tried to write a file with the name of a directory. This is not possible.
|
||||
You probably need to append a file name.
|
||||
|
||||
*E19* >
|
||||
Mark has invalid line number
|
||||
|
||||
You are using a mark that has a line number that doesn't exist. This can
|
||||
happen when you have a mark in another file, and some other program has
|
||||
deleted lines from it.
|
||||
|
||||
*E219* *E220* >
|
||||
Missing {.
|
||||
Missing }.
|
||||
|
||||
Using a {} construct in a file name, but there is a { without a matching } or
|
||||
the other way around. It should be used like this: {foo,bar}. This matches
|
||||
"foo" and "bar".
|
||||
|
||||
*E315* >
|
||||
ml_get: invalid lnum:
|
||||
|
||||
This is an internal Vim error. Please try to find out how it can be
|
||||
reproduced, and submit a bug report |bugreport.vim|.
|
||||
|
||||
*E173* >
|
||||
{number} more files to edit
|
||||
|
||||
You are trying to exit, while the last item in the argument list has not been
|
||||
edited. This protects you from accidentally exiting when you still have more
|
||||
files to work on. See |argument-list|. If you do want to exit, just do it
|
||||
again and it will work.
|
||||
|
||||
*E23* *E194* >
|
||||
No alternate file
|
||||
No alternate file name to substitute for '#'
|
||||
|
||||
The alternate file is not defined yet. See |alternate-file|.
|
||||
|
||||
*E32* >
|
||||
No file name
|
||||
|
||||
The current buffer has no name. To write it, use ":w fname". Or give the
|
||||
buffer a name with ":file fname".
|
||||
|
||||
*E141* >
|
||||
No file name for buffer {number}
|
||||
|
||||
One of the buffers that was changed does not have a file name. Therefore it
|
||||
cannot be written. You need to give the buffer a file name: >
|
||||
:buffer {number}
|
||||
:file {filename}
|
||||
<
|
||||
*E33* >
|
||||
No previous substitute regular expression
|
||||
|
||||
When using the '~' character in a pattern, it is replaced with the previously
|
||||
used pattern in a ":substitute" command. This fails when no such command has
|
||||
been used yet. See |/~|.
|
||||
|
||||
*E35* >
|
||||
No previous regular expression
|
||||
|
||||
When using an empty search pattern, the previous search pattern is used. But
|
||||
that is not possible if there was no previous search.
|
||||
|
||||
*E24* >
|
||||
No such abbreviation
|
||||
|
||||
You have used an ":unabbreviate" command with an argument which is not an
|
||||
existing abbreviation. All variations of this command give the same message:
|
||||
":cunabbrev", ":iunabbrev", etc. Check for trailing white space.
|
||||
|
||||
>
|
||||
/dev/dsp: No such file or directory
|
||||
|
||||
Only given for GTK GUI with Gnome support. Gnome tries to use the audio
|
||||
device and it isn't present. You can ignore this error.
|
||||
|
||||
*E31* >
|
||||
No such mapping
|
||||
|
||||
You have used an ":unmap" command with an argument which is not an existing
|
||||
mapping. All variations of this command give the same message: ":cunmap",
|
||||
":unmap!", etc. Check for trailing white space.
|
||||
|
||||
*E37* *E89* >
|
||||
No write since last change (use ! to override)
|
||||
No write since last change for buffer {N} (use ! to override)
|
||||
|
||||
You are trying to |abandon| a file that has changes. Vim protects you from
|
||||
losing your work. You can either write the changed file with ":w", or, if you
|
||||
are sure, |abandon| it anyway, and lose all the changes. This can be done by
|
||||
adding a '!' character just after the command you used. Example: >
|
||||
:e other_file
|
||||
changes to: >
|
||||
:e! other_file
|
||||
<
|
||||
*E162* >
|
||||
No write since last change for buffer "{name}"
|
||||
|
||||
This appears when you try to exit Vim while some buffers are changed. You
|
||||
will either have to write the changed buffer (with |:w|), or use a command to
|
||||
abandon the buffer forcefully, e.g., with ":qa!". Careful, make sure you
|
||||
don't throw away changes you really want to keep. You might have forgotten
|
||||
about a buffer, especially when 'hidden' is set.
|
||||
|
||||
*E38* >
|
||||
Null argument
|
||||
|
||||
Something inside Vim went wrong and resulted in a NULL pointer. If you know
|
||||
how to reproduce this problem, please report it. |bugs|
|
||||
|
||||
*E172* >
|
||||
Only one file name allowed
|
||||
|
||||
The ":edit" command only accepts one file name. When you want to specify
|
||||
several files for editing use ":next" |:next|.
|
||||
|
||||
*E41* *E82* *E83* *E342* >
|
||||
Out of memory!
|
||||
Out of memory! (allocating {number} bytes)
|
||||
Cannot allocate any buffer, exiting...
|
||||
Cannot allocate buffer, using other one...
|
||||
|
||||
Oh, oh. You must have been doing something complicated, or some other program
|
||||
is consuming your memory. Be careful! Vim is not completely prepared for an
|
||||
out-of-memory situation. First make sure that any changes are saved. Then
|
||||
try to solve the memory shortage. To stay on the safe side, exit Vim and
|
||||
start again. Also see |msdos-limitations|.
|
||||
|
||||
*E339* >
|
||||
Pattern too long
|
||||
|
||||
This only happens on systems with 16 bit ints: The compiled regexp pattern is
|
||||
longer than about 65000 characters. Try using a shorter pattern.
|
||||
|
||||
*E45* >
|
||||
'readonly' option is set (use ! to override)
|
||||
|
||||
You are trying to write a file that was marked as read-only. To write the
|
||||
file anyway, either reset the 'readonly' option, or add a '!' character just
|
||||
after the command you used. Example: >
|
||||
:w
|
||||
changes to: >
|
||||
:w!
|
||||
<
|
||||
*E294* *E295* *E301* >
|
||||
Read error in swap file
|
||||
Seek error in swap file read
|
||||
Oops, lost the swap file!!!
|
||||
|
||||
Vim tried to read text from the |swap-file|, but something went wrong. The
|
||||
text in the related buffer may now be corrupted! Check carefully before you
|
||||
write a buffer. You may want to write it in another file and check for
|
||||
differences.
|
||||
|
||||
*E192* >
|
||||
Recursive use of :normal too deep
|
||||
|
||||
You are using a ":normal" command, whose argument again uses a ":normal"
|
||||
command in a recursive way. This is restricted to 'maxmapdepth' levels. This
|
||||
example illustrates how to get this message: >
|
||||
:map gq :normal gq<CR>
|
||||
If you type "gq", it will execute this mapping, which will call "gq" again.
|
||||
|
||||
*E22* >
|
||||
Scripts nested too deep
|
||||
|
||||
Scripts can be read with the "-s" command-line argument and with the ":source"
|
||||
command. The script can then again read another script. This can continue
|
||||
for about 14 levels. When more nesting is done, Vim assumes that there is a
|
||||
recursive loop somewhere and stops with this error message.
|
||||
|
||||
*E319* >
|
||||
Sorry, the command is not available in this version
|
||||
|
||||
You have used a command that is not present in the version of Vim you are
|
||||
using. When compiling Vim, many different features can be enabled or
|
||||
disabled. This depends on how big Vim has chosen to be and the operating
|
||||
system. See |+feature-list| for when which feature is available. The
|
||||
|:version| command shows which feature Vim was compiled with.
|
||||
|
||||
*E300* >
|
||||
Swap file already exists (symlink attack?)
|
||||
|
||||
This message appears when Vim is trying to open a swap file and finds it
|
||||
already exists or finds a symbolic link in its place. This shouldn't happen,
|
||||
because Vim already checked that the file doesn't exist. Either someone else
|
||||
opened the same file at exactly the same moment (very unlikely) or someone is
|
||||
attempting a symlink attack (could happen when editing a file in /tmp or when
|
||||
'directory' starts with "/tmp", which is a bad choice).
|
||||
|
||||
*E432* >
|
||||
Tags file not sorted: {file name}
|
||||
|
||||
Vim (and Vi) expect tags files to be sorted in ASCII order. Binary searching
|
||||
can then be used, which is a lot faster than a linear search. If your tags
|
||||
files are not properly sorted, reset the |'tagbsearch'| option.
|
||||
This message is only given when Vim detects a problem when searching for a
|
||||
tag. Sometimes this message is not given, even thought the tags file is not
|
||||
properly sorted.
|
||||
|
||||
*E424* >
|
||||
Too many different highlighting attributes in use
|
||||
|
||||
Vim can only handle about 223 different kinds of highlighting. If you run
|
||||
into this limit, you have used too many |:highlight| commands with different
|
||||
arguments. A ":highlight link" is not counted.
|
||||
|
||||
*E77* >
|
||||
Too many file names
|
||||
|
||||
When expanding file names, more than one match was found. Only one match is
|
||||
allowed for the command that was used.
|
||||
|
||||
*E303* >
|
||||
Unable to open swap file for "{filename}", recovery impossible
|
||||
|
||||
Vim was not able to create a swap file. You can still edit the file, but if
|
||||
Vim unexpected exits the changes will be lost. And Vim may consume a lot of
|
||||
memory when editing a big file. You may want to change the 'directory' option
|
||||
to avoid this error. See |swap-file|.
|
||||
|
||||
*E140* >
|
||||
Use ! to write partial buffer
|
||||
|
||||
When using a range to write part of a buffer, it is unusual to overwrite the
|
||||
original file. It is probably a mistake (e.g., when Visual mode was active
|
||||
when using ":w"), therefore Vim requires using a ! after the command, e.g.:
|
||||
":3,10w!".
|
||||
>
|
||||
|
||||
Warning: Cannot convert string "<Key>Escape,_Key_Cancel" to type
|
||||
VirtualBinding
|
||||
|
||||
Messages like this appear when starting up. This is not a Vim problem, your
|
||||
X11 configuration is wrong. You can find a hint on how to solve this here:
|
||||
http://groups.yahoo.com/group/solarisonintel/message/12179.
|
||||
|
||||
*W10* >
|
||||
Warning: Changing a readonly file
|
||||
|
||||
The file is read-only and you are making a change to it anyway. You can use
|
||||
the |FileChangedRO| autocommand event to avoid this message (the autocommand
|
||||
must reset the 'readonly' option). See 'modifiable' to completely disallow
|
||||
making changes to a file.
|
||||
|
||||
*W13* >
|
||||
Warning: File "{filename}" has been created after editing started
|
||||
|
||||
You are editing a file in Vim when it didn't exist, but it does exist now.
|
||||
You will have to decide if you want to keep the version in Vim or the newly
|
||||
created file. This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W11* >
|
||||
Warning: File "{filename}" has changed since editing started
|
||||
|
||||
The file which you have started editing has got another timestamp and the
|
||||
contents changed (more precisely: When reading the file again with the current
|
||||
option settings and autocommands you would end up with different text). This
|
||||
probably means that some other program changed the file. You will have to
|
||||
find out what happened, and decide which version of the file you want to keep.
|
||||
Set the 'autoread' option if you want to do this automatically.
|
||||
There is one situation where you get this message even though there is nothing
|
||||
wrong: If you save a file in Windows on the day the daylight saving time
|
||||
starts. It can be fixed by adding this line in your autoexec.bat: >
|
||||
SET TZ=-1
|
||||
Adjust the "-1" for your time zone. Or just write the file again the next
|
||||
day.
|
||||
This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W12* >
|
||||
Warning: File "{filename}" has changed and the buffer was changed in Vim as well
|
||||
|
||||
Like the above, and the buffer for the file was changed in this Vim as well.
|
||||
You will have to decide if you want to keep the version in this Vim or the one
|
||||
on disk. This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W16* >
|
||||
Warning: Mode of file "{filename}" has changed since editing started
|
||||
|
||||
When the timestamp for a buffer was changed and the contents are still the
|
||||
same but the mode (permissions) have changed. This usually occurs when
|
||||
checking out a file from a version control system, which causes the read-only
|
||||
bit to be reset. It should be safe to reload the file. Set 'autoread' to
|
||||
automatically reload the file.
|
||||
|
||||
*E211* >
|
||||
Warning: File "{filename}" no longer available
|
||||
|
||||
The file which you have started editing has disappeared, or is no longer
|
||||
accessible. Make sure you write the buffer somewhere to avoid loosing
|
||||
changes. This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W14* >
|
||||
Warning: List of file names overflow
|
||||
|
||||
You must be using an awful lot of buffers. It's now possible that two buffers
|
||||
have the same number, which causes various problems. You might want to exit
|
||||
Vim and restart it.
|
||||
|
||||
*E296* *E297* >
|
||||
Seek error in swap file write
|
||||
Write error in swap file
|
||||
|
||||
This mostly happens when the disk is full. Vim could not write text into the
|
||||
|swap-file|. It's not directly harmful, but when Vim unexpectedly exits some
|
||||
text may be lost without recovery being possible. Vim might run out of memory
|
||||
when this problem persists.
|
||||
|
||||
*connection-refused* >
|
||||
Xlib: connection to "<machine-name:0.0" refused by server
|
||||
|
||||
This happens when Vim tries to connect to the X server, but the X server does
|
||||
not allow a connection. The connection to the X server is needed to be able
|
||||
to restore the title and for the xterm clipboard support. Unfortunately this
|
||||
error message cannot be avoided, except by disabling the |+xterm_clipboard|
|
||||
and |+X11| features.
|
||||
|
||||
*E10* >
|
||||
\\ should be followed by /, ? or &
|
||||
|
||||
A command line started with a backslash or the range of a command contained a
|
||||
backslash in a wrong place. This is often caused by command-line continuation
|
||||
being disabled. Remove the 'C' flag from the 'cpoptions' option to enable it.
|
||||
|
||||
==============================================================================
|
||||
3. Messages *messages*
|
||||
|
||||
This is an (incomplete) overview of various messages that Vim gives:
|
||||
|
||||
*hit-enter* *press-enter* *hit-return* *press-return* >
|
||||
|
||||
Hit ENTER or type command to continue
|
||||
|
||||
This message is given when there is something on the screen for you to read,
|
||||
and the screen is about to be redrawn:
|
||||
- After executing an external command (e.g., ":!ls" and "=").
|
||||
- Something is displayed on the status line that is longer than the width of
|
||||
the window, or runs into the 'showcmd' or 'ruler' output.
|
||||
|
||||
-> Hit <Enter> or <Space> to redraw the screen and continue, without that key
|
||||
being used otherwise.
|
||||
-> Hit ":" or any other Normal mode command character to start that command.
|
||||
-> Hit <C-Y> to copy (yank) a modeless selection to the clipboard register.
|
||||
-> Use a menu. The characters defined for Cmdline-mode are used.
|
||||
{Vi: only ":" commands are interpreted}
|
||||
|
||||
To reduce the number of hit-enter prompts:
|
||||
- Set 'cmdheight' to 2 or higher.
|
||||
- Add flags to 'shortmess'.
|
||||
- Reset 'showcmd' and/or 'ruler'.
|
||||
|
||||
Also see 'mouse'. It is highlighted with the |hl-Question| group.
|
||||
|
||||
|
||||
*more-prompt* >
|
||||
-- More --
|
||||
-- More -- (RET: line, SPACE: page, d: half page, q: quit)
|
||||
-- More -- (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)
|
||||
|
||||
This message is given when the screen is filled with messages. It is only
|
||||
given when the 'more' option is on. It is highlighted with the |hl-MoreMsg|
|
||||
group.
|
||||
|
||||
Type effect ~
|
||||
<CR> or <NL> or j or <Down> one more line
|
||||
<BS> or k or <Up> one line back (*)
|
||||
<Space> or <PageDown> next page
|
||||
b or <PageUp> previous page (*)
|
||||
d down half a page
|
||||
u up half a page (*)
|
||||
q, <Esc> or CTRL-C stop the listing
|
||||
: stop the listing and enter a
|
||||
command-line
|
||||
<C-Y> yank (copy) a modeless selection to
|
||||
the clipboard ("* and "+ registers)
|
||||
{menu-entry} what the menu is defined to in
|
||||
Cmdline-mode.
|
||||
|
||||
Any other key causes the meaning of the keys to be displayed.
|
||||
|
||||
(*) backwards scrolling is only supported for these commands: >
|
||||
:clist
|
||||
|
||||
Note: The typed key is directly obtained from the terminal, it is not mapped
|
||||
and typeahead is ignored.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1029
docs/vim/todo/motion.txt
Normal file
1029
docs/vim/todo/motion.txt
Normal file
File diff suppressed because it is too large
Load Diff
6324
docs/vim/todo/options.txt
Normal file
6324
docs/vim/todo/options.txt
Normal file
File diff suppressed because it is too large
Load Diff
1039
docs/vim/todo/pattern.txt
Normal file
1039
docs/vim/todo/pattern.txt
Normal file
File diff suppressed because it is too large
Load Diff
1305
docs/vim/todo/quickref.txt
Normal file
1305
docs/vim/todo/quickref.txt
Normal file
File diff suppressed because it is too large
Load Diff
490
docs/vim/todo/repeat.txt
Normal file
490
docs/vim/todo/repeat.txt
Normal file
@ -0,0 +1,490 @@
|
||||
*repeat.txt* For Vim version 6.1. Last change: 2001 Dec 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Repeating commands, Vim scripts and debugging *repeating*
|
||||
|
||||
Chapter 26 of the user manual introduces repeating |usr_26.txt|.
|
||||
|
||||
1. Single repeats |single-repeat|
|
||||
2. Multiple repeats |multi-repeat|
|
||||
3. Complex repeats |complex-repeat|
|
||||
4. Using Vim scripts |using-scripts|
|
||||
5. Debugging scripts |debug-scripts|
|
||||
|
||||
==============================================================================
|
||||
1. Single repeats *single-repeat*
|
||||
|
||||
*.*
|
||||
. Repeat last change, with count replaced with [count].
|
||||
Also repeat a yank command, when the 'y' flag is
|
||||
included in 'cpoptions'.
|
||||
|
||||
Simple changes can be repeated with the "." command. Without a count, the
|
||||
count of the last change is used. If you enter a count, it will replace the
|
||||
last one. If the last change included a specification of a numbered register,
|
||||
the register number will be incremented. See |undo-redo| for an example how
|
||||
to use this. Note that when repeating a command that used a Visual selection,
|
||||
the same SIZE of area is used, see |visual-repeat|.
|
||||
|
||||
*@:*
|
||||
@: Repeat last command-line [count] times.
|
||||
{not available when compiled without the
|
||||
|+cmdline_hist| feature}
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Multiple repeats *multi-repeat*
|
||||
|
||||
*:g* *:global* *E147* *E148*
|
||||
:[range]g[lobal]/{pattern}/[cmd]
|
||||
Execute the Ex command [cmd] (default ":p") on the
|
||||
lines within [range] where {pattern} matches.
|
||||
|
||||
:[range]g[lobal]!/{pattern}/[cmd]
|
||||
Execute the Ex command [cmd] (default ":p") on the
|
||||
lines within [range] where {pattern} does NOT match.
|
||||
|
||||
*:v* *:vglobal*
|
||||
:[range]v[global]/{pattern}/[cmd]
|
||||
Same as :g!.
|
||||
|
||||
The global commands work by first scanning through the [range] lines and
|
||||
marking each line where a match occurs (for a multi-line pattern, only the
|
||||
start of the match matters).
|
||||
In a second scan the [cmd] is executed for each marked line with its line
|
||||
number prepended. If a line is deleted its mark disappears.
|
||||
The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
|
||||
the command. If an error message is given for a line, the command for that
|
||||
line is aborted and the global command continues with the next matching line.
|
||||
|
||||
To repeat a non-Ex command, you can use the ":normal" command: >
|
||||
:g/pat/normal {commands}
|
||||
Make sure that {commands} ends with a whole command, otherwise Vim will wait
|
||||
for you to type the rest of the command for each match. The screen will not
|
||||
have been updated, so you don't know what you are doing. See |:normal|.
|
||||
|
||||
The undo/redo command will undo/redo the whole global command at once.
|
||||
The previous context mark will only be set once (with "''" you go back to
|
||||
where the cursor was before the global command).
|
||||
|
||||
The global command sets both the last used search pattern and the last used
|
||||
substitute pattern (this is vi compatible). This makes it easy to globally
|
||||
replace a string:
|
||||
:g/pat/s//PAT/g
|
||||
This replaces all occurrences of "pat" with "PAT". The same can be done with:
|
||||
:%s/pat/PAT/g
|
||||
Which is two characters shorter!
|
||||
|
||||
==============================================================================
|
||||
3. Complex repeats *complex-repeat*
|
||||
|
||||
*q* *recording*
|
||||
q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
|
||||
(uppercase to append). The 'q' command is disabled
|
||||
while executing a register, and it doesn't work inside
|
||||
a mapping. {Vi: no recording}
|
||||
|
||||
q Stops recording. (Implementation note: The 'q' that
|
||||
stops recording is not stored in the register, unless
|
||||
it was the result of a mapping) {Vi: no recording}
|
||||
|
||||
*@*
|
||||
@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} [count]
|
||||
times. Note that register '%' (name of the current
|
||||
file) and '#' (name of the alternate file) cannot be
|
||||
used. For "@=" you are prompted to enter an
|
||||
expression. The result of the expression is then
|
||||
executed. See also |@:|. {Vi: only named registers}
|
||||
|
||||
*@@*
|
||||
@@ Repeat the previous @{0-9a-z":*} [count] times.
|
||||
|
||||
:[addr]*{0-9a-z".=} *:@* *:star*
|
||||
:[addr]@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} as an Ex
|
||||
command. First set cursor at line [addr] (default is
|
||||
current line). When the last line in the register does
|
||||
not have a <CR> it will be added automatically when
|
||||
the 'e' flag is present in 'cpoptions'.
|
||||
Note that the ":*" command is only recognized when the
|
||||
'*' flag is present in 'cpoptions'. This is NOT the
|
||||
default when 'nocompatible' is used.
|
||||
For ":@=" the last used expression is used. The
|
||||
result of evaluating the expression is executed as an
|
||||
Ex command.
|
||||
Mappings are not recognized in these commands.
|
||||
{Vi: only in some versions} Future: Will execute the
|
||||
register for each line in the address range.
|
||||
|
||||
*:@:*
|
||||
:[addr]@: Repeat last command-line. First set cursor at line
|
||||
[addr] (default is current line). {not in Vi}
|
||||
|
||||
*:@@*
|
||||
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
|
||||
line [addr] (default is current line). {Vi: only in
|
||||
some versions}
|
||||
|
||||
==============================================================================
|
||||
4. Using Vim scripts *using-scripts*
|
||||
|
||||
For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
|
||||
*:so* *:source* *load-vim-script*
|
||||
:so[urce] {file} Read Ex commands from {file}. These are commands that
|
||||
start with a ":".
|
||||
|
||||
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
||||
that are executed from Normal mode, like you type
|
||||
them.
|
||||
When used after |:global|, |:argdo|, |:windo|,
|
||||
|:bufdo|, in a loop or when another command follows
|
||||
the display won't be updated while executing the
|
||||
commands.
|
||||
{not in Vi}
|
||||
|
||||
*:ru* *:runtime*
|
||||
:ru[ntime][!] {file} ..
|
||||
Read Ex commands from {file} in each directory given
|
||||
by 'runtimepath'. There is no error for non-existing
|
||||
files. Example: >
|
||||
:runtime syntax/c.vim
|
||||
|
||||
< There can be multiple {file} arguments, separated by
|
||||
spaces. Each {file} is searched for in the first
|
||||
directory from 'runtimepath', then in the second
|
||||
directory, etc. Use a backslash to include a space
|
||||
inside {file} (although it's better not to use spaces
|
||||
in file names, it causes trouble).
|
||||
|
||||
When [!] is included, all found files are sourced.
|
||||
When it is not included only the first found file is
|
||||
sourced.
|
||||
|
||||
When {file} contains wildcards it is expanded to all
|
||||
matching files. Example: >
|
||||
:runtime! plugin/*.vim
|
||||
< This is what Vim uses to load the plugin files when
|
||||
starting up. This similar command: >
|
||||
:runtime plugin/*.vim
|
||||
< would source the first file only.
|
||||
|
||||
When 'verbose' is one or higher, there is a message
|
||||
when no file could be found.
|
||||
When 'verbose' is two or higher, there is a message
|
||||
about each searched file.
|
||||
{not in Vi}
|
||||
|
||||
:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
|
||||
Specify the character encoding used in the script.
|
||||
The following lines will be converted from [encoding]
|
||||
to the value of the 'encoding' option, if they are
|
||||
different. Examples: >
|
||||
scriptencoding iso-8859-5
|
||||
scriptencoding cp932
|
||||
<
|
||||
When [encoding] is empty, no conversion is done. This
|
||||
can be used to restrict conversion to a sequence of
|
||||
lines: >
|
||||
scriptencoding euc-jp
|
||||
... lines to be converted ...
|
||||
scriptencoding
|
||||
... not converted ...
|
||||
|
||||
< When conversion isn't supported by the system, there
|
||||
is no error message and no conversion is done.
|
||||
|
||||
Don't use "ucs-2" or "ucs-4", scripts cannot be in
|
||||
these encodings (they would contain NUL bytes).
|
||||
|
||||
When compiled without the |+multi_byte| feature this
|
||||
command is ignored.
|
||||
{not in Vi}
|
||||
|
||||
*:scrip* *:scriptnames*
|
||||
:scrip[tnames] List all sourced script names, in the order they were
|
||||
first sourced. The number is used for the script ID
|
||||
|<SID>|.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+eval| feature}
|
||||
|
||||
*:fini* *:finish* *E168*
|
||||
:fini[sh] Stop sourcing a script. Can only be used in a Vim
|
||||
script file. This is a quick way to skip the rest of
|
||||
the file.
|
||||
{not in Vi}
|
||||
|
||||
All commands and command sequences can be repeated by putting them in a named
|
||||
register and then executing it. There are two ways to get the commands in the
|
||||
register:
|
||||
- Use the record command "q". You type the commands once, and while they are
|
||||
being executed they are stored in a register. Easy, because you can see
|
||||
what you are doing. If you make a mistake, "p"ut the register into the
|
||||
file, edit the command sequence, and then delete it into the register
|
||||
again. You can continue recording by appending to the register (use an
|
||||
uppercase letter).
|
||||
- Delete or yank the command sequence into the register.
|
||||
|
||||
Often used command sequences can be put under a function key with the ':map'
|
||||
command.
|
||||
|
||||
An alternative is to put the commands in a file, and execute them with the
|
||||
':source!' command. Useful for long command sequences. Can be combined with
|
||||
the ':map' command to put complicated commands under a function key.
|
||||
|
||||
The ':source' command reads Ex commands from a file line by line. You will
|
||||
have to type any needed keyboard input. The ':source!' command reads from a
|
||||
script file character by character, interpreting each character as if you
|
||||
typed it.
|
||||
|
||||
Example: When you give the ":!ls" command you get the |hit-enter| prompt. If
|
||||
you ':source' a file with the line "!ls" in it, you will have to type the
|
||||
<Enter> yourself. But if you ':source!' a file with the line ":!ls" in it,
|
||||
the next characters from that file are read until a <CR> is found. You will
|
||||
not have to type <CR> yourself, unless ":!ls" was the last line in the file.
|
||||
|
||||
It is possible to put ':source[!]' commands in the script file, so you can
|
||||
make a top-down hierarchy of script files. The ':source' command can be
|
||||
nested as deep as the number of files that can be opened at one time (about
|
||||
15). The ':source!' command can be nested up to 15 levels deep.
|
||||
|
||||
You can use the "<sfile>" string (literally, this is not a special key) inside
|
||||
of the sourced file, in places where a file name is expected. It will be
|
||||
replaced by the file name of the sourced file. For example, if you have a
|
||||
"other.vimrc" file in the same directory as your ".vimrc" file, you can source
|
||||
it from your ".vimrc" file with this command: >
|
||||
:source <sfile>:h/other.vimrc
|
||||
|
||||
In script files terminal-dependent key codes are represented by
|
||||
terminal-independent two character codes. This means that they can be used
|
||||
in the same way on different kinds of terminals. The first character of a
|
||||
key code is 0x80 or 128, shown on the screen as "~@". The second one can be
|
||||
found in the list |key-notation|. Any of these codes can also be entered
|
||||
with CTRL-V followed by the three digit decimal code. This does NOT work for
|
||||
the <t_xx> termcap codes, these can only be used in mappings.
|
||||
|
||||
*:source_crnl* *W15*
|
||||
MS-DOS, Win32 and OS/2: Files that are read with ":source" normally have
|
||||
<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s
|
||||
(for example, a file made on Unix), this will be recognized if 'fileformats'
|
||||
is not empty and the first line does not end in a <CR>. This fails if the
|
||||
first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If
|
||||
the first line ends in a <CR>, but following ones don't, you will get an error
|
||||
message, because the <CR> from the first lines will be lost.
|
||||
|
||||
Macintosh: Files that are read with ":source" normally have <CR> <EOL>s.
|
||||
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||
file made on Unix), this will be recognized if 'fileformats' is not empty and
|
||||
the first line does not end in a <CR>. Be careful not to use a file with <NL>
|
||||
linebreaks which has a <CR> in first line.
|
||||
|
||||
On other systems, Vim expects ":source"ed files to end in a <NL>. These
|
||||
always work. If you are using a file with <CR><NL> <EOL>s (for example, a
|
||||
file made on MS-DOS), all lines will have a trailing <CR>. This may cause
|
||||
problems for some commands (e.g., mappings). There is no automatic <EOL>
|
||||
detection, because it's common to start with a line that defines a mapping
|
||||
that ends in a <CR>, which will confuse the automaton.
|
||||
|
||||
*line-continuation*
|
||||
Long lines in a ":source"d Ex command script file can be split by inserting
|
||||
a line continuation symbol "\" (backslash) at the start of the next line.
|
||||
There can be white space before the backslash, which is ignored.
|
||||
|
||||
Example: the lines >
|
||||
:set comments=sr:/*,mb:*,el:*/,
|
||||
\://,
|
||||
\b:#,
|
||||
\:%,
|
||||
\n:>,
|
||||
\fb:-
|
||||
are interpreted as if they were given in one line:
|
||||
:set comments=sr:/*,mb:*,el:*/,://,b:#,:%,n:>,fb:-
|
||||
|
||||
All leading whitespace characters in the line before a backslash are ignored.
|
||||
Note however that trailing whitespace in the line before it cannot be
|
||||
inserted freely; it depends on the position where a command is split up
|
||||
whether additional whitespace is allowed or not.
|
||||
|
||||
There is a problem with the ":append" and ":insert" commands: >
|
||||
:1append
|
||||
\asdf
|
||||
.
|
||||
The backslash is seen as a line-continuation symbol, thus this results in the
|
||||
command: >
|
||||
:1appendasdf
|
||||
.
|
||||
To avoid this, add the 'C' flag to the 'cpoptions' option: >
|
||||
:set cpo+=C
|
||||
:1append
|
||||
\asdf
|
||||
.
|
||||
:set cpo-=C
|
||||
|
||||
Rationale:
|
||||
Most programs work with a trailing backslash to indicate line
|
||||
continuation. Using this in Vim would cause incompatibility with Vi.
|
||||
For example for this Vi mapping: >
|
||||
:map xx asdf\
|
||||
< Therefore the unusual leading backslash is used.
|
||||
|
||||
==============================================================================
|
||||
5. Debugging scripts *debug-scripts*
|
||||
|
||||
Besides the obvious messages that you can add to your scripts to find out what
|
||||
they are doing, Vim offers a debug mode. This allows you to step through a
|
||||
sourced file or user function and set breakpoints.
|
||||
|
||||
NOTE: The debugging mode is far from perfect. Debugging will have side
|
||||
effects on how Vim works. You cannot use it to debug everything. For
|
||||
example, the display is messed up by the debugging messages.
|
||||
{Vi does not have a debug mode}
|
||||
|
||||
An alternative to debug mode is setting the 'verbose' option. With a bigger
|
||||
number it will give more verbose messages about what Vim is doing.
|
||||
|
||||
|
||||
STARTING DEBUG MODE *debug-mode*
|
||||
|
||||
To enter debugging mode use one of these methods:
|
||||
1. Start Vim with the |-D| argument: >
|
||||
vim -D file.txt
|
||||
< Debugging will start as soon as the first vimrc file is sourced. This is
|
||||
useful to find out what is happening when Vim is starting up. A side
|
||||
effect is that Vim will switch the terminal mode before initialisations
|
||||
have finished, with unpredictable results.
|
||||
For a GUI-only version (Windows, Macintosh) the debugging will start as
|
||||
soon as the GUI window has been opened. To make this happen early, add a
|
||||
":gui" command in the vimrc file.
|
||||
*:debug*
|
||||
2. Run a command with ":debug" prepended. Debugging will only be done while
|
||||
this command executes. Useful for debugging a specific script or user
|
||||
function. And for scripts and fuctions used by autocommands. Example: >
|
||||
:debug edit test.txt.gz
|
||||
|
||||
3. Set a breakpoint in a sourced file or user function. You could do this in
|
||||
the command line: >
|
||||
vim -c "breakadd file */explorer.vim" .
|
||||
< This will run Vim and stop in the first line of the "explorer.vim" script.
|
||||
Breakpoints can also be set while in debugging mode.
|
||||
|
||||
In debugging mode every executed command is displayed before it is executed.
|
||||
Comment lines, empty lines and lines that are not executed are skipped. When
|
||||
a line contains two commands, separated by "|", each command will be displayed
|
||||
separately.
|
||||
|
||||
|
||||
DEBUG MODE
|
||||
|
||||
Once in debugging mode, the usual Ex commands can be used. For example, to
|
||||
inspect the value of a variable: >
|
||||
echo idx
|
||||
When inside a user function, this will print the value of the local variable
|
||||
"idx". Prepend "g:" to get the value of a global variable: >
|
||||
echo g:idx
|
||||
All commands are executed in the context of the current function or script.
|
||||
You can also set options, for example setting or resetting 'verbose' will show
|
||||
what happens, but you might want to set it just before executing the lines you
|
||||
are interested in: >
|
||||
:set verbose=20
|
||||
|
||||
Commands that require updating the screen should be avoided, because their
|
||||
effect won't be noticed until after leaving debug mode. For example: >
|
||||
:help
|
||||
won't be very helpful.
|
||||
|
||||
There is a separate command-line history for debug mode.
|
||||
|
||||
The line number for a function line is relative to the start of the function.
|
||||
If you have trouble figuring out where you are, edit the file that defines
|
||||
the function in another Vim, search for the start of the function and do
|
||||
"99j". Replace "99" with the line number.
|
||||
|
||||
Additionally, these commands can be used:
|
||||
*>cont*
|
||||
cont Continue execution until the next breakpoint is hit.
|
||||
*>quit*
|
||||
quit Abort execution. This is like using CTRL-C, some things might
|
||||
still be executed, doesn't abort everything. Still stops at
|
||||
the next breakpoint.
|
||||
*>next*
|
||||
next Execute the command and come back to debug mode when it's
|
||||
finished. This steps over user function calls and sourced
|
||||
files.
|
||||
*>step*
|
||||
step Execute the command and come back to debug mode for the next
|
||||
command. This steps into called user functions and sourced
|
||||
files.
|
||||
*>finish*
|
||||
finish Finish the current script or user function and come back to
|
||||
debug mode for the command after the one that sourced or
|
||||
called it.
|
||||
|
||||
About the additional commands in debug mode:
|
||||
- There is no command-line completion.
|
||||
- You can shorten them, up to a single character: "c", "n", "s" and "f".
|
||||
- Hitting <CR> will repeat the previous one. When doing another command, this
|
||||
is reset (because it's not clear what you want to repeat).
|
||||
- When you want to use the Ex command with the same name, prepend a colon:
|
||||
":cont", ":next", ":finish" (or shorter).
|
||||
|
||||
|
||||
DEFINING BREAKPOINTS
|
||||
*:breaka* *:breakadd*
|
||||
:breaka[dd] func [lnum] {name}
|
||||
Set a breakpoint in a function. Example: >
|
||||
:breakadd func Explore
|
||||
< Doesn't check for a valid function name, thus the breakpoint
|
||||
can be set before the function is defined.
|
||||
|
||||
:breaka[dd] file [lnum] {name}
|
||||
Set a breakpoint in a sourced file. Example: >
|
||||
:breakadd file 43 .vimrc
|
||||
|
||||
The [lnum] is the line number of the breakpoint. Vim will stop at or after
|
||||
this line. When omitted line 1 is used.
|
||||
|
||||
{name} is a pattern that is matched with the file or function name. The
|
||||
pattern is like what is used for autocommands. There must be a full match (as
|
||||
if the pattern starts with "^" and ends in "$"). A "*" matches any sequence
|
||||
of characters. 'ignorecase' is not used, but "\c" can be used in the pattern
|
||||
to ignore case |/\c|. Don't include the () for the function name!
|
||||
|
||||
The match for sourced scripts is done against the full file name. Examples: >
|
||||
breakadd file explorer
|
||||
won't match, the path is missing. >
|
||||
breakadd file *explorer.vim
|
||||
matches ".../plugin/explorer.vim" and ".../plugin/iexplorer.vim". >
|
||||
breakadd file */explorer.vim
|
||||
matches ".../plugin/explorer.vim" only.
|
||||
|
||||
The match for functions is done against the name as it's shown in the output
|
||||
of ":function". For local functions this means that something like "<SNR>99_"
|
||||
is prepended.
|
||||
|
||||
|
||||
DELETING BREAKPOINTS
|
||||
*:breakd* *:breakdel* *E161*
|
||||
:breakd[el] {nr}
|
||||
Delete breakpoint {nr}. Use |:breaklist| to see the number of
|
||||
each breakpoint.
|
||||
|
||||
:breakd[el] func [lnum] {name}
|
||||
Delete a breakpoint in a function.
|
||||
|
||||
:breakd[el] file [lnum] {name}
|
||||
Delete a breakpoint in a sourced file.
|
||||
|
||||
When [lnum] is omitted, the first breakpoint in the function or file is
|
||||
deleted.
|
||||
The {name} must be exactly the same as what was typed for the ":breakadd"
|
||||
command. "explorer", "*explorer.vim" and "*explorer*" are different.
|
||||
|
||||
|
||||
LISTING BREAKPOINTS
|
||||
*:breakl* *:breaklist*
|
||||
:breakl[ist]
|
||||
List all breakpoints.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
299
docs/vim/todo/scroll.txt
Normal file
299
docs/vim/todo/scroll.txt
Normal file
@ -0,0 +1,299 @@
|
||||
*scroll.txt* For Vim version 6.1. Last change: 2001 Sep 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Scrolling *scrolling*
|
||||
|
||||
These commands move the contents of the window. If the cursor position is
|
||||
moved off of the window, the cursor is moved onto the window (with
|
||||
'scrolloff' screen lines around it). A page is the number of lines in the
|
||||
window minus two. The mnemonics for these commands may be a bit confusing.
|
||||
Remember that the commands refer to moving the window (the part of the buffer
|
||||
that you see) upwards or downwards in the buffer. When the window moves
|
||||
upwards in the buffer, the text in the window moves downwards on your screen.
|
||||
|
||||
See section |03.7| of the user manual for an introduction.
|
||||
|
||||
1. Scrolling downwards |scroll-down|
|
||||
2. Scrolling upwards |scroll-up|
|
||||
3. Scrolling relative to cursor |scroll-cursor|
|
||||
4. Scrolling horizontally |scroll-horizontal|
|
||||
5. Scrolling synchronously |scroll-binding|
|
||||
6. Scrolling with a mouse wheel |scroll-mouse-wheel|
|
||||
|
||||
==============================================================================
|
||||
1. Scrolling downwards *scroll-down*
|
||||
|
||||
The following commands move the edit window (the part of the buffer that you
|
||||
see) downwards (this means that more lines downwards in the text buffer can be
|
||||
seen):
|
||||
|
||||
*CTRL-E*
|
||||
CTRL-E Scroll window [count] lines downwards in the buffer.
|
||||
Mnemonic: Extra lines.
|
||||
|
||||
*CTRL-D*
|
||||
CTRL-D Scroll window Downwards in the buffer. The number of
|
||||
lines comes from the 'scroll' option (default: half a
|
||||
screen). If [count] given, first set 'scroll' option
|
||||
to [count]. The cursor is moved the same number of
|
||||
lines down in the file (if possible; when lines wrap
|
||||
and when hitting the end of the file there may be a
|
||||
difference). When the cursor is on the last line of
|
||||
the buffer nothing happens and a beep is produced.
|
||||
See also 'startofline' option.
|
||||
{difference from vi: Vim scrolls 'scroll' screen
|
||||
lines, instead of file lines; makes a difference when
|
||||
lines wrap}
|
||||
|
||||
<S-Down> or *<S-Down>* *<kPageDown>*
|
||||
<PageDown> or *<PageDown>* *CTRL-F*
|
||||
CTRL-F Scroll window [count] pages Forwards (downwards) in
|
||||
the buffer. See also 'startofline' option.
|
||||
|
||||
*z+*
|
||||
z+ Without [count]: Redraw with the line just below the
|
||||
window at the top of the window. Put the cursor in
|
||||
that line, at the first non-blank in the line.
|
||||
With [count]: just like "z<CR>".
|
||||
|
||||
==============================================================================
|
||||
2. Scrolling upwards *scroll-up*
|
||||
|
||||
The following commands move the edit window (the part of the buffer that you
|
||||
see) upwards (this means that more lines upwards in the text buffer can be
|
||||
seen):
|
||||
|
||||
*CTRL-Y*
|
||||
CTRL-Y Scroll window [count] lines upwards in the buffer.
|
||||
Note: When using the MS-Windows key bindings CTRL-Y is
|
||||
remapped to redo.
|
||||
|
||||
*CTRL-U*
|
||||
CTRL-U Scroll window Upwards in the buffer. The number of
|
||||
lines comes from the 'scroll' option (default: half a
|
||||
screen). If [count] given, first set the 'scroll'
|
||||
option to [count]. The cursor is moved the same
|
||||
number of lines up in the file (if possible; when
|
||||
lines wrap and when hitting the end of the file there
|
||||
may be a difference). When the cursor is on the first
|
||||
line of the buffer nothing happens and a beep is
|
||||
produced. See also 'startofline' option.
|
||||
{difference from vi: Vim scrolls 'scroll' screen
|
||||
lines, instead of file lines; makes a difference when
|
||||
lines wrap}
|
||||
|
||||
<S-Up> or *<S-Up>* *<kPageUp>*
|
||||
<PageUp> or *<PageUp>* *CTRL-B*
|
||||
CTRL-B Scroll window [count] pages Backwards (upwards) in the
|
||||
buffer. See also 'startofline' option.
|
||||
|
||||
*z^*
|
||||
z^ Without [count]: Redraw with the line just above the
|
||||
window at the bottom of the window. Put the cursor in
|
||||
that line, at the first non-blank in the line.
|
||||
With [count]: First scroll the text to put the [count]
|
||||
line at the bottom of the window, then redraw with the
|
||||
line which is now at the top of the window at the
|
||||
bottom of the window. Put the cursor in that line, at
|
||||
the first non-blank in the line.
|
||||
|
||||
==============================================================================
|
||||
3. Scrolling relative to cursor *scroll-cursor*
|
||||
|
||||
The following commands reposition the edit window (the part of the buffer that
|
||||
you see) while keeping the cursor on the same line:
|
||||
|
||||
*z<CR>*
|
||||
z<CR> Redraw, line [count] at top of window (default
|
||||
cursor line). Put cursor at first non-blank in the
|
||||
line.
|
||||
|
||||
*zt*
|
||||
zt Like "z<CR>", but leave the cursor in the same
|
||||
column. {not in Vi}
|
||||
|
||||
*zN<CR>*
|
||||
z{height}<CR> Redraw, make window {height} lines tall. This is
|
||||
useful to make the number of lines small when screen
|
||||
updating is very slow. Cannot make the height more
|
||||
than the physical screen height.
|
||||
|
||||
*z.*
|
||||
z. Redraw, line [count] at center of window (default
|
||||
cursor line). Put cursor at first non-blank in the
|
||||
line.
|
||||
|
||||
*zz*
|
||||
zz Like "z.", but leave the cursor in the same column.
|
||||
Careful: If caps-lock is on, this commands becomes
|
||||
"ZZ": write buffer and exit! {not in Vi}
|
||||
|
||||
*z-*
|
||||
z- Redraw, line [count] at bottom of window (default
|
||||
cursor line). Put cursor at first non-blank in the
|
||||
line.
|
||||
|
||||
*zb*
|
||||
zb Like "z-", but leave the cursor in the same column.
|
||||
{not in Vi}
|
||||
|
||||
==============================================================================
|
||||
4. Scrolling horizontally *scroll-horizontal*
|
||||
|
||||
For the following four commands the cursor follows the screen. If the
|
||||
character that the cursor is on is moved off the screen, the cursor is moved
|
||||
to the closest character that is on the screen. The value of 'sidescroll' is
|
||||
not used.
|
||||
|
||||
z<Right> or *zl* *z<Right>*
|
||||
zl Scroll the screen [count] characters to the left.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
|
||||
z<Left> or *zh* *z<Left>*
|
||||
zh Scroll the screen [count] characters to the right.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
|
||||
*zL*
|
||||
zL Scroll the screen half a screenwidth to the left.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
|
||||
*zH*
|
||||
zH Scroll the screen half a screenwith to the right.
|
||||
This only works when 'wrap' is off. {not in Vi}
|
||||
|
||||
For the following two commands the cursor is not moved in the text, only the
|
||||
text scrolls on the screen.
|
||||
|
||||
*zs*
|
||||
zs Scroll the screen horizontally to position the cursor
|
||||
at the start (left side) of the screen. This only
|
||||
works when 'wrap' is off. {not in Vi}
|
||||
|
||||
*ze*
|
||||
ze Scroll the screen horizontally to position the cursor
|
||||
at the end (right side) of the screen. This only
|
||||
works when 'wrap' is off. {not in Vi}
|
||||
|
||||
==============================================================================
|
||||
5. Scrolling synchronously *scroll-binding*
|
||||
|
||||
Occasionally, it is desirable to bind two or more windows together such that
|
||||
when one window is scrolled, the other windows are scrolled also. In Vim,
|
||||
windows can be given this behavior by setting the (window-specific)
|
||||
'scrollbind' option. When a window that has 'scrollbind' set is scrolled, all
|
||||
other 'scrollbind' windows are scrolled the same amount, if possible. The
|
||||
behavior of 'scrollbind' can be modified by the 'scrollopt' option.
|
||||
|
||||
When a window also has the 'diff' option set, the scroll-binding uses the
|
||||
differences between the two buffers to synchronize the position precisely.
|
||||
Otherwise the following method is used.
|
||||
|
||||
*scrollbind-relative*
|
||||
Each 'scrollbind' window keeps track of its "relative offset," which can be
|
||||
thought of as the difference between the current window's vertical scroll
|
||||
position and the other window's vertical scroll position. When one of the
|
||||
'scrollbind' windows is asked to vertically scroll past the beginning or end
|
||||
limit of its text, the window no longer scrolls, but remembers how far past
|
||||
the limit it wishes to be. The window keeps this information so that it can
|
||||
maintain the same relative offset, regardless of its being asked to scroll
|
||||
past its buffer's limits.
|
||||
|
||||
However, if a 'scrollbind' window that has a relative offset that is past its
|
||||
buffer's limits is given the cursor focus, the other 'scrollbind' windows must
|
||||
jump to a location where the current window's relative offset is valid. This
|
||||
behavior can be changed by clearing the 'jump' flag from the 'scrollopt'
|
||||
option.
|
||||
|
||||
*syncbind* *:syncbind*
|
||||
:syncbind Force all 'scrollbind' windows to have the same
|
||||
relative offset. I.e., when any of the 'scrollbind'
|
||||
windows is scrolled to the top of its buffer, all of
|
||||
the 'scrollbind' windows will also be at the top of
|
||||
their buffers.
|
||||
|
||||
*scrollbind-quickadj*
|
||||
The 'scrollbind' flag is meaningful when using keyboard commands to vertically
|
||||
scroll a window, and also meaningful when using the vertical scrollbar of the
|
||||
window which has the cursor focus. However, when using the vertical scrollbar
|
||||
of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
|
||||
This allows quick adjustment of the relative offset of 'scrollbind' windows.
|
||||
|
||||
==============================================================================
|
||||
6. Scrolling with a mouse wheel *scroll-mouse-wheel*
|
||||
|
||||
When your mouse has a scroll wheel, it should work with Vim in the GUI. How
|
||||
it works depends on your system. It might also work in an xterm
|
||||
|xterm-mouse-wheel|.
|
||||
|
||||
For the Win32 GUI the scroll action is hard coded. It works just like
|
||||
dragging the scrollbar of the current window. How many lines are scrolled
|
||||
depends on your mouse driver. If the scroll action causes input focus
|
||||
problems, see |intellimouse-wheel-problems|.
|
||||
|
||||
For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
|
||||
presses <MouseDown> and <MouseUp>. The default action for these keys are:
|
||||
<MouseDown> scroll three lines down. *<MouseDown>*
|
||||
<S-MouseDown> scroll a full page down. *<S-MouseDown>*
|
||||
<C-MouseDown> scroll a full page down. *<C-MouseDown>*
|
||||
<MouseUp> scroll three lines up. *<MouseUp>*
|
||||
<S-MouseUp> scroll a full page up. *<S-MouseUp>*
|
||||
<C-MouseUp> scroll a full page up. *<C-MouseUp>*
|
||||
This should work in all modes, except when editing the command line.
|
||||
|
||||
Note that <MouseDown> is used for scrolling the text down, this happens when
|
||||
you turn the mouse wheel up!
|
||||
|
||||
You can modify this behavior by mapping the keys. For example, to make the
|
||||
scroll wheel move one line or half a page in Normal mode: >
|
||||
:map <MouseDown> <C-Y>
|
||||
:map <S-MouseDown> <C-U>
|
||||
:map <MouseUp> <C-E>
|
||||
:map <S-MouseUp> <C-D>
|
||||
You can also use Alt and Ctrl modifiers.
|
||||
|
||||
This only works when Vim gets the scroll wheel events, of course. You can
|
||||
check if this works with the "xev" program.
|
||||
|
||||
When using Xfree86, the /etc/XF86Config file should have the correct entry for
|
||||
your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: >
|
||||
Protocol "MouseMan"
|
||||
Device "/dev/psm0"
|
||||
ZAxisMapping 4 5
|
||||
See the Xfree86 documentation for information.
|
||||
|
||||
*xterm-mouse-wheel*
|
||||
To use the mouse wheel in a new xterm you only have to make the scroll wheel
|
||||
work in your Xserver, as mentioned above.
|
||||
|
||||
To use the mouse wheel in an older xterm you must do this:
|
||||
1. Make it work in your Xserver, as mentioned above.
|
||||
2. Add translations for the xterm, so that the xterm will pass a scroll event
|
||||
to Vim as an escape sequence.
|
||||
3. Add mappings in Vim, to interpret the escape sequences as <MouseUp> or
|
||||
<MouseDown> keys.
|
||||
|
||||
You can do the translations by adding this to your ~.Xdefaults file (or other
|
||||
file where your X resources are kept): >
|
||||
|
||||
XTerm*VT100.Translations: #override \n\
|
||||
s<Btn4Down>: string("0x9b") string("[64~") \n\
|
||||
s<Btn5Down>: string("0x9b") string("[65~") \n\
|
||||
<Btn4Down>: string("0x9b") string("[62~") \n\
|
||||
<Btn5Down>: string("0x9b") string("[63~") \n\
|
||||
<Btn4Up>: \n\
|
||||
<Btn5Up>:
|
||||
|
||||
Add these mappings to your vimrc file: >
|
||||
:map <M-Esc>[62~ <MouseDown>
|
||||
:map! <M-Esc>[62~ <MouseDown>
|
||||
:map <M-Esc>[63~ <MouseUp>
|
||||
:map! <M-Esc>[63~ <MouseUp>
|
||||
:map <M-Esc>[64~ <S-MouseDown>
|
||||
:map! <M-Esc>[64~ <S-MouseDown>
|
||||
:map <M-Esc>[65~ <S-MouseUp>
|
||||
:map! <M-Esc>[65~ <S-MouseUp>
|
||||
<
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
166
docs/vim/todo/sign.txt
Normal file
166
docs/vim/todo/sign.txt
Normal file
@ -0,0 +1,166 @@
|
||||
*sign.txt* For Vim version 6.1. Last change: 2002 Feb 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
and Bram Moolenaar
|
||||
|
||||
|
||||
Sign Support Features *sign-support*
|
||||
|
||||
1. Introduction |sign-intro|
|
||||
2. Commands |sign-commands|
|
||||
|
||||
{Vi does not have any of these features}
|
||||
{only available when compiled with the |+signs| feature}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *sign-intro*
|
||||
|
||||
When a debugger or other IPE tool is driving an editor it needs to be able
|
||||
to give specific highlights which quickly tell the user useful information
|
||||
about the file. One example of this would be a debugger which had an icon
|
||||
in the left-hand column denoting a breakpoint. Another example might be an
|
||||
arrow representing the Program Counter (PC). The sign features allow both
|
||||
placement of a sign, or icon, in the left-hand side of the window and
|
||||
definition of a highlight which will be applied to that line. Displaying the
|
||||
sign as an image is most likely only feasible in gvim (although Sun
|
||||
Microsystem's dtterm does support this its the only terminal emulator I know
|
||||
of which does). A text sign and the highlight should be feasible in any color
|
||||
terminal emulator.
|
||||
|
||||
Signs and highlights are not useful just for debuggers. Sun's Visual
|
||||
WorkShop uses signs and highlights to mark build errors and SourceBrowser
|
||||
hits. Additionally, the debugger supports 8 to 10 different signs and
|
||||
highlight colors. |workshop|
|
||||
|
||||
There are two steps in using signs:
|
||||
|
||||
1. Define the sign. This specifies the image, text and highlighting. For
|
||||
example, you can define a "break" sign with an image of a stop roadsign and
|
||||
text "!!".
|
||||
|
||||
2. Place the sign. This specifies the file and line number where the sign is
|
||||
displayed. A defined sign can be placed several times in different lines
|
||||
and files.
|
||||
|
||||
When signs are defined for a file, Vim will automatically add a column of two
|
||||
characters to display them in. When the last sign is unplaced the column
|
||||
disappears again.
|
||||
|
||||
==============================================================================
|
||||
2. Commands *sign-commands* *:sig* *:sign*
|
||||
|
||||
DEFINING A SIGN. *:sign-define* *E255* *E160*
|
||||
|
||||
:sign define {name} {argument}...
|
||||
Define a new sign or set attributes for an existing sign.
|
||||
The {name} can either be a number (all digits) or a name
|
||||
starting with a non-digit.
|
||||
About 120 different signs can be defined.
|
||||
|
||||
Accepted arguments:
|
||||
|
||||
icon={pixmap}
|
||||
Define the file name where the pixmap can be found. The
|
||||
pixmap should fit in the place of two characters. This is not
|
||||
checked. If the pixmap is too big it will cause redraw
|
||||
problems.
|
||||
|
||||
linehl={group}
|
||||
Highlighting group used for the whole line the sign is placed
|
||||
in. Most useful is defining a background color.
|
||||
|
||||
text={text} *E239*
|
||||
Define the text that is displayed when there is no icon or the
|
||||
GUI is not being used. Thus currently must be two ASCII
|
||||
characters.
|
||||
|
||||
texthl={group}
|
||||
Highlighting group used for the text item.
|
||||
|
||||
|
||||
DELETING A SIGN *:sign-undefine* *E155*
|
||||
|
||||
:sign undefine {name}
|
||||
Deletes a previously defined sign. If signs with this {name}
|
||||
are still placed this will cause trouble.
|
||||
|
||||
|
||||
LISTING SIGNS *:sign-list* *E156*
|
||||
|
||||
:sign list Lists all defined signs and their attributes.
|
||||
|
||||
:sign list {name}
|
||||
Lists one defined sign and its attributes.
|
||||
|
||||
|
||||
PLACING SIGNS *:sign-place* *E158*
|
||||
|
||||
:sign place {id} line={lnum} name={name} file={fname}
|
||||
Place sign defined as {name} at line {lnum} in file {fname}.
|
||||
The file {fname} must already be loaded in a buffer. The
|
||||
exact file name must be used, wildcards, $ENV and ~ are not
|
||||
expanded.
|
||||
|
||||
The sign is remembered under {id}, this can be used for
|
||||
further manipulation. {id} must be a number.
|
||||
It's up to the user to make sure the {id} is used only once in
|
||||
each file (if it's used several times unplacing will also have
|
||||
to be done several times and making changes may not work as
|
||||
expected).
|
||||
|
||||
:sign place {id} line={lnum} name={name} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
:sign place {id} name={name} file={fname}
|
||||
Change the placed sign {id} in file {fname} to use the defined
|
||||
sign {name}.
|
||||
This can be used to change the displayed sign without moving
|
||||
it (e.g., when the debugger has stopped at a breakpoint).
|
||||
|
||||
:sign place {id} name={name} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
|
||||
REMOVING SIGNS *:sign-unplace* *E159*
|
||||
|
||||
:sign unplace {id} file={fname}
|
||||
Remove the previously placed sign {id} from file {fname}.
|
||||
|
||||
:sign unplace {id} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
:sign unplace {id}
|
||||
Remove the previously placed sign {id} from all files it
|
||||
appears in.
|
||||
|
||||
:sign unplace *
|
||||
Remove all placed signs.
|
||||
|
||||
:sign unplace
|
||||
Remove the placed sign at the cursor position.
|
||||
|
||||
|
||||
LISTING PLACED SIGNS
|
||||
|
||||
:sign place file={fname}
|
||||
List signs placed in file {fname}.
|
||||
|
||||
:sign place buffer={nr}
|
||||
List signs placed in buffer {nr}.
|
||||
|
||||
:sign place List placed signs in all files.
|
||||
|
||||
|
||||
JUMPING TO A SIGN *:sign-jump* *E157*
|
||||
|
||||
:sign jump {id} file={fname}
|
||||
Open the file {fname} or jump to the window that contains
|
||||
{fname} and position the cursor at sign {id}.
|
||||
If the file isn't displayed in window and the current file can
|
||||
not be |abandon|ed this fails.
|
||||
|
||||
:sign jump {id} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1345
docs/vim/todo/starting.txt
Normal file
1345
docs/vim/todo/starting.txt
Normal file
File diff suppressed because it is too large
Load Diff
434
docs/vim/todo/tips.txt
Normal file
434
docs/vim/todo/tips.txt
Normal file
@ -0,0 +1,434 @@
|
||||
*tips.txt* For Vim version 6.1. Last change: 2001 Dec 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Tips and ideas for using Vim *tips*
|
||||
|
||||
Don't forget to browse the user manual, it also contains lots of useful tips
|
||||
|usr_toc.txt|.
|
||||
|
||||
Editing C programs |C-editing|
|
||||
Finding where identifiers are used |ident-search|
|
||||
Switching screens in an xterm |xterm-screens|
|
||||
Scrolling in Insert mode |scroll-insert|
|
||||
Smooth scrolling |scroll-smooth|
|
||||
Correcting common typing mistakes |type-mistakes|
|
||||
Counting words, lines, etc. |count-items|
|
||||
Restoring the cursor position |restore-position|
|
||||
Renaming files |rename-files|
|
||||
Speeding up external commands |speed-up|
|
||||
Useful mappings |useful-mappings|
|
||||
Compressing the help files |gzip-helpfile|
|
||||
Hex editing |hex-editing|
|
||||
Executing shell commands in a window |shell-window|
|
||||
Using <> notation in autocommands |autocmd-<>|
|
||||
|
||||
==============================================================================
|
||||
Editing C programs *C-editing*
|
||||
|
||||
There are quite a few features in Vim to help you edit C program files. Here
|
||||
is an overview with tags to jump to:
|
||||
|
||||
|usr_29.txt| Moving through programs chapter in the user manual.
|
||||
|usr_30.txt| Editing programs chapter in the user manual.
|
||||
|C-indenting| Automatically set the indent of a line while typing
|
||||
text.
|
||||
|=| Re-indent a few lines.
|
||||
|format-comments| Format comments.
|
||||
|
||||
|:checkpath| Show all recursively included files.
|
||||
|[i| Search for identifier under cursor in current and
|
||||
included files.
|
||||
|[_CTRL-I| Jump to match for "[i"
|
||||
|[I| List all lines in current and included files where
|
||||
identifier under the cursor matches.
|
||||
|[d| Search for define under cursor in current and included
|
||||
files.
|
||||
|
||||
|CTRL-]| Jump to tag under cursor (e.g., definition of a
|
||||
function).
|
||||
|CTRL-T| Jump back to before a CTRL-] command.
|
||||
|:tselect| Select one tag out of a list of matching tags.
|
||||
|
||||
|gd| Go to Declaration of local variable under cursor.
|
||||
|gD| Go to Declaration of global variable under cursor.
|
||||
|
||||
|gf| Go to file name under the cursor.
|
||||
|
||||
|%| Go to matching (), {}, [], /* */, #if, #else, #endif.
|
||||
|[/| Go to previous start of comment.
|
||||
|]/| Go to next end of comment.
|
||||
|[#| Go back to unclosed #if, #ifdef, or #else.
|
||||
|]#| Go forward to unclosed #else or #endif.
|
||||
|[(| Go back to unclosed '('
|
||||
|])| Go forward to unclosed ')'
|
||||
|[{| Go back to unclosed '{'
|
||||
|]}| Go forward to unclosed '}'
|
||||
|
||||
|v_ab| Select "a block" from "[(" to "])", including braces
|
||||
|v_ib| Select "inner block" from "[(" to "])"
|
||||
|v_aB| Select "a block" from "[{" to "]}", including brackets
|
||||
|v_iB| Select "inner block" from "[{" to "]}"
|
||||
|
||||
==============================================================================
|
||||
Finding where identifiers are used *ident-search*
|
||||
|
||||
You probably already know that |tags| can be used to jump to the place where a
|
||||
function or variable is defined. But sometimes you wish you could jump to all
|
||||
the places where a function or variable is being used. This is possible in
|
||||
two ways:
|
||||
1. Using the |:grep| command. This should work on most Unix systems,
|
||||
but can be slow (it reads all files) and only searches in one directory.
|
||||
2. Using ID utils. This is fast and works in multiple directories. It uses a
|
||||
database to store locations. You will need some additional programs for
|
||||
this to work. And you need to keep the database up to date.
|
||||
|
||||
Using the GNU id-tools:
|
||||
|
||||
What you need:
|
||||
- The GNU id-tools installed (mkid is needed to create ID and lid is needed to
|
||||
use the macros).
|
||||
- An identifier database file called "ID" in the current directory. You can
|
||||
create it with the shell command "mkid file1 file2 ..".
|
||||
|
||||
Put this in your .vimrc: >
|
||||
map _u :call ID_search()<Bar>execute "/\\<" . g:word . "\\>"<CR>
|
||||
map _n :n<Bar>execute "/\\<" . g:word . "\\>"<CR>
|
||||
|
||||
function ID_search()
|
||||
let g:word = expand("<cword>")
|
||||
let x = system("lid --key=none ". g:word)
|
||||
let x = substitute(x, "\n", " ", "g")
|
||||
execute "next " . x
|
||||
endfun
|
||||
|
||||
To use it, place the cursor on a word, type "_u" and vim will load the file
|
||||
that contains the word. Search for the next occurence of the word in the same
|
||||
file with "n". Go to the next file with "_n".
|
||||
|
||||
This has been tested with id-utils-3.2 (which is the name of the id-tools
|
||||
archive file on your closest gnu-ftp-mirror).
|
||||
|
||||
[the idea for this comes from Andreas Kutschera]
|
||||
|
||||
==============================================================================
|
||||
Switching screens in an xterm *xterm-screens* *xterm-save-screen*
|
||||
|
||||
(From comp.editors, by Juergen Weigert, in reply to a question)
|
||||
|
||||
:> Another question is that after exiting vim, the screen is left as it
|
||||
:> was, i.e. the contents of the file I was viewing (editing) was left on
|
||||
:> the screen. The output from my previous like "ls" were lost,
|
||||
:> ie. no longer in the scrolling buffer. I know that there is a way to
|
||||
:> restore the screen after exiting vim or other vi like editors,
|
||||
:> I just don't know how. Helps are appreciated. Thanks.
|
||||
:
|
||||
:I imagine someone else can answer this. I assume though that vim and vi do
|
||||
:the same thing as each other for a given xterm setup.
|
||||
|
||||
They not necessarily do the same thing, as this may be a termcap vs.
|
||||
terminfo problem. You should be aware that there are two databases for
|
||||
describing attributes of a particular type of terminal: termcap and
|
||||
terminfo. This can cause differences when the entries differ AND when of
|
||||
the programs in question one uses terminfo and the other uses termcap
|
||||
(also see |+terminfo|).
|
||||
|
||||
In your particular problem, you are looking for the control sequences
|
||||
^[[?47h and ^[[?47l. These switch between xterms alternate and main screen
|
||||
buffer. As a quick workaround a command sequence like >
|
||||
echo -n "^[[?47h"; vim ... ; echo -n "^[[?47l"
|
||||
may do what you want. (My notation ^[ means the ESC character, further down
|
||||
you'll see that the databases use \E instead).
|
||||
|
||||
On startup, vim echoes the value of the termcap variable ti (terminfo:
|
||||
smcup) to the terminal. When exiting, it echoes te (terminfo: rmcup). Thus
|
||||
these two variables are the correct place where the above mentioned control
|
||||
sequences should go.
|
||||
|
||||
Compare your xterm termcap entry (found in /etc/termcap) with your xterm
|
||||
terminfo entry (retrieved with /usr/5bin/infocmp -C xterm). Both should
|
||||
contain entries similar to: >
|
||||
:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:
|
||||
|
||||
PS: If you find any difference, someone (your sysadmin?) should better check
|
||||
the complete termcap and terminfo database for consistency.
|
||||
|
||||
NOTE 1: If you recompile Vim with FEAT_XTERM_SAVE defined in feature.h, the
|
||||
builtin xterm will include the mentioned "te" and "ti" entries.
|
||||
|
||||
NOTE 2: If you want to disable the screen switching, and you don't want to
|
||||
change your termcap, you can add these lines to your .vimrc: >
|
||||
:set t_ti= t_te=
|
||||
|
||||
==============================================================================
|
||||
Scrolling in Insert mode *scroll-insert*
|
||||
|
||||
If you are in insert mode and you want to see something that is just off the
|
||||
screen, you can use CTRL-X CTRL-E and CTRL-X CTRL-Y to scroll the screen.
|
||||
|i_CTRL-X_CTRL-E|
|
||||
|
||||
To make this easier, you could use these mappings: >
|
||||
:inoremap <C-E> <C-X><C-E>
|
||||
:inoremap <C-Y> <C-X><C-Y>
|
||||
(Type this literally, make sure the '<' flag is not in 'cpoptions').
|
||||
You then lose the ability to copy text from the line above/below the cursor
|
||||
|i_CTRL-E|.
|
||||
|
||||
Also consider setting 'scrolloff' to a larger value, so that you can always see
|
||||
some context around the cursor. If 'scrolloff' is bigger than half the window
|
||||
height, the cursor will always be in the middle and the text is scrolled when
|
||||
the cursor is moved up/down.
|
||||
|
||||
==============================================================================
|
||||
Smooth scrolling *scroll-smooth*
|
||||
|
||||
If you like the scrolling to go a bit smoother, you can use these mappings: >
|
||||
:map <C-U> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y>
|
||||
:map <C-D> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E>
|
||||
|
||||
(Type this literally, make sure the '<' flag is not in 'cpoptions').
|
||||
|
||||
==============================================================================
|
||||
Correcting common typing mistakes *type-mistakes*
|
||||
|
||||
When there are a few words that you keep on typing in the wrong way, make
|
||||
abbreviations that correct them. For example: >
|
||||
:ab teh the
|
||||
:ab fro for
|
||||
|
||||
==============================================================================
|
||||
Counting words, lines, etc. *count-items*
|
||||
|
||||
To count how often any pattern occurs in a buffer, set 'report' to 0, and use
|
||||
the substitute command to replace the pattern with itself. The reported
|
||||
number of substitutions is the number of items. Examples: >
|
||||
|
||||
:set report=0
|
||||
:%s/./&/g characters
|
||||
:%s/\i\+/&/g words
|
||||
:%s/^ lines
|
||||
:%s/the/&/g "the" anywhere
|
||||
:%s/\<the\>/&/g "the" as a word
|
||||
|
||||
You might want to reset 'hlsearch' or do ":nohlsearch".
|
||||
An alternative is using |v_g_CTRL-G| in Visual mode.
|
||||
|
||||
==============================================================================
|
||||
Restoring the cursor position *restore-position*
|
||||
|
||||
Sometimes you want to write a mapping that makes a change somewhere in the
|
||||
file and restores the cursor position, without scrolling the text. For
|
||||
example, to change the date mark in a file: >
|
||||
:map <F2> msHmtgg/Last [cC]hange:\s*/e+1<CR>"_D"=strftime("%Y %b %d")<CR>p'tzt`s
|
||||
|
||||
Breaking up saving the position:
|
||||
ms store cursor position in the 's' mark
|
||||
H go to the first line in the window
|
||||
mt store this position in the 't' mark
|
||||
|
||||
Breaking up restoring the position:
|
||||
't go to the line previously at the top of the window
|
||||
zt scroll to move this line to the top of the window
|
||||
`s jump to the original position of the cursor
|
||||
|
||||
==============================================================================
|
||||
Renaming files *rename-files*
|
||||
|
||||
Say I have a directory with the following files in them (directory picked at
|
||||
random :-):
|
||||
|
||||
buffer.c
|
||||
charset.c
|
||||
digraph.c
|
||||
...
|
||||
|
||||
and I want to rename *.c *.bla. I'd do it like this: >
|
||||
|
||||
$ vim
|
||||
:r! ls *.c
|
||||
:%s/\(.*\).c/mv & \1.bla
|
||||
:w !sh
|
||||
:q!
|
||||
|
||||
==============================================================================
|
||||
Speeding up external commands *speed-up*
|
||||
|
||||
In some situations, execution of an external command can be very slow. This
|
||||
can also slow down wildcard expansion on Unix. Here are a few suggestions to
|
||||
increase the speed.
|
||||
|
||||
If your .cshrc (or other file, depending on the shell used) is very long, you
|
||||
should separate it into a section for interactive use and a section for
|
||||
non-interactive use (often called secondary shells). When you execute a
|
||||
command from Vim like ":!ls", you do not need the interactive things (for
|
||||
example, setting the prompt). Put the stuff that is not needed after these
|
||||
lines: >
|
||||
|
||||
if ($?prompt == 0) then
|
||||
exit 0
|
||||
endif
|
||||
|
||||
Another way is to include the "-f" flag in the 'shell' option, e.g.: >
|
||||
|
||||
:set shell=csh\ -f
|
||||
|
||||
(the backslash is needed to include the space in the option).
|
||||
This will make csh completely skip the use of the .cshrc file. This may cause
|
||||
some things to stop working though.
|
||||
|
||||
==============================================================================
|
||||
Useful mappings *useful-mappings*
|
||||
|
||||
Here are a few mappings that some people like to use.
|
||||
|
||||
*map-backtick* >
|
||||
:map ' `
|
||||
Make the single quote work like a backtick. Puts the cursor on the column of
|
||||
a mark, instead of going to the first non-blank character in the line.
|
||||
|
||||
*emacs-keys*
|
||||
For Emacs-style editing on the command-line: >
|
||||
" start of line
|
||||
:cnoremap <C-A> <Home>
|
||||
" back one character
|
||||
:cnoremap <C-B> <Left>
|
||||
" delete character under cursor
|
||||
:cnoremap <C-D> <Del>
|
||||
" end of line
|
||||
:cnoremap <C-E> <End>
|
||||
" forward one character
|
||||
:cnoremap <C-F> <Right>
|
||||
" recall newer command-line
|
||||
:cnoremap <C-N> <Down>
|
||||
" recall previous (older) command-line
|
||||
:cnoremap <C-P> <Up>
|
||||
" back one word
|
||||
:cnoremap <Esc><C-B> <S-Left>
|
||||
" forward one word
|
||||
:cnoremap <Esc><C-F> <S-Right>
|
||||
|
||||
NOTE: This requires that the '<' flag is excluded from 'cpoptions'. |<>|
|
||||
|
||||
*format-bullet-list*
|
||||
This mapping will format any bullet list. It requires that there is an empty
|
||||
line above and below each list entry. The expression commands are used to
|
||||
be able to give comments to the parts of the mapping. >
|
||||
|
||||
:let m = ":map _f :set ai<CR>" " need 'autoindent' set
|
||||
:let m = m . "{O<Esc>" " add empty line above item
|
||||
:let m = m . "}{)^W" " move to text after bullet
|
||||
:let m = m . "i <CR> <Esc>" " add space for indent
|
||||
:let m = m . "gq}" " format text after the bullet
|
||||
:let m = m . "{dd" " remove the empty line
|
||||
:let m = m . "5lDJ" " put text after bullet
|
||||
:execute m |" define the mapping
|
||||
|
||||
(<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not
|
||||
CTRL-W. You can copy/paste this into Vim if '<' is not included in
|
||||
'cpoptions')
|
||||
|
||||
Note that the last comment starts with |", because the ":execute" command
|
||||
doesn't accept a comment directly.
|
||||
|
||||
You also need to set 'textwidth' to a non-zero value, e.g., >
|
||||
:set tw=70
|
||||
|
||||
A mapping that does about the same, but takes the indent for the list from the
|
||||
first line (Note: this mapping is a single long line with a lot of spaces): >
|
||||
:map _f :set ai<CR>}{a <Esc>WWmmkD`mi<CR><Esc>kkddpJgq}'mJO<Esc>j
|
||||
<
|
||||
*collapse*
|
||||
These two mappings reduce a sequence of empty (;b) or blank (;n) lines into a
|
||||
single line >
|
||||
:map ;b GoZ<Esc>:g/^$/.,/./-j<CR>Gdd
|
||||
:map ;n GoZ<Esc>:g/^[ <Tab>]*$/.,/[^ <Tab>]/-j<CR>Gdd
|
||||
|
||||
==============================================================================
|
||||
Compressing the help files *gzip-helpfile*
|
||||
|
||||
For those of you who are really short on disk space, you can compress the help
|
||||
files and still be able to view them with Vim. This makes accessing the help
|
||||
files a bit slower and requires the "gzip" program.
|
||||
|
||||
(1) Compress all the help files: "gzip doc/*.txt".
|
||||
|
||||
(2) Edit "doc/tags" and change the ".txt" to ".txt.gz": >
|
||||
:%s=\(\t.*\.txt\)\t=\1.gz\t=
|
||||
|
||||
(3) Add this line to your vimrc: >
|
||||
set helpfile={dirname}/help.txt.gz
|
||||
|
||||
Where {dirname} is the directory where the help files are. The |gzip| plugin
|
||||
will take care of decompressing the files.
|
||||
You must make sure that $VIMRUNTIME is set to where the other Vim files are,
|
||||
when they are not in the same location as the compressed "doc" directory. See
|
||||
|$VIMRUNTIME|.
|
||||
|
||||
==============================================================================
|
||||
Executing shell commands in a window *shell-window*
|
||||
|
||||
There have been questions for the possibility to execute a shell in a window
|
||||
inside Vim. The answer: you can't! Including this would add a lot of code to
|
||||
Vim, which is a good reason not to do this. After all, Vim is an editor, it
|
||||
is not supposed to do non-editing tasks. However, to get something like this,
|
||||
you might try splitting your terminal screen or display window with the
|
||||
"splitvt" program. You can probably find it on some ftp server. The person
|
||||
that knows more about this is Sam Lantinga <slouken@cs.ucdavis.edu>.
|
||||
An alternative is the "window" command, found on BSD Unix systems, which
|
||||
supports multiple overlapped windows. Or the "screen" program, found at
|
||||
www.uni-erlangen.de, which supports a stack of windows.
|
||||
|
||||
==============================================================================
|
||||
Hex editing *hex-editing* *using-xxd*
|
||||
|
||||
See section |23.4| of the user manual.
|
||||
|
||||
If one has a particular extension that one uses for binary files (such as exe,
|
||||
bin, etc), you may find it helpful to automate the process with the following
|
||||
bit of autocmds for your <.vimrc>. Change that "*.bin" to whatever
|
||||
comma-separated list of extension(s) you find yourself wanting to edit: >
|
||||
|
||||
" vim -b : edit binary using xxd-format!
|
||||
augroup Binary
|
||||
au!
|
||||
au BufReadPre *.bin let &bin=1
|
||||
au BufReadPost *.bin if &bin | %!xxd
|
||||
au BufReadPost *.bin set ft=xxd | endif
|
||||
au BufWritePre *.bin if &bin | %!xxd -r
|
||||
au BufWritePre *.bin endif
|
||||
au BufWritePost *.bin if &bin | %!xxd
|
||||
au BufWritePost *.bin set nomod | endif
|
||||
augroup END
|
||||
|
||||
==============================================================================
|
||||
Using <> notation in autocommands *autocmd-<>*
|
||||
|
||||
The <> notation is not recognized in the argument of an :autocmd. To avoid
|
||||
having to use special characters, you could use a self-destroying mapping to
|
||||
get the <> notation and then call the mapping from the autocmd. Example:
|
||||
|
||||
*map-self-destroy* >
|
||||
" This is for automatically adding the name of the file to the menu list.
|
||||
" It uses a self-destroying mapping!
|
||||
" 1. use a line in the buffer to convert the 'dots' in the file name to \.
|
||||
" 2. store that in register '"'
|
||||
" 3. add that name to the Buffers menu list
|
||||
" WARNING: this does have some side effects, like overwriting the
|
||||
" current register contents and removing any mapping for the "i" command.
|
||||
"
|
||||
autocmd BufNewFile,BufReadPre * nmap i :nunmap i<CR>O<C-R>%<Esc>:.g/\./s/\./\\./g<CR>0"9y$u:menu Buffers.<C-R>9 :buffer <C-R>%<C-V><CR><CR>
|
||||
autocmd BufNewFile,BufReadPre * normal i
|
||||
|
||||
Another method, perhaps better, is to use the ":execute" command. In the
|
||||
string you can use the <> notation by preceding it with a backslash. Don't
|
||||
forget to double the number of existing backslashes and put a backslash before
|
||||
'"'.
|
||||
>
|
||||
autocmd BufNewFile,BufReadPre * exe "normal O\<C-R>%\<Esc>:.g/\\./s/\\./\\\\./g\<CR>0\"9y$u:menu Buffers.\<C-R>9 :buffer \<C-R>%\<C-V>\<CR>\<CR>"
|
||||
|
||||
For a real buffer menu, user functions should be used (see |:function|), but
|
||||
then the <> notation isn't used, which defeats using it as an example here.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
3167
docs/vim/todo/todo.txt
Normal file
3167
docs/vim/todo/todo.txt
Normal file
File diff suppressed because it is too large
Load Diff
116
docs/vim/todo/undo.txt
Normal file
116
docs/vim/todo/undo.txt
Normal file
@ -0,0 +1,116 @@
|
||||
*undo.txt* For Vim version 6.1. Last change: 2001 Sep 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Undo and redo *undo-redo*
|
||||
|
||||
The basics are explained in section |02.5| of the user manual.
|
||||
|
||||
1. Undo and redo commands |undo-commands|
|
||||
2. Two ways of undo |undo-two-ways|
|
||||
3. Remarks about undo |undo-remarks|
|
||||
|
||||
==============================================================================
|
||||
1. Undo and redo commands *undo-commands*
|
||||
|
||||
<Undo> or *undo* *<Undo>* *u*
|
||||
u Undo [count] changes. {Vi: only one level}
|
||||
|
||||
*:u* *:un* *:undo*
|
||||
:u[ndo] Undo one change. {Vi: only one level}
|
||||
|
||||
*CTRL-R*
|
||||
CTRL-R Redo [count] changes which were undone. {Vi: redraw
|
||||
screen}
|
||||
|
||||
*:red* *:redo* *redo*
|
||||
:red[o] Redo one change which was undone. {Vi: no redo}
|
||||
|
||||
*U*
|
||||
U Undo all latest changes on one line. {Vi: while not
|
||||
moved off of it}
|
||||
|
||||
The last changes are remembered. You can use the undo and redo commands above
|
||||
to revert the text to how it was before each change. You can also apply the
|
||||
changes again, getting back the text before the undo.
|
||||
|
||||
The "U" command is treated by undo/redo just like any other command. Thus a
|
||||
"u" command undos a "U" command and a 'CTRL-R' command redoes it again. When
|
||||
mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will
|
||||
restore the situation of a line to before the previous "U" command. This may
|
||||
be confusing. Try it out to get used to it.
|
||||
The "U" command will always mark the buffer as changed. When "U" changes the
|
||||
buffer back to how it was without changes, it is still considered changed.
|
||||
Use "u" to undo changes until the buffer becomes unchanged.
|
||||
|
||||
==============================================================================
|
||||
2. Two ways of undo *undo-two-ways*
|
||||
|
||||
How undo and redo commands work depends on the 'u' flag in 'cpoptions'.
|
||||
There is the Vim way ('u' excluded) and the vi-compatible way ('u' included).
|
||||
In the Vim way, "uu" undoes two changes. In the Vi-compatible way, "uu" does
|
||||
nothing (undoes an undo).
|
||||
|
||||
'u' excluded, the Vim way:
|
||||
You can go back in time with the undo command. You can then go forward again
|
||||
with the redo command. If you make a new change after the undo command,
|
||||
the redo will not be possible anymore.
|
||||
|
||||
'u' included, the Vi-compatible way:
|
||||
The undo command undoes the previous change, and also the previous undo command.
|
||||
The redo command repeats the previous undo command. It does NOT repeat a
|
||||
change command, use "." for that.
|
||||
|
||||
Examples Vim way Vi-compatible way ~
|
||||
"uu" two times undo no-op
|
||||
"u CTRL-R" no-op two times undo
|
||||
|
||||
Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this
|
||||
is not Vi compatible. For example "dwdwu." in Vi deletes two
|
||||
words, in Nvi it does nothing.
|
||||
|
||||
==============================================================================
|
||||
3. Remarks about undo *undo-remarks*
|
||||
|
||||
The number of changes that are remembered is set with the 'undolevels' option.
|
||||
If it is zero, the Vi-compatible way is always used. If it is negative no
|
||||
undo is possible. Use this if you are running out of memory.
|
||||
|
||||
Marks for the buffer ('a to 'z) are also saved and restored, together with the
|
||||
text. {Vi does this a little bit different}
|
||||
|
||||
When all changes have been undone, the buffer is not considered to be changed.
|
||||
It is then possible to exit Vim with ":q" instead of ":q!". {this is not in
|
||||
Vi} Note that this is relative to the last write of the file. Typing "u"
|
||||
after ":w" actually changes the buffer, compared to what was written, so the
|
||||
buffer is considered changed then.
|
||||
|
||||
When manual |folding| is being used, the folds are not saved and restored.
|
||||
Only changes completely within a fold will keep the fold as it was, because
|
||||
the first and last line of the fold don't change.
|
||||
|
||||
The numbered registers can also be used for undoing deletes. Each time you
|
||||
delete text, it is put into register "1. The contents of register "1 are
|
||||
shifted to "2, etc. The contents of register "9 are lost. You can now get
|
||||
back the most recent deleted text with the put command: '"1P'. (also, if the
|
||||
deleted text was the result of the last delete or copy operation, 'P' or 'p'
|
||||
also works as this puts the contents of the unnamed register). You can get
|
||||
back the text of three deletes ago with '"3P'.
|
||||
|
||||
If you want to get back more than one part of deleted text, you can use a
|
||||
special feature of the repeat command ".". It will increase the number of the
|
||||
register used. So if you first do ""1P", the following "." will result in a
|
||||
'"2P'. Repeating this will result in all numbered registers being inserted.
|
||||
|
||||
Example: If you deleted text with 'dd....' it can be restored with
|
||||
'"1P....'.
|
||||
|
||||
If you don't know in which register the deleted text is, you can use the
|
||||
:display command. An alternative is to try the first register with '"1P', and
|
||||
if it is not what you want do 'u.'. This will remove the contents of the
|
||||
first put, and repeat the put command for the second register. Repeat the
|
||||
'u.' until you got what you want.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
890
docs/vim/todo/various.txt
Normal file
890
docs/vim/todo/various.txt
Normal file
@ -0,0 +1,890 @@
|
||||
*various.txt* For Vim version 6.1. Last change: 2002 Feb 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Various commands *various*
|
||||
|
||||
1. Various commands |various-cmds|
|
||||
2. Online help |online-help|
|
||||
3. Printing |printing|
|
||||
4. Using Vim like less or more |less|
|
||||
|
||||
==============================================================================
|
||||
1. Various commands *various-cmds*
|
||||
|
||||
*CTRL-L*
|
||||
CTRL-L Clear and redraw the screen (later).
|
||||
|
||||
*:redr* *:redraw*
|
||||
:redr[aw][!] Redraw the screen right now. When ! is included it is
|
||||
cleared first.
|
||||
Useful to update the screen halfway executing a script
|
||||
or function. Also when halfway a mapping and
|
||||
'lazyredraw' is set.
|
||||
|
||||
*N<Del>*
|
||||
<Del> When entering a number: Remove the last digit.
|
||||
Note: if you like to use <BS> for this, add this
|
||||
mapping to your .vimrc:
|
||||
:map CTRL-V <BS> CTRL-V <Del>
|
||||
See |:fixdel| if your <Del> key does not do what you
|
||||
want.
|
||||
|
||||
:as[cii] or *ga* *:as* *:ascii*
|
||||
ga Print the ascii value of the character under the
|
||||
cursor in decimal, hexadecimal and octal. For
|
||||
example, when the cursor is on a 'R':
|
||||
<R> 82, Hex 52, Octal 122
|
||||
When the character is a non-standard ASCII character,
|
||||
but printable according to the 'isprint' option, the
|
||||
non-printable version is also given. When the
|
||||
character is larger than 127, the <M-x> form is also
|
||||
printed. For example:
|
||||
<~A> <M-^A> 129, Hex 81, Octal 201
|
||||
<p> <|~> <M-~> 254, Hex fe, Octal 376
|
||||
(where <p> is a special character)
|
||||
The <Nul> character in a file is stored internally as
|
||||
<NL>, but it will be shown as:
|
||||
<^@> 0, Hex 00, Octal 000
|
||||
Mnemonic: Get Ascii value. {not in Vi}
|
||||
|
||||
*g8*
|
||||
g8 Print the hex values of the bytes used in the
|
||||
character under the cursor, assuming it is in |UTF-8|
|
||||
encoding. This also shows composing characters.
|
||||
Example of a character with three composing
|
||||
characters: >
|
||||
e0 b8 81 + e0 b8 b9 + e0 b9 89
|
||||
< {not in Vi}
|
||||
|
||||
*:p* *:pr* *:print*
|
||||
:[range]p[rint] Print [range] lines (default current line).
|
||||
Note: If you are looking for a way to print your text
|
||||
file, you need an external program for that. In the
|
||||
GUI you can use the File.Print menu entry.
|
||||
(For printing on paper see |:hardcopy|)
|
||||
|
||||
:[range]p[rint] {count}
|
||||
Print {count} lines, starting with [range] (default
|
||||
current line |cmdline-ranges|).
|
||||
|
||||
*:P* *:Print*
|
||||
:[range]P[rint] [count]
|
||||
Just as ":print". Was apparently added to Vi for
|
||||
people that keep the shift key pressed too long...
|
||||
|
||||
*:l* *:list*
|
||||
:[range]l[ist] [count]
|
||||
Same as :print, but display unprintable characters
|
||||
with '^'.
|
||||
|
||||
*:nu* *:number*
|
||||
:[range]nu[mber] [count]
|
||||
Same as :print, but precede each line with its line
|
||||
number. (See also 'highlight' option).
|
||||
|
||||
*:#*
|
||||
:[range]# [count] synonym for :number.
|
||||
|
||||
*:z* *E144*
|
||||
:{range}z[+-^.=]{count} Display several lines of text surrounding the line
|
||||
specified with {range}, or around the current line
|
||||
if there is no {range}. If there is a {count}, that's
|
||||
how many lines you'll see; otherwise, the current
|
||||
window size is used.
|
||||
|
||||
:z can be used either alone or followed by any of
|
||||
several punctuation marks. These have the following
|
||||
effect:
|
||||
|
||||
mark first line last line new location ~
|
||||
---- ---------- --------- ------------
|
||||
+ current line 1 scr forward 1 scr forward
|
||||
- 1 scr back current line current line
|
||||
^ 2 scr back 1 scr back 1 scr back
|
||||
. 1/2 scr back 1/2 scr fwd 1/2 src fwd
|
||||
= 1/2 src back 1/2 scr fwd current line
|
||||
|
||||
Specifying no mark at all is the same as "+".
|
||||
If the mark is "=", a line of dashes is printed
|
||||
around the current line.
|
||||
|
||||
:{range}z#[+-^.=]{count} *:z#*
|
||||
Like ":z", but number the lines.
|
||||
{not in all versions of Vi, not with these arguments}
|
||||
|
||||
*:=*
|
||||
:= Print the cursor line number.
|
||||
|
||||
:{range}= Prints the last line number in {range}.
|
||||
|
||||
:norm[al][!] {commands} *:norm* *:normal*
|
||||
Execute Normal mode commands {commands}. This makes
|
||||
it possible to execute Normal mode commands typed on
|
||||
the command-line. {commands} is executed like it is
|
||||
typed. For undo all commands are undone together.
|
||||
If the [!] is given, mappings will not be used.
|
||||
{commands} should be a complete command. If
|
||||
{commands} does not finish a command, the last one
|
||||
will be aborted as if <Esc> was typed. The display
|
||||
isn't updated while doing this. This implies that an
|
||||
insert command must be completed (to start Insert
|
||||
mode, see |:startinsert|). A ":" command must be
|
||||
completed as well.
|
||||
The 'insertmode' option is ignored for {commands}.
|
||||
This command cannot be followed by another command,
|
||||
since any '|' is considered part of the command.
|
||||
This command can be used recursively, but the depth is
|
||||
limited by 'maxmapdepth'.
|
||||
When this command is called from a non-remappable
|
||||
mapping |:noremap|, the argument can be mapped anyway.
|
||||
An alternative is to use |:execute|, which uses an
|
||||
expression as argument. This allows the use of
|
||||
printable characters. Example: >
|
||||
:exe "normal \<c-w>\<c-w>"
|
||||
< {not in Vi, of course}
|
||||
Not available when |+ex_extra| feature was disabled at
|
||||
compile time.
|
||||
|
||||
:{range}norm[al][!] {commands} *:normal-range*
|
||||
Execute Normal mode commands {commands} for each line
|
||||
in the {range}. Before executing the {commands}, the
|
||||
cursor is positioned in the first column of the range,
|
||||
for each line. Otherwise it's the same as the
|
||||
":normal" command without a range.
|
||||
{not in Vi}
|
||||
Not available when |+ex_extra| feature was disabled at
|
||||
compile time.
|
||||
|
||||
*:sh* *:shell* *E371*
|
||||
:sh[ell] This command starts a shell. When the shell exits
|
||||
(after the "exit" command) you return to Vim. The
|
||||
name for the shell command comes from 'shell' option.
|
||||
*E360*
|
||||
Note: This doesn't work when Vim on the Amiga was
|
||||
started in QuickFix mode from a compiler, because the
|
||||
compiler will have set stdin to a non-interactive
|
||||
mode.
|
||||
|
||||
*:!cmd* *:!* *E34*
|
||||
:!{cmd} Execute {cmd} with the shell. See also the 'shell'
|
||||
and 'shelltype' option.
|
||||
Any '!' in {cmd} is replaced with the previous
|
||||
external command (see also 'cpoptions'). But not when
|
||||
there is a backslash before the '!', then that
|
||||
backslash is removed. Example: ":!ls" followed by
|
||||
":!echo ! \! \\!" executes "echo ls ! \!".
|
||||
After the command has been executed, the timestamp of
|
||||
the current file is checked |timestamp|.
|
||||
There cannot be a '|' in {cmd}, see |:bar|.
|
||||
On Unix the command normally runs in a non-interactive
|
||||
shell. If you want an interactive shell to be used
|
||||
(to use aliases) set 'shellcmdflag' to "-ic".
|
||||
For Win32 also see |:!start|.
|
||||
Vim redraws the screen after the command is finished,
|
||||
because it may have printed any text. This requires a
|
||||
hit-enter prompt, so that you can read any messages.
|
||||
To avoid this use: >
|
||||
:silent !{cmd}
|
||||
< The screen is not redrawn then, thus you have to use
|
||||
CTRL-L or ":redraw!" if the command did display
|
||||
something.
|
||||
Also see |shell-window|.
|
||||
|
||||
*:!!*
|
||||
:!! Repeat last ":!{cmd}".
|
||||
|
||||
*:ve* *:version*
|
||||
:ve[rsion] Print the version number of the editor. If the
|
||||
compiler used understands "__DATE__" the compilation
|
||||
date is mentioned. Otherwise a fixed release-date is
|
||||
shown.
|
||||
The following lines contain information about which
|
||||
features were enabled when Vim was compiled. When
|
||||
there is a preceding '+', the feature is included,
|
||||
when there is a '-' it is excluded. To change this,
|
||||
you have to edit feature.h and recompile Vim.
|
||||
To check for this in an expression, see |has()|.
|
||||
Here is an overview of the features.
|
||||
The first column shows the smallest version in which
|
||||
they are included:
|
||||
T tiny
|
||||
S small
|
||||
N normal
|
||||
B big
|
||||
H huge
|
||||
m manually enabled or depends on other features
|
||||
(none) system dependent
|
||||
Thus if a feature is marked with "N", it is included
|
||||
in the normal, big and huge versions of Vim.
|
||||
|
||||
*+feature-list*
|
||||
*+ARP* Amiga only: ARP support included
|
||||
N *+autocmd* |:autocmd|, automatic commands
|
||||
m *+balloon_eval* |balloon-eval| support
|
||||
N *+browse* |:browse| command
|
||||
N *+builtin_terms* some terminals builtin |builtin-terms|
|
||||
B *++builtin_terms* maximal terminals builtin |builtin-terms|
|
||||
N *+byte_offset* support for 'o' flag in 'statusline' option, "go"
|
||||
and ":goto" commands.
|
||||
N *+cindent* |'cindent'|, C indenting
|
||||
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
|
||||
*+clipboard* |clipboard| support
|
||||
N *+cmdline_compl* command line completion |cmdline-completion|
|
||||
N *+cmdline_hist* command line history |cmdline-history|
|
||||
N *+cmdline_info* |'showcmd'| and |'ruler'|
|
||||
N *+comments* |'comments'| support
|
||||
N *+cryptv* encryption support |encryption|
|
||||
B *+cscope* |cscope| support
|
||||
N *+dialog_gui* Support for |:confirm| with GUI dialog.
|
||||
N *+dialog_con* Support for |:confirm| with console dialog.
|
||||
N *+dialog_con_gui* Support for |:confirm| with GUI and console dialog.
|
||||
N *+diff* |vimdiff| and 'diff'
|
||||
N *+digraphs* |digraphs| *E196*
|
||||
B *+emacs_tags* |emacs-tags| files
|
||||
N *+eval* expression evaluation |eval.txt|
|
||||
N *+ex_extra* Vim's extra Ex commands: |:center|, |:left|,
|
||||
|:normal|, |:retab| and |:right|
|
||||
N *+extra_search* |'hlsearch'| and |'incsearch'| options.
|
||||
B *+farsi* |farsi| language
|
||||
N *+file_in_path* |gf|, |CTRL-W_f| and |<cfile>|
|
||||
N *+find_in_path* include file searches: |[I|, |:isearch|,
|
||||
|CTRL-W_CTRL-I|, |:checkpath|, etc.
|
||||
N *+folding* |folding|
|
||||
*+footer* |gui-footer|
|
||||
*+fork* Unix only: |fork| shell commands
|
||||
N *+gettext* message translations |multi-lang|
|
||||
*+GUI_Athena* Unix only: Athena |GUI|
|
||||
*+GUI_BeOS* BeOS only: BeOS |GUI|
|
||||
*+GUI_GTK* Unix only: GTK+ |GUI|
|
||||
*+GUI_Motif* Unix only: Motif |GUI|
|
||||
*+GUI_Photon* QNX only: Photon |GUI|
|
||||
m *+hangul_input* Hangul input support |hangul|
|
||||
*+iconv* Compiled with the |iconv()| function, may have |/dyn|
|
||||
N *+insert_expand* |insert_expand| Insert mode completion
|
||||
N *+jumplist* |jumplist|
|
||||
B *+keymap* |'keymap'|
|
||||
B *+langmap* |'langmap'|
|
||||
N *+libcall* |libcall()|
|
||||
N *+linebreak* |'linebreak'|, |'breakat'| and |'showbreak'|
|
||||
N *+lispindent* |'lisp'|
|
||||
N *+listcmds* Vim commands for the list of buffers |buffer-hidden|
|
||||
and argument list |:argdelete|
|
||||
N *+localmap* Support for mappings local to a buffer |:map-local|
|
||||
N *+menu* |:menu|
|
||||
N *+mksession* |:mksession|
|
||||
N *+modify_fname* |filename-modifiers|
|
||||
N *+mouse* Mouse handling |mouse-using|
|
||||
N *+mouseshape* |'mouseshape'|
|
||||
B *+mouse_dec* Unix only: Dec terminal mouse handling |dec-mouse|
|
||||
N *+mouse_gpm* Unix only: Linux console mouse handling |gpm-mouse|
|
||||
B *+mouse_netterm* Unix only: netterm mouse handling |netterm-mouse|
|
||||
N *+mouse_pterm* QNX only: pterm mouse handling |qnx-terminal|
|
||||
N *+mouse_xterm* Unix only: xterm mouse handling |xterm-mouse|
|
||||
B *+multi_byte* Korean and other languages |multibyte|
|
||||
*+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
|
||||
N *+multi_lang* non-English language support |multi-lang|
|
||||
m *+ole* Win32 GUI only: |ole-interface|
|
||||
*+osfiletype* Support for the 'osfiletype' option and filetype
|
||||
checking in automatic commands. |autocmd-osfiletypes|
|
||||
N *+path_extra* Up/downwards search in 'path' and 'tags'
|
||||
m *+perl* Perl interface |perl|, may have |/dyn|
|
||||
*+postscript* |:hardcopy| writes a PostScript file
|
||||
N *+printer* |:hardcopy| command
|
||||
m *+python* Python interface |python|, may have |/dyn|
|
||||
N *+quickfix* |:make| and |quickfix| commands
|
||||
B *+rightleft* Right to left typing |'rightleft'|
|
||||
m *+ruby* Ruby interface |ruby|, may have |/dyn|
|
||||
N *+scrollbind* |'scrollbind'|
|
||||
B *+signs* |:sign|
|
||||
N *+smartindent* |'smartindent'|
|
||||
m *+sniff* SniFF interface (no docs available...)
|
||||
N *+statusline* Options 'statusline', 'rulerformat' and special
|
||||
formats of 'titlestring' and 'iconstring'
|
||||
*+sun_workshop* |workshop|
|
||||
N *+syntax* Syntax highlighting |syntax|
|
||||
*+system()* Unix only: opposite of |+fork|
|
||||
N *+tag_binary* binary searching in tags file |tag-binary-search|
|
||||
N *+tag_old_static* old method for static tags |tag-old-static|
|
||||
m *+tag_any_white* any white space allowed in tags file |tag-any-white|
|
||||
m *+tcl* Tcl interface |tcl|, may have |/dyn|
|
||||
*+terminfo* uses |terminfo| instead of termcap
|
||||
N *+termresponse* support for |t_RV| and |v:termresponse|
|
||||
N *+textobjects* |text-objects| selection
|
||||
*+tgetent* non-Unix only: able to use external termcap
|
||||
N *+title* Setting the window title |'title'|
|
||||
N *+toolbar* |gui-toolbar|
|
||||
N *+user_commands* User-defined commands. |user-commands|
|
||||
N *+viminfo* |'viminfo'|
|
||||
N *+vertsplit* Vertically split windows |:vsplit|
|
||||
N *+virtualedit* |'virtualedit'|
|
||||
S *+visual* Visual mode |Visual-mode|
|
||||
N *+visualextra* extra Visual mode commands |blockwise-operators|
|
||||
N *+vreplace* |gR| and |gr|
|
||||
N *+wildignore* |'wildignore'|
|
||||
N *+wildmenu* |'wildmenu'|
|
||||
S *+windows* more than one window
|
||||
m *+writebackup* |'writebackup'| is default on
|
||||
m *+xim* X input method |xim|
|
||||
*+xfontset* X fontset support |xfontset|
|
||||
N *+xterm_clipboard* Unix only: xterm clipboard handling
|
||||
m *+xterm_save* save and restore xterm screen |xterm-screens|
|
||||
N *+X11* Unix only: can restore window title |X11|
|
||||
|
||||
*/dyn* *E370*
|
||||
To some of the features "/dyn" is added when the
|
||||
feature is only available when the related library can
|
||||
be dynamically loaded.
|
||||
|
||||
:ve[rsion] {nr} Is now ignored. This was previously used to check the
|
||||
version number of a .vimrc file. It was removed,
|
||||
because you can now use the ":if" command for
|
||||
version-dependent behavior. {not in Vi}
|
||||
|
||||
*:redi* *:redir*
|
||||
:redi[r][!] > {file} Redirect messages to file {file}. The messages which
|
||||
are the output of commands are written to that file,
|
||||
until redirection ends. The messages are also still
|
||||
shown on the screen. When [!] is included, an
|
||||
existing file is overwritten. When [!] is omitted,
|
||||
and {file} exists, this command fails.
|
||||
Only one ":redir" can be active at a time. Calls to
|
||||
":redir" will close any active redirection before
|
||||
starting redirection to the new target.
|
||||
To stop the messages and commands from being echoed to
|
||||
the screen, put the commands in a function and call it
|
||||
with ":silent call Function()".
|
||||
{not in Vi}
|
||||
|
||||
:redi[r] >> {file} Redirect messages to file {file}. Append if {file}
|
||||
already exists. {not in Vi}
|
||||
|
||||
:redi[r] @{a-zA-Z} Redirect messages to register {a-z}. Append to the
|
||||
contents of the register if its name is given
|
||||
uppercase {A-Z}. {not in Vi}
|
||||
|
||||
:redi[r] @* Redirect messages to the clipboard. {not in Vi}
|
||||
|
||||
:redi[r] @" Redirect messages to the unnamed register. {not in Vi}
|
||||
|
||||
:redi[r] END End redirecting messages. {not in Vi}
|
||||
|
||||
*:sil* *:silent*
|
||||
:sil[ent][!] {command} Execute {command} silently. Normal messages will not
|
||||
be given.
|
||||
When [!] is added, error messages will also be
|
||||
skipped, and commands and mappings will not be aborted
|
||||
when an error is detected. |v:errmsg| is still set.
|
||||
When [!] is not used, an error message will cause
|
||||
further messages to be displayed normally.
|
||||
Redirection, started with |:redir|, will continue as
|
||||
usual, although there might be small differences.
|
||||
This will allow redirecting the output of a command
|
||||
without seeing it on the screen. Example: >
|
||||
:redir >/tmp/foobar
|
||||
:silent g/Aap/p
|
||||
:redir END
|
||||
< To execute a Normal mode command silently, use the
|
||||
|:normal| command. For example, to search for a
|
||||
string without messages: >
|
||||
:silent exe "normal /path\<CR>"
|
||||
< ":silent!" is useful to execute a command that may
|
||||
fail, but the failure is to be ignored. Example: >
|
||||
:let v:errmsg = ""
|
||||
:silent! /^begin
|
||||
:if v:errmsg != ""
|
||||
: ... pattern was not found
|
||||
< ":silent" will also avoid the hit-enter prompt. When
|
||||
using this for an external command, this may cause the
|
||||
screen to be messed up. Use |CTRL-L| to clean it up
|
||||
then.
|
||||
":silent menu ..." defines a menu that will not echo a
|
||||
Command-line command. The command will still produce
|
||||
messages though. Use ":silent" in the command itself
|
||||
to avoid that: ":silent menu .... :silent command".
|
||||
|
||||
*:verb* *:verbose*
|
||||
:[count]verb[ose] {command}
|
||||
Execute {command} with 'verbose' set to [count]. If
|
||||
[count] is omitted one is used.
|
||||
The additional use of ":silent" makes messages
|
||||
generated but not displayed.
|
||||
The combination of ":silent" and ":verbose" can be
|
||||
used to generate messages and check them with
|
||||
|v:statusmsg| and friends. For example: >
|
||||
:let v:statusmsg = ""
|
||||
:silent verbose runtime foobar.vim
|
||||
:if v:statusmsg != ""
|
||||
: " foobar.vim could not be found
|
||||
:endif
|
||||
< When concatenating another command, the ":verbose"
|
||||
only applies to the first one: >
|
||||
:4verbose set verbose | set verbose
|
||||
< verbose=4 ~
|
||||
verbose=0 ~
|
||||
|
||||
*K*
|
||||
K Run a program to lookup the keyword under the
|
||||
cursor. The name of the program is given with the
|
||||
'keywordprg' (kp) option (default is "man"). The
|
||||
keyword is formed of letters, numbers and the
|
||||
characters in 'iskeyword'. The keyword under or
|
||||
right of the cursor is used. The same can be done
|
||||
with the command >
|
||||
:!{program} {keyword}
|
||||
< There is an example of a program to use in the tools
|
||||
directory of Vim. It is called 'ref' and does a
|
||||
simple spelling check.
|
||||
Special cases:
|
||||
- If 'keywordprg' is empty, the ":help" command is
|
||||
used. It's a good idea to include more characters
|
||||
in 'iskeyword' then, to be able to find more help.
|
||||
- When 'keywordprg' is equal to "man", a count before
|
||||
"K" is inserted after the "man" command and before
|
||||
the keyword. For example, using "2K" while the
|
||||
cursor is on "mkdir", results in: >
|
||||
!man 2 mkdir
|
||||
< - When 'keywordprg' is equal to "man -s", a count
|
||||
before "K" is inserted after the "-s". If there is
|
||||
no count, the "-s" is removed.
|
||||
{not in Vi}
|
||||
|
||||
*v_K*
|
||||
{Visual}K Like "K", but use the visually highlighted text for
|
||||
the keyword. Only works when the highlighted text is
|
||||
not more than one line. {not in Vi}
|
||||
|
||||
[N]gs *gs* *:sl* *:sleep*
|
||||
:[N]sl[eep] [N] [m] Do nothing for [N] seconds. When [m] is included,
|
||||
sleep for [N] milliseconds. The count for "gs" always
|
||||
uses seconds. The default is one second. >
|
||||
:sleep "sleep for one second
|
||||
:5sleep "sleep for five seconds
|
||||
:sleep 100m "sleep for a hundred milliseconds
|
||||
10gs "sleep for ten seconds
|
||||
< Can be interrupted with CTRL-C (CTRL-Break on MS-DOS).
|
||||
"gs" stands for "goto sleep". While sleeping the
|
||||
cursor is positioned in the text (if visible). {not
|
||||
in Vi}
|
||||
|
||||
*g_CTRL-A*
|
||||
g CTRL-A Only when Vim was compiled with MEM_PROFILING defined
|
||||
(which is very rare): print memory usage statistics.
|
||||
Only useful for debugging Vim.
|
||||
|
||||
==============================================================================
|
||||
2. Online help *online-help*
|
||||
|
||||
*help* *<Help>* *:h* *:help* *<F1>* *i_<F1>* *i_<Help>*
|
||||
<Help> or
|
||||
:h[elp] Open a window and display the help file in read-only
|
||||
mode. If there is a help window open already, use
|
||||
that one. Otherwise, if the current window uses the
|
||||
full width of the screen or is at least 80 characters
|
||||
wide, the help window will appear just above the
|
||||
current window. Otherwise the new window is put at
|
||||
the very top.
|
||||
{not in Vi}
|
||||
|
||||
*{subject}* *E149*
|
||||
:h[elp] {subject} Like ":help", additionally jump to the tag {subject}.
|
||||
{subject} can include wildcards like "*", "?" and
|
||||
"[a-z]":
|
||||
:help z? jump to help for any "z" command
|
||||
:help z. jump to the help for "z."
|
||||
If there is no full match for the pattern, or there
|
||||
are several matches, the "best" match will be used.
|
||||
A sophisticated algorithm is used to decide which
|
||||
match is better than another one. These items are
|
||||
considered in the computation:
|
||||
- A match with same case is much better than a match
|
||||
with different case.
|
||||
- A match that starts after a non-alphanumeric
|
||||
character is better than a match in the middle of a
|
||||
word.
|
||||
- A match at or near the beginning of the tag is
|
||||
better than a match further on.
|
||||
- The more alphanumeric characters match, the better.
|
||||
- The shorter the length of the match, the better.
|
||||
Note that the longer the {subject} you give, the less
|
||||
matches will be found. You can get an idea how this
|
||||
all works by using commandline completion (type CTRL-D
|
||||
after ":help subject").
|
||||
If there are several matches, you can have them listed
|
||||
by hitting CTRL-D. Example: >
|
||||
:help cont<Ctrl-D>
|
||||
< To use a regexp |pattern|, first do ":help" and then
|
||||
use ":tag {pattern}" in the help window. The
|
||||
":tnext" command can then be used to jump to other
|
||||
matches, "tselect" to list matches and choose one. >
|
||||
:help index| :tse z.
|
||||
< This command can be followed by '|' and another
|
||||
command, but you don't need to escape the '|' inside a
|
||||
help command. So these both work: >
|
||||
:help |
|
||||
:help k| only
|
||||
< Note that a space before the '|' is seen as part of
|
||||
the ":help" argument.
|
||||
You can also use <LF> or <CR> to separate the help
|
||||
command from a following command. You need to type
|
||||
CTRL-V first to insert the <LF> or <CR>. Example: >
|
||||
:help so<C-V><CR>only
|
||||
< {not in Vi}
|
||||
|
||||
When no argument is given the file given with the 'helpfile' option will be
|
||||
opened. Otherwise the specified tag is searched for in all "doc/tags" files
|
||||
in the directories specified in the 'runtimepath' option.
|
||||
|
||||
The initial height of the help window can be set with the 'helpheight' option
|
||||
(default 20).
|
||||
|
||||
Jump to specific subjects by using tags. This can be done in two ways:
|
||||
- Use the "CTRL-]" command while standing on the name of a command or option.
|
||||
This only works when the tag is a keyword. "<C-Leftmouse>" and
|
||||
"g<LeftMouse>" work just like "CTRL-]".
|
||||
- use the ":ta {subject}" command. This also works with non-keyword
|
||||
characters.
|
||||
|
||||
Use CTRL-T or CTRL-O to jump back.
|
||||
Use ":q" to close the help window.
|
||||
|
||||
If there are several matches for an item you are looking for, this is how you
|
||||
can jump to each one of them:
|
||||
1. open a help window
|
||||
2. Use the ":tag" command with a slash prepended to the tag. E.g.: >
|
||||
:tag /min
|
||||
3. Use ":tnext" to jump to the next matching tag.
|
||||
|
||||
It is possible to add help files for plugins and other items. You don't need
|
||||
to change the distributed help files for that. See |add-local-help|
|
||||
|
||||
To write a local help file, see |write-local-help|.
|
||||
|
||||
Note that the title lines from the local help files are automagically added to
|
||||
the "LOCAL ADDITIONS" section in the "help.txt" help file. This is done when
|
||||
viewing the file in Vim, the file itself is not changed. It is done by going
|
||||
through all help files and obtaining the first line of each file. The files
|
||||
in $VIMRUNTIME/doc are skipped.
|
||||
|
||||
*help-xterm-window*
|
||||
If you want to have the help in another xterm window, you could use this
|
||||
command:
|
||||
:!xterm -e vim +help &
|
||||
|
||||
|
||||
*:helpfind* *:helpf*
|
||||
:helpf[ind] Like |:help|, but use a dialog to enter the argument.
|
||||
Only for backwards compatibilty. It now executes the
|
||||
ToolBar.HelpFind menu entry instead of using a builtin
|
||||
dialog. {only when compiled with |+GUI_GTK|}
|
||||
|
||||
*:helpt* *:helptags* *E154* *E150* *E151* *E152* *E153*
|
||||
:helpt[ags] {dir} Generate the help tags file for directory {dir}. All
|
||||
"*.txt" files in the directory are scanned for a help
|
||||
tag definition in between stars. The generated tags
|
||||
file is sorted. When there are duplicates an error
|
||||
message is given. An existing tags file is silently
|
||||
overwritten.
|
||||
|
||||
==============================================================================
|
||||
3. Printing *printing*
|
||||
|
||||
On MS-Windows Vim can print your text on any installed printer. On other
|
||||
systems a PostScript file is produced. This can be directly sent to a
|
||||
PostScript printer. For other printers a program like ghostscript needs to be
|
||||
used.
|
||||
|
||||
{not in Vi}
|
||||
{only available when compiled with |+printer| feature}
|
||||
|
||||
*:ha* *:hardcopy* *E237* *E238* *E324*
|
||||
:[range]ha[rdcopy][!] [arguments]
|
||||
Send [range] lines (default whole file) to the
|
||||
printer.
|
||||
|
||||
On MS-Windows a dialog is displayed to allow selection
|
||||
of printer, paper size etc. To skip the dialog, use
|
||||
the [!]. In this case the printer defined by
|
||||
'printdevice' is used, or, if 'printdevice' is empty,
|
||||
the system default printer.
|
||||
|
||||
For systems other than MS-Windows, PostScript is
|
||||
written in a temp file and 'printexpr' is used to
|
||||
actually print it. Then [arguments] can be used by
|
||||
'printexpr' through |v:cmdarg|. Otherwise [arguments]
|
||||
is ignored. 'printoptions' can be used to specify
|
||||
paper size, duplex, etc.
|
||||
|
||||
:[range]ha[rdcopy][!] >{filename}
|
||||
As above, but write the resulting PostScript in file
|
||||
{filename}. Careful: An existing file is silently
|
||||
overwritten.
|
||||
{only available when compiled with the |+postscript|
|
||||
feature}
|
||||
On MS-Windows use the "print to file" feature of the
|
||||
printer driver.
|
||||
|
||||
Progress is displayed during printing as a page number and a percentage. To
|
||||
abort printing use the interrupt key (CTRL-C or, on MS-systems, CTRL-Break).
|
||||
|
||||
Printer output is controlled by the 'printfont' and 'printoptions' options.
|
||||
'printheader' specifies the format of a page header.
|
||||
|
||||
The printed file is always limited to the selected margins, irrespective of
|
||||
the current window's 'wrap' or 'linebreak' settings. The "wrap" item in
|
||||
'printoptions' can be used to switch wrapping off.
|
||||
The current highlighting colors are used in the printout, with the following
|
||||
considerations:
|
||||
1) The normal background is always rendered as white (i.e. blank paper.)
|
||||
2) White text or the default foreground is rendered as black, so that it shows
|
||||
up!
|
||||
3) If 'background' is "dark", then the colours are darkened to compensate for
|
||||
the fact that otherwise they would be too bright to show up clearly on
|
||||
white paper.
|
||||
|
||||
|
||||
3.1 PostScript Printing
|
||||
*E455* *E456* *E457*
|
||||
Provided you have enough disk space there should be no problems generating a
|
||||
PostScript file. You need to have the runtime files correctly installed (if
|
||||
you can find the help files, they probably are).
|
||||
|
||||
There are currently a number of limitations with PostScript printing:
|
||||
|
||||
- 'printfont' - The font name is ignored (the Courier family is always used -
|
||||
it should be available on all PostScript printers) but the font size is
|
||||
used.
|
||||
|
||||
- 'printoptions' - The duplex setting is used when generating PostScript
|
||||
output, but it is up to the printer to take notice of the setting. If the
|
||||
printer does not support duplex printing then it should be silently ignored.
|
||||
Some printers, however, don't print at all.
|
||||
|
||||
- 8-bit and Multi-byte support - There is limited support for 8-bit character
|
||||
set encodings. It is based on the Latin-1 encoding, modified for the host
|
||||
platform so that what is printed should match what VIM displays on screen.
|
||||
There is no support for multi-byte character sets - the characters are
|
||||
replaced with spaces.
|
||||
|
||||
|
||||
3.2 PostScript Printing Troubleshooting
|
||||
|
||||
Usually the only sign of a problem when printing with PostScript is that your
|
||||
printout does not appear. If you are lucky you may get a printed page that
|
||||
tells you the PostScript operator that generated the error that prevented the
|
||||
print job completing.
|
||||
|
||||
There are a number of possible causes as to why the printing may have failed:
|
||||
|
||||
- Paper size. Some PostScript printers will abort printing a file if they do
|
||||
not support the requested paper size. By default VIM uses A4 paper. Find
|
||||
out what size paper your printer normally uses and set the appropriate paper
|
||||
size with 'printoptions'. If you cannot find the name of the paper used,
|
||||
measure a sheet and compare it with the table of supported paper sizes listed
|
||||
for 'printoptions', using the paper that is closest in both width AND height.
|
||||
Note: The dimensions of actual paper may vary slightly from the ones listed.
|
||||
If there is no paper listed close enough, then you may want to try psresize
|
||||
from PSUtils, discussed below.
|
||||
|
||||
- Two-sided printing (duplex). Normally a PostScript printer that does not
|
||||
support two-sided printing will ignore any request to do it. However, some
|
||||
printers may abort the job altogether. Try printing with duplex turned off.
|
||||
Note: Duplex prints can be achieved manually using PS utils - see below.
|
||||
|
||||
- Collated printing. As with Duplex printing, most PostScript printers that
|
||||
do not support collating printouts will ignore a request to do so. Some may
|
||||
not. Try printing with collation turned off.
|
||||
|
||||
- Syntax highlighting. Some print management code may prevent the generated
|
||||
PostScript file from being printed on a black and white printer when syntax
|
||||
highlighting is turned on, even if solid black is the only color used. Try
|
||||
printing with syntax highlighting turned off.
|
||||
|
||||
A safe printoptions setting to try is: >
|
||||
|
||||
:set printoptions=paper:A4,duplex:off,collate:n,syntax:n
|
||||
|
||||
Replace "A4" with the paper size that best matches your printer paper.
|
||||
|
||||
|
||||
3.3 PostScript Utilities
|
||||
|
||||
3.3.1 Ghostscript
|
||||
|
||||
Ghostscript is a PostScript and PDF interpreter that can be used to display
|
||||
and print on non-PostScript printers PostScript and PDF files. It can also
|
||||
generate PDF files from PostScript.
|
||||
|
||||
Ghostscript will run on a wide variety of platforms.
|
||||
|
||||
There are three available versions:
|
||||
|
||||
- AFPL Ghostscript (formerly Aladdin Ghostscript) which is free for
|
||||
non-commercial use. It can be obtained from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/
|
||||
|
||||
- GNU Ghostscript which is available under the GNU General Public License. It
|
||||
can be obtained from:
|
||||
|
||||
ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/gnu/
|
||||
|
||||
- A commercial version for inclusion in commercial products.
|
||||
|
||||
Additional information on Ghostscript can also be found at:
|
||||
|
||||
http://www.ghostscript.com/
|
||||
|
||||
Support for a number of non PostScript printers is provided in the
|
||||
distribution as standard, but if you cannot find support for your printer
|
||||
check the Ghostscript site for other printers not included by default.
|
||||
|
||||
|
||||
3.3.2 Ghostscript Previewers.
|
||||
|
||||
The interface to Ghostscript is very primitive so a number of graphical front
|
||||
ends have been created. These allow easier PostScript file selection,
|
||||
previewing at different zoom levels, and printing. Check supplied
|
||||
documentation for full details.
|
||||
|
||||
X11
|
||||
|
||||
- Ghostview. Obtainable from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gv/
|
||||
|
||||
- gv. Derived from Ghostview. Obtainable from:
|
||||
|
||||
http://wwwthep.physik.uni-mainz.de/~plass/gv/
|
||||
|
||||
Copies (possibly not the most recent) can be found at:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gv/
|
||||
|
||||
OpenVMS
|
||||
|
||||
- gv-vms. A port of gv to OpenVMS. Obtainable from:
|
||||
|
||||
ftp://axp.psl.ku.dk/decwindows/xaw3d/
|
||||
ftp://ftp.wku.edu/vms/fileserv/x11kit.zip
|
||||
|
||||
Windows and OS/2
|
||||
|
||||
- GSview. Obtainable from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gsview/
|
||||
|
||||
DOS
|
||||
|
||||
- ps_view. Obtainable from:
|
||||
|
||||
ftp://ftp.pg.gda.pl/pub/TeX/support/ps_view/
|
||||
ftp://ftp.dante.de/tex-archive/support/ps_view/
|
||||
|
||||
Linux
|
||||
|
||||
- GSview. Linux version of the popular Windows and OS/2 previewer.
|
||||
Obtainable from:
|
||||
|
||||
http://www.cs.wisc.edu/~ghost/gsview/
|
||||
|
||||
- BMV. Different from Ghostview and gv in that it doesn't use X but svgalib.
|
||||
Obtainable from:
|
||||
|
||||
ftp://sunsite.unc.edu/pub/Linux/apps/graphics/viewers/svga/bmv-1.2.tgz
|
||||
|
||||
|
||||
3.3.3 PSUtils
|
||||
|
||||
PSUtils is a collection of utility programs for manipulating PostScript
|
||||
documents. Binary distributions are available for many platforms, as well as
|
||||
the full source. PSUtils can be found at:
|
||||
|
||||
http://www.tardis.ed.ac.uk/~ajcd/psutils/index.html
|
||||
|
||||
The utilities of interest include:
|
||||
|
||||
- psnup. Convert PS files for N-up printing.
|
||||
- psselect. Select page range and order of printing.
|
||||
- psresize. Change the page size.
|
||||
- psbook. Reorder and lay out pages ready for making a book.
|
||||
|
||||
The output of one program can be used as the input to the next, allowing for
|
||||
complex print document creation.
|
||||
|
||||
|
||||
N-UP PRINTING
|
||||
|
||||
The psnup utility takes an existing PostScript file generated from VIM and
|
||||
convert it to an n-up version. The simplest way to create a 2-up printout is
|
||||
to first create a PostScript file with: >
|
||||
|
||||
:hardcopy > test.ps
|
||||
|
||||
Then on your command line execute: >
|
||||
|
||||
psnup -n 2 test.ps final.ps
|
||||
|
||||
Note: You may get warnings from some Ghostscript previewers for files produced
|
||||
by psnup - these may safely be ignored.
|
||||
|
||||
Finally print the file final.ps to your PostScript printer with your
|
||||
platform's print command. (You will need to delete the two PostScript files
|
||||
afterwards yourself.) 'printexpr' could be modified to perform this extra
|
||||
step before printing.
|
||||
|
||||
|
||||
ALTERNATE DUPLEX PRINTING
|
||||
|
||||
It is possible to achieve a poor man's version of duplex printing using the PS
|
||||
utility psselect. This utility has options -e and -o for printing just the
|
||||
even or odd pages of a PS file respectively.
|
||||
|
||||
First generate a PS file with the 'hardcopy' command, then generate a new
|
||||
files with all the odd and even numbered pages with: >
|
||||
|
||||
psselect -o test.ps odd.ps
|
||||
psselect -e test.ps even.ps
|
||||
|
||||
Next print odd.ps with your platform's normal print command. Then take the
|
||||
print output, turn it over and place it back in the paper feeder. Now print
|
||||
even.ps with your platform's print command. All the even pages should now
|
||||
appear on the back of the odd pages.
|
||||
|
||||
There a couple of points to bear in mind:
|
||||
|
||||
1. Position of the first page. If the first page is on top of the printout
|
||||
when printing the odd pages then you need to reverse the order that the odd
|
||||
pages are printed. This can be done with the -r option to psselect. This
|
||||
will ensure page 2 is printed on the back of page 1.
|
||||
Note: it is better to reverse the odd numbered pages rather than the even
|
||||
numbered in case there are an odd number of pages in the original PS file.
|
||||
|
||||
2. Paper flipping. When turning over the paper with the odd pages printed on
|
||||
them you may have to either flip them horizontally (along the long edge) or
|
||||
vertically (along the short edge), as well as possibly rotating them 180
|
||||
degrees. All this depends on the printer - it will be more obvious for
|
||||
desktop ink jets than for small office laser printers where the paper path
|
||||
is hidden from view.
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. Using Vim like less or more *less*
|
||||
|
||||
If you use the less or more program to view a file, you don't get syntax
|
||||
highlighting. Thus you would like to use Vim instead. You can do this by
|
||||
using the shell script "$VIMRUNTIME/macros/less.sh".
|
||||
|
||||
This shell script uses the Vim script "$VIMRUNTIME/macros/less.vim". It sets
|
||||
up mappings to simulate the commands that less supports. Otherwise, you can
|
||||
still use the Vim commands.
|
||||
|
||||
This isn't perfect. For example, when viewing a short file Vim will still use
|
||||
the whole screen. But it works good enough for most uses, and you get syntax
|
||||
highlighting.
|
||||
|
||||
The "h" key will give you a short overview of the available comands.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
485
docs/vim/todo/visual.txt
Normal file
485
docs/vim/todo/visual.txt
Normal file
@ -0,0 +1,485 @@
|
||||
*visual.txt* For Vim version 6.1. Last change: 2001 Dec 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Visual mode *Visual* *Visual-mode* *visual-mode*
|
||||
|
||||
Visual mode is a flexible and easy way to select a piece of text for an
|
||||
operator. It is the only way to select a block of text.
|
||||
|
||||
This is introduced in section |04.4| of the user manual.
|
||||
|
||||
1. Using Visual mode |visual-use|
|
||||
2. Starting and stopping Visual mode |visual-start|
|
||||
3. Changing the Visual area |visual-change|
|
||||
4. Operating on the Visual area |visual-operators|
|
||||
5. Blockwise operators |blockwise-operators|
|
||||
6. Repeating |visual-repeat|
|
||||
7. Examples |visual-examples|
|
||||
8. Select mode |Select-mode|
|
||||
|
||||
{Vi has no Visual mode, the name "visual" is used for Normal mode, to
|
||||
distinguish it from Ex mode}
|
||||
{not available when the |+visual| feature was disabled when compiling}
|
||||
|
||||
==============================================================================
|
||||
1. Using Visual mode *visual-use*
|
||||
|
||||
Using Visual mode consists of three parts:
|
||||
1. Mark the start of the text with "v", "V" or CTRL-V.
|
||||
The character under the cursor will be used as the start.
|
||||
2. Move to the end of the text.
|
||||
The text from the start of the Visual mode up to and including the
|
||||
character under the cursor is highlighted.
|
||||
3. Type an operator command.
|
||||
The highlighted characters will be operated upon.
|
||||
|
||||
The 'highlight' option can be used to set the display mode to use for
|
||||
highlighting in Visual mode.
|
||||
The 'virtualedit' option can be used to allow positioning the cursor to
|
||||
positions where there is no actual character.
|
||||
|
||||
The highlighted text includes the character under the cursor. On terminals
|
||||
where it is possible to make the cursor invisible the cursor position is
|
||||
also highlighted. On terminals where this is not possible the cursor is
|
||||
displayed normally. If your cursor cannot be made invisible and you want Vim
|
||||
to highlight the character under the cursor anyway, you could set the 't_cv'
|
||||
and 't_ci' options to something harmless, for example: >
|
||||
:set t_cv=^[^[ t_ci=^[^[
|
||||
|
||||
With "v" the text before the start position and after the end position will
|
||||
not be highlighted. However, All uppercase and non-alpha operators, except
|
||||
"~", will work on whole lines anyway. See the list of operators below.
|
||||
|
||||
*visual-block*
|
||||
With CTRL-V (blockwise Visual mode) the highlighted text will be a rectangle
|
||||
between start position and the cursor. However, some operators work on whole
|
||||
lines anyway (see the list below). The change and substitute operators will
|
||||
delete the highlighted text and then start insertion at the top left
|
||||
position.
|
||||
|
||||
==============================================================================
|
||||
2. Starting and stopping Visual mode *visual-start*
|
||||
|
||||
*v* *characterwise-visual*
|
||||
v start Visual mode per character.
|
||||
|
||||
*V* *linewise-visual*
|
||||
V start Visual mode linewise.
|
||||
|
||||
*CTRL-V* *blockwise-visual*
|
||||
CTRL-V start Visual mode blockwise. Note: Under Windows
|
||||
CTRL-V could be mapped to paste text, it doesn't work
|
||||
to start Visual mode then, see |CTRL-V-alternative|.
|
||||
|
||||
If you use <Esc>, click the left mouse button or use any command that
|
||||
does a jump to another buffer while in Visual mode, the highlighting stops
|
||||
and no text is affected. Also when you hit "v" in characterwise Visual mode,
|
||||
"CTRL-V" in blockwise Visual mode or "V" in linewise Visual mode. If you hit
|
||||
CTRL-Z the highlighting stops and the editor is suspended or a new shell is
|
||||
started |CTRL-Z|.
|
||||
|
||||
new mode after typing: *v_v* *v_CTRL-V* *v_V*
|
||||
old mode "v" "CTRL-V" "V" ~
|
||||
|
||||
Normal Visual blockwise Visual linewise Visual
|
||||
Visual Normal blockwise Visual linewise Visual
|
||||
blockwise Visual Visual Normal linewise Visual
|
||||
linewise Visual Visual blockwise Visual Normal
|
||||
|
||||
*gv* *v_gv*
|
||||
gv Start Visual mode with the same area as the previous
|
||||
area and the same mode. In Visual mode the current and
|
||||
the previous Visual area are exchanged.
|
||||
|
||||
*<LeftMouse>*
|
||||
<LeftMouse> Set the current cursor position. If Visual mode is
|
||||
active it is stopped. Only when 'mouse' option is
|
||||
contains 'n' or 'a'. If the position is within 'so'
|
||||
lines from the last line on the screen the text is
|
||||
scrolled up. If the position is within 'so' lines from
|
||||
the first line on the screen the text is scrolled
|
||||
down.
|
||||
|
||||
*<RightMouse>*
|
||||
<RightMouse> Start Visual mode if it is not active. The text from
|
||||
the cursor position to the position of the click is
|
||||
highlighted. If Visual mode was already active move
|
||||
the start or end of the highlighted text, which ever
|
||||
is closest, to the position of the click. Only when
|
||||
'mouse' option contains 'n' or 'a'.
|
||||
|
||||
Note: when 'mousemodel' is set to "popup",
|
||||
<S-LeftMouse> has to be used instead of <RightMouse>.
|
||||
|
||||
*<LeftRelease>*
|
||||
<LeftRelease> This works like a <LeftMouse>, if it is not a
|
||||
the same position as <LeftMouse>. In an xterm you
|
||||
won't see the selected area until the button is
|
||||
released, unless there is access to the display where
|
||||
the xterm is running (via the DISPLAY environment
|
||||
variable or the -display argument). Only when 'mouse'
|
||||
option contains 'n' or 'a'.
|
||||
|
||||
If Visual mode is not active and the "v", "V" or CTRL-V is preceded with a
|
||||
count, the size of the previously highlighted area is used for a start. You
|
||||
can then move the end of the highlighted area and give an operator. The type
|
||||
of the old area is used (character, line or blockwise).
|
||||
- Linewise Visual mode: The number of lines is multiplied with the count.
|
||||
- Blockwise Visual mode: The number of lines and columns is multiplied with
|
||||
the count.
|
||||
- Normal Visual mode within one line: The number of characters is multiplied
|
||||
with the count.
|
||||
- Normal Visual mode with several lines: The number of lines is multiplied
|
||||
with the count, in the last line the same number of characters is used as
|
||||
in the last line in the previously highlighted area.
|
||||
The start of the text is the Cursor position. If the "$" command was used as
|
||||
one of the last commands to extend the highlighted text, the area will be
|
||||
extended to the rightmost column of the longest line.
|
||||
|
||||
If you want to highlight exactly the same area as the last time, you can use
|
||||
"gv" |gv| |v_gv|.
|
||||
|
||||
*v_CTRL-C*
|
||||
CTRL-C In Visual mode: Stop Visual mode. When insert mode is
|
||||
pending (the mode message shows
|
||||
"-- (insert) VISUAL --"), it is also stopped.
|
||||
|
||||
==============================================================================
|
||||
3. Changing the Visual area *visual-change*
|
||||
|
||||
*v_o*
|
||||
o Go to Other end of highlighted text: The current
|
||||
cursor position becomes the start of the highlighted
|
||||
text and the cursor is moved to the other end of the
|
||||
highlighted text. The highlighted area remains the
|
||||
same.
|
||||
|
||||
*v_O*
|
||||
O Go to Other end of highlighted text. This is like
|
||||
"o", but in Visual block mode the cursor moves to the
|
||||
other corner in the same line. When the corner is at
|
||||
a character that occupies more than one position on
|
||||
the screen (e.g., a <Tab>), the highlighted text may
|
||||
change.
|
||||
|
||||
*v_$*
|
||||
When the "$" command is used with blockwise Visual mode, the right end of the
|
||||
highlighted text will be determined by the longest highlighted line. This
|
||||
stops when a motion command is used that does not move straight up or down.
|
||||
|
||||
For moving the end of the block many commands can be used, but you cannot
|
||||
use Ex commands, commands that make changes or abandon the file. Commands
|
||||
(starting with) ".pPiIaAO&", CTRL-^, "Z", CTRL-], CTRL-T, CTRL-R, CTRL-I
|
||||
and CTRL-O cause a beep and Visual mode continues.
|
||||
|
||||
When switching to another window on the same buffer, the cursor position in
|
||||
that window is adjusted, so that the same Visual area is still selected. This
|
||||
is especially useful to view the start of the Visual area in one window, and
|
||||
the end in another. You can then use <RightMouse> (or <S-LeftMouse> when
|
||||
'mousemodel' is "popup") to move either end of the Visual area.
|
||||
|
||||
==============================================================================
|
||||
4. Operating on the Visual area *visual-operators*
|
||||
|
||||
The operators that can be used are:
|
||||
~ switch case |v_~|
|
||||
d delete |v_d|
|
||||
c change (4) |v_c|
|
||||
y yank |v_y|
|
||||
> shift right (4) |v_>|
|
||||
< shift left (4) |v_<|
|
||||
! filter through external command (1) |v_!|
|
||||
= filter through 'equalprg' option command (1) |v_=|
|
||||
gq format lines to 'textwidth' length (1) |v_gq|
|
||||
|
||||
The objects that can be used are:
|
||||
aw a word (with white space) |v_aw|
|
||||
iw inner word |v_iw|
|
||||
aW a WORD (with white space) |v_aW|
|
||||
iW inner WORD |v_iW|
|
||||
as a sentence (with white space) |v_as|
|
||||
is inner sentence |v_is|
|
||||
ap a paragraph (with white space) |v_ap|
|
||||
ip inner paragraph |v_ip|
|
||||
ab a () block (with parenthesis) |v_ab|
|
||||
ib inner () block |v_ib|
|
||||
aB a {} block (with braces) |v_aB|
|
||||
iB inner {} block |v_iB|
|
||||
a< a <> block (with <>) |v_a<|
|
||||
i< inner <> block |v_i<|
|
||||
a[ a [] block (with []) |v_a[|
|
||||
i[ inner [] block |v_i[|
|
||||
|
||||
Additionally the following commands can be used:
|
||||
: start ex command for highlighted lines (1) |v_:|
|
||||
r change (4) |v_r|
|
||||
s change |v_s|
|
||||
C change (2)(4) |v_C|
|
||||
S change (2) |v_S|
|
||||
R change (2) |v_R|
|
||||
x delete |v_x|
|
||||
D delete (3) |v_D|
|
||||
X delete (2) |v_X|
|
||||
Y yank (2) |v_Y|
|
||||
p put |v_p|
|
||||
J join (1) |v_J|
|
||||
U make uppercase |v_U|
|
||||
u make lowercase |v_u|
|
||||
^] find tag |v_CTRL-]|
|
||||
I block insert |v_b_I|
|
||||
A block append |v_b_A|
|
||||
|
||||
(1): Always whole lines, see |:visual_example|.
|
||||
(2): Whole lines when not using CTRL-V.
|
||||
(3): Whole lines when not using CTRL-V, delete until the end of the line when
|
||||
using CTRL-V.
|
||||
(4): When using CTRL-V operates on the block only.
|
||||
|
||||
Note that the ":vmap" command can be used to specifically map keys in Visual
|
||||
mode. For example, if you would like the "/" command not to extend the Visual
|
||||
area, but instead take the highlighted text and search for that: >
|
||||
:vmap / y/<C-R>"<CR>
|
||||
(In the <> notation |<>|, when typing it you should type it literally; you
|
||||
need to remove the 'B' and '<' flags from 'cpoptions')
|
||||
|
||||
If you want to give a register name using the """ command, do this just before
|
||||
typing the operator character: "v{move-around}"xd".
|
||||
|
||||
If you want to give a count to the command, do this just before typing the
|
||||
operator character: "v{move-around}3>" (move lines 3 indents to the right).
|
||||
|
||||
*{move-around}*
|
||||
The {move-around} is any sequence of movement commands. Note the difference
|
||||
with {motion}, which is only ONE movement command.
|
||||
|
||||
==============================================================================
|
||||
5. Blockwise operators *blockwise-operators*
|
||||
|
||||
{not available when compiled without the |+visualextra| feature}
|
||||
|
||||
Reminder: Use 'virtualedit' to be able to select blocks that start or end
|
||||
after the end of a line or halfway a tab.
|
||||
|
||||
Visual-block Insert *v_b_I*
|
||||
With a blockwise selection, I{string}<ESC> will insert {string} at the start
|
||||
of block on every line of the block, provided that the line extends into the
|
||||
block. Thus lines that are short will remain unmodified. TABs are split to
|
||||
retain visual columns.
|
||||
See |v_b_I_example|.
|
||||
|
||||
Visual-block Append *v_b_A*
|
||||
With a blockwise selection, A{string}<ESC> will append {string} to the end of
|
||||
block on every line of the block. There is some differing behavior where the
|
||||
block RHS is not straight, due to different line lengths:
|
||||
|
||||
1. Block was created with <C-v>$
|
||||
In this case the string is appended to the end of each line.
|
||||
2. Block was created with <C-v>{move-around}
|
||||
In this case the string is appended to the end of the block on each line,
|
||||
and whitespace is inserted to pad to the end-of-block column.
|
||||
See |v_b_A_example|.
|
||||
Note: "I" and "A" behave differently for lines that don't extend into the
|
||||
selected block. This was done intentionally, so that you can do it the way
|
||||
you want.
|
||||
|
||||
Visual-block change *v_b_c*
|
||||
All selected text in the block will be replaced by the same text string. When
|
||||
using "c" the selected text is deleted and Insert mode started. You can then
|
||||
enter text (without a line break). When you hit <Esc>, the same string is
|
||||
inserted in all previously selected lines.
|
||||
|
||||
Visual-block Change *v_b_C*
|
||||
Like using "c", but the selection is extended until the end of the line for
|
||||
all lines.
|
||||
|
||||
*v_b_<*
|
||||
Visual-block Shift *v_b_>*
|
||||
The block is shifted by 'shiftwidth'. The RHS of the block is irrelevant. The
|
||||
LHS of the block determines the point from which to apply a right shift, and
|
||||
padding includes TABs optimally according to 'ts' and 'et'. The LHS of the
|
||||
block determines the point upto which to shift left.
|
||||
Note: v_< padding is buggy if the Visual Block starts and ends in the same
|
||||
TAB. (Vim 5.4c).
|
||||
See |v_b_>_example|.
|
||||
See |v_b_<_example|.
|
||||
|
||||
Visual-block Replace *v_b_r*
|
||||
Every screen char in the highlighted region is replaced with the same char, ie
|
||||
TABs are split and the virtual whitespace is replaced, maintaining screen
|
||||
layout.
|
||||
See |v_b_r_example|.
|
||||
|
||||
|
||||
==============================================================================
|
||||
6. Repeating *visual-repeat*
|
||||
|
||||
When repeating a Visual mode operator, the operator will be applied to the
|
||||
same amount of text as the last time:
|
||||
- Linewise Visual mode: The same number of lines.
|
||||
- Blockwise Visual mode: The same number of lines and columns.
|
||||
- Normal Visual mode within one line: The same number of characters.
|
||||
- Normal Visual mode with several lines: The same number of lines, in the
|
||||
last line the same number of characters as in the last line the last time.
|
||||
The start of the text is the Cursor position. If the "$" command was used as
|
||||
one of the last commands to extend the highlighted text, the repeating will
|
||||
be applied up to the rightmost column of the longest line.
|
||||
|
||||
|
||||
==============================================================================
|
||||
7. Examples *visual-examples*
|
||||
|
||||
*:visual_example*
|
||||
Currently the ":" command works on whole lines only. When you select part of
|
||||
a line, doing something like ":!date" will replace the whole line. If you
|
||||
want only part of the line to be replaced you will have to make a mapping for
|
||||
it. In a future release ":" may work on partial lines.
|
||||
|
||||
Here is an example, to replace the selected text with the output of "date": >
|
||||
:vmap _a <Esc>`>a<CR><Esc>`<i<CR><Esc>!!date<CR>kJJ
|
||||
|
||||
(In the <> notation |<>|, when typing it you should type it literally; you
|
||||
need to remove the 'B' and '<' flags from 'cpoptions')
|
||||
|
||||
What this does is:
|
||||
<Esc> stop Visual mode
|
||||
`> go to the end of the Visual area
|
||||
a<CR><Esc> break the line after the Visual area
|
||||
`< jump to the start of the Visual area
|
||||
i<CR><Esc> break the line before the Visual area
|
||||
!!date<CR> filter the Visual text through date
|
||||
kJJ Join the lines back together
|
||||
|
||||
*visual-search*
|
||||
Here is an idea for a mapping that makes it possible to do a search for the
|
||||
selected text: >
|
||||
:vmap X y/<C-R>"<CR>
|
||||
|
||||
(In the <> notation |<>|, when typing it you should type it literally; you
|
||||
need to remove the 'B' and '<' flags from 'cpoptions')
|
||||
|
||||
Note that special characters (like '.' and '*') will cause problems.
|
||||
|
||||
Visual-block Examples *blockwise-examples*
|
||||
With the following text, I will indicate the commands to produce the block and
|
||||
the results below. In all cases, the cursor begins on the 'a' in the first
|
||||
line if the test text.
|
||||
The following modeline settings are assumed :ts=8:sw=4:
|
||||
|
||||
It will be helpful to
|
||||
:set hls
|
||||
/<TAB>
|
||||
where <TAB> ia a real TAB. This helps visualise the operations.
|
||||
|
||||
The test text is:
|
||||
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
abc defghijklmnopqrstuvwxyz
|
||||
abcdef ghi jklmnopqrstuvwxyz
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
|
||||
1. fo<C-v>3jISTRING<ESC> *v_b_I_example*
|
||||
|
||||
abcdefghijklmnSTRINGopqrstuvwxyz
|
||||
abc STRING defghijklmnopqrstuvwxyz
|
||||
abcdef ghi STRING jklmnopqrstuvwxyz
|
||||
abcdefghijklmnSTRINGopqrstuvwxyz
|
||||
|
||||
2. fo<C-v>3j$ASTRING<ESC> *v_b_A_example*
|
||||
|
||||
abcdefghijklmnopqrstuvwxyzSTRING
|
||||
abc defghijklmnopqrstuvwxyzSTRING
|
||||
abcdef ghi jklmnopqrstuvwxyzSTRING
|
||||
abcdefghijklmnopqrstuvwxyzSTRING
|
||||
|
||||
3. fo<C-v>3j3l<.. *v_b_<_example*
|
||||
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
abc defghijklmnopqrstuvwxyz
|
||||
abcdef ghi jklmnopqrstuvwxyz
|
||||
abcdefghijklmnopqrstuvwxyz
|
||||
|
||||
4. fo3j>.. *v_b_>_example*
|
||||
|
||||
abcdefghijklmn opqrstuvwxyz
|
||||
abc defghijklmnopqrstuvwxyz
|
||||
abcdef ghi jklmnopqrstuvwxyz
|
||||
abcdefghijklmn opqrstuvwxyz
|
||||
|
||||
5. fo5l3jrX *v_b_r_example*
|
||||
|
||||
abcdefghijklmnXXXXXXuvwxyz
|
||||
abc XXXXXXhijklmnopqrstuvwxyz
|
||||
abcdef ghi XXXXXX jklmnopqrstuvwxyz
|
||||
abcdefghijklmnXXXXXXuvwxyz
|
||||
|
||||
==============================================================================
|
||||
8. Select mode *Select* *Select-mode*
|
||||
|
||||
Select mode looks like Visual mode, but the commands accepted are quite
|
||||
different. This resembles the selection mode in Microsoft Windows.
|
||||
When the 'showmode' option is set, "-- SELECT --" is shown in the last line.
|
||||
|
||||
Entering Select mode:
|
||||
- Using the mouse to select an area, and 'selectmode' contains "mouse".
|
||||
'mouse' must also contain a flag for the current mode.
|
||||
- Using a non-printable movement command, with the Shift key pressed, and
|
||||
'selectmode' contains "key". For example: <S-Left> and <S-End>. 'keymodel'
|
||||
must also contain "startsel".
|
||||
- Using "v", "V" or CTRL-V command, and 'selectmode' contains "cmd".
|
||||
- Using "gh", "gH" or "g_CTRL-H" command in Normal mode.
|
||||
- From Visual mode, press CTRL-G. *v_CTRL-G*
|
||||
|
||||
Commands in Select mode:
|
||||
- Printable characters, <NL> and <CR> cause the selection to be deleted, and
|
||||
Vim enters Insert mode. The typed character is inserted.
|
||||
- Non-printable movement commands, with the Shift key pressed, extend the
|
||||
selection. 'keymodel' must include "startsel".
|
||||
- Non-printable movement commands, with the Shift key NOT pressed, stop Select
|
||||
mode. 'keymodel' must include "stopsel".
|
||||
- ESC stops Select mode.
|
||||
- CTRL-O switches to Visual mode for the duration of one command. *v_CTRL-O*
|
||||
- CTRL-G switches to Visual mode.
|
||||
|
||||
Otherwise, typed characters are handled as in Visual mode.
|
||||
|
||||
When using an operator in Select mode, and the selection is linewise, the
|
||||
selected lines are operated upon, but like in characterwise selection. For
|
||||
example, when a whole line is deleted, it can later be pasted halfway a line.
|
||||
|
||||
|
||||
Mappings and menus in Select mode. *Select-mode-mapping*
|
||||
|
||||
In Select mode the mappings and menus of Visual mode are used. Before it is
|
||||
executed, Vim automatically switches to Visual mode, so that the same
|
||||
behavior as in Visual mode is effective.
|
||||
|
||||
After the mapping or menu finishes, the selection is enabled again and Select
|
||||
mode entered, unless the selected area was deleted, another buffer became
|
||||
the current one or the window layout was changed.
|
||||
|
||||
*gV* *v_gV*
|
||||
gV Avoid the automatic reselection of the Visual area
|
||||
after a Select mode mapping or menu has finished.
|
||||
Put this just before the end of the mapping or menu.
|
||||
At least it should be after any operations on the
|
||||
selection.
|
||||
|
||||
*gh*
|
||||
gh Start Select mode, characterwise. This is like "v",
|
||||
but starts Select mode instead of Visual mode.
|
||||
Mnemonic: "get highlighted".
|
||||
|
||||
*gH*
|
||||
gH Start Select mode, linewise. This is like "V",
|
||||
but starts Select mode instead of Visual mode.
|
||||
Mnemonic: "get Highlighted".
|
||||
|
||||
*g_CTRL-H*
|
||||
g CTRL-H Start Select mode, blockwise. This is like CTRL-V,
|
||||
but starts Select mode instead of Visual mode.
|
||||
Mnemonic: "get Highlighted".
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
1108
docs/vim/todo/windows.txt
Normal file
1108
docs/vim/todo/windows.txt
Normal file
File diff suppressed because it is too large
Load Diff
168
install/vim.xml
Normal file
168
install/vim.xml
Normal file
@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<keymap version="1" name="Vim" disable-mnemonics="false" parent="$default">
|
||||
<action id="$Copy">
|
||||
<keyboard-shortcut id="$Copy" first-keystroke="control INSERT" />
|
||||
</action>
|
||||
<action id="$Cut">
|
||||
<keyboard-shortcut id="$Cut" first-keystroke="shift DELETE" />
|
||||
</action>
|
||||
<action id="$Paste">
|
||||
<keyboard-shortcut id="$Paste" first-keystroke="shift INSERT" />
|
||||
</action>
|
||||
<action id="$Redo">
|
||||
<keyboard-shortcut id="$Redo" first-keystroke="shift alt BACK_SPACE" />
|
||||
</action>
|
||||
<action id="$SelectAll" />
|
||||
<action id="$Undo">
|
||||
<keyboard-shortcut id="$Undo" first-keystroke="alt BACK_SPACE" />
|
||||
</action>
|
||||
<action id="ClassNameCompletion" />
|
||||
<action id="CodeCompletion" />
|
||||
<action id="CommanderSwapPanels" />
|
||||
<action id="EditorBackSpace">
|
||||
<keyboard-shortcut id="EditorBackSpace" first-keystroke="BACK_SPACE" />
|
||||
</action>
|
||||
<action id="EditorCodeBlockEnd" />
|
||||
<action id="EditorCodeBlockStart" />
|
||||
<action id="EditorCopy">
|
||||
<keyboard-shortcut id="EditorCopy" first-keystroke="control INSERT" />
|
||||
</action>
|
||||
<action id="EditorCut">
|
||||
<keyboard-shortcut id="EditorCut" first-keystroke="shift DELETE" />
|
||||
</action>
|
||||
<action id="EditorDeleteLine" />
|
||||
<action id="EditorDeleteToWordEnd" />
|
||||
<action id="EditorDeleteToWordStart" />
|
||||
<action id="EditorDownWithSelection" />
|
||||
<action id="EditorDuplicate" />
|
||||
<action id="EditorIndentSelection" />
|
||||
<action id="EditorJoinLines" />
|
||||
<action id="EditorLeftWithSelection" />
|
||||
<action id="EditorLineEndWithSelection" />
|
||||
<action id="EditorLineStartWithSelection" />
|
||||
<action id="EditorMoveToPageBottom" />
|
||||
<action id="EditorMoveToPageBottomWithSelection" />
|
||||
<action id="EditorMoveToPageTop" />
|
||||
<action id="EditorMoveToPageTopWithSelection" />
|
||||
<action id="EditorNextWord" />
|
||||
<action id="EditorNextWordWithSelection" />
|
||||
<action id="EditorPageDownWithSelection" />
|
||||
<action id="EditorPageUpWithSelection" />
|
||||
<action id="EditorPaste">
|
||||
<keyboard-shortcut id="EditorPaste" first-keystroke="shift INSERT" />
|
||||
</action>
|
||||
<action id="EditorPreviousWord" />
|
||||
<action id="EditorPreviousWordWithSelection" />
|
||||
<action id="EditorRedo" />
|
||||
<action id="EditorRightWithSelection" />
|
||||
<action id="EditorScrollDown" />
|
||||
<action id="EditorScrollToCenter" />
|
||||
<action id="EditorScrollUp" />
|
||||
<action id="EditorSelectAll" />
|
||||
<action id="EditorSelectWord" />
|
||||
<action id="EditorSplitLine" />
|
||||
<action id="EditorStartNewLine" />
|
||||
<action id="EditorTextEnd" />
|
||||
<action id="EditorTextEndWithSelection" />
|
||||
<action id="EditorTextStart" />
|
||||
<action id="EditorTextStartWithSelection" />
|
||||
<action id="EditorToggleCase" />
|
||||
<action id="EditorUnSelectWord" />
|
||||
<action id="EditorUndo" />
|
||||
<action id="EditorUnindentSelection" />
|
||||
<action id="EditorUpWithSelection" />
|
||||
<action id="Find" />
|
||||
<action id="FindNext">
|
||||
<keyboard-shortcut id="FindNext" first-keystroke="F3" />
|
||||
</action>
|
||||
<action id="FindPrevious">
|
||||
<keyboard-shortcut id="FindPrevious" first-keystroke="shift F3" />
|
||||
</action>
|
||||
<action id="GotoBookmark2" />
|
||||
<action id="GotoClass">
|
||||
<keyboard-shortcut id="GotoClass" first-keystroke="shift alt N" />
|
||||
</action>
|
||||
<action id="GotoDeclaration">
|
||||
<mouse-shortcut id="GotoDeclaration" keystroke="control button1" />
|
||||
<mouse-shortcut id="GotoDeclaration" keystroke="button2" />
|
||||
</action>
|
||||
<action id="GotoLine" />
|
||||
<action id="GotoSuperMethod">
|
||||
<keyboard-shortcut id="GotoSuperMethod" first-keystroke="shift control U" />
|
||||
</action>
|
||||
<action id="ImplementMethods">
|
||||
<keyboard-shortcut id="ImplementMethods" first-keystroke="shift control I" />
|
||||
</action>
|
||||
<action id="InsertLiveTemplate" />
|
||||
<action id="MethodHierarchy.ImplementMethodAction" />
|
||||
<action id="MethodHierarchy.OverrideMethodAction" />
|
||||
<action id="OverrideMethods">
|
||||
<keyboard-shortcut id="OverrideMethods" first-keystroke="shift control O" />
|
||||
</action>
|
||||
<action id="ParameterInfo">
|
||||
<keyboard-shortcut id="ParameterInfo" first-keystroke="shift control P" />
|
||||
</action>
|
||||
<action id="QuickJavaDoc">
|
||||
<mouse-shortcut id="QuickJavaDoc" keystroke="alt button2" />
|
||||
</action>
|
||||
<action id="RecentFiles" />
|
||||
<action id="Replace" />
|
||||
<action id="SaveAll" />
|
||||
<action id="SmartTypeCompletion" />
|
||||
<action id="Starteam.CheckinProject" />
|
||||
<action id="ToggleBookmark2" />
|
||||
<action id="TypeHierarchy">
|
||||
<keyboard-shortcut id="TypeHierarchy" first-keystroke="shift control alt H" />
|
||||
</action>
|
||||
<action id="VimKeyHandler">
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control 2" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control A" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control alt SPACE" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control B" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control BACK_SLASH" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control C" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control CLOSE_BRACKET" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control D" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control E" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control END" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control F" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control G" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control H" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control HOME" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control I" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control J" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control K" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control L" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control LEFT" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control M" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control N" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control O" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control OPEN_BRACKET" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control P" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control PAGE_DOWN" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control PAGE_UP" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control Q" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control R" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control RIGHT" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control S" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control SPACE" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control T" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control U" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control V" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control W" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control X" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control Y" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="control Z" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="KP_DOWN" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="KP_LEFT" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="KP_RIGHT" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="KP_UP" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="shift control 2" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="shift control SPACE" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="shift DOWN" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="shift LEFT" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="shift RIGHT" />
|
||||
<keyboard-shortcut id="VimKeyHandler" first-keystroke="shift UP" />
|
||||
</action>
|
||||
</keymap>
|
||||
|
340
license/gpl.txt
Normal file
340
license/gpl.txt
Normal file
@ -0,0 +1,340 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
191
plugin.xml
Normal file
191
plugin.xml
Normal file
@ -0,0 +1,191 @@
|
||||
<idea-plugin>
|
||||
<name>@NAME@</name>
|
||||
<description>VIM Emulator</description>
|
||||
<version>@VERSION@</version>
|
||||
<vendor>Rick Maddy</vendor>
|
||||
<idea-version min="3.0" max="3.1"/>
|
||||
|
||||
<application-components>
|
||||
<component>
|
||||
<implementation-class>com.maddyhome.idea.vim.VimPlugin</implementation-class>
|
||||
</component>
|
||||
</application-components>
|
||||
|
||||
<project-components>
|
||||
</project-components>
|
||||
|
||||
<actions>
|
||||
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.VimPlugin$VimPluginToggleAction" text="VIM Emulator" description="Toggle the Vim Plugin On/Off">
|
||||
<keyboard-shortcut first-keystroke="control alt V" keymap="$default"/>
|
||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||
</action>
|
||||
|
||||
<!-- Motions -->
|
||||
<!-- Left/Right -->
|
||||
<action id="VimMotionColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction" text="Move to Column"/>
|
||||
<action id="VimMotionFirstColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction" text="Start of Line"/>
|
||||
<action id="VimMotionFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction" text="First Character of Line"/>
|
||||
<action id="VimMotionLastColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction" text="End of Line"/>
|
||||
<action id="VimMotionLastColumnAppend" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAppendAction" text="End of Line"/>
|
||||
<action id="VimMotionLastMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction" text="Repeat Last Character Match"/>
|
||||
<action id="VimMotionLastMatchCharReverse" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction" text="Repeat Last Character Match in Reverse"/>
|
||||
<action id="VimMotionLastNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction" text="Last Character of Line"/>
|
||||
<action id="VimMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction" text="Left"/>
|
||||
<action id="VimMotionLeftWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction" text="Left"/>
|
||||
<action id="VimMotionLeftMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction" text="Move Left to Character"/>
|
||||
<action id="VimMotionLeftTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction" text="Move Left till Character"/>
|
||||
<action id="VimMotionMiddleColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction" text="Middle of Screen"/>
|
||||
<action id="VimMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction" text="Right"/>
|
||||
<action id="VimMotionRightAppend" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAppendAction" text="Right"/>
|
||||
<action id="VimMotionRightWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction" text="Right"/>
|
||||
<action id="VimMotionRightMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" text="Move Right to Character"/>
|
||||
<action id="VimMotionRightTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" text="Move Right till Character"/>
|
||||
<!-- Up/Down -->
|
||||
<action id="VimMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" text="Down"/>
|
||||
<action id="VimMotionDownFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction" text="Down to First non-Space"/>
|
||||
<action id="VimMotionDownLess1FirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction" text="Down to First non-Space"/>
|
||||
<action id="VimMotionGotoLineFirst" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction" text="Goto Line"/>
|
||||
<action id="VimMotionGotoLineLast" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction" text="Goto Line"/>
|
||||
<action id="VimMotionGotoLineLastEnd" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction" text="Goto Line End"/>
|
||||
<action id="VimMotionGotoLineLastEndAppend" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAppendAction" text="Goto Line End"/>
|
||||
<action id="VimMotionPercentOrMatch" class="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction" text="Percent Down or Match"/>
|
||||
<action id="VimMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction" text="Up"/>
|
||||
<action id="VimMotionUpFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction" text="Up to First non-Space"/>
|
||||
<!-- Text -->
|
||||
<action id="VimMotionNthCharacter" class="com.maddyhome.idea.vim.action.motion.text.MotionNthCharacterAction" text="Nth Character"/>
|
||||
<action id="VimMotionWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndLeftAction" text="Word End Left"/>
|
||||
<action id="VimMotionWORDEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWORDEndLeftAction" text="WORD End Left"/>
|
||||
<action id="VimMotionWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction" text="Word End Right"/>
|
||||
<action id="VimMotionWORDEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWORDEndRightAction" text="WORD End Right"/>
|
||||
<action id="VimMotionWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction" text="Word Left"/>
|
||||
<action id="VimMotionWORDLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWORDLeftAction" text="WORD Left"/>
|
||||
<action id="VimMotionWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction" text="Word Right"/>
|
||||
<action id="VimMotionWORDRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWORDRightAction" text="WORD Right"/>
|
||||
<!-- Marks -->
|
||||
<action id="VimMotionMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction" text="Mark"/>
|
||||
<action id="VimMotionGotoFileMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction" text="Goto Mark"/>
|
||||
<action id="VimMotionGotoFileMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction" text="Goto Mark Line"/>
|
||||
<action id="VimMotionGotoMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction" text="Goto Mark"/>
|
||||
<action id="VimMotionGotoMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction" text="Goto Mark Line"/>
|
||||
<!-- Screen -->
|
||||
<action id="VimMotionFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction" text="First Screen Line"/>
|
||||
<action id="VimMotionLastScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction" text="Last Screen Line"/>
|
||||
<action id="VimMotionLastScreenLineEnd" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineEndAction" text="Last Screen Line End"/>
|
||||
<action id="VimMotionMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionMiddleScreenLineAction" text="Middle Screen Line"/>
|
||||
<!-- Scroll -->
|
||||
<action id="VimMotionScrollFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineAction" text="Scroll Line to Top"/>
|
||||
<action id="VimMotionScrollHalfPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction" text="Scroll Half Page Down"/>
|
||||
<action id="VimMotionScrollHalfPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageUpAction" text="Scroll Half Page Up"/>
|
||||
<action id="VimMotionScrollLastScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineAction" text="Scroll Line to Bottom"/>
|
||||
<action id="VimMotionScrollLineDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineDownAction" text="Scroll Line Down"/>
|
||||
<action id="VimMotionScrollLineUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineUpAction" text="Scroll Line Up"/>
|
||||
<action id="VimMotionScrollMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction" text="Scroll Line to Middle"/>
|
||||
<action id="VimMotionScrollPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction" text="Scroll Page Down"/>
|
||||
<action id="VimMotionScrollPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction" text="Scroll Page Up"/>
|
||||
<!-- Visual -->
|
||||
<action id="VimVisualExitMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" text="Exit Visual Mode"/>
|
||||
<action id="VimVisualToggleCharacterMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" text="Toggle Character Selection"/>
|
||||
<action id="VimVisualToggleLineMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleLineModeAction" text="Toggle Line Selection"/>
|
||||
<action id="VimVisualSwapEnds" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsAction" text="Swap Visual Selection Ends"/>
|
||||
<action id="VimVisualSelectPrevious" class="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction" text="Swap Visual Selection Ends"/>
|
||||
<action id="VimVisualSwapSelections" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction" text="Swap Visual Selection Ends"/>
|
||||
|
||||
<!-- Insert -->
|
||||
<action id="VimInsertAfterCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction" text="Insert After Cursor"/>
|
||||
<action id="VimInsertAfterLineEnd" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction" text="Insert After Line End"/>
|
||||
<action id="VimInsertAtPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertAtPreviousInsertAction" text="Insert Before Cursor"/>
|
||||
<action id="VimInsertBeforeCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeCursorAction" text="Insert Before Cursor"/>
|
||||
<action id="VimInsertBeforeFirstNonBlank" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeFirstNonBlankAction" text="Insert Before First non-Blank"/>
|
||||
<action id="VimInsertCharacterAboveCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterAboveCursorAction" text="Insert Character Above Cursor"/>
|
||||
<action id="VimInsertCharacterBelowCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterBelowCursorAction" text="Insert Character Below Cursor"/>
|
||||
<action id="VimInsertDeletePreviousWord" class="com.maddyhome.idea.vim.action.change.insert.InsertDeletePreviousWordAction" text="Delete Previous Word"/>
|
||||
<action id="VimInsertEnter" class="com.maddyhome.idea.vim.action.change.insert.InsertEnterAction" text="Enter"/>
|
||||
<action id="VimInsertExitMode" class="com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction" text="Exit Insert Mode"/>
|
||||
<action id="VimInsertLineStart" class="com.maddyhome.idea.vim.action.change.insert.InsertLineStartAction" text="Insert at Line Start"/>
|
||||
<action id="VimInsertNewLineAbove" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineAboveAction" text="Insert New Line Above"/>
|
||||
<action id="VimInsertNewLineBelow" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineBelowAction" text="Insert New Line Below"/>
|
||||
<action id="VimInsertPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertAction" text="Insert Previous Text"/>
|
||||
<action id="VimInsertPreviousInsertExit" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertExitAction" text="Insert Previous Text"/>
|
||||
<action id="VimInsertRegister" class="com.maddyhome.idea.vim.action.change.insert.InsertRegisterAction" text="Insert Register"/>
|
||||
<action id="VimInsertReplaceToggle" class="com.maddyhome.idea.vim.action.change.insert.InsertInsertAction" text="Toggle Insert/Replace"/>
|
||||
<action id="VimInsertSingleCommand" class="com.maddyhome.idea.vim.action.change.insert.InsertSingleCommandAction" text="Execute Command"/>
|
||||
|
||||
<!-- Delete -->
|
||||
<action id="VimDeleteCharacter" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterAction" text="Delete Character"/>
|
||||
<action id="VimDeleteCharacterLeft" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterLeftAction" text="Delete Character Left"/>
|
||||
<action id="VimDeleteCharacterRight" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterRightAction" text="Delete Character Right"/>
|
||||
<action id="VimDeleteEndOfLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteEndOfLineAction" text="Delete End-of-Line"/>
|
||||
<action id="VimDeleteJoinLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteJoinLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesSpacesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteJoinVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteJoinVisualLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesSpacesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteLineAction" text="Delete Line"/>
|
||||
<action id="VimDeleteMotion" class="com.maddyhome.idea.vim.action.change.delete.DeleteMotionAction" text="Delete Motion"/>
|
||||
<action id="VimDeleteVisual" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction" text="Delete Selection"/>
|
||||
<action id="VimDeleteVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesAction" text="Delete Selected Lines"/>
|
||||
|
||||
<!-- Change -->
|
||||
<action id="VimChangeCaseLowerMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerMotionAction" text="Change Motion to Lower Case"/>
|
||||
<action id="VimChangeCaseLowerVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerVisualAction" text="Change Motion to Lower Case"/>
|
||||
<action id="VimChangeCaseToggleCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleCharacterAction" text="Change Toggle Case"/>
|
||||
<action id="VimChangeCaseToggleMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleMotionAction" text="Change Motion Toggle Case"/>
|
||||
<action id="VimChangeCaseToggleVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleVisualAction" text="Change Motion Toggle Case"/>
|
||||
<action id="VimChangeCaseUpperMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperMotionAction" text="Change Motion to Upper Case"/>
|
||||
<action id="VimChangeCaseUpperVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperVisualAction" text="Change Motion to Upper Case"/>
|
||||
<action id="VimChangeCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCharacterAction" text="Change Character"/>
|
||||
<action id="VimChangeCharacters" class="com.maddyhome.idea.vim.action.change.change.ChangeCharactersAction" text="Change Characters"/>
|
||||
<action id="VimChangeEndOfLine" class="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction" text="Change to End-of-Line"/>
|
||||
<action id="VimChangeLine" class="com.maddyhome.idea.vim.action.change.change.ChangeLineAction" text="Change Line"/>
|
||||
<action id="VimChangeMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" text="Change Motion"/>
|
||||
<action id="VimChangeReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction" text="Replace"/>
|
||||
<action id="VimChangeVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction" text="Change Motion"/>
|
||||
<action id="VimChangeVisualCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction" text="Change Motion"/>
|
||||
<action id="VimChangeVisualLines" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesAction" text="Change Motion"/>
|
||||
|
||||
<!-- Shift -->
|
||||
<action id="VimShiftLeftLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" text="Shift Lines Left"/>
|
||||
<action id="VimShiftLeftMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" text="Shift Motion Left"/>
|
||||
<action id="VimShiftLeftVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" text="Shift Visual Left"/>
|
||||
<action id="VimShiftRightLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction" text="Shift Lines Right"/>
|
||||
<action id="VimShiftRightMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction" text="Shift Motion Right"/>
|
||||
<action id="VimShiftRightVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" text="Shift Visual Right"/>
|
||||
|
||||
<!-- Copy -->
|
||||
<action id="VimCopyPutTextAfterCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorAction" text="Put Text"/>
|
||||
<action id="VimCopyPutTextBeforeCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorAction" text="Put Text"/>
|
||||
<action id="VimCopySelectRegister" class="com.maddyhome.idea.vim.action.copy.SelectRegisterAction" text="Select Register"/>
|
||||
<action id="VimCopyYankLine" class="com.maddyhome.idea.vim.action.copy.YankLineAction" text="Yank Line"/>
|
||||
<action id="VimCopyYankMotion" class="com.maddyhome.idea.vim.action.copy.YankMotionAction" text="Yank Motion"/>
|
||||
<action id="VimCopyYankVisual" class="com.maddyhome.idea.vim.action.copy.YankVisualAction" text="Yank Motion"/>
|
||||
<action id="VimCopyYankVisualLines" class="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction" text="Yank Motion"/>
|
||||
<action id="VimVisualPutText" class="com.maddyhome.idea.vim.action.copy.PutVisualTextAction" text="Paste over Selection"/>
|
||||
|
||||
<!-- File -->
|
||||
<action id="VimFileSaveClose" class="com.maddyhome.idea.vim.action.file.FileSaveCloseAction" text="Save and Close Editor"/>
|
||||
<action id="VimFileClose" class="com.maddyhome.idea.vim.action.file.FileCloseAction" text="Close Editor"/>
|
||||
|
||||
<!-- Other -->
|
||||
<action id="VimRepeatChange" class="com.maddyhome.idea.vim.action.change.RepeatChangeAction" text="Repeat Change"/>
|
||||
<action id="VimExEntry" class="com.maddyhome.idea.vim.action.ExEntryAction" text="Enter Ex Command"/>
|
||||
<action id="VimResetMode" class="com.maddyhome.idea.vim.action.ResetModeAction" text="Reset Mode"/>
|
||||
<action id="VimRedo" class="com.maddyhome.idea.vim.action.change.RedoAction" text="Redo"/>
|
||||
<action id="VimUndo" class="com.maddyhome.idea.vim.action.change.UndoAction" text="Undo"/>
|
||||
|
||||
<!-- Keys -->
|
||||
<action id="VimKeyHandler" class="com.maddyhome.idea.vim.action.key.KeyAction" text="Keys"/>
|
||||
<action id="VimEditorBackSpace" class="com.maddyhome.idea.vim.action.key.BackSpaceAction" text="BackSpace"/>
|
||||
<action id="VimEditorDelete" class="com.maddyhome.idea.vim.action.key.DeleteAction" text="Delete"/>
|
||||
<action id="VimEditorDown" class="com.maddyhome.idea.vim.action.key.DownAction" text="Down"/>
|
||||
<action id="VimEditorEnter" class="com.maddyhome.idea.vim.action.key.EnterAction" text="Enter"/>
|
||||
<action id="VimEditorEscape" class="com.maddyhome.idea.vim.action.key.EscapeAction" text="Escape"/>
|
||||
<action id="VimEditorLeft" class="com.maddyhome.idea.vim.action.key.LeftAction" text="Left"/>
|
||||
<action id="VimEditorLineEnd" class="com.maddyhome.idea.vim.action.key.LineEndAction" text="LineEnd"/>
|
||||
<action id="VimEditorLineStart" class="com.maddyhome.idea.vim.action.key.LineStartAction" text="LineStart"/>
|
||||
<action id="VimEditorPageDown" class="com.maddyhome.idea.vim.action.key.PageDownAction" text="PageDown"/>
|
||||
<action id="VimEditorPageUp" class="com.maddyhome.idea.vim.action.key.PageUpAction" text="PageUp"/>
|
||||
<action id="VimEditorRight" class="com.maddyhome.idea.vim.action.key.RightAction" text="Right"/>
|
||||
<action id="VimEditorTab" class="com.maddyhome.idea.vim.action.key.TabAction" text="Tab"/>
|
||||
<action id="VimEditorToggleInsertState" class="com.maddyhome.idea.vim.action.key.ToggleInsertStateAction" text="Insert/Overwrite"/>
|
||||
<action id="VimEditorUp" class="com.maddyhome.idea.vim.action.key.UpAction" text="Up"/>
|
||||
</actions>
|
||||
</idea-plugin>
|
467
src/com/maddyhome/idea/vim/KeyHandler.java
Normal file
467
src/com/maddyhome/idea/vim/KeyHandler.java
Normal file
@ -0,0 +1,467 @@
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
import com.maddyhome.idea.vim.command.Argument;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.group.CommandGroups;
|
||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||
import com.maddyhome.idea.vim.key.ArgumentNode;
|
||||
import com.maddyhome.idea.vim.key.BranchNode;
|
||||
import com.maddyhome.idea.vim.key.CommandNode;
|
||||
import com.maddyhome.idea.vim.key.KeyParser;
|
||||
import com.maddyhome.idea.vim.key.Node;
|
||||
import com.maddyhome.idea.vim.key.ParentNode;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Stack;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
/**
|
||||
* This handlers every keystroke that the user can argType except those that are still valid hotkeys for various
|
||||
* Idea actions. This is a singleton.
|
||||
*/
|
||||
public class KeyHandler
|
||||
{
|
||||
/**
|
||||
* Returns a reference to the singleton instance of this class
|
||||
* @return A reference to the singleton
|
||||
*/
|
||||
public static KeyHandler getInstance()
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new KeyHandler();
|
||||
}
|
||||
|
||||
return instance;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance
|
||||
*/
|
||||
private KeyHandler()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the original key handler
|
||||
* @param origHandler The original key handler
|
||||
*/
|
||||
public void setOriginalHandler(TypedActionHandler origHandler)
|
||||
{
|
||||
this.origHandler = origHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the original key handler
|
||||
* @return The orginal key handler
|
||||
*/
|
||||
public TypedActionHandler getOriginalHandler()
|
||||
{
|
||||
return origHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the main key handler for the Vim plugin. Every keystroke not handled directly by Idea is sent
|
||||
* here for processing.
|
||||
* @param editor The editor the key was typed into
|
||||
* @param key The keystroke typed by the user
|
||||
* @param context The data context
|
||||
*/
|
||||
public void handleKey(Editor editor, KeyStroke key, DataContext context)
|
||||
{
|
||||
// If this is a "regular" character keystroke, get the character
|
||||
char chKey = key.getKeyChar() == KeyEvent.CHAR_UNDEFINED ? 0 : key.getKeyChar();
|
||||
|
||||
if (CommandState.getInstance().getMode() == CommandState.MODE_COMMAND &&
|
||||
(key.getKeyCode() == KeyEvent.VK_ESCAPE ||
|
||||
(key.getKeyCode() == KeyEvent.VK_C && (key.getModifiers() & KeyEvent.CTRL_MASK) != 0) ||
|
||||
(key.getKeyCode() == '[' && (key.getModifiers() & KeyEvent.CTRL_MASK) != 0)))
|
||||
{
|
||||
if (count == 0 && currentArg == Argument.NONE && currentCmd.size() == 0 &&
|
||||
CommandGroups.getInstance().getRegister().getCurrentRegister() == RegisterGroup.REGISTER_DEFAULT)
|
||||
{
|
||||
indicateError();
|
||||
}
|
||||
|
||||
fullReset();
|
||||
}
|
||||
// At this point the user must be typing in a command. Most commands can be preceeded by a number. Let's
|
||||
// check if a number can be entered at this point, and if so, did the user send us a digit.
|
||||
else if ((CommandState.getInstance().getMode() == CommandState.MODE_COMMAND ||
|
||||
CommandState.getInstance().getMode() == CommandState.MODE_VISUAL) &&
|
||||
mode == STATE_NEW_COMMAND && currentArg != Argument.CHARACTER && Character.isDigit(chKey) &&
|
||||
(count != 0 || chKey != '0'))
|
||||
{
|
||||
// Update the count
|
||||
count = count * 10 + (chKey - '0');
|
||||
}
|
||||
// Pressing delete while entering a count "removes" the last digit entered
|
||||
else if ((CommandState.getInstance().getMode() == CommandState.MODE_COMMAND ||
|
||||
CommandState.getInstance().getMode() == CommandState.MODE_VISUAL) &&
|
||||
mode == STATE_NEW_COMMAND && currentArg != Argument.CHARACTER &&
|
||||
key.getKeyCode() == KeyEvent.VK_DELETE && count != 0)
|
||||
{
|
||||
// "Remove" the last digit sent to us
|
||||
count /= 10;
|
||||
}
|
||||
// If we got this far the user is entering a command or supplying an argument to an entered command.
|
||||
// First let's check to see if we are at the point of expecting a single character argument to a command.
|
||||
else if (currentArg == Argument.CHARACTER)
|
||||
{
|
||||
// We are expecting a character argument - is this a regular character the user typed?
|
||||
if (chKey != 0)
|
||||
{
|
||||
// Create the character argument, add it to the current command, and signal we are ready to process
|
||||
// the command
|
||||
Argument arg = new Argument(chKey);
|
||||
Command cmd = (Command)currentCmd.peek();
|
||||
cmd.setArgument(arg);
|
||||
mode = STATE_READY;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Oops - this isn't a valid character argument
|
||||
mode = STATE_ERROR;
|
||||
}
|
||||
}
|
||||
// If we are this far - sheesh, then the user must be entering a command or a non-single-character argument
|
||||
// to an entered command. Let's figure out which it is
|
||||
else
|
||||
{
|
||||
// For debugging purposes we track the keys entered for this command
|
||||
keys.add(key);
|
||||
logger.debug("keys now " + keys);
|
||||
|
||||
// Ask the key/action tree if this is an appropriate key at this point in the command and if so,
|
||||
// return the node matching this keystroke
|
||||
Node node = currentNode.getChild(key);
|
||||
// If this is a branch node we have entered only part of a multikey command
|
||||
if (node instanceof BranchNode)
|
||||
{
|
||||
// Flag that we aren't allowing any more count digits
|
||||
mode = STATE_COMMAND;
|
||||
currentNode = (BranchNode)node;
|
||||
}
|
||||
// If this is a command node the user has entered a valid key sequence of a know command
|
||||
else if (node instanceof CommandNode)
|
||||
{
|
||||
// If all does well we are ready to process this command
|
||||
mode = STATE_READY;
|
||||
CommandNode cmdNode = (CommandNode)node;
|
||||
// Did we just get the completed sequence for a motion command argument?
|
||||
if (currentArg == Argument.MOTION)
|
||||
{
|
||||
// We have been expecting a motion argument - is this one?
|
||||
if (cmdNode.getCmdType() == Command.MOTION)
|
||||
{
|
||||
// Create the motion command and add it to the stack
|
||||
Command cmd = new Command(count, cmdNode.getAction(), cmdNode.getCmdType(), cmdNode.getFlags());
|
||||
currentCmd.push(cmd);
|
||||
}
|
||||
else if (cmdNode.getCmdType() == Command.RESET)
|
||||
{
|
||||
currentCmd.clear();
|
||||
Command cmd = new Command(1, cmdNode.getAction(), cmdNode.getCmdType(), cmdNode.getFlags());
|
||||
currentCmd.push(cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Oops - this wasn't a motion command. The user goofed and typed something else
|
||||
mode = STATE_ERROR;
|
||||
}
|
||||
}
|
||||
// The user entered a valid command that doesn't take any arguments
|
||||
else
|
||||
{
|
||||
// Create the command and add it to the stack
|
||||
Command cmd = new Command(count, cmdNode.getAction(), cmdNode.getCmdType(), cmdNode.getFlags());
|
||||
currentCmd.push(cmd);
|
||||
|
||||
// This is a sanity check that the command has a valid action. This should only fail if the
|
||||
// programmer made a typo or forgot to add the action to the plugin.xml file
|
||||
if (cmd.getAction() == null)
|
||||
{
|
||||
logger.error("NULL action for keys '" + keys + "'");
|
||||
mode = STATE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If this is an argument node then the last keystroke was not part of the current command but should
|
||||
// be the first keystroke of the current command's argument
|
||||
else if (node instanceof ArgumentNode)
|
||||
{
|
||||
// Create a new command based on what the user has typed so far, excluding this keystroke.
|
||||
ArgumentNode arg = (ArgumentNode)node;
|
||||
Command cmd = new Command(count, arg.getAction(), arg.getCmdType(), arg.getFlags());
|
||||
currentCmd.push(cmd);
|
||||
// What argType of argument does this command expect?
|
||||
switch (arg.getArgType())
|
||||
{
|
||||
case Argument.CHARACTER:
|
||||
case Argument.MOTION:
|
||||
mode = STATE_NEW_COMMAND;
|
||||
currentArg = arg.getArgType();
|
||||
// Is the current command an operator? If so set the state to only accept "operator pending"
|
||||
// commands
|
||||
if ((arg.getFlags() & KeyParser.FLAG_OP_PEND) != 0)
|
||||
{
|
||||
CommandState.getInstance().setMappingMode(KeyParser.MAPPING_OP_PEND);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// Oops - we aren't expecting any other argType of argument
|
||||
mode = STATE_ERROR;
|
||||
}
|
||||
|
||||
// If the current keystroke is really the first character of an argument the user needs to enter,
|
||||
// recursively go back and handle this keystroke again with all the state properly updated to
|
||||
// handle the argument
|
||||
if (currentArg != Argument.NONE)
|
||||
{
|
||||
partialReset();
|
||||
handleKey(editor, key, context);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we are in insert/replace mode send this key in for processing
|
||||
if (CommandState.getInstance().getMode() == CommandState.MODE_INSERT ||
|
||||
CommandState.getInstance().getMode() == CommandState.MODE_REPLACE)
|
||||
{
|
||||
CommandGroups.getInstance().getChange().processKey(editor, context, key);
|
||||
}
|
||||
// If we get here then the user has entered an unrecognized series of keystrokes
|
||||
else
|
||||
{
|
||||
mode = STATE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do we have a fully entere command at this point? If so, lets execute it
|
||||
if (mode == STATE_READY)
|
||||
{
|
||||
// Let's go through the command stack and merge it all into one command. At this time there should never
|
||||
// be more than two commands on the stack - one is the actual command and the other would be a motion
|
||||
// command argument needed by the first command
|
||||
Command cmd = (Command)currentCmd.pop();
|
||||
while (currentCmd.size() > 0)
|
||||
{
|
||||
Command top = (Command)currentCmd.pop();
|
||||
top.setArgument(new Argument(cmd));
|
||||
cmd = top;
|
||||
}
|
||||
|
||||
// If we have a command and a motion command argument, both could possibly have their own counts. We
|
||||
// need to adjust the counts so the motion gets the product of both counts and the command's count gets
|
||||
// reset. Example 3c2w (change 2 words, three times) becomes c6w (change 6 words)
|
||||
Argument arg = cmd.getArgument();
|
||||
if (arg != null && arg.getType() == Argument.MOTION)
|
||||
{
|
||||
Command mot = arg.getMotion();
|
||||
// If no count was entered for either command then nothing changes. If either had a count then
|
||||
// the motion gets the product of both.
|
||||
int cnt = cmd.getRawCount() == 0 && mot.getRawCount() == 0 ? 0 : cmd.getCount() * mot.getCount();
|
||||
cmd.setCount(0);
|
||||
mot.setCount(cnt);
|
||||
}
|
||||
|
||||
// If we were in "operator pending" mode, reset back to normal mode.
|
||||
if (CommandState.getInstance().getMappingMode() == KeyParser.MAPPING_OP_PEND)
|
||||
{
|
||||
CommandState.getInstance().setMappingMode(KeyParser.MAPPING_NORMAL);
|
||||
}
|
||||
|
||||
// Save off the command we are about to execute
|
||||
CommandState.getInstance().setCommand(cmd);
|
||||
|
||||
if (!editor.getDocument().isWritable() && !Command.isReadOnlyType(cmd.getType()))
|
||||
{
|
||||
indicateError();
|
||||
}
|
||||
else
|
||||
{
|
||||
executeAction(cmd.getAction(), context);
|
||||
if (CommandState.getInstance().getMode() == CommandState.MODE_INSERT ||
|
||||
CommandState.getInstance().getMode() == CommandState.MODE_REPLACE)
|
||||
{
|
||||
CommandGroups.getInstance().getChange().processCommand(editor, context, cmd);
|
||||
}
|
||||
}
|
||||
|
||||
// Now that the command has been executed let's clean up a few things.
|
||||
|
||||
// By default the "empty" register is used by all commands so we want to reset whatever the last register
|
||||
// selected by the user was to the empty register - unless we just executed the "select register" command.
|
||||
if (cmd.getType() != Command.SELECT_REGISTER)
|
||||
{
|
||||
CommandGroups.getInstance().getRegister().resetRegister();
|
||||
}
|
||||
|
||||
reset();
|
||||
|
||||
// If, at this point, we are not in insert, replace, or visual modes, we need to restore the previous
|
||||
// mode we were in. This handles commands in those modes that temporarily allow us to execute normal
|
||||
// mode commands.
|
||||
if (CommandState.getInstance().getMode() != CommandState.MODE_INSERT &&
|
||||
CommandState.getInstance().getMode() != CommandState.MODE_REPLACE &&
|
||||
CommandState.getInstance().getMode() != CommandState.MODE_VISUAL)
|
||||
{
|
||||
CommandState.getInstance().restoreMode();
|
||||
}
|
||||
}
|
||||
// We had some sort of error so reset the handler and let the user know (beep)
|
||||
else if (mode == STATE_ERROR)
|
||||
{
|
||||
indicateError();
|
||||
fullReset();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute an action by name
|
||||
* @param name The name of the action to execute
|
||||
* @param context The context to run it in
|
||||
*/
|
||||
public static void executeAction(String name, DataContext context)
|
||||
{
|
||||
logger.debug("executing action " + name);
|
||||
ActionManager aMgr = ActionManager.getInstance();
|
||||
AnAction action = aMgr.getAction(name);
|
||||
if (action != null)
|
||||
{
|
||||
executeAction(action, context);
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.debug("Unknown action");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute an action
|
||||
* @param action The action to execute
|
||||
* @param context The context to run it in
|
||||
*/
|
||||
public static void executeAction(AnAction action, DataContext context)
|
||||
{
|
||||
logger.debug("executing action " + action);
|
||||
|
||||
// Hopefully all the arguments are sufficient. So far they all seem to work OK.
|
||||
// We don't have a specific InputEvent so that is null
|
||||
// What is "place"? Leave it the empty string for now.
|
||||
// Is the template presentation sufficient?
|
||||
// What are the modifiers? Is zero OK?
|
||||
action.actionPerformed(new AnActionEvent(null, context, "", action.getTemplatePresentation(), 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Inidicate to the user that an error has occurred. Just beep.
|
||||
*/
|
||||
public static void indicateError()
|
||||
{
|
||||
Toolkit.getDefaultToolkit().beep();
|
||||
}
|
||||
|
||||
/**
|
||||
* Partially resets the state of this handler. Resets the command count, clears the key list, resets the
|
||||
* key tree node to the root for the current mode we are in.
|
||||
*/
|
||||
private void partialReset()
|
||||
{
|
||||
count = 0;
|
||||
keys = new ArrayList();
|
||||
currentNode = KeyParser.getInstance().getKeyRoot(CommandState.getInstance().getMappingMode());
|
||||
logger.debug("partialReset");
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the state of this handler. Does a partial reset then resets the mode, the command, and the argument
|
||||
*/
|
||||
public void reset()
|
||||
{
|
||||
partialReset();
|
||||
mode = STATE_NEW_COMMAND;
|
||||
currentCmd.clear();
|
||||
currentArg = Argument.NONE;
|
||||
logger.debug("reset");
|
||||
}
|
||||
|
||||
/**
|
||||
* Completely resets the state of this handler. Resets the command mode to normal, resets, and clears the selected
|
||||
* register.
|
||||
*/
|
||||
public void fullReset()
|
||||
{
|
||||
CommandState.getInstance().setMappingMode(KeyParser.MAPPING_NORMAL);
|
||||
reset();
|
||||
CommandGroups.getInstance().getRegister().resetRegister();
|
||||
}
|
||||
|
||||
/**
|
||||
* This was used as an experiment to execute actions as a runnable.
|
||||
*/
|
||||
static class ActionRunner implements Runnable
|
||||
{
|
||||
public ActionRunner(AnAction action, DataContext context)
|
||||
{
|
||||
this.action = action;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
action.actionPerformed(new AnActionEvent(null, context, "", action.getTemplatePresentation(), 0));
|
||||
}
|
||||
|
||||
private AnAction action;
|
||||
private DataContext context;
|
||||
}
|
||||
|
||||
private int count;
|
||||
private ArrayList keys;
|
||||
private int mode;
|
||||
private ParentNode currentNode;
|
||||
private Stack currentCmd = new Stack();
|
||||
private int currentArg;
|
||||
private TypedActionHandler origHandler;
|
||||
|
||||
private static KeyHandler instance;
|
||||
|
||||
private static final int STATE_NEW_COMMAND = 1;
|
||||
private static final int STATE_COMMAND = 2;
|
||||
private static final int STATE_READY = 3;
|
||||
private static final int STATE_ERROR = 4;
|
||||
|
||||
private static Logger logger = Logger.getInstance(KeyHandler.class.getName());
|
||||
}
|
220
src/com/maddyhome/idea/vim/VimPlugin.java
Normal file
220
src/com/maddyhome/idea/vim/VimPlugin.java
Normal file
@ -0,0 +1,220 @@
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
||||
import com.intellij.openapi.components.ApplicationComponent;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.EditorFactory;
|
||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedAction;
|
||||
import com.intellij.openapi.editor.event.EditorFactoryAdapter;
|
||||
import com.intellij.openapi.editor.event.EditorFactoryEvent;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.project.ProjectManager;
|
||||
import com.intellij.openapi.project.ProjectManagerAdapter;
|
||||
import com.intellij.openapi.util.InvalidDataException;
|
||||
import com.intellij.openapi.util.JDOMExternalizable;
|
||||
import com.intellij.openapi.util.WriteExternalException;
|
||||
import com.maddyhome.idea.vim.ex.CommandParser;
|
||||
import com.maddyhome.idea.vim.group.ChangeGroup;
|
||||
import com.maddyhome.idea.vim.group.CommandGroups;
|
||||
import com.maddyhome.idea.vim.group.MotionGroup;
|
||||
import com.maddyhome.idea.vim.helper.EditorData;
|
||||
import com.maddyhome.idea.vim.key.RegisterActions;
|
||||
import org.jdom.Element;
|
||||
|
||||
/**
|
||||
* This plugin attempts to emulate the keybinding and general functionality of Vim and gVim. See the supplied
|
||||
* documentation for a complete list of supported and unsupported Vim emulation. The code base contains some
|
||||
* debugging output that can be enabled in necessary.
|
||||
*
|
||||
* This is an application level plugin meaning that all open projects will share a common instance of the plugin.
|
||||
* Registers and marks are shared across open projects so you can copy and paste between files of different projects.
|
||||
*
|
||||
* @version 0.1
|
||||
*/
|
||||
public class VimPlugin implements ApplicationComponent, JDOMExternalizable
|
||||
{
|
||||
/**
|
||||
* Creates the Vim Plugin
|
||||
*/
|
||||
public VimPlugin()
|
||||
{
|
||||
logger.debug("VimPlugin ctr");
|
||||
}
|
||||
|
||||
/**
|
||||
* Supplies the name of the plugin
|
||||
* @return The plugin name
|
||||
*/
|
||||
public String getComponentName()
|
||||
{
|
||||
return "VimPlugin";
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the Vim Plugin. This plugs the vim key handler into the editor action mananger.
|
||||
*/
|
||||
public void initComponent()
|
||||
{
|
||||
logger.debug("initComponent");
|
||||
// It appears that custom actions listed in plugin.xml are not registered with the ActionManager until
|
||||
// after this method returns :(
|
||||
|
||||
EditorActionManager manager = EditorActionManager.getInstance();
|
||||
TypedAction action = manager.getTypedAction();
|
||||
|
||||
// Replace the default key handler with the Vim key handler
|
||||
vimHandler = new VimTypedActionHandler(action.getHandler());
|
||||
action.setupHandler(vimHandler);
|
||||
|
||||
// Add some listeners so we can handle special events
|
||||
setupListeners();
|
||||
|
||||
logger.debug("done");
|
||||
}
|
||||
|
||||
/**
|
||||
* This sets up some listeners so we can handle various events that occur
|
||||
*/
|
||||
private void setupListeners()
|
||||
{
|
||||
EditorFactory.getInstance().addEditorFactoryListener(new EditorFactoryAdapter() {
|
||||
public void editorCreated(EditorFactoryEvent event)
|
||||
{
|
||||
EditorData.initializeEditor(event.getEditor());
|
||||
}
|
||||
|
||||
public void editorReleased(EditorFactoryEvent event)
|
||||
{
|
||||
EditorData.uninitializeEditor(event.getEditor());
|
||||
}
|
||||
});
|
||||
|
||||
// Since the Vim plugin custom actions aren't available to the call to <code>initComponent()</code>
|
||||
// we need to force the generation of the key map when the first project is opened.
|
||||
ProjectManager.getInstance().addProjectManagerListener(new ProjectManagerAdapter() {
|
||||
public void projectOpened(Project project)
|
||||
{
|
||||
// Make sure all the keys are registered before the user can interact with the first project
|
||||
actions = RegisterActions.getInstance();
|
||||
CommandParser.getInstance().registerHandlers();
|
||||
|
||||
FileEditorManager.getInstance(project).addFileEditorManagerListener(new ChangeGroup.InsertCheck());
|
||||
FileEditorManager.getInstance(project).addFileEditorManagerListener(new MotionGroup.MotionEditorChange());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* This shuts down the Vim plugin. All we need to do is reinstall the original key handler
|
||||
*/
|
||||
public void disposeComponent()
|
||||
{
|
||||
logger.debug("disposeComponent");
|
||||
EditorActionManager manager = EditorActionManager.getInstance();
|
||||
TypedAction action = manager.getTypedAction();
|
||||
action.setupHandler(vimHandler.getOriginalTypedHandler());
|
||||
logger.debug("done");
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called by the framework to load custom configuration data. The data is stored in
|
||||
* <code>$HOME/.IntelliJIdea/config/options/other.xml</code> though this is handled by the openAPI.
|
||||
* @param element The element specific to the Vim Plugin. All the plugin's custom state information is
|
||||
* children of this element.
|
||||
* @throws InvalidDataException if any of the configuration data is invalid
|
||||
*/
|
||||
public void readExternal(Element element) throws InvalidDataException
|
||||
{
|
||||
logger.debug("readExternal");
|
||||
|
||||
// Restore whether the plugin is enabled or not
|
||||
Element state = element.getChild("state");
|
||||
if (state != null)
|
||||
{
|
||||
enabled = Boolean.valueOf(state.getAttributeValue("enabled")).booleanValue();
|
||||
}
|
||||
|
||||
CommandGroups.getInstance().readData(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called by the framework to store custom configuration data. The data is stored in
|
||||
* <code>$HOME/.IntelliJIdea/config/options/other.xml</code> though this is handled by the openAPI.
|
||||
* @param element The element specific to the Vim Plugin. All the plugin's custom state information is
|
||||
* children of this element.
|
||||
* @throws WriteExternalException if unable to save and of the configuration data
|
||||
*/
|
||||
public void writeExternal(Element element) throws WriteExternalException
|
||||
{
|
||||
// Save whether the plugin is enabled or not
|
||||
Element elem = new Element("state");
|
||||
elem.setAttribute("enabled", Boolean.toString(enabled));
|
||||
element.addContent(elem);
|
||||
|
||||
CommandGroups.getInstance().saveData(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the user has enabled or disabled the plugin
|
||||
* @return true if the Vim plugin is enabled, false if not
|
||||
*/
|
||||
public static boolean isEnabled()
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* This class is used to handle the Vim Plugin enabled/disabled toggle. This is most likely used as a menu
|
||||
* option but could also be used as a toolbar item.
|
||||
*/
|
||||
public static class VimPluginToggleAction extends ToggleAction
|
||||
{
|
||||
/**
|
||||
* Indicates if the toggle is on or off
|
||||
* @param event The event that triggered the action
|
||||
* @return true if the toggle is on, false if off
|
||||
*/
|
||||
public boolean isSelected(AnActionEvent event)
|
||||
{
|
||||
return enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether the toggle should be on or off
|
||||
* @param event The event that triggered the action
|
||||
* @param b The new state - true is on, false is off
|
||||
*/
|
||||
public void setSelected(AnActionEvent event, boolean b)
|
||||
{
|
||||
enabled = b;
|
||||
}
|
||||
}
|
||||
|
||||
private VimTypedActionHandler vimHandler;
|
||||
private RegisterActions actions;
|
||||
|
||||
private static boolean enabled = true;
|
||||
private static Logger logger = Logger.getInstance(VimPlugin.class.getName());
|
||||
}
|
84
src/com/maddyhome/idea/vim/VimTypedActionHandler.java
Normal file
84
src/com/maddyhome/idea/vim/VimTypedActionHandler.java
Normal file
@ -0,0 +1,84 @@
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
/**
|
||||
* This handler accepts all regular keystrokes and passes them on to the Vim Key handler
|
||||
*/
|
||||
public class VimTypedActionHandler implements TypedActionHandler
|
||||
{
|
||||
/**
|
||||
* Creates an instance of the key handler
|
||||
* @param origHandler The original key handler
|
||||
*/
|
||||
public VimTypedActionHandler(TypedActionHandler origHandler)
|
||||
{
|
||||
this.origHandler = origHandler;
|
||||
handler = KeyHandler.getInstance();
|
||||
handler.setOriginalHandler(origHandler);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gives the original key handler
|
||||
* @return The original key handler
|
||||
*/
|
||||
public TypedActionHandler getOriginalTypedHandler()
|
||||
{
|
||||
return origHandler;
|
||||
}
|
||||
|
||||
/**
|
||||
* All characters typed into an editor will get sent to this handler. Only letters, numbers, and punctuation
|
||||
* are sent here. Keys like Tab, Enter, Home, Backspace, etc. and all Control-Letter etc. argType keys are not
|
||||
* sent by Idea to this handler.
|
||||
* @param editor The editor the character was typed into
|
||||
* @param charTyped The character that was typed
|
||||
* @param context The data context
|
||||
*/
|
||||
public void execute(Editor editor, char charTyped, DataContext context)
|
||||
{
|
||||
// If the plugin is disabled we simply resend the character to the original handler
|
||||
if (!VimPlugin.isEnabled())
|
||||
{
|
||||
origHandler.execute(editor, charTyped, context);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), context);
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
private TypedActionHandler origHandler;
|
||||
private KeyHandler handler;
|
||||
|
||||
private static Logger logger = Logger.getInstance(VimTypedActionHandler.class.getName());
|
||||
}
|
44
src/com/maddyhome/idea/vim/action/AbstractCommandAction.java
Normal file
44
src/com/maddyhome/idea/vim/action/AbstractCommandAction.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.maddyhome.idea.vim.action;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.maddyhome.idea.vim.KeyHandler;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
|
||||
/**
|
||||
*/
|
||||
public abstract class AbstractCommandAction extends AnAction
|
||||
{
|
||||
public final void actionPerformed(AnActionEvent event)
|
||||
{
|
||||
CommandState state = CommandState.getInstance();
|
||||
Command cmd = state.getCommand();
|
||||
if (!execute(event.getDataContext(), cmd))
|
||||
{
|
||||
KeyHandler.indicateError();
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract boolean execute(DataContext context, Command cmd);
|
||||
}
|
34
src/com/maddyhome/idea/vim/action/ExEntryAction.java
Normal file
34
src/com/maddyhome/idea/vim/action/ExEntryAction.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.maddyhome.idea.vim.action;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.ExEntryHandler;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ExEntryAction extends EditorAction
|
||||
{
|
||||
public ExEntryAction()
|
||||
{
|
||||
super(new ExEntryHandler());
|
||||
}
|
||||
}
|
34
src/com/maddyhome/idea/vim/action/ResetModeAction.java
Normal file
34
src/com/maddyhome/idea/vim/action/ResetModeAction.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.maddyhome.idea.vim.action;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.ResetModeHandler;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ResetModeAction extends EditorAction
|
||||
{
|
||||
public ResetModeAction()
|
||||
{
|
||||
super(new ResetModeHandler());
|
||||
}
|
||||
}
|
33
src/com/maddyhome/idea/vim/action/change/RedoAction.java
Normal file
33
src/com/maddyhome/idea/vim/action/change/RedoAction.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.RedoHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class RedoAction extends EditorAction
|
||||
{
|
||||
public RedoAction()
|
||||
{
|
||||
super(new RedoHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.RepeatChangeHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class RepeatChangeAction extends EditorAction
|
||||
{
|
||||
public RepeatChangeAction()
|
||||
{
|
||||
super(new RepeatChangeHandler());
|
||||
}
|
||||
}
|
33
src/com/maddyhome/idea/vim/action/change/UndoAction.java
Normal file
33
src/com/maddyhome/idea/vim/action/change/UndoAction.java
Normal file
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.UndoHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class UndoAction extends EditorAction
|
||||
{
|
||||
public UndoAction()
|
||||
{
|
||||
super(new UndoHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseLowerMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseLowerMotionAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseLowerMotionAction()
|
||||
{
|
||||
super(new ChangeCaseLowerMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseLowerVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseLowerVisualAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseLowerVisualAction()
|
||||
{
|
||||
super(new ChangeCaseLowerVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseToggleCharacterHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseToggleCharacterAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseToggleCharacterAction()
|
||||
{
|
||||
super(new ChangeCaseToggleCharacterHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseToggleMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseToggleMotionAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseToggleMotionAction()
|
||||
{
|
||||
super(new ChangeCaseToggleMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseToggleVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseToggleVisualAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseToggleVisualAction()
|
||||
{
|
||||
super(new ChangeCaseToggleVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseUpperMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseUpperMotionAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseUpperMotionAction()
|
||||
{
|
||||
super(new ChangeCaseUpperMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCaseUpperVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCaseUpperVisualAction extends EditorAction
|
||||
{
|
||||
public ChangeCaseUpperVisualAction()
|
||||
{
|
||||
super(new ChangeCaseUpperVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCharacterHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeCharacterAction extends EditorAction
|
||||
{
|
||||
public ChangeCharacterAction()
|
||||
{
|
||||
super(new ChangeCharacterHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeCharactersHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class
|
||||
|
||||
|
||||
ChangeCharactersAction extends EditorAction
|
||||
{
|
||||
public ChangeCharactersAction()
|
||||
{
|
||||
super(new ChangeCharactersHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeEndOfLineHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeEndOfLineAction extends EditorAction
|
||||
{
|
||||
public ChangeEndOfLineAction()
|
||||
{
|
||||
super(new ChangeEndOfLineHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeLineHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeLineAction extends EditorAction
|
||||
{
|
||||
public ChangeLineAction()
|
||||
{
|
||||
super(new ChangeLineHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeMotionAction extends EditorAction
|
||||
{
|
||||
public ChangeMotionAction()
|
||||
{
|
||||
super(new ChangeMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeReplaceHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeReplaceAction extends EditorAction
|
||||
{
|
||||
public ChangeReplaceAction()
|
||||
{
|
||||
super(new ChangeReplaceHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeVisualAction extends EditorAction
|
||||
{
|
||||
public ChangeVisualAction()
|
||||
{
|
||||
super(new ChangeVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeVisualCharacterHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeVisualCharacterAction extends EditorAction
|
||||
{
|
||||
public ChangeVisualCharacterAction()
|
||||
{
|
||||
super(new ChangeVisualCharacterHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.change;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.change.ChangeVisualLinesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ChangeVisualLinesAction extends EditorAction
|
||||
{
|
||||
public ChangeVisualLinesAction()
|
||||
{
|
||||
super(new ChangeVisualLinesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteCharacterHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteCharacterAction extends EditorAction
|
||||
{
|
||||
public DeleteCharacterAction()
|
||||
{
|
||||
super(new DeleteCharacterHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteCharacterLeftHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteCharacterLeftAction extends EditorAction
|
||||
{
|
||||
public DeleteCharacterLeftAction()
|
||||
{
|
||||
super(new DeleteCharacterLeftHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteCharacterRightHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteCharacterRightAction extends EditorAction
|
||||
{
|
||||
public DeleteCharacterRightAction()
|
||||
{
|
||||
super(new DeleteCharacterRightHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteEndOfLineHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteEndOfLineAction extends EditorAction
|
||||
{
|
||||
public DeleteEndOfLineAction()
|
||||
{
|
||||
super(new DeleteEndOfLineHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteJoinLinesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteJoinLinesAction extends EditorAction
|
||||
{
|
||||
public DeleteJoinLinesAction()
|
||||
{
|
||||
super(new DeleteJoinLinesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteJoinLinesSpacesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteJoinLinesSpacesAction extends EditorAction
|
||||
{
|
||||
public DeleteJoinLinesSpacesAction()
|
||||
{
|
||||
super(new DeleteJoinLinesSpacesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteJoinVisualLinesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteJoinVisualLinesAction extends EditorAction
|
||||
{
|
||||
public DeleteJoinVisualLinesAction()
|
||||
{
|
||||
super(new DeleteJoinVisualLinesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteJoinVisualLinesSpacesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteJoinVisualLinesSpacesAction extends EditorAction
|
||||
{
|
||||
public DeleteJoinVisualLinesSpacesAction()
|
||||
{
|
||||
super(new DeleteJoinVisualLinesSpacesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteLineHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteLineAction extends EditorAction
|
||||
{
|
||||
public DeleteLineAction()
|
||||
{
|
||||
super(new DeleteLineHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteMotionAction extends EditorAction
|
||||
{
|
||||
public DeleteMotionAction()
|
||||
{
|
||||
super(new DeleteMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteVisualAction extends EditorAction
|
||||
{
|
||||
public DeleteVisualAction()
|
||||
{
|
||||
super(new DeleteVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.delete;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.delete.DeleteVisualLinesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class DeleteVisualLinesAction extends EditorAction
|
||||
{
|
||||
public DeleteVisualLinesAction()
|
||||
{
|
||||
super(new DeleteVisualLinesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertAfterCursorHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertAfterCursorAction extends EditorAction
|
||||
{
|
||||
public InsertAfterCursorAction()
|
||||
{
|
||||
super(new InsertAfterCursorHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertAfterLineEndHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertAfterLineEndAction extends EditorAction
|
||||
{
|
||||
public InsertAfterLineEndAction()
|
||||
{
|
||||
super(new InsertAfterLineEndHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertAtPreviousInsertHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertAtPreviousInsertAction extends EditorAction
|
||||
{
|
||||
public InsertAtPreviousInsertAction()
|
||||
{
|
||||
super(new InsertAtPreviousInsertHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertBeforeCursorHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertBeforeCursorAction extends EditorAction
|
||||
{
|
||||
public InsertBeforeCursorAction()
|
||||
{
|
||||
super(new InsertBeforeCursorHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertBeforeFirstNonBlankHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertBeforeFirstNonBlankAction extends EditorAction
|
||||
{
|
||||
public InsertBeforeFirstNonBlankAction()
|
||||
{
|
||||
super(new InsertBeforeFirstNonBlankHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertCharacterAboveCursorHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertCharacterAboveCursorAction extends EditorAction
|
||||
{
|
||||
public InsertCharacterAboveCursorAction()
|
||||
{
|
||||
super(new InsertCharacterAboveCursorHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertCharacterBelowCursorHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertCharacterBelowCursorAction extends EditorAction
|
||||
{
|
||||
public InsertCharacterBelowCursorAction()
|
||||
{
|
||||
super(new InsertCharacterBelowCursorHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertDeletePreviousWordHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertDeletePreviousWordAction extends EditorAction
|
||||
{
|
||||
public InsertDeletePreviousWordAction()
|
||||
{
|
||||
super(new InsertDeletePreviousWordHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertEnterHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertEnterAction extends EditorAction
|
||||
{
|
||||
public InsertEnterAction()
|
||||
{
|
||||
super(new InsertEnterHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertExitModeHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertExitModeAction extends EditorAction
|
||||
{
|
||||
public InsertExitModeAction()
|
||||
{
|
||||
super(new InsertExitModeHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertInsertHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertInsertAction extends EditorAction
|
||||
{
|
||||
public InsertInsertAction()
|
||||
{
|
||||
super(new InsertInsertHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertLineStartHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class
|
||||
InsertLineStartAction extends EditorAction
|
||||
{
|
||||
public InsertLineStartAction()
|
||||
{
|
||||
super(new InsertLineStartHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertNewLineAboveHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class
|
||||
InsertNewLineAboveAction extends EditorAction
|
||||
{
|
||||
public InsertNewLineAboveAction()
|
||||
{
|
||||
super(new InsertNewLineAboveHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertNewLineBelowHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class
|
||||
InsertNewLineBelowAction extends EditorAction
|
||||
{
|
||||
public InsertNewLineBelowAction()
|
||||
{
|
||||
super(new InsertNewLineBelowHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertPreviousInsertHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertPreviousInsertAction extends EditorAction
|
||||
{
|
||||
public InsertPreviousInsertAction()
|
||||
{
|
||||
super(new InsertPreviousInsertHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertPreviousInsertExitHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertPreviousInsertExitAction extends EditorAction
|
||||
{
|
||||
public InsertPreviousInsertExitAction()
|
||||
{
|
||||
super(new InsertPreviousInsertExitHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertRegisterHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertRegisterAction extends EditorAction
|
||||
{
|
||||
public InsertRegisterAction()
|
||||
{
|
||||
super(new InsertRegisterHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.insert;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.insert.InsertSingleCommandHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class InsertSingleCommandAction extends EditorAction
|
||||
{
|
||||
public InsertSingleCommandAction()
|
||||
{
|
||||
super(new InsertSingleCommandHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.shift.ShiftLeftLinesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ShiftLeftLinesAction extends EditorAction
|
||||
{
|
||||
public ShiftLeftLinesAction()
|
||||
{
|
||||
super(new ShiftLeftLinesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.shift.ShiftLeftMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ShiftLeftMotionAction extends EditorAction
|
||||
{
|
||||
public ShiftLeftMotionAction()
|
||||
{
|
||||
super(new ShiftLeftMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.shift.ShiftLeftVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ShiftLeftVisualAction extends EditorAction
|
||||
{
|
||||
public ShiftLeftVisualAction()
|
||||
{
|
||||
super(new ShiftLeftVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.shift.ShiftRightLinesHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ShiftRightLinesAction extends EditorAction
|
||||
{
|
||||
public ShiftRightLinesAction()
|
||||
{
|
||||
super(new ShiftRightLinesHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.shift.ShiftRightMotionHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ShiftRightMotionAction extends EditorAction
|
||||
{
|
||||
public ShiftRightMotionAction()
|
||||
{
|
||||
super(new ShiftRightMotionHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.change.shift;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.change.shift.ShiftRightVisualHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ShiftRightVisualAction extends EditorAction
|
||||
{
|
||||
public ShiftRightVisualAction()
|
||||
{
|
||||
super(new ShiftRightVisualHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.copy;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.copy.PutTextAfterCursorHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class PutTextAfterCursorAction extends EditorAction
|
||||
{
|
||||
public PutTextAfterCursorAction()
|
||||
{
|
||||
super(new PutTextAfterCursorHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.copy;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.copy.PutTextBeforeCursorHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class PutTextBeforeCursorAction extends EditorAction
|
||||
{
|
||||
public PutTextBeforeCursorAction()
|
||||
{
|
||||
super(new PutTextBeforeCursorHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.maddyhome.idea.vim.action.copy;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
||||
import com.maddyhome.idea.vim.handler.copy.PutVisualTextHandler;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class PutVisualTextAction extends EditorAction
|
||||
{
|
||||
public PutVisualTextAction()
|
||||
{
|
||||
super(new PutVisualTextHandler());
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package com.maddyhome.idea.vim.action.copy;
|
||||
|
||||
/*
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003 Rick Maddy
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.maddyhome.idea.vim.action.AbstractCommandAction;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.group.CommandGroups;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class SelectRegisterAction extends AbstractCommandAction
|
||||
{
|
||||
protected boolean execute(DataContext context, Command cmd)
|
||||
{
|
||||
return CommandGroups.getInstance().getRegister().selectRegister(cmd.getArgument().getCharacter());
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user