1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-05-22 10:34:04 +02:00

Lots of changes for 0.1.1 to fix Enter and Backspace for Ex commands

This commit is contained in:
rmaddy 2003-04-18 20:45:35 +00:00
parent d8092b5913
commit bc08b3ef80
23 changed files with 469 additions and 147 deletions

View File

@ -81,6 +81,9 @@
<filter targetName="clean" isVisible="true" /> <filter targetName="clean" isVisible="true" />
<filter targetName="build" isVisible="true" /> <filter targetName="build" isVisible="true" />
<filter targetName="deploy" isVisible="true" /> <filter targetName="deploy" isVisible="true" />
<filter targetName="dist" isVisible="true" />
<filter targetName="dist-bin" isVisible="true" />
<filter targetName="dist-src" isVisible="true" />
<filter targetName="javadoc" isVisible="false" /> <filter targetName="javadoc" isVisible="false" />
</targetFilters> </targetFilters>
</buildFile> </buildFile>
@ -128,6 +131,5 @@
<option name="OPEN_IN_BROWSER" value="false" /> <option name="OPEN_IN_BROWSER" value="false" />
<option name="OUTPUT_DIRECTORY" /> <option name="OUTPUT_DIRECTORY" />
</component> </component>
<component name="WebReferencesManager" />
</project> </project>

View File

@ -1,73 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="3" relativePaths="false"> <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"> <component name="FileEditorManager">
<history> <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/ex/CommandParser.java" line="54" column="13" vertical-scroll-proportion="0.33249685" horizontal-scroll-proportion="0.10781991" />
<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/ex/ExCommand.java" line="41" column="0" vertical-scroll-proportion="0.71518195" 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/ui/ClipboardHandler.java" line="33" column="13" vertical-scroll-proportion="0.050188206" horizontal-scroll-proportion="0.10781991" />
<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/group/ChangeGroup.java" line="1201" column="0" vertical-scroll-proportion="0.82763535" 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/VimPlugin.java" line="56" column="13" vertical-scroll-proportion="-2.2792022" horizontal-scroll-proportion="0.10781991" />
<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/KeyHandler.java" line="48" column="13" vertical-scroll-proportion="0.43304843" horizontal-scroll-proportion="0.10781991" />
<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/ex/CommandHandler.java" line="128" column="24" vertical-scroll-proportion="1.1111112" horizontal-scroll-proportion="0.19905214" />
<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$/web/index.php" line="24" column="0" vertical-scroll-proportion="0.51282054" horizontal-scroll-proportion="0.0" />
<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/handler/ExEntryHandler.java" line="75" column="33" vertical-scroll-proportion="0.35042736" horizontal-scroll-proportion="0.2736967" />
<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$/docs/README.txt" line="23" column="23" vertical-scroll-proportion="0.491453" horizontal-scroll-proportion="0.19075829" />
<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/ui/CommandEntryPanel.java" line="117" column="9" vertical-scroll-proportion="0.97863245" horizontal-scroll-proportion="0.07464455" />
<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/ui/ExEditorKit.java" line="207" column="0" vertical-scroll-proportion="0.8333333" horizontal-scroll-proportion="0.0" />
<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="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/SwingUtilities.java" line="1517" column="0" vertical-scroll-proportion="0.66239315" horizontal-scroll-proportion="0.0" />
<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="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/Keymap.java" line="98" column="16" vertical-scroll-proportion="0.32905984" horizontal-scroll-proportion="0.13270143" />
<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="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/JMenuBar.java" line="637" column="0" vertical-scroll-proportion="0.23504274" horizontal-scroll-proportion="0.0" />
<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="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/DefaultEditorKit.java" line="999" column="0" vertical-scroll-proportion="0.24216524" horizontal-scroll-proportion="0.0" />
<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="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/JTextComponent.java" line="2917" column="41" vertical-scroll-proportion="3.022792" horizontal-scroll-proportion="0.3400474" />
<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="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/JComponent.java" line="2438" column="20" vertical-scroll-proportion="0.32621083" horizontal-scroll-proportion="0.16587678" />
<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/ui/ExTextField.java" line="42" column="47" vertical-scroll-proportion="0.56980056" horizontal-scroll-proportion="0.3898104" />
<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/ui/ExKeyBindings.java" line="45" column="0" vertical-scroll-proportion="0.54415953" horizontal-scroll-proportion="0.0" />
<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$/docs/NOTES.txt" line="2" column="0" vertical-scroll-proportion="0.03988604" horizontal-scroll-proportion="0.0" />
<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$/docs/CHANGES.txt" line="7" column="0" vertical-scroll-proportion="0.14957266" horizontal-scroll-proportion="0.0" />
<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$/web/vim/index.txt" line="11" column="0" vertical-scroll-proportion="0.23504274" horizontal-scroll-proportion="0.0" />
<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$/build.xml" line="82" column="42" vertical-scroll-proportion="0.37321937" horizontal-scroll-proportion="0.34834123" />
<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> </history>
<open-files /> <open-files>
<source-position-entry url="file://$PROJECT_DIR$/docs/README.txt" line="23" column="23" vertical-scroll-proportion="0.491453" horizontal-scroll-proportion="0.19075829" />
<source-position-entry url="file://$PROJECT_DIR$/docs/NOTES.txt" line="2" column="0" vertical-scroll-proportion="0.03988604" horizontal-scroll-proportion="0.0" />
<source-position-entry url="file://$PROJECT_DIR$/build.xml" line="82" column="42" vertical-scroll-proportion="0.37321937" horizontal-scroll-proportion="0.34834123" selected="true" />
<source-position-entry url="file://$PROJECT_DIR$/web/index.php" line="24" column="0" vertical-scroll-proportion="0.51282054" horizontal-scroll-proportion="0.0" />
<source-position-entry url="file://$PROJECT_DIR$/docs/CHANGES.txt" line="7" column="0" vertical-scroll-proportion="0.14957266" horizontal-scroll-proportion="0.0" />
<source-position-entry url="file://$PROJECT_DIR$/web/vim/index.txt" line="11" column="0" vertical-scroll-proportion="0.23504274" horizontal-scroll-proportion="0.0" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/ui/ExEditorKit.java" line="207" column="0" vertical-scroll-proportion="0.8333333" horizontal-scroll-proportion="0.0" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/ui/ExKeyBindings.java" line="45" column="0" vertical-scroll-proportion="0.54415953" horizontal-scroll-proportion="0.0" />
<source-position-entry url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/DefaultEditorKit.java" line="999" column="0" vertical-scroll-proportion="0.24216524" horizontal-scroll-proportion="0.0" />
<source-position-entry url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/SwingUtilities.java" line="1517" column="0" vertical-scroll-proportion="0.66239315" horizontal-scroll-proportion="0.0" />
<source-position-entry url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/JComponent.java" line="2438" column="20" vertical-scroll-proportion="0.32621083" horizontal-scroll-proportion="0.16587678" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/ui/ExTextField.java" line="42" column="47" vertical-scroll-proportion="0.56980056" horizontal-scroll-proportion="0.3898104" />
<source-position-entry url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/JMenuBar.java" line="637" column="0" vertical-scroll-proportion="0.23504274" horizontal-scroll-proportion="0.0" />
<source-position-entry url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/JTextComponent.java" line="2917" column="41" vertical-scroll-proportion="3.022792" horizontal-scroll-proportion="0.3400474" />
<source-position-entry url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/Keymap.java" line="98" column="16" vertical-scroll-proportion="0.32905984" horizontal-scroll-proportion="0.13270143" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/handler/ExEntryHandler.java" line="75" column="33" vertical-scroll-proportion="0.35042736" horizontal-scroll-proportion="0.2736967" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/ex/CommandHandler.java" line="128" column="24" vertical-scroll-proportion="1.1111112" horizontal-scroll-proportion="0.19905214" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/KeyHandler.java" line="48" column="13" vertical-scroll-proportion="0.43304843" horizontal-scroll-proportion="0.10781991" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/VimPlugin.java" line="56" column="13" vertical-scroll-proportion="-2.2792022" horizontal-scroll-proportion="0.10781991" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/ui/CommandEntryPanel.java" line="117" column="9" vertical-scroll-proportion="0.97863245" horizontal-scroll-proportion="0.07464455" />
<source-position-entry url="file://$PROJECT_DIR$/src/com/maddyhome/idea/vim/group/ChangeGroup.java" line="1201" column="0" vertical-scroll-proportion="0.82763535" horizontal-scroll-proportion="0.0" />
</open-files>
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="3" y="0" width="1277" height="972" extended-state="6" /> <frame x="4" y="0" width="1277" height="972" extended-state="0" />
<editor active="true" /> <editor active="false" />
<layout> <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="Ant Build" active="false" anchor="right" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.25" order="1" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.24911869" order="5" />
<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="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="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="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="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="Project" active="true" 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="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.2972973" 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="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.32902467" order="1" />
<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.30904818" order="7" />
<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="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="sliding" type="sliding" visible="false" weight="0.4" order="6" />
<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="Web" active="false" anchor="left" auto_hide="false" internal_type="docked" type="docked" visible="false" weight="0.25" order="2" /> <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="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="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" /> <window_info id="Struts Console" active="false" anchor="right" auto_hide="true" internal_type="docked" type="docked" visible="false" weight="0.32980457" order="3" />
</layout> </layout>
</component> </component>
<component name="Debugger"> <component name="Debugger">
<line_breakpoints /> <line_breakpoints>
<breakpoint url="jar:///usr/java/j2sdk1.4.1_01/src.zip!/javax/swing/text/DefaultEditorKit.java" line="999">
<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" />
</breakpoint>
</line_breakpoints>
<exception_breakpoints> <exception_breakpoints>
<breakpoint_any> <breakpoint_any>
<option name="NOTIFY_CAUGHT" value="true" /> <option name="NOTIFY_CAUGHT" value="true" />
@ -170,6 +193,12 @@
<option name="GROUP_GETTERS_AND_SETTERS" value="true" /> <option name="GROUP_GETTERS_AND_SETTERS" value="true" />
</component> </component>
<component name="CvsConfiguration"> <component name="CvsConfiguration">
<cvs_root>
<option name="METHOD" value="ext" />
<option name="USER_NAME" value="rmaddy" />
<option name="HOST" value="cvs.sourceforge.net" />
<option name="REPOSITORY" value="/cvsroot/ideavim" />
</cvs_root>
<Checkout> <Checkout>
<option name="DATE_TAG" value="" /> <option name="DATE_TAG" value="" />
<option name="REVISION_TAG" value="" /> <option name="REVISION_TAG" value="" />
@ -193,7 +222,7 @@
<Commit> <Commit>
<option name="NON_RECURSIVE" value="false" /> <option name="NON_RECURSIVE" value="false" />
<option name="REVISION_TAG" value="" /> <option name="REVISION_TAG" value="" />
<option name="LOG_MESSAGE" value="" /> <option name="LOG_MESSAGE" value="Lots of changes for 0.1.1 to fix Enter and Backspace for Ex commands" />
<option name="ADDITIONAL_OPTIONS" value="" /> <option name="ADDITIONAL_OPTIONS" value="" />
</Commit> </Commit>
<Diff> <Diff>
@ -233,13 +262,13 @@
<option name="NON_RECURSIVE" value="false" /> <option name="NON_RECURSIVE" value="false" />
<option name="FORCE_RECURSIVE" value="false" /> <option name="FORCE_RECURSIVE" value="false" />
</Editors> </Editors>
<option name="CLIENT_PATH" value="" /> <option name="CLIENT_PATH" value="/usr/bin/cvs" />
<option name="EXTERNAL_DIFF_PATH" /> <option name="EXTERNAL_DIFF_PATH" value="" />
<option name="USE_EXTERNAL_DIFF" value="false" /> <option name="USE_EXTERNAL_DIFF" value="false" />
<option name="WORKING_FILES_READONLY" value="false" /> <option name="WORKING_FILES_READONLY" value="false" />
<option name="COMPRESSION_LEVEL" value="0" /> <option name="COMPRESSION_LEVEL" value="0" />
<option name="ADDITIONAL_OPTIONS" value="" /> <option name="ADDITIONAL_OPTIONS" value="" />
<option name="BINARY_FILES_EXTENSIONS" /> <option name="BINARY_FILES_EXTENSIONS" value="" />
<option name="REUSE_LAST_LOG_MESSAGE" value="false" /> <option name="REUSE_LAST_LOG_MESSAGE" value="false" />
<option name="PUT_FOCUS_INTO_LOG_MESSAGE" value="false" /> <option name="PUT_FOCUS_INTO_LOG_MESSAGE" value="false" />
<option name="SHOW_UPDATE_OPTIONS" value="true" /> <option name="SHOW_UPDATE_OPTIONS" value="true" />
@ -257,12 +286,16 @@
<option name="HIDE_UP_TO_DATE_FILES" value="false" /> <option name="HIDE_UP_TO_DATE_FILES" value="false" />
</component> </component>
<component name="CvsVcs"> <component name="CvsVcs">
<expanded_paths /> <expanded_paths>
<path value="$PROJECT_DIR$" />
</expanded_paths>
</component> </component>
<component name="ProjectViewSettings"> <component name="ProjectViewSettings">
<navigator currentView="ProjectPane" flattenPackages="false" showMembers="false" showStructure="false" autoscrollToSource="false" splitterProportion="0.5" /> <navigator currentView="ProjectPane" flattenPackages="false" showMembers="false" showStructure="false" autoscrollToSource="false" splitterProportion="0.5" />
<view id="ProjectPane"> <view id="ProjectPane">
<expanded_node type="directory" url="file://$PROJECT_DIR$/docs" />
<expanded_node type="directory" url="file://$PROJECT_DIR$" /> <expanded_node type="directory" url="file://$PROJECT_DIR$" />
<expanded_node type="directory" url="file://$PROJECT_DIR$/dist" />
</view> </view>
<view id="SourcepathPane" /> <view id="SourcepathPane" />
<view id="ClasspathPane" /> <view id="ClasspathPane" />
@ -329,7 +362,7 @@
<splitter proportion="0.5" /> <splitter proportion="0.5" />
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="GoToClass.includeJavaFiles" value="false" /> <property name="GoToClass.includeJavaFiles" value="true" />
<property name="MemberChooser.copyJavadoc" value="false" /> <property name="MemberChooser.copyJavadoc" value="false" />
<property name="GoToClass.includeLibraries" value="false" /> <property name="GoToClass.includeLibraries" value="false" />
<property name="MemberChooser.showClasses" value="true" /> <property name="MemberChooser.showClasses" value="true" />
@ -344,6 +377,7 @@
<target name="Source" /> <target name="Source" />
<target name="Classpath View" /> <target name="Classpath View" />
<target name="Commander" /> <target name="Commander" />
<target name="CVS View" />
</component> </component>
<component name="VssConfiguration"> <component name="VssConfiguration">
<CheckoutOptions> <CheckoutOptions>
@ -398,7 +432,9 @@
<option name="SORT_ALPHABETICALLY" value="false" /> <option name="SORT_ALPHABETICALLY" value="false" />
</component> </component>
<component name="WebViewSettings"> <component name="WebViewSettings">
<webview flattenPackages="false" showMembers="false" autoscrollToSource="false" /> <webview flattenPackages="false" showMembers="false" autoscrollToSource="false">
<expanded_node type="directory" url="file://$PROJECT_DIR$/web" />
</webview>
</component> </component>
<component name="EjbViewSettings"> <component name="EjbViewSettings">
<EjbView showMembers="false" autoscrollToSource="false" /> <EjbView showMembers="false" autoscrollToSource="false" />
@ -478,8 +514,8 @@
</inspection_tool> </inspection_tool>
<inspection_tool class="Deprecated API usage" enabled="true" /> <inspection_tool class="Deprecated API usage" enabled="true" />
<inspection_tool class="equals() and hashCode() not paired" enabled="true" /> <inspection_tool class="equals() and hashCode() not paired" enabled="true" />
<group name="Local Code Analysis" />
<group name="Declaration Redundancy" /> <group name="Declaration Redundancy" />
<group name="Local Code Analysis" />
<profile name="Full" /> <profile name="Full" />
</component> </component>
<component name="TodoView" selected-index="0"> <component name="TodoView" selected-index="0">
@ -496,7 +532,7 @@
</todo-panel> </todo-panel>
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="ACTIVE_VCS_NAME" value="" /> <option name="ACTIVE_VCS_NAME" value="CVS" />
</component> </component>
<component name="StarteamConfiguration"> <component name="StarteamConfiguration">
<option name="SERVER" value="" /> <option name="SERVER" value="" />
@ -507,13 +543,5 @@
<option name="VIEW" value="" /> <option name="VIEW" value="" />
<option name="ALTERNATIVE_WORKING_PATH" value="" /> <option name="ALTERNATIVE_WORKING_PATH" value="" />
</component> </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="&quot;" />
<partialExecute value="0" />
<rowLimit enabled="true" value="1000" />
<primaryKeyCols enabled="true" />
<savePasswords enabled="false" />
</component>
</project> </project>

View File

@ -32,7 +32,7 @@
<property name="project" value="IdeaVIM" /> <property name="project" value="IdeaVIM" />
<!-- Update this prior to building a new distribution --> <!-- Update this prior to building a new distribution -->
<property name="version" value="0.1.0" /> <property name="version" value="0.1.1" />
<path id="build.classpath"> <path id="build.classpath">
<pathelement path="${idea.home}/lib/openapi.jar" /> <pathelement path="${idea.home}/lib/openapi.jar" />
@ -65,7 +65,10 @@
<copy file="${install}/${project}.jar" todir="${idea.home}/plugins/" /> <copy file="${install}/${project}.jar" todir="${idea.home}/plugins/" />
</target> </target>
<target name="dist" depends="clean, build" description="Creates a tar file containing the plugin distribution" > <target name="dist" depends="dist-src, dist-bin" description="Creates the src and bin distribution files" />
<target name="dist-bin" depends="clean, build" description="Creates a tar file containing the plugin distribution" >
<mkdir dir="dist" />
<delete dir="${project}" /> <delete dir="${project}" />
<mkdir dir="${project}"/> <mkdir dir="${project}"/>
<copy todir="${project}"> <copy todir="${project}">
@ -77,13 +80,35 @@
<filter token="NAME" value="${project}" /> <filter token="NAME" value="${project}" />
<filter token="VERSION" value="${version}" /> <filter token="VERSION" value="${version}" />
</filterset> </filterset>
<fileset dir="docs" includes="*,vim/*.txt" excludes="javadoc" /> <fileset dir="docs" includes="vim/*.txt" excludes="javadoc" />
</copy>
<copy file="docs/README.txt" tofile="${project}/README" >
<filterset>
<filter token="NAME" value="${project}" />
<filter token="VERSION" value="${version}" />
</filterset>
</copy>
<copy file="docs/CHANGES.txt" tofile="${project}/CHANGES" >
<filterset>
<filter token="NAME" value="${project}" />
<filter token="VERSION" value="${version}" />
</filterset>
</copy>
<copy file="docs/NOTES.txt" tofile="${project}/NOTES" >
<filterset>
<filter token="NAME" value="${project}" />
<filter token="VERSION" value="${version}" />
</filterset>
</copy> </copy>
<copy file="docs/README.txt" tofile="${project}/README" />
<mkdir dir="${dist}"/> <mkdir dir="${dist}"/>
<tar basedir="." destfile="${dist}/${project}-${version}.tar.gz" compression="gzip" includes="${project}/**" /> <tar basedir="." destfile="${dist}/${project}-${version}.tar.gz" compression="gzip" includes="${project}/**" />
</target> </target>
<target name="dist-src" depends="clean" description="Creates the source tar file" >
<mkdir dir="dist" />
<tar basedir="." destfile="${dist}/${project}-src-${version}.tar.gz" excludes="dist/**" compression="gzip"/>
</target>
<target name="javadoc" depends="build" description="Generates Javadoc for all source code" > <target name="javadoc" depends="build" description="Generates Javadoc for all source code" >
<delete dir="${javadoc}"/> <delete dir="${javadoc}"/>
<mkdir dir="${javadoc}" /> <mkdir dir="${javadoc}" />

8
docs/CHANGES.txt Normal file
View File

@ -0,0 +1,8 @@
History of changes for @NAME@
0.1.0 to 0.1.1
- Fixed text of README file (NAME and VERSION weren't properly substituted)
- Fixed issue with pressing Enter when entering an Ex command (no more beep or
IDEA error message)
- Fixed issue with pressing Backspace in the Ex command entry window when there
are no characters. The beep is gone and the command entry is properly exited.

7
docs/NOTES.txt Normal file
View File

@ -0,0 +1,7 @@
@NAME@ version @VERSION@ Release Notes
VIM Emulator plugin for IntelliJ IDEA. See the enclosed README file in the
binary distribution for installation instructions. See docs/vim/index.txt for
a complete list of supported VIM commands. This release has been tested with
IDEA 3.0.2 (build #695) and 3.0.3 (build #698) but may work with other 3.0
releases.

View File

@ -12,7 +12,8 @@ UNIX/Linux
Copy @NAME@.jar to $IDEA_HOME/plugins where IDEA_HOME is where IntelliJ IDEA Copy @NAME@.jar to $IDEA_HOME/plugins where IDEA_HOME is where IntelliJ IDEA
has been installed. has been installed.
Copy vim.xml to $HOME/.IntelliJIdea/config/keymaps Copy vim.xml to $HOME/.IntelliJIdea/config/keymaps. You will have to create
the keymaps directory if it doesn't exist.
Windows Windows
@ -20,7 +21,7 @@ Copy @NAME@.jar to %IDEA_HOME%/plugins where IDEA_HOME is where IntelliJ IDEA
has been installed. has been installed.
Copy vim.xml to C:\Documents and Settings\<user>\.IntelliJIdea\config\keymaps Copy vim.xml to C:\Documents and Settings\<user>\.IntelliJIdea\config\keymaps
You will have to create the keymaps directory if it doesn't exist.
Starting Starting

View File

@ -37,7 +37,6 @@ import com.maddyhome.idea.vim.key.CommandNode;
import com.maddyhome.idea.vim.key.KeyParser; import com.maddyhome.idea.vim.key.KeyParser;
import com.maddyhome.idea.vim.key.Node; import com.maddyhome.idea.vim.key.Node;
import com.maddyhome.idea.vim.key.ParentNode; import com.maddyhome.idea.vim.key.ParentNode;
import java.awt.Toolkit;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Stack; import java.util.Stack;
@ -110,7 +109,7 @@ public class KeyHandler
if (count == 0 && currentArg == Argument.NONE && currentCmd.size() == 0 && if (count == 0 && currentArg == Argument.NONE && currentCmd.size() == 0 &&
CommandGroups.getInstance().getRegister().getCurrentRegister() == RegisterGroup.REGISTER_DEFAULT) CommandGroups.getInstance().getRegister().getCurrentRegister() == RegisterGroup.REGISTER_DEFAULT)
{ {
indicateError(); VimPlugin.indicateError();
} }
fullReset(); fullReset();
@ -307,7 +306,7 @@ public class KeyHandler
if (!editor.getDocument().isWritable() && !Command.isReadOnlyType(cmd.getType())) if (!editor.getDocument().isWritable() && !Command.isReadOnlyType(cmd.getType()))
{ {
indicateError(); VimPlugin.indicateError();
} }
else else
{ {
@ -343,7 +342,7 @@ public class KeyHandler
// We had some sort of error so reset the handler and let the user know (beep) // We had some sort of error so reset the handler and let the user know (beep)
else if (mode == STATE_ERROR) else if (mode == STATE_ERROR)
{ {
indicateError(); VimPlugin.indicateError();
fullReset(); fullReset();
} }
} }
@ -385,14 +384,6 @@ public class KeyHandler
action.actionPerformed(new AnActionEvent(null, context, "", action.getTemplatePresentation(), 0)); 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 * 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. * key tree node to the root for the current mode we are in.

View File

@ -42,6 +42,7 @@ import com.maddyhome.idea.vim.group.MotionGroup;
import com.maddyhome.idea.vim.helper.EditorData; import com.maddyhome.idea.vim.helper.EditorData;
import com.maddyhome.idea.vim.key.RegisterActions; import com.maddyhome.idea.vim.key.RegisterActions;
import org.jdom.Element; import org.jdom.Element;
import java.awt.Toolkit;
/** /**
* This plugin attempts to emulate the keybinding and general functionality of Vim and gVim. See the supplied * This plugin attempts to emulate the keybinding and general functionality of Vim and gVim. See the supplied
@ -185,6 +186,14 @@ public class VimPlugin implements ApplicationComponent, JDOMExternalizable
return enabled; return enabled;
} }
/**
* Inidicate to the user that an error has occurred. Just beep.
*/
public static void indicateError()
{
Toolkit.getDefaultToolkit().beep();
}
/** /**
* This class is used to handle the Vim Plugin enabled/disabled toggle. This is most likely used as a menu * 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. * option but could also be used as a toolbar item.

View File

@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.actionSystem.DataContext;
import com.maddyhome.idea.vim.KeyHandler; import com.maddyhome.idea.vim.KeyHandler;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.command.Command; import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.command.CommandState; import com.maddyhome.idea.vim.command.CommandState;
@ -36,7 +37,7 @@ public abstract class AbstractCommandAction extends AnAction
Command cmd = state.getCommand(); Command cmd = state.getCommand();
if (!execute(event.getDataContext(), cmd)) if (!execute(event.getDataContext(), cmd))
{ {
KeyHandler.indicateError(); VimPlugin.indicateError();
} }
} }

View File

@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.Editor;
import com.maddyhome.idea.vim.helper.RunnableHelper; import com.maddyhome.idea.vim.helper.RunnableHelper;
import com.maddyhome.idea.vim.undo.UndoManager; import com.maddyhome.idea.vim.undo.UndoManager;
import com.maddyhome.idea.vim.VimPlugin;
/** /**
* *
@ -85,7 +86,7 @@ public abstract class CommandHandler
if ((getFlags() & WRITABLE) != 0) if ((getFlags() & WRITABLE) != 0)
{ {
RunnableHelper.runCommand(new Runnable() { RunnableHelper.runWriteCommand(new Runnable() {
public void run() public void run()
{ {
boolean res = false; boolean res = false;
@ -97,6 +98,7 @@ public abstract class CommandHandler
catch (ExException e) catch (ExException e)
{ {
// TODO - handle this // TODO - handle this
VimPlugin.indicateError();
} }
finally finally
{ {
@ -114,7 +116,20 @@ public abstract class CommandHandler
} }
else else
{ {
execute(editor, context, cmd); RunnableHelper.runReadCommand(new Runnable() {
public void run()
{
try
{
execute(editor, context, cmd);
}
catch (ExException e)
{
// TODO - handle this
VimPlugin.indicateError();
}
}
});
} }
} }

View File

@ -0,0 +1,46 @@
package com.maddyhome.idea.vim.ex.handler;
/*
* 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.editor.Editor;
import com.intellij.openapi.diagnostic.Logger;
import com.maddyhome.idea.vim.ex.CommandHandler;
import com.maddyhome.idea.vim.ex.ExCommand;
import com.maddyhome.idea.vim.ex.ExException;
/**
*
*/
public class EmptyHandler extends CommandHandler
{
public EmptyHandler()
{
super(null, "", RANGE_OPTIONAL | ARGUMENT_OPTIONAL);
}
public boolean execute(Editor editor, DataContext context, ExCommand cmd) throws ExException
{
logger.info("execute");
return true;
}
private static Logger logger = Logger.getInstance(EmptyHandler.class.getName());
}

View File

@ -0,0 +1,47 @@
package com.maddyhome.idea.vim.ex.handler;
/*
* 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.editor.Editor;
import com.maddyhome.idea.vim.ex.CommandHandler;
import com.maddyhome.idea.vim.ex.ExCommand;
import com.maddyhome.idea.vim.ex.ExException;
/**
*
*/
public class ErrorHandler extends CommandHandler
{
public ErrorHandler(ExException error)
{
super(null, "", RANGE_OPTIONAL | ARGUMENT_OPTIONAL);
this.error = error;
}
public boolean execute(Editor editor, DataContext context, ExCommand cmd) throws ExException
{
// TODO - display error
return true;
}
private ExException error;
}

View File

@ -0,0 +1,53 @@
package com.maddyhome.idea.vim.ex.handler;
/*
* 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.editor.Editor;
import com.maddyhome.idea.vim.ex.CommandHandler;
import com.maddyhome.idea.vim.ex.ExCommand;
import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.group.MotionGroup;
/**
*
*/
public class GotoLineHandler extends CommandHandler
{
public GotoLineHandler()
{
super(null, "", RANGE_REQUIRED | ARGUMENT_OPTIONAL);
}
public boolean execute(Editor editor, DataContext context, ExCommand cmd)
{
int count = cmd.getLine(editor, context);
if (count > 0)
{
MotionGroup.moveCaret(editor, context,
CommandGroups.getInstance().getMotion().moveCaretToLineStartSkipLeading(editor, count - 1));
return true;
}
return false;
}
}

View File

@ -1035,7 +1035,7 @@ public class ChangeGroup extends AbstractActionGroup
//CommandGroups.getInstance().getMark().setMark(editor, context, ']', start + str.length()); //CommandGroups.getInstance().getMark().setMark(editor, context, ']', start + str.length());
//CommandGroups.getInstance().getRegister().storeTextInternal(editor, context, start, start + str.length(), str, MotionGroup.CHARACTERWISE, '.', false, false); //CommandGroups.getInstance().getRegister().storeTextInternal(editor, context, start, start + str.length(), str, MotionGroup.CHARACTERWISE, '.', false, false);
//runCommand(new InsertText(editor, context, start, str)); //runWriteCommand(new InsertText(editor, context, start, str));
} }
/** /**
@ -1067,7 +1067,7 @@ public class ChangeGroup extends AbstractActionGroup
CommandGroups.getInstance().getMark().setMark(editor, context, '.', start); CommandGroups.getInstance().getMark().setMark(editor, context, '.', start);
CommandGroups.getInstance().getMark().setMark(editor, context, '[', start); CommandGroups.getInstance().getMark().setMark(editor, context, '[', start);
CommandGroups.getInstance().getMark().setMark(editor, context, ']', start); CommandGroups.getInstance().getMark().setMark(editor, context, ']', start);
//runCommand(new DeleteText(editor, context, start, end)); //runWriteCommand(new DeleteText(editor, context, start, end));
return true; return true;
} }
@ -1090,11 +1090,11 @@ public class ChangeGroup extends AbstractActionGroup
CommandGroups.getInstance().getMark().setMark(editor, context, '[', start); CommandGroups.getInstance().getMark().setMark(editor, context, '[', start);
CommandGroups.getInstance().getMark().setMark(editor, context, ']', start + str.length()); CommandGroups.getInstance().getMark().setMark(editor, context, ']', start + str.length());
CommandGroups.getInstance().getMark().setMark(editor, context, '.', start + str.length()); CommandGroups.getInstance().getMark().setMark(editor, context, '.', start + str.length());
//runCommand(new ReplaceText(editor, context, start, end, str)); //runWriteCommand(new ReplaceText(editor, context, start, end, str));
} }
/* /*
public static void runCommand(Runnable cmd) public static void runWriteCommand(Runnable cmd)
{ {
CommandProcessor.getInstance().executeCommand(new WriteAction(cmd), "Foo", "Bar"); CommandProcessor.getInstance().executeCommand(new WriteAction(cmd), "Foo", "Bar");
} }
@ -1203,11 +1203,6 @@ public class ChangeGroup extends AbstractActionGroup
// NOTE - is there a way to get the DataContext at this point? // NOTE - is there a way to get the DataContext at this point?
CommandGroups.getInstance().getChange().processEscape(EditorHelper.getEditor(event.getManager(), event.getOldFile()), null); CommandGroups.getInstance().getChange().processEscape(EditorHelper.getEditor(event.getManager(), event.getOldFile()), null);
} }
if (CommandEntryPanel.getInstance().isActive())
{
CommandEntryPanel.getInstance().deactivate();
}
} }
} }

View File

@ -23,6 +23,7 @@ import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.editor.Editor; import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.actionSystem.EditorActionHandler; import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
import com.maddyhome.idea.vim.KeyHandler; import com.maddyhome.idea.vim.KeyHandler;
import com.maddyhome.idea.vim.VimPlugin;
import com.maddyhome.idea.vim.command.Command; import com.maddyhome.idea.vim.command.Command;
import com.maddyhome.idea.vim.command.CommandState; import com.maddyhome.idea.vim.command.CommandState;
@ -36,7 +37,7 @@ public abstract class AbstractEditorActionHandler extends EditorActionHandler
Command cmd = state.getCommand(); Command cmd = state.getCommand();
if (!execute(editor, context, cmd)) if (!execute(editor, context, cmd))
{ {
KeyHandler.indicateError(); VimPlugin.indicateError();
} }
} }

View File

@ -29,8 +29,10 @@ import com.maddyhome.idea.vim.ex.CommandParser;
import com.maddyhome.idea.vim.ex.ExException; import com.maddyhome.idea.vim.ex.ExException;
import com.maddyhome.idea.vim.group.CommandGroups; import com.maddyhome.idea.vim.group.CommandGroups;
import com.maddyhome.idea.vim.ui.CommandEntryPanel; import com.maddyhome.idea.vim.ui.CommandEntryPanel;
import com.maddyhome.idea.vim.VimPlugin;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import javax.swing.SwingUtilities;
/** /**
* *
@ -39,7 +41,6 @@ public class ExEntryHandler extends AbstractEditorActionHandler
{ {
protected boolean execute(Editor editor, DataContext context, Command cmd) protected boolean execute(Editor editor, DataContext context, Command cmd)
{ {
// TODO - deal with any preceeding count or if currently in visual mode
CommandEntryPanel panel = CommandEntryPanel.getInstance(); CommandEntryPanel panel = CommandEntryPanel.getInstance();
String initText = ""; String initText = "";
@ -68,28 +69,38 @@ public class ExEntryHandler extends AbstractEditorActionHandler
static class ExEntryListener implements ActionListener static class ExEntryListener implements ActionListener
{ {
public void actionPerformed(ActionEvent e) public void actionPerformed(final ActionEvent e)
{ {
try SwingUtilities.invokeLater(new Runnable()
{ {
logger.debug("processing command"); public void run()
CommandEntryPanel.getInstance().deactivate();
CommandParser.getInstance().processCommand(editor, context, e.getActionCommand());
if (CommandState.getInstance().getMode() == CommandState.MODE_VISUAL)
{ {
CommandGroups.getInstance().getMotion().resetVisual(editor); try
{
logger.debug("processing command");
CommandEntryPanel.getInstance().deactivate(true);
CommandParser.getInstance().processCommand(editor, context, e.getActionCommand());
if (CommandState.getInstance().getMode() == CommandState.MODE_VISUAL)
{
CommandGroups.getInstance().getMotion().resetVisual(editor);
}
}
catch (ExException ex)
{
// TODO - display error
logger.info(ex.getMessage());
VimPlugin.indicateError();
}
catch (Exception bad)
{
logger.error(bad);
VimPlugin.indicateError();
}
finally
{
}
} }
} });
catch (ExException ex)
{
// TODO - display error
logger.info(ex.getMessage());
}
catch (Exception bad)
{
logger.error(bad);
}
//CommandGroups.getInstance().getEx().processExCommand(editor, context, e.getActionCommand());
} }
public void setState(Editor editor, DataContext context) public void setState(Editor editor, DataContext context)

View File

@ -27,11 +27,31 @@ import com.intellij.openapi.command.CommandProcessor;
*/ */
public class RunnableHelper public class RunnableHelper
{ {
public static void runCommand(Runnable cmd) public static void runReadCommand(Runnable cmd)
{
CommandProcessor.getInstance().executeCommand(new ReadAction(cmd), "Foo", "Bar");
}
public static void runWriteCommand(Runnable cmd)
{ {
CommandProcessor.getInstance().executeCommand(new WriteAction(cmd), "Foo", "Bar"); CommandProcessor.getInstance().executeCommand(new WriteAction(cmd), "Foo", "Bar");
} }
static class ReadAction implements Runnable
{
ReadAction(Runnable cmd)
{
this.cmd = cmd;
}
public void run()
{
ApplicationManager.getApplication().runReadAction(cmd);
}
Runnable cmd;
}
static class WriteAction implements Runnable static class WriteAction implements Runnable
{ {
WriteAction(Runnable cmd) WriteAction(Runnable cmd)

View File

@ -28,7 +28,6 @@ import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.Point; import java.awt.Point;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter; import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent; import java.awt.event.ComponentEvent;
@ -95,19 +94,13 @@ public class CommandEntryPanel extends JPanel
{ {
if (isActive()) if (isActive())
{ {
deactivate(); deactivate(false);
} }
} }
}); });
addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
//deactivate();
}
});
// TODO - move these keys to the ExEditorKit // TODO - move these keys to the ExEditorKit
/*
entry.addKeyListener(new KeyAdapter() { entry.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) public void keyPressed(KeyEvent e)
{ {
@ -120,15 +113,9 @@ public class CommandEntryPanel extends JPanel
entry.postActionEvent(); entry.postActionEvent();
} }
} }
/*
else if (e.getKeyCode() == KeyEvent.VK_ENTER)
{
e.consume();
entry.postActionEvent();
}
*/
} }
}); });
*/
} }
public void activate(JComponent comp, String label, String initText) public void activate(JComponent comp, String label, String initText)
@ -163,13 +150,17 @@ public class CommandEntryPanel extends JPanel
repaint(); repaint();
} }
public void deactivate() public void deactivate(boolean changeFocus)
{ {
logger.info("deactivate"); logger.info("deactivate");
if (!active) return;
active = false; active = false;
newGlass.setVisible(false); newGlass.setVisible(false);
root.setGlassPane(oldGlass); root.setGlassPane(oldGlass);
parent.requestFocus(); if (changeFocus)
{
parent.requestFocus();
}
parent = null; parent = null;
} }

View File

@ -66,7 +66,7 @@ public class ExEditorKit extends DefaultEditorKit
*/ */
public Action[] getActions() public Action[] getActions()
{ {
return TextAction.augmentList(super.getActions(), this.defaultActions); return TextAction.augmentList(super.getActions(), this.exActions);
} }
/** /**
@ -82,6 +82,7 @@ public class ExEditorKit extends DefaultEditorKit
public static final String CompleteEdit = "complete-edit"; public static final String CompleteEdit = "complete-edit";
public static final String AbortEdit = "abort-edit"; public static final String AbortEdit = "abort-edit";
public static final String DeletePreviousChar = "delete-prev-char";
public static final String DeletePreviousWord = "delete-prev-word"; public static final String DeletePreviousWord = "delete-prev-word";
public static final String DeleteToCursor = "delete-to-cursor"; public static final String DeleteToCursor = "delete-to-cursor";
public static final String ToggleInsertReplace = "toggle-insert"; public static final String ToggleInsertReplace = "toggle-insert";
@ -94,9 +95,10 @@ public class ExEditorKit extends DefaultEditorKit
public static final String HistoryOldFilter = "history-old-filter"; public static final String HistoryOldFilter = "history-old-filter";
//TODO - add rest of actions //TODO - add rest of actions
protected Action[] defaultActions = new Action[] { protected Action[] exActions = new Action[] {
new CompleteEditAction(), new CompleteEditAction(),
new AbortEditAction(), new AbortEditAction(),
new DeletePreviousCharAction(),
new DeletePreviousWordAction(), new DeletePreviousWordAction(),
new DeleteToCursorAction(), new DeleteToCursorAction(),
new ToggleInsertReplaceAction() new ToggleInsertReplaceAction()
@ -160,6 +162,65 @@ public class ExEditorKit extends DefaultEditorKit
} }
public static class DeletePreviousCharAction extends TextAction
{
public DeletePreviousCharAction()
{
super(DeletePreviousChar);
}
/**
* Invoked when an action occurs.
*/
public void actionPerformed(ActionEvent e)
{
JTextField target = (JTextField)getTextComponent(e);
if ((target != null) && (target.isEditable()))
{
try
{
Document doc = target.getDocument();
Caret caret = target.getCaret();
int dot = caret.getDot();
int mark = caret.getMark();
if (dot != mark)
{
doc.remove(Math.min(dot, mark), Math.abs(dot - mark));
}
else if (dot > 0)
{
int delChars = 1;
if (dot > 1)
{
String dotChars = doc.getText(dot - 2, 2);
char c0 = dotChars.charAt(0);
char c1 = dotChars.charAt(1);
if (c0 >= '\uD800' && c0 <= '\uDBFF' &&
c1 >= '\uDC00' && c1 <= '\uDFFF')
{
delChars = 2;
}
}
doc.remove(dot - delChars, delChars);
}
else
{
if (doc.getLength() == 0)
{
target.postActionEvent();
}
}
}
catch (BadLocationException bl)
{
}
}
}
}
public static class DeletePreviousWordAction extends TextAction public static class DeletePreviousWordAction extends TextAction
{ {
public DeletePreviousWordAction() public DeletePreviousWordAction()

View File

@ -21,6 +21,7 @@ package com.maddyhome.idea.vim.ui;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import javax.swing.JTextField;
import javax.swing.text.JTextComponent.KeyBinding; import javax.swing.text.JTextComponent.KeyBinding;
/** /**
@ -43,8 +44,7 @@ public class ExKeyBindings
// Ctrl-U - remove all chars to cursor // Ctrl-U - remove all chars to cursor
// Ctrl-\ Ctrl-N - abort // Ctrl-\ Ctrl-N - abort
static final KeyBinding[] bindings = new KeyBinding[] { static final KeyBinding[] bindings = new KeyBinding[] {
//new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), JTextField.notifyAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), ExEditorKit.CompleteEdit),
//new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), ExEditorKit.CompleteEdit),
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.CTRL_MASK), ExEditorKit.CompleteEdit), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_J, KeyEvent.CTRL_MASK), ExEditorKit.CompleteEdit),
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK), ExEditorKit.CompleteEdit), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK), ExEditorKit.CompleteEdit),
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), ExEditorKit.AbortEdit), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), ExEditorKit.AbortEdit),
@ -62,7 +62,7 @@ public class ExKeyBindings
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK), ExEditorKit.nextWordAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK), ExEditorKit.nextWordAction),
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.CTRL_MASK), ExEditorKit.nextWordAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.CTRL_MASK), ExEditorKit.nextWordAction),
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), ExEditorKit.deleteNextCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), ExEditorKit.deleteNextCharAction),
// new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), ExEditorKit.deletePrevCharAction), new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0), ExEditorKit.DeletePreviousChar),
new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK), ExEditorKit.deletePrevCharAction) new KeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK), ExEditorKit.DeletePreviousChar)
}; };
} }

View File

@ -23,6 +23,7 @@ import com.intellij.openapi.diagnostic.Logger;
import java.awt.Font; import java.awt.Font;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JTextField; import javax.swing.JTextField;
import javax.swing.InputMap;
import javax.swing.text.Document; import javax.swing.text.Document;
import javax.swing.text.Keymap; import javax.swing.text.Keymap;
import javax.swing.text.TextAction; import javax.swing.text.TextAction;
@ -39,8 +40,11 @@ public class ExTextField extends JTextField
Font font = new Font("Monospaced", Font.PLAIN, 12); Font font = new Font("Monospaced", Font.PLAIN, 12);
setFont(font); setFont(font);
Keymap map = addKeymap("ex", getKeymap()); setInputMap(WHEN_FOCUSED, new InputMap());
Keymap map = addKeymap("ex", null);
loadKeymap(map, ExKeyBindings.getBindings(), getActions()); loadKeymap(map, ExKeyBindings.getBindings(), getActions());
map.setDefaultAction(new ExEditorKit.DefaultKeyTypedAction());
setKeymap(map);
} }
public Action[] getActions() public Action[] getActions()

View File

@ -9,25 +9,30 @@
<h3>Introduction</h3> <h3>Introduction</h3>
<p>
<a href="http://www.intellij.com">IntelliJ IDEA</a> is an outstanding IDE for editing Java source code and other <a href="http://www.intellij.com">IntelliJ IDEA</a> is an outstanding IDE for editing Java source code and other
related files. However, it lacks one related files. However, it lacks one
important feature - <code>vi</code> style commands for editing. I've been using <code>vi</code> and important feature - <code>vi</code> style commands for editing. I've been using <code>vi</code> and
<a href="http://www.vim.org">VIM</a> <a href="http://www.vim.org">VIM</a>
for about 20 years. I'm used to it. I know the command keyboard shortcuts are cryptic and stange but I've been using for about 20 years. I'm used to it. I know the command keyboard shortcuts are cryptic and stange but I've been using
it so long I just know how to use them and I find I am very efficient with them. it so long I just know how to use them and I find I am very efficient with them.
</p>
<p> <p>
IDEA makes my Java editing even more efficient. Now, if I could only combine the features of IDEA with the quick and IDEA makes my Java editing even more efficient. Now, if I could only combine the features of IDEA with the quick and
easy editing of VIM, life would be grand. A quick search revealed that there wasn't a feature filled VIM plugin so I easy editing of VIM, life would be grand. A quick search revealed that there wasn't a feature filled VIM plugin so I
took it upon myself to write one. This project is the result of my desire to keep using my old keyboard habits. took it upon myself to write one. This project is the result of my desire to keep using my old keyboard habits.
</p>
<p> <p>
The goal of this plugin is to support as much VIM functionality as makes sense within the scope of IDEA. The plugin The goal of this plugin is to support as much VIM functionality as makes sense within the scope of IDEA. The plugin
was actually written in IDEA using the VIM plugin once there was enough basic editing support. For the curious, the was actually written in IDEA using the VIM plugin once there was enough basic editing support. For the curious, the
plugin is being written without any reference to the VIM source code. I'm basically using the excellent VIM plugin is being written without any reference to the VIM source code. I'm basically using the excellent VIM
documentation and VIM itself as a reference to verify correct behavior. documentation and VIM itself as a reference to verify correct behavior.
</p>
<p> <p>
This plugin is meant for developers that already know, and probably love, vi/VIM. I make no attempt to teach users This plugin is meant for developers that already know, and probably love, vi/VIM. I make no attempt to teach users
how to use the VIM commands and you will not find any sort of help from within IDEA on what the key mappings are. how to use the VIM commands and you will not find any sort of help from within IDEA on what the key mappings are.
Within the pages of this website however, you will find a reference of all working commands. Within the pages of this website however, you will find a reference of all working commands.
</p>
<h3>Installation</h3> <h3>Installation</h3>
@ -38,7 +43,8 @@ using IDEA in VIM Emulation mode:
<li>Copy <code>IdeaVIM.jar</code> to the plugins directory. This is at <code>&lt;IDEA_HOME&gt;/plugins</code> where <li>Copy <code>IdeaVIM.jar</code> to the plugins directory. This is at <code>&lt;IDEA_HOME&gt;/plugins</code> where
<code>IDEA_HOME</code> is IDEA installation directory.</li> <code>IDEA_HOME</code> is IDEA installation directory.</li>
<li>Copy <code>vim.xml</code> to <code>&lt;HOME&gt;/.IntelliJIdea/config/keymaps</code> where <code>HOME</code> <li>Copy <code>vim.xml</code> to <code>&lt;HOME&gt;/.IntelliJIdea/config/keymaps</code> where <code>HOME</code>
if your home directory on Unix or <code>C:\Documents&nbsp;and&nbsp;Settings\&lt;user&gt;</code> on Windows.</li> if your home directory on Unix or <code>C:\Documents&nbsp;and&nbsp;Settings\&lt;user&gt;</code> on Windows.
Create the <code>keymaps</code> directory if it does not exist.</li>
<li>Restart IDEA and then select the <code>Options|Keymaps</code> menu. Select the <code>vim</code> keymap and make <li>Restart IDEA and then select the <code>Options|Keymaps</code> menu. Select the <code>vim</code> keymap and make
it the active keymap by pressing the <code>Set Active</code> button.</li> it the active keymap by pressing the <code>Set Active</code> button.</li>
</ol> </ol>
@ -55,8 +61,8 @@ You may obtain the plugin by visiting the files page on
<h3>Versions</h3> <h3>Versions</h3>
The VIM plugin has been developed and tested with IntelliJ IDEA 3.0.2 (#695). It is not known at this time if older The VIM plugin has been developed and tested with IntelliJ IDEA 3.0.2 (#695) and 3.0.3 (#698).
or newer versions will work correctly. It is not known at this time if older or newer versions will work correctly.
<hr> <hr>

View File

@ -1,4 +1,4 @@
*index.txt* For IdeaVIM version 0.1.0. Last change: 2003 Apr 17 *index.txt* For IdeaVIM version 0.1.1. Last change: 2003 Apr 17
IdeaVIM REFERENCE MANUAL by Rick Maddy IdeaVIM REFERENCE MANUAL by Rick Maddy