Skip to content

Instantly share code, notes, and snippets.

@kurogelee
Created June 9, 2014 10:02
Show Gist options
  • Save kurogelee/96bc04a2e1ed4cdcb4e6 to your computer and use it in GitHub Desktop.
Save kurogelee/96bc04a2e1ed4cdcb4e6 to your computer and use it in GitHub Desktop.
Light Tableでカーソルをいろいろ移動する ref: http://qiita.com/kurogelee/items/ae59f18544f41d7461d2
(ns lt.plugins.cursorkit
(:require [lt.objs.command :as cmd]
[lt.objs.editor :as editor]
[lt.objs.editor.pool :as pool]))
(defn cm [] (editor/->cm-ed (pool/last-active)))
(cmd/command {:command ::extend-true
:desc "cursorkit: Set Extending true"
:exec (fn [] (.setExtending (cm) true))})
(cmd/command {:command ::extend-false
:desc "cursorkit: Set Extending false"
:exec (fn [] (.setExtending (cm) false))})
(.execCommand cm "goLineEnd")
(.execCommand cm "goLineStart")
(.execCommand cm "goLineStartSmart")
(.execCommand cm "goLineLeft")
(.execCommand cm "goLineRight")
(.execCommand cm "goLineUp")
(.execCommand cm "goLineDown")
(.execCommand cm "goCharLeft")
(.execCommand cm "goCharRight")
(.execCommand cm "goColumnLeft")
(.execCommand cm "goColumnRight")
(do
(.execCommand cm "goLineStartSmart")
(.setExtending cm true)
(.execCommand cm "goLineEnd")
(.setExtending cm false))
(ns sample.core
(:require [lt.objs.editor :as editor]
[lt.objs.editor.pool :as pool]))
(def cm (editor/->cm-ed (pool/last-active)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment