Coder Social home page Coder Social logo

subpar's People

Contributors

achengs avatar fappy012 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

subpar's Issues

petit paredit?

https://github.com/laurentpetit/paredit.clj ... Would a cljs version be trivial? If so, subpar could use it instead.

But if it uses a lot of things unsupported in cljs (that is, if creating a cljs version would be nontrivial), subpar could still be improved by having a similar consistent return value from paredit. A lot of hard coded stuff in core would be obviated.

The return value should probably be [1] a list of replacements to make if any, [2] a new cursor position, [3] a range of lines to re-indent if any. Cursor position should be set before re-indentation so we don't have to figure out the change due to it.

really having difficulty getting this plugin working with the latest version of lighttable

would appreciate a keybinding file and a user behaviour file.
when using this plugin it acts almost nothing like the demo you have on this github page.
when i forward delete parens, matching doesn't matter... i can just delete them like normal characters.

when i look up subpar via ctrl + space they keybindings look ok...
light table_014

user.keymap

;; Your file has been converted to the new flat format.
;; Conversion does not preserve comments or indentation.
;; File is backed up at /home/paul/.config/LightTable/User/user.keymap.bak
[
 [:app "shift-up" :tabs.prev]
 [:app "ctrl-x 3" :tabset.new]
 [:app "shift-down" :tabs.next]
 [:app "shift-right" :tabset.next]
 [:app "ctrl-t" :new-file]
 [:app "shift-left" :tabset.prev]
 [:app "alt-x" :show-commandbar-transient]

 [:editor "alt-shift-w" :editor.watch.unwatch]
 [:editor "alt-w" :editor.watch.watch-selection]

 [:editor.clj "\"" :subpar.insert-double-quote]
 [:editor.clj "ctrl-shift-0" :subpar.grow.right]
 [:editor.clj "ctrl-down" :subpar.move.forward-down]
 [:editor.clj "alt-down" :subpar.splice.delete-forward]
 [:editor.clj "(" (:subpar.open-pair "()")]
 [:editor.clj ")" (:subpar.close-pair ")")]
 [:editor.clj "ctrl-left" :subpar.move.backward]
 [:editor.clj "alt-shift-9" (:subpar.open-pair "()") :subpar.grow.right]
 [:editor.clj "delete" :subpar.delete.right]
 [:editor.clj "ctrl-shift-9" :subpar.barf.right]
 [:editor.clj "ctrl-shift-[" :subpar.grow.left]
 [:editor.clj "alt-s" :subpar.splice]
 [:editor.clj "ctrl-shift-]" :subpar.barf.left]
 [:editor.clj "ctrl-right" :subpar.move.forward]
 [:editor.clj "[" (:subpar.open-pair "[]")]
 [:editor.clj "{" (:subpar.open-pair "{}")]
 [:editor.clj "]" (:subpar.close-pair "]")]
 [:editor.clj "}" (:subpar.close-pair "}")]
 [:editor.clj "ctrl-up" :subpar.move.backward-up]
 [:editor.clj "backspace" :subpar.delete.left]
 [:editor.clj "delete" :subpar.delete.left]
 [:editor.clj "alt-up" :subpar.splice.delete-backward]

 [:editor.keys.emacs "alt-left" (:emacs.keymap-cmd "Alt-B")]
 [:editor.keys.emacs "alt-x" :show-commandbar-transient]
 [:editor.keys.emacs "alt-right" (:emacs.keymap-cmd "Alt-F")]
 [:editor.keys.emacs "-ctrl-down" (:emacs.keymap-cmd "Ctrl-Down")]
 [:editor.keys.emacs "-delete" (:emacs.keymap-cmd "Delete")]
 [:editor.keys.emacs "-ctrl-n" (:emacs.keymap-cmd "Ctrl-N")]
 [:editor.keys.emacs "-ctrl-t" (:emacs.keymap-cmd "Ctrl-T")]
 [:editor.keys.emacs "-ctrl-up" (:emacs.keymap-cmd "Ctrl-Up")]
 [:editor.keys.emacs "-backspace" (:emacs.keymap-cmd "Backspace")]

 [:editor.keys.normal "-\"" (:editor.repeat-pair "\"")]
 [:editor.keys.normal "-(" (:editor.open-pair "(")]
 [:editor.keys.normal "-)" (:editor.close-pair ")")]
 [:editor.keys.normal "-[" (:editor.open-pair "[")]
 [:editor.keys.normal "-{" (:editor.open-pair "{")]
 [:editor.keys.normal "-]" (:editor.close-pair "]")]
 [:editor.keys.normal "-}" (:editor.close-pair "}")]
 [:editor.keys.normal "-backspace" :editor.backspace-pair]
]

user.behaviours

;; User behaviors
;; -----------------------------
;; Behaviors are stored as a set of diffs that are merged together
;; to create the final set of functionality that makes up Light Table. You can
;; modify these diffs to either add or subtract functionality.
;;
;; Behaviors are added to tags, objects with those tags then automatically gain
;; whatever logic the behavior imparts. To see a list of user-level behaviors,
;; start typing a word related to the functionality you want in between the square
;; brackets (e.g. "theme").

[
 ;; The app tag is kind of like global scope. You assign behaviors that affect
 ;; all of Light Table to it.
 [:app :lt.objs.style/set-skin "dark"]
 [:app :lt.objs.plugins/load-js "user_compiled.js"]

 ;; The editor tag is applied to all editors
 [:editor :lt.objs.editor/no-wrap]
 [:editor :lt.objs.style/set-theme "default"]

 [:editor (:lt.plugins.emacs/activate-emacs)]

 [:editor.clj (:lt.object/add-tag :editor.keys.normal.clojure)]

 ;; Here we can add behaviors to just clojure editors
 [:editor.clojure :lt.plugins.clojure/print-length 1000]

 ;; Behaviors specific to a user-defined object
 [:user.hello :lt.plugins.user/on-close-destroy]

 [:app :lt.objs.settings/pair-keymap-diffs]

 ;; To subtract a behavior, prefix the name with '-' e.g.
 ;;  [:app :-lt.objs.intro/show-intro]
]

Performance too slow

Good, but unfortunately the response to keypresses is much too slow to be usable on large file sizes; approx 700 lines.
Chrome on OSX.

cursor placement after undo

Try a larger operation such as a forward killing splice and then undo. Does the cursor placement work out as expected? Compare with emacs w paredit22

throwing errors when attempting to forward delete

Error: No matching clause: 0
    at forward_delete (/home/paul/.config/LightTable/plugins/Subpar/subpar_compiled.js:1069:9)
    at Function.eval (/home/paul/.config/LightTable/plugins/Subpar/subpar_compiled.js:1360:70)
    at b (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6188:14)
    at a (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6234:18)
    at a (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:21134:29)
    at b (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:21138:14)
    at cljs.core.apply_to (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6097:85)
    at c (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6194:66)
    at a (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:6236:18)
    at a (file:///opt/LightTable/core/node_modules/lighttable/bootstrap.js:25603:153)

Very cool!

Subpar is very cool!

I've integrated subpar into klipse: take a look at http://app.klipse.tech/
Click on the icon on the top-left box to switch editing mode.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.