mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-05-03 22:34:03 +02:00
Annotate commands
This commit is contained in:
parent
0f0bafb66a
commit
dee84bcc63
annotation-processors/src/main/kotlin/com/intellij/vim/annotations
src/main/java/com/maddyhome/idea/vim/action
vim-engine/src/main/kotlin/com/maddyhome/idea/vim/action
ResetModeAction.kt
change
RedoAction.ktUndoAction.kt
change
AutoIndentLinesVisualAction.ktChangeCaseLowerMotionAction.ktChangeCaseLowerVisualAction.ktChangeCaseToggleCharacterAction.ktChangeCaseToggleMotionAction.ktChangeCaseToggleVisualAction.ktChangeCaseUpperMotionAction.ktChangeCaseUpperVisualAction.ktChangeCharacterAction.ktChangeCharactersAction.ktChangeEndOfLineAction.ktChangeLastGlobalSearchReplaceAction.ktChangeLastSearchReplaceAction.ktChangeLineAction.ktChangeMotionAction.ktChangeReplaceAction.ktChangeVisualAction.ktChangeVisualCharacterAction.ktChangeVisualLinesAction.ktChangeVisualLinesEndAction.ktFilterMotionAction.ktFilterVisualLinesAction.ktReformatCodeMotionAction.ktReformatCodeVisualAction.kt
number
delete
DeleteCharacterAction.ktDeleteEndOfLineAction.ktDeleteMotionAction.ktDeleteVisualAction.ktDeleteVisualLinesAction.ktDeleteVisualLinesEndAction.kt
insert
InsertAfterCursorAction.ktInsertAfterLineEndAction.ktInsertAtPreviousInsertAction.ktInsertBeforeCursorAction.ktInsertBeforeFirstNonBlankAction.ktInsertCharacterAroundCursorAction.ktInsertCompletedDigraphAction.ktInsertCompletedLiteralAction.ktInsertDeleteInsertedTextAction.ktInsertDeletePreviousWordAction.ktInsertEnterAction.ktInsertExitModeAction.ktInsertInsertAction.ktInsertLineStartAction.ktInsertNewLineBelowAction.ktInsertPreviousInsertAction.ktInsertRegisterAction.ktInsertSingleCommandAction.ktVisualBlockAppendAction.ktVisualBlockInsertAction.kt
shift
copy
PutTextAction.ktPutVisualTextAction.ktYankLineAction.ktYankMotionAction.ktYankVisualAction.ktYankVisualLinesAction.kt
file
FileGetAsciiAction.ktFileGetFileInfoAction.ktFileGetHexAction.ktFileGetLocationInfoAction.ktFilePreviousAction.ktFileSaveCloseAction.kt
fold
macro
motion
gn
leftright
MotionArrowLeftAction.ktMotionArrowRightAction.ktMotionBackspaceAction.ktMotionColumnAction.ktMotionEndAction.ktMotionFirstColumnAction.ktMotionFirstNonSpaceAction.ktMotionFirstScreenColumnAction.ktMotionFirstScreenNonSpaceAction.ktMotionHomeAction.ktMotionLastColumnAction.ktMotionLastMatchCharAction.ktMotionLastNonSpaceAction.ktMotionLastScreenColumnAction.kt
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2003-2023 The IdeaVim authors
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE.txt file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
*/
|
||||
|
||||
package com.intellij.vim.annotations
|
||||
|
||||
// TODO support numpad keys parsing, see :keycodes
|
||||
/**
|
||||
* It's not necessary a Vim command
|
||||
* This annotation may be used for:
|
||||
* - commands
|
||||
* - motions
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class CommandOrMotion(val keys: Array<String>, vararg val modes: Mode)
|
||||
|
||||
annotation class TextObject(val keys: String)
|
||||
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*
|
||||
* COMPATIBILITY-LAYER: Do not move this class to a different package
|
||||
*/
|
||||
enum class Mode {
|
||||
/**
|
||||
* Indicates this key mapping applies to Normal mode
|
||||
*/
|
||||
NORMAL,
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Visual mode
|
||||
*/
|
||||
VISUAL,
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Select mode
|
||||
*/
|
||||
SELECT,
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Operator Pending mode
|
||||
*/
|
||||
OP_PENDING,
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Insert mode
|
||||
*/
|
||||
INSERT,
|
||||
|
||||
/**
|
||||
* Indicates this key mapping applies to Command Line mode
|
||||
*/
|
||||
CMD_LINE,
|
||||
}
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = [":"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
internal class ExEntryAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@ -47,6 +49,7 @@ private fun doOperatorAction(editor: VimEditor, context: ExecutionContext, textR
|
||||
return result
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["g@"], modes = [Mode.NORMAL])
|
||||
internal class OperatorAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
@ -97,6 +100,7 @@ internal class OperatorAction : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["g@"], modes = [Mode.VISUAL])
|
||||
internal class VisualOperatorAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.intellij.openapi.command.CommandProcessor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
import com.maddyhome.idea.vim.newapi.ij
|
||||
|
||||
@CommandOrMotion(keys = ["."], modes = [Mode.NORMAL])
|
||||
internal class RepeatChangeAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_WRITABLE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.newapi.ijOptions
|
||||
|
||||
@CommandOrMotion(keys = ["gJ"], modes = [Mode.NORMAL])
|
||||
public class DeleteJoinLinesAction : ChangeEditorActionHandler.ConditionalSingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
override fun runAsMulticaret(
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -16,6 +18,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.newapi.ijOptions
|
||||
|
||||
@CommandOrMotion(keys = ["J"], modes = [Mode.NORMAL])
|
||||
public class DeleteJoinLinesSpacesAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["gJ"], modes = [Mode.VISUAL])
|
||||
public class DeleteJoinVisualLinesAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["J"], modes = [Mode.VISUAL])
|
||||
public class DeleteJoinVisualLinesSpacesAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.editor
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@ -23,6 +25,7 @@ import java.awt.event.KeyEvent
|
||||
import java.util.*
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<C-H>", "<BS>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorBackSpace : IdeActionHandler(IdeActions.ACTION_EDITOR_BACKSPACE), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_DOWN_MASK)),
|
||||
@ -31,6 +34,7 @@ internal class VimEditorBackSpace : IdeActionHandler(IdeActions.ACTION_EDITOR_BA
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<Del>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorDelete : IdeActionHandler(IdeActions.ACTION_EDITOR_DELETE), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)),
|
||||
@ -39,6 +43,7 @@ internal class VimEditorDelete : IdeActionHandler(IdeActions.ACTION_EDITOR_DELET
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<Down>", "<kDown>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorDown : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)),
|
||||
@ -48,6 +53,7 @@ internal class VimEditorDown : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CA
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES)
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<Tab>", "<C-I>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorTab : IdeActionHandler(IdeActions.ACTION_EDITOR_TAB), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_DOWN_MASK)),
|
||||
@ -57,6 +63,7 @@ internal class VimEditorTab : IdeActionHandler(IdeActions.ACTION_EDITOR_TAB), Co
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<Up>", "<kUp>"], modes = [Mode.INSERT])
|
||||
internal class VimEditorUp : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARET_UP), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)),
|
||||
@ -66,6 +73,7 @@ internal class VimEditorUp : IdeActionHandler(IdeActions.ACTION_EDITOR_MOVE_CARE
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_CLEAR_STROKES)
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["K"], modes = [Mode.NORMAL])
|
||||
internal class VimQuickJavaDoc : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.ex
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
@ -23,6 +25,7 @@ import javax.swing.KeyStroke
|
||||
*
|
||||
* The mapping for this action means that the ex command is executed as a write action
|
||||
*/
|
||||
@CommandOrMotion(keys = ["<CR>", "<C-M>", "<C-J>"], modes = [Mode.CMD_LINE])
|
||||
public class ProcessExEntryAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> =
|
||||
parseKeysSet("<CR>", "<C-M>", 0x0a.toChar().toString(), 0x0d.toChar().toString())
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
@ -14,13 +16,13 @@ import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.api.moveToMotion
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.state.mode.Mode
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.state.mode.mode
|
||||
|
||||
@CommandOrMotion(keys = ["<C-\\><C-N>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.SELECT, Mode.OP_PENDING, Mode.INSERT, Mode.CMD_LINE])
|
||||
public class ResetModeAction : VimActionHandler.ConditionalMulticaret() {
|
||||
private lateinit var modeBeforeReset: Mode
|
||||
private lateinit var modeBeforeReset: com.maddyhome.idea.vim.state.mode.Mode
|
||||
override val type: Command.Type = Command.Type.OTHER_WRITABLE
|
||||
override fun runAsMulticaret(
|
||||
editor: VimEditor,
|
||||
@ -40,7 +42,7 @@ public class ResetModeAction : VimActionHandler.ConditionalMulticaret() {
|
||||
cmd: Command,
|
||||
operatorArguments: OperatorArguments,
|
||||
): Boolean {
|
||||
if (modeBeforeReset == Mode.INSERT) {
|
||||
if (modeBeforeReset == com.maddyhome.idea.vim.state.mode.Mode.INSERT) {
|
||||
val position = injector.motion.getHorizontalMotion(editor, caret, -1, false)
|
||||
caret.moveToMotion(position)
|
||||
}
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["<C-R>"], modes = [Mode.NORMAL])
|
||||
public class RedoAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["u"], modes = [Mode.NORMAL])
|
||||
public class UndoAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
injector.parser.parseKeys("u"),
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["="], modes = [Mode.VISUAL])
|
||||
public class AutoIndentLinesVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
|
||||
@CommandOrMotion(keys = ["gu"], modes = [Mode.NORMAL])
|
||||
public class ChangeCaseLowerMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["u"], modes = [Mode.VISUAL])
|
||||
public class ChangeCaseLowerVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -16,6 +18,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["~"], modes = [Mode.NORMAL])
|
||||
public class ChangeCaseToggleCharacterAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
|
||||
@CommandOrMotion(keys = ["g~"], modes = [Mode.NORMAL])
|
||||
public class ChangeCaseToggleMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["~"], modes = [Mode.VISUAL])
|
||||
public class ChangeCaseToggleVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
|
||||
@CommandOrMotion(keys = ["gU"], modes = [Mode.NORMAL])
|
||||
public class ChangeCaseUpperMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["U"], modes = [Mode.VISUAL])
|
||||
public class ChangeCaseUpperVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["r"], modes = [Mode.NORMAL])
|
||||
public class ChangeCharacterAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -21,6 +23,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["s"], modes = [Mode.NORMAL])
|
||||
public class ChangeCharactersAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -21,6 +23,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["C"], modes = [Mode.NORMAL])
|
||||
public class ChangeEndOfLineAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.ex.ranges.LineRange
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.vimscript.model.Script
|
||||
|
||||
@CommandOrMotion(keys = ["g&"], modes = [Mode.NORMAL])
|
||||
public class ChangeLastGlobalSearchReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.ex.ranges.LineRange
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.vimscript.model.Script
|
||||
|
||||
@CommandOrMotion(keys = ["&"], modes = [Mode.NORMAL])
|
||||
public class ChangeLastSearchReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
@ -22,6 +24,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["S"], modes = [Mode.NORMAL])
|
||||
public class ChangeLineAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["c"], modes = [Mode.NORMAL])
|
||||
public class ChangeMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,18 +7,20 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.state.mode.Mode
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["R"], modes = [Mode.NORMAL])
|
||||
public class ChangeReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
@ -41,5 +43,5 @@ public class ChangeReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
* @param context The data context
|
||||
*/
|
||||
private fun changeReplace(editor: VimEditor, context: ExecutionContext) {
|
||||
injector.changeGroup.initInsert(editor, context, Mode.REPLACE)
|
||||
injector.changeGroup.initInsert(editor, context, com.maddyhome.idea.vim.state.mode.Mode.REPLACE)
|
||||
}
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["c", "s"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -26,6 +28,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["r"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualCharacterAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -29,6 +31,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["R", "S"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualLinesAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -29,6 +31,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["C"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualLinesEndAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.endOffsetInclusive
|
||||
|
||||
@CommandOrMotion(keys = ["!"], modes = [Mode.NORMAL])
|
||||
public class FilterMotionAction : VimActionHandler.SingleExecution(), DuplicableOperatorAction {
|
||||
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -21,6 +23,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["!"], modes = [Mode.VISUAL])
|
||||
public class FilterVisualLinesAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["gq"], modes = [Mode.NORMAL])
|
||||
public class ReformatCodeMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["gq"], modes = [Mode.VISUAL])
|
||||
public class ReformatCodeVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change.number
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -30,5 +32,8 @@ public sealed class IncAction(public val inc: Int) : ChangeEditorActionHandler.F
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<C-A>"], modes = [Mode.NORMAL])
|
||||
public class ChangeNumberIncAction : IncAction(1)
|
||||
|
||||
@CommandOrMotion(keys = ["<C-X>"], modes = [Mode.NORMAL])
|
||||
public class ChangeNumberDecAction : IncAction(-1)
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change.number
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -35,7 +37,14 @@ public sealed class IncNumber(public val inc: Int, private val avalanche: Boolea
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<C-A>"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualNumberIncAction : IncNumber(1, false)
|
||||
|
||||
@CommandOrMotion(keys = ["<C-X>"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualNumberDecAction : IncNumber(-1, false)
|
||||
|
||||
@CommandOrMotion(keys = ["g<C-A>"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualNumberAvalancheIncAction : IncNumber(1, true)
|
||||
|
||||
@CommandOrMotion(keys = ["g<C-X>"], modes = [Mode.VISUAL])
|
||||
public class ChangeVisualNumberAvalancheDecAction : IncNumber(-1, true)
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -16,8 +18,13 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["<Del>"], modes = [Mode.NORMAL])
|
||||
public class DeleteCharacterAction : DeleteCharacter({ 1 })
|
||||
|
||||
@CommandOrMotion(keys = ["X"], modes = [Mode.NORMAL])
|
||||
public class DeleteCharacterLeftAction : DeleteCharacter({ -it })
|
||||
|
||||
@CommandOrMotion(keys = ["x"], modes = [Mode.NORMAL])
|
||||
public class DeleteCharacterRightAction : DeleteCharacter({ it })
|
||||
|
||||
public abstract class DeleteCharacter(private val countModifier: (Int) -> Int) : ChangeEditorActionHandler.ForEachCaret() {
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -16,6 +18,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["D"], modes = [Mode.NORMAL])
|
||||
public class DeleteEndOfLineAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["d"], modes = [Mode.NORMAL])
|
||||
public class DeleteMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["d", "x", "<Del>"], modes = [Mode.VISUAL])
|
||||
public class DeleteVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -26,6 +28,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["X"], modes = [Mode.VISUAL])
|
||||
public class DeleteVisualLinesAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.delete
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -26,6 +28,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["D"], modes = [Mode.VISUAL])
|
||||
public class DeleteVisualLinesEndAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.DELETE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["a"], modes = [Mode.NORMAL])
|
||||
public class InsertAfterCursorAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["A"], modes = [Mode.NORMAL])
|
||||
public class InsertAfterLineEndAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.VimMarkService
|
||||
@ -20,6 +22,7 @@ import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["gi"], modes = [Mode.NORMAL])
|
||||
public class InsertAtPreviousInsertAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -19,6 +21,7 @@ import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import org.jetbrains.annotations.Contract
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["i", "<Insert>"], modes = [Mode.NORMAL])
|
||||
public class InsertBeforeCursorAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
@get:Contract(pure = true)
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["I"], modes = [Mode.NORMAL])
|
||||
public class InsertBeforeFirstNonBlankAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.MutableVimEditor
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
@ -21,6 +23,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["<C-Y>"], modes = [Mode.INSERT])
|
||||
public class InsertCharacterAboveCursorAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
@ -39,6 +42,7 @@ public class InsertCharacterAboveCursorAction : ChangeEditorActionHandler.ForEac
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<C-E>"], modes = [Mode.INSERT])
|
||||
public class InsertCharacterBelowCursorAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<C-K>"], modes = [Mode.INSERT, Mode.CMD_LINE])
|
||||
public class InsertCompletedDigraphAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<C-V>", "<C-Q>"], modes = [Mode.INSERT, Mode.CMD_LINE])
|
||||
public class InsertCompletedLiteralAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<C-U>"], modes = [Mode.INSERT])
|
||||
public class InsertDeleteInsertedTextAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import com.maddyhome.idea.vim.handler.Motion.AbsoluteOffset
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<C-W>"], modes = [Mode.INSERT])
|
||||
public class InsertDeletePreviousWordAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<C-M>", "<CR>"], modes = [Mode.INSERT])
|
||||
public class InsertEnterAction : VimActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,12 +7,15 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["<C-[>", "<C-C>", "<Esc>"], modes = [Mode.INSERT])
|
||||
public class InsertExitModeAction : VimActionHandler.SingleExecution() {
|
||||
// Note that hitting Escape can insert text when exiting insert mode after visual block mode.
|
||||
// If the editor is read-only, we'll get a "This view is read-only" tooltip. However, we should only enter insert
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<Insert>"], modes = [Mode.INSERT])
|
||||
public class InsertInsertAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["gI"], modes = [Mode.NORMAL])
|
||||
public class InsertLineStartAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -21,6 +22,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["o"], modes = [com.intellij.vim.annotations.Mode.NORMAL])
|
||||
public class InsertNewLineBelowAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
@ -38,6 +40,7 @@ public class InsertNewLineBelowAction : ChangeEditorActionHandler.SingleExecutio
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["O"], modes = [com.intellij.vim.annotations.Mode.NORMAL])
|
||||
public class InsertNewLineAboveAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<C-A>"], modes = [Mode.INSERT])
|
||||
public class InsertPreviousInsertAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
@ -32,6 +35,8 @@ public class InsertPreviousInsertAction : ChangeEditorActionHandler.SingleExecut
|
||||
}
|
||||
}
|
||||
|
||||
// TODO is C-S-2 needed?
|
||||
@CommandOrMotion(keys = ["C-@", "<C-S-2>"], modes = [Mode.INSERT])
|
||||
public class InsertPreviousInsertExitAction : ChangeEditorActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_DOWN_MASK or KeyEvent.SHIFT_DOWN_MASK)),
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -21,6 +23,7 @@ import com.maddyhome.idea.vim.put.PutData
|
||||
import com.maddyhome.idea.vim.register.Register
|
||||
import com.maddyhome.idea.vim.vimscript.model.Script
|
||||
|
||||
@CommandOrMotion(keys = ["<C-R>"], modes = [Mode.INSERT])
|
||||
public class InsertRegisterAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<C-O>"], modes = [Mode.INSERT])
|
||||
public class InsertSingleCommandAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["A"], modes = [Mode.VISUAL])
|
||||
public class VisualBlockAppendAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.insert
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["I"], modes = [Mode.VISUAL])
|
||||
public class VisualBlockInsertAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.shift
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -20,6 +22,7 @@ import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
/**
|
||||
* @author Aleksey Lagoshin
|
||||
*/
|
||||
@CommandOrMotion(keys = ["="], modes = [Mode.NORMAL])
|
||||
public class AutoIndentMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.shift
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<C-D>"], modes = [Mode.INSERT])
|
||||
public class ShiftLeftLinesAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
@ -42,6 +45,7 @@ public class ShiftLeftLinesAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<"], modes = [Mode.NORMAL])
|
||||
public class ShiftLeftMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
@ -63,6 +67,7 @@ public class ShiftLeftMotionAction : ChangeEditorActionHandler.ForEachCaret(), D
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<"], modes = [Mode.VISUAL])
|
||||
public class ShiftLeftVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.shift
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<C-T>"], modes = [Mode.INSERT])
|
||||
public class ShiftRightLinesAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
@ -42,6 +45,7 @@ public class ShiftRightLinesAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = [">"], modes = [Mode.NORMAL])
|
||||
public class ShiftRightMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
@ -63,6 +67,7 @@ public class ShiftRightMotionAction : ChangeEditorActionHandler.ForEachCaret(),
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = [">"], modes = [Mode.VISUAL])
|
||||
public class ShiftRightVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.copy
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -68,11 +70,20 @@ public sealed class PutTextBaseAction(
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["p"], modes = [Mode.NORMAL])
|
||||
public class PutTextAfterCursorAction : PutTextBaseAction(insertTextBeforeCaret = false, indent = true, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["gp"], modes = [Mode.NORMAL])
|
||||
public class PutTextAfterCursorActionMoveCursor : PutTextBaseAction(insertTextBeforeCaret = false, indent = true, caretAfterInsertedText = true)
|
||||
|
||||
@CommandOrMotion(keys = ["]p"], modes = [Mode.NORMAL])
|
||||
public class PutTextAfterCursorNoIndentAction : PutTextBaseAction(insertTextBeforeCaret = false, indent = false, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["[P", "]P", "[p"], modes = [Mode.NORMAL])
|
||||
public class PutTextBeforeCursorNoIndentAction : PutTextBaseAction(insertTextBeforeCaret = true, indent = false, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["P"], modes = [Mode.NORMAL])
|
||||
public class PutTextBeforeCursorAction : PutTextBaseAction(insertTextBeforeCaret = true, indent = true, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["gP"], modes = [Mode.NORMAL])
|
||||
public class PutTextBeforeCursorActionMoveCursor : PutTextBaseAction(insertTextBeforeCaret = true, indent = true, caretAfterInsertedText = true)
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.copy
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -71,11 +73,20 @@ public sealed class PutVisualTextBaseAction(
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["P"], modes = [Mode.VISUAL])
|
||||
public class PutVisualTextBeforeCursorAction : PutVisualTextBaseAction(insertTextBeforeCaret = true, indent = true, caretAfterInsertedText = false, modifyRegister = false)
|
||||
|
||||
@CommandOrMotion(keys = ["p"], modes = [Mode.VISUAL])
|
||||
public class PutVisualTextAfterCursorAction : PutVisualTextBaseAction(insertTextBeforeCaret = false, indent = true, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["]P", "[P"], modes = [Mode.VISUAL])
|
||||
public class PutVisualTextBeforeCursorNoIndentAction : PutVisualTextBaseAction(insertTextBeforeCaret = true, indent = false, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["[p", "]p"], modes = [Mode.VISUAL])
|
||||
public class PutVisualTextAfterCursorNoIndentAction : PutVisualTextBaseAction(insertTextBeforeCaret = false, indent = false, caretAfterInsertedText = false)
|
||||
|
||||
@CommandOrMotion(keys = ["gP"], modes = [Mode.VISUAL])
|
||||
public class PutVisualTextBeforeCursorMoveCursorAction : PutVisualTextBaseAction(insertTextBeforeCaret = true, indent = true, caretAfterInsertedText = true)
|
||||
|
||||
@CommandOrMotion(keys = ["gp"], modes = [Mode.VISUAL])
|
||||
public class PutVisualTextAfterCursorMoveCursorAction : PutVisualTextBaseAction(insertTextBeforeCaret = false, indent = true, caretAfterInsertedText = true)
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.copy
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -15,6 +17,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["Y"], modes = [Mode.NORMAL])
|
||||
public class YankLineAction : VimActionHandler.SingleExecution() {
|
||||
|
||||
override val type: Command.Type = Command.Type.COPY
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.copy
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -16,6 +18,7 @@ import com.maddyhome.idea.vim.command.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["y"], modes = [Mode.NORMAL])
|
||||
public class YankMotionAction : VimActionHandler.SingleExecution(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.COPY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.copy
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["y"], modes = [Mode.VISUAL])
|
||||
public class YankVisualAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.COPY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.copy
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -24,6 +26,7 @@ import java.util.*
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
@CommandOrMotion(keys = ["Y"], modes = [Mode.VISUAL])
|
||||
public class YankVisualLinesAction : VisualOperatorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.COPY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.file
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["ga"], modes = [Mode.NORMAL])
|
||||
public class FileGetAsciiAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.file
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["<C-G>"], modes = [Mode.NORMAL])
|
||||
public class FileGetFileInfoAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.file
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["g8"], modes = [Mode.NORMAL])
|
||||
public class FileGetHexAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.file
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["g<C-G>"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class FileGetLocationInfoAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.file
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +18,7 @@ import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<C-^>"], modes = [com.intellij.vim.annotations.Mode.NORMAL])
|
||||
public class FilePreviousAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_6, KeyEvent.CTRL_DOWN_MASK or KeyEvent.SHIFT_DOWN_MASK)),
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.file
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -14,6 +16,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["ZQ", "ZZ"], modes = [Mode.NORMAL])
|
||||
public class FileSaveCloseAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_WRITABLE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.fold
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -15,6 +17,7 @@ import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["zM"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VimCollapseAllRegions : VimActionHandler.SingleExecution() {
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
@ -30,6 +33,7 @@ public class VimCollapseAllRegions : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["zc"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VimCollapseRegion : VimActionHandler.SingleExecution() {
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
@ -45,6 +49,7 @@ public class VimCollapseRegion : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["zC"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VimCollapseRegionRecursively : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
@ -59,6 +64,7 @@ public class VimCollapseRegionRecursively : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["zR"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VimExpandAllRegions : VimActionHandler.SingleExecution() {
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
@ -74,6 +80,7 @@ public class VimExpandAllRegions : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["zo"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VimExpandRegion : VimActionHandler.SingleExecution() {
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
@ -89,6 +96,7 @@ public class VimExpandRegion : VimActionHandler.SingleExecution() {
|
||||
}
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["zO"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VimExpandRegionRecursively : VimActionHandler.SingleExecution() {
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.macro
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.ex.ExException
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.register.RegisterConstants.LAST_COMMAND_REGISTER
|
||||
|
||||
@CommandOrMotion(keys = ["@"], modes = [Mode.NORMAL])
|
||||
public class PlaybackRegisterAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.macro
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -16,6 +18,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.vimStateMachine
|
||||
|
||||
@CommandOrMotion(keys = ["q"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class ToggleRecordingAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.gn
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -20,6 +22,7 @@ import com.maddyhome.idea.vim.handler.TextObjectActionHandler
|
||||
* @author Alex Plate
|
||||
*/
|
||||
|
||||
@CommandOrMotion(keys = ["gn"], modes = [Mode.OP_PENDING])
|
||||
public class GnNextTextObject : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.gn
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -20,6 +22,7 @@ import com.maddyhome.idea.vim.handler.TextObjectActionHandler
|
||||
* @author Alex Plate
|
||||
*/
|
||||
|
||||
@CommandOrMotion(keys = ["gN"], modes = [Mode.OP_PENDING])
|
||||
public class GnPreviousTextObject : TextObjectActionHandler() {
|
||||
|
||||
override val visualType: TextObjectVisualType = TextObjectVisualType.CHARACTER_WISE
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.gn
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
import com.maddyhome.idea.vim.api.injector
|
||||
@ -23,6 +25,7 @@ import com.maddyhome.idea.vim.helper.noneOfEnum
|
||||
import java.util.*
|
||||
import kotlin.math.max
|
||||
|
||||
@CommandOrMotion(keys = ["gn"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VisualSelectNextSearch : MotionActionHandler.SingleExecution() {
|
||||
override val flags: EnumSet<CommandFlags> = noneOfEnum()
|
||||
|
||||
@ -38,6 +41,7 @@ public class VisualSelectNextSearch : MotionActionHandler.SingleExecution() {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["gN"], modes = [Mode.NORMAL, Mode.VISUAL])
|
||||
public class VisualSelectPreviousSearch : MotionActionHandler.SingleExecution() {
|
||||
override val flags: EnumSet<CommandFlags> = noneOfEnum()
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
@ -22,6 +24,7 @@ import com.maddyhome.idea.vim.handler.NonShiftedSpecialKeyHandler
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<Left>", "<kLeft>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionArrowLeftAction : NonShiftedSpecialKeyHandler(), ComplicatedKeysAction {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
@ -24,6 +26,7 @@ import com.maddyhome.idea.vim.helper.usesVirtualSpace
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
@CommandOrMotion(keys = ["<Right>", "<kRight>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionArrowRightAction : NonShiftedSpecialKeyHandler(), ComplicatedKeysAction {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["<BS>", "<C-H>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionBackspaceAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
@ -33,6 +36,7 @@ public class MotionBackspaceAction : MotionActionHandler.ForEachCaret() {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["<Space>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionSpaceAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["|"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionColumnAction : MotionActionHandler.ForEachCaret() {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -23,6 +25,7 @@ import com.maddyhome.idea.vim.state.mode.isInsertionAllowed
|
||||
import com.maddyhome.idea.vim.state.mode.inSelectMode
|
||||
import com.maddyhome.idea.vim.state.mode.inVisualMode
|
||||
|
||||
@CommandOrMotion(keys = ["<End>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.SELECT, Mode.OP_PENDING])
|
||||
public class MotionEndAction : NonShiftedSpecialKeyHandler() {
|
||||
override val motionType: MotionType = MotionType.INCLUSIVE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -22,6 +24,7 @@ import com.maddyhome.idea.vim.handler.toMotion
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["0"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionFirstColumnAction : MotionActionHandler.ForEachCaret() {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
||||
@ -36,6 +39,8 @@ public class MotionFirstColumnAction : MotionActionHandler.ForEachCaret() {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO we have the same command but for NX modes
|
||||
@CommandOrMotion(keys = ["<Home>"], modes = [Mode.INSERT])
|
||||
public class MotionFirstColumnInsertModeAction : MotionActionHandler.ForEachCaret() {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.handler.toMotion
|
||||
|
||||
@CommandOrMotion(keys = ["^"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionFirstNonSpaceAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,6 +19,7 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
|
||||
@CommandOrMotion(keys = ["g0", "g<Home>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionFirstScreenColumnAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.handler.toMotion
|
||||
|
||||
@CommandOrMotion(keys = ["g^"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionFirstScreenNonSpaceAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -19,6 +21,7 @@ import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.NonShiftedSpecialKeyHandler
|
||||
import com.maddyhome.idea.vim.handler.toMotionOrError
|
||||
|
||||
@CommandOrMotion(keys = ["<Home>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.SELECT])
|
||||
public class MotionHomeAction : NonShiftedSpecialKeyHandler() {
|
||||
override val motionType: MotionType = MotionType.EXCLUSIVE
|
||||
|
||||
|
@ -8,6 +8,8 @@
|
||||
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -25,10 +27,12 @@ import com.maddyhome.idea.vim.state.mode.inVisualMode
|
||||
import com.maddyhome.idea.vim.helper.isEndAllowed
|
||||
import java.util.*
|
||||
|
||||
@CommandOrMotion(keys = ["<End>"], modes = [Mode.INSERT])
|
||||
public class MotionLastColumnInsertAction : MotionLastColumnAction() {
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_SAVE_STROKE)
|
||||
}
|
||||
|
||||
@CommandOrMotion(keys = ["$"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public open class MotionLastColumnAction : MotionActionHandler.ForEachCaret() {
|
||||
override val motionType: MotionType = MotionType.INCLUSIVE
|
||||
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -17,7 +19,10 @@ import com.maddyhome.idea.vim.command.OperatorArguments
|
||||
import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
|
||||
@CommandOrMotion(keys = [";"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionLastMatchCharAction : MotionLastMatchCharActionBase(MotionType.INCLUSIVE, reverse = false)
|
||||
|
||||
@CommandOrMotion(keys = [","], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionLastMatchCharReverseAction : MotionLastMatchCharActionBase(MotionType.EXCLUSIVE, reverse = true)
|
||||
|
||||
public sealed class MotionLastMatchCharActionBase(defaultMotionType: MotionType, private val reverse: Boolean) :
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -18,6 +20,7 @@ import com.maddyhome.idea.vim.handler.Motion
|
||||
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.handler.toMotion
|
||||
|
||||
@CommandOrMotion(keys = ["g_"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionLastNonSpaceAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
|
@ -7,6 +7,8 @@
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.motion.leftright
|
||||
|
||||
import com.intellij.vim.annotations.CommandOrMotion
|
||||
import com.intellij.vim.annotations.Mode
|
||||
import com.maddyhome.idea.vim.api.ExecutionContext
|
||||
import com.maddyhome.idea.vim.api.ImmutableVimCaret
|
||||
import com.maddyhome.idea.vim.api.VimEditor
|
||||
@ -21,6 +23,7 @@ import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||
import com.maddyhome.idea.vim.state.mode.isInsertionAllowed
|
||||
import com.maddyhome.idea.vim.state.mode.inVisualMode
|
||||
|
||||
@CommandOrMotion(keys = ["g$", "g<End>"], modes = [Mode.NORMAL, Mode.VISUAL, Mode.OP_PENDING])
|
||||
public class MotionLastScreenColumnAction : MotionActionHandler.ForEachCaret() {
|
||||
override fun getOffset(
|
||||
editor: VimEditor,
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user