Liking cljdoc? Tell your friends :D
ClojureScript only.

paredit-cm.core

paredit operations (exported)

paredit operations (exported)
raw docstring

appendcljs

(append ch s tok)

returns the result of appending the applicable part of 'tok' to 's'. this is for collecting all the text on a line after 'ch'

returns the result of appending the applicable part of 'tok' to
's'. this is for collecting all the text on a line after 'ch'
sourceraw docstring

at-a-word?cljs

(at-a-word? cm cur)

returns true if at a word of code

returns true if at a word of code
sourceraw docstring

backspacecljs

(backspace cm)
(backspace cm n)

delete 1 or n char to left

delete 1 or n char to left
sourceraw docstring

backwardcljs

(backward cm)

paredit backward exposed for keymap.

paredit backward exposed for keymap.
sourceraw docstring

backward-barf-sexpcljs

(backward-barf-sexp cm)
(backward-barf-sexp cm cur)

paredit backward-barf-sexp exposed for keymap.

paredit backward-barf-sexp exposed for keymap.
sourceraw docstring

backward-deletecljs

(backward-delete cm)

paredit backward delete exposed for keymap

paredit backward delete exposed for keymap
sourceraw docstring

backward-downcljs

(backward-down cm)
(backward-down cm cur)
source

backward-kill-wordcljs

(backward-kill-word cm)

paredit backward-kill-word exposed for keymap.

paredit backward-kill-word exposed for keymap.
sourceraw docstring

backward-sexpcljs

(backward-sexp cm)
(backward-sexp cm cur)

backward-sexp exposed for keymap. seems part of emacs and not part of paredit itself. but including it here since this will be used in things other than emacs itself.

backward-sexp exposed for keymap. seems part of emacs and not part
of paredit itself. but including it here since this will be used in
things other than emacs itself.
sourceraw docstring

backward-slurp-sexpcljs

(backward-slurp-sexp cm)
(backward-slurp-sexp cm cur)

paredit backward-slurp-sexp exposed for keymap.

paredit backward-slurp-sexp exposed for keymap.
sourceraw docstring

backward-upcljs

(backward-up cm)
(backward-up cm cur)

paredit backward-up exposed for keymap.

paredit backward-up exposed for keymap.
sourceraw docstring

backward-up-curcljs

(backward-up-cur cm)
(backward-up-cur cm cur)

get cursor corresponding to paredit backward up

get cursor corresponding to paredit backward up
sourceraw docstring

beginning-of-line?cljs

(beginning-of-line? cm cur)
source

betw-code-and-comment?cljs

(betw-code-and-comment? cm cur)

true if code is to the left and whitespace* comment* is to the right.

true if code is to the left and whitespace* comment* is to the right.
sourceraw docstring

betw-code-and-line-end?cljs

(betw-code-and-line-end? cm)

true if code is to the left and whitespace* is to the right. assumes you already know line does not end with a comment.

true if code is to the left and whitespace* is to the right.
assumes you already know line does not end with a comment.
sourceraw docstring

bkwdcljs

(bkwd cm i n)

trampoline helper for backward. 'i' is the index we're inspecting. 'n' is number of remaining calls before we suspect an infinite loop

trampoline helper for backward. 'i' is the index we're inspecting. 'n' is
number of remaining calls before we suspect an infinite loop
sourceraw docstring

bkwd-barfcljs

(bkwd-barf cm cur n)

trampoline-able that looks for an ancestor opening bracket (parent, grandparent, etc) that has a sibling to barf. returns... . nil if there is no such anscestor that can barf

trampoline-able that looks for an ancestor opening bracket (parent,
grandparent, etc) that has a sibling to barf. returns... . nil if
there is no such anscestor that can barf
sourceraw docstring

bkwd-downcljs

(bkwd-down cm cur n)

trampoline-able that looks for the cursor where we'd be if we went backward and then down into the prev sibling that is available. nil if there is no sibling to enter.

trampoline-able that looks for the cursor where we'd be if we went backward
and then down into the prev sibling that is available. nil if there is no
sibling to enter.
sourceraw docstring

bkwd-kill-skippable-comment-char?cljs

(bkwd-kill-skippable-comment-char? cm cur)
source

bkwd-kill-wordcljs

(bkwd-kill-word cm mark i n)

trampoline helper for backward-kill-word. 'mark' is the index to start killing from. 'i' is the index we're inspecting. 'n' is how many more calls we'll entertain before stopping because we suspect an infinite loop. first call can use char count for 'n'.

trampoline helper for backward-kill-word. 'mark' is the index to start
killing from. 'i' is the index we're inspecting. 'n' is how many more calls
we'll entertain before stopping because we suspect an infinite loop. first
call can use char count for 'n'.
sourceraw docstring

bkwd-slurpcljs

(bkwd-slurp cm cur n)

trampolin-able that looks for an ancestor opening bracket (parent, grandparent, etc) that has a sibling to slurp. returns a vector of the cur to the left of such a bracket, the cur to the left of the sibling that will be slurped, the string of the bracket to move. nil if there is no such anscestor that can slurp.

trampolin-able that looks for an ancestor opening bracket (parent,
grandparent, etc) that has a sibling to slurp. returns a vector of the cur to
the left of such a bracket, the cur to the left of the sibling that will be
slurped, the string of the bracket to move. nil if there is no such anscestor
that can slurp.
sourceraw docstring

bof?cljs

(bof? cm cur)

true if at beginning of file

true if at beginning of file
sourceraw docstring

bracket?cljs

(bracket? cm cur)

true if cursor info indicates opening/closing bracket or quote

true if cursor info indicates opening/closing bracket or quote
sourceraw docstring

char-countcljs

(char-count cm)

returns the number of characters in the code mirror instance

returns the number of characters in the code mirror instance
sourceraw docstring

close-bracecljs

(close-brace cm)

close curly brace like close-rond

close curly brace like close-rond
sourceraw docstring

close-roundcljs

(close-round cm)
(close-round cm s)

paredit-close-round exposed for keymap. skips to end of current list even if it ends with ] or }. but if you're in a string or comment then this just inserts the bracket. requires CodeMirror mode's parser uses state with indentStack because that's how we can tell we've reached the end of a top level form and avoid entering the next top level form. 's' is the character as a string.

paredit-close-round exposed for keymap. skips to end of current
list even if it ends with ] or }. but if you're in a string or
comment then this just inserts the bracket. requires CodeMirror
mode's parser uses state with indentStack because that's how we
can tell we've reached the end of a top level form and avoid
entering the next top level form. 's' is the character as a string.
sourceraw docstring

close-round-and-newlinecljs

(close-round-and-newline cm)
(close-round-and-newline cm s)
source

close-squarecljs

(close-square cm)
source

closer?cljs

(closer? s)
source

closerscljs

source

closing-delim?cljs

(closing-delim? cm cur)

returns true for closing brackets and for closing double-quotes

returns true for closing brackets and for closing double-quotes
sourceraw docstring

closing-doublequote?cljs

(closing-doublequote? cm cur)

returns true if cur is just to the right of a closing doublequote

returns true if cur is just to the right of a closing doublequote
sourceraw docstring

code-to-left?cljs

(code-to-left? cm)

returns true if there's any code to the left of cursor. assumes you've already ruled out comments so only looks for non nil tokens

returns true if there's any code to the left of cursor. assumes you've
already ruled out comments so only looks for non nil tokens
sourceraw docstring

comment-dwimcljs

(comment-dwim cm)
source

comment-or-string?cljs

(comment-or-string? type)

true if the type is comment or string. a lot of editing behavior (like movement and deletion) is similar when you are in a string or in a comment, so often this is the predicate for that behavior.

true if the type is comment or string. a lot of editing behavior (like
movement and deletion) is similar when you are in a string or in a comment, so
often this is the predicate for that behavior.
sourceraw docstring

comment-selectioncljs

(comment-selection cm)
source

comment-startcljs

source

comment-whitespacecljs

source

comment?cljs

(comment? cm cur)
source

create-comment-at-endcljs

(create-comment-at-end cm)

starts a ; comment at column 40 or greater and moves to it.

starts a ; comment at column 40 or greater and moves to it.
sourceraw docstring

create-line-commentcljs

(create-line-comment cm)

creates and indents a ;; comment

creates and indents a ;; comment
sourceraw docstring

cursorcljs

(cursor cm)
(cursor cm i)

get cur, the position of the cursor

get cur, the position of the cursor
sourceraw docstring

deletecljs

(delete cm)
(delete cm n)

delete 1 or n char to right

delete 1 or n char to right
sourceraw docstring

delete-paircljs

(delete-pair cm)

assumes a pair of brackets surround the cursor. deletes the pair.

assumes a pair of brackets surround the cursor. deletes the pair.
sourceraw docstring

delete-selectioncljs

(delete-selection cm)
source

delete-to-end-of-linecljs

(delete-to-end-of-line cm)

deletes from current position to the end of the line

deletes from current position to the end of the line
sourceraw docstring

delete-whitespacecljs

(delete-whitespace cm)
(delete-whitespace cm cur)
(delete-whitespace cm cur indent-after)

if cur is in whitespace, deletes it optionally without ruining indentation.

if cur is in whitespace, deletes it optionally without ruining indentation.
sourceraw docstring

doublequotecljs

(doublequote cm)
source

end-of-a-string?cljs

(end-of-a-string? cm cur)

returns true if just to the right of a closing doublequote of a string.

returns true if just to the right of a closing doublequote of a string.
sourceraw docstring

end-of-next-siblingcljs

(end-of-next-sibling cm)
(end-of-next-sibling cm cur)

get the cursor for the end of the sibling to the right.

get the cursor for the end of the sibling to the right.
sourceraw docstring

end-of-next-sibling-spcljs

(end-of-next-sibling-sp cm cur stack)

returns the cursor at the end of the sibling to the right or nil if no sibling or eof. does not exit the containing form. does this by skipping past any comments or whitespace, and branches depending on whether an opening bracket or doublequote is encountered (sp satisfied when encountering a closing bracket that empties the stack) vs the beginning of a word (return token at the end of the word). assuming the cm has matched brackets for now.

returns the cursor at the end of the sibling to the right or nil if
no sibling or eof. does not exit the containing form. does this by
skipping past any comments or whitespace, and branches depending on
whether an opening bracket or doublequote is encountered (sp
satisfied when encountering a closing bracket that empties the
stack) vs the beginning of a word (return token at the end of the
word). assuming the cm has matched brackets for now.
sourceraw docstring

end-of-next-wordcljs

(end-of-next-word cm i)

assumes i is in a comment or a string. returns the i at the end of the next word (going to the right) in this comment/string

assumes i is in a comment or a string. returns the i at the end of
the next word (going to the right) in this comment/string
sourceraw docstring

end-of-thiscljs

(end-of-this cm cur)

go to the end of the current thing, whether it be a string or a word of code

go to the end of the current thing, whether it be a string or a word of code
sourceraw docstring

eof?cljs

(eof? cm cur)

true if at end of file

true if at end of file
sourceraw docstring

escape-stringcljs

(escape-string s)

escapes a string, replacing backslashes and doublequotes. wraps result in a new pair of doublequotes.

escapes a string, replacing backslashes and doublequotes. wraps
result in a new pair of doublequotes.
sourceraw docstring

escaped-char-name?cljs

(escaped-char-name? stg)
source

escaped-char-to-left?cljs

(escaped-char-to-left? cm cur)

returns true if an escaped char and its backslash are to the left

returns true if an escaped char and its backslash are to the left
sourceraw docstring

escaped-char-to-right?cljs

(escaped-char-to-right? cm cur)

returns true if an escaped char and its backslash is to the right

returns true if an escaped char and its backslash is to the right
sourceraw docstring

exit-stringcljs

(exit-string cm)

moves cursor right, out of the current string

moves cursor right, out of the current string
sourceraw docstring

find-first-nonwscljs

(find-first-nonws stg ch)
source

find-first-wscljs

(find-first-ws stg ch)
source

forwardcljs

(forward cm)

paredit forward exposed for keymap. find the first thing that isn't whitespace or comment. if it is a closing bracket, step past it. otherwise skip over the thing.

paredit forward exposed for keymap. find the first thing that isn't
whitespace or comment. if it is a closing bracket, step past it. otherwise
skip over the thing.
sourceraw docstring

forward-barf-sexpcljs

(forward-barf-sexp cm)
(forward-barf-sexp cm cur)

paredit forward-barf-sexp exposed for keymap.

paredit forward-barf-sexp exposed for keymap.
sourceraw docstring

forward-deletecljs

(forward-delete cm)

paredit-forward-delete exposed for keymap

paredit-forward-delete exposed for keymap
sourceraw docstring

forward-downcljs

(forward-down cm)
(forward-down cm cur)
source

forward-down-curcljs

(forward-down-cur cm)
(forward-down-cur cm cur)
source

forward-kill-wordcljs

(forward-kill-word cm)

paredit forward-kill-word exposed for keymap.

paredit forward-kill-word exposed for keymap.
sourceraw docstring

forward-sexpcljs

(forward-sexp cm)
(forward-sexp cm cur)

forward-sexp exposed for keymap. seems part of emacs and not part of paredit itself. but including it here since this will be used in things other than emacs itself.

forward-sexp exposed for keymap. seems part of emacs and not part
of paredit itself. but including it here since this will be used in
things other than emacs itself.
sourceraw docstring

forward-slurp-sexpcljs

(forward-slurp-sexp cm)
(forward-slurp-sexp cm cur)

paredit forward-slurp-sexp exposed for keymap.

paredit forward-slurp-sexp exposed for keymap.
sourceraw docstring

forward-upcljs

(forward-up cm)
(forward-up cm cur)

paredit forward-up exposed for keymap.

paredit forward-up exposed for keymap.
sourceraw docstring

forward-up-curcljs

(forward-up-cur cm)
(forward-up-cur cm cur)

get cursor corresponding to paredit forward up

get cursor corresponding to paredit forward up
sourceraw docstring

fwdcljs

(fwd cm i n)

trampoline helper for forward. 'i' is the index we're inspecting. 'n' is how many more calls we'll entertain before suspecting an infinite loop. first call can pass in char count.

trampoline helper for forward. 'i' is the index we're inspecting. 'n' is how
many more calls we'll entertain before suspecting an infinite loop. first call
can pass in char count.
sourceraw docstring

fwd-barfcljs

(fwd-barf cm cur n)

trampoline-able that looks for an ancestor closing bracket (parent, grandparent, etc) that has a sibling to barf. returns a vector of the cur to the right of such a bracket, the cur at the bracket, the cur where the bracket should go, the text of the bracket, and whether the operation causes the cursor to be moved. nil if there is no such anscestor that can barf

trampoline-able that looks for an ancestor closing bracket (parent,
grandparent, etc) that has a sibling to barf. returns a vector of
the cur to the right of such a bracket, the cur at the bracket, the
cur where the bracket should go, the text of the bracket, and
whether the operation causes the cursor to be moved. nil if there is
no such anscestor that can barf
sourceraw docstring

fwd-downcljs

(fwd-down cm cur n)

trampoline-able that looks for the cursor where we'd be if we went forward and then down into the next sibling that is available. nil if there is no sibling to enter.

trampoline-able that looks for the cursor where we'd be if we went forward
and then down into the next sibling that is available. nil if there is no
sibling to enter.
sourceraw docstring

fwd-kill-wordcljs

(fwd-kill-word cm mark i n)

trampoline helper for forward-kill-word. 'mark' is the index to start killing from. 'i' is the index we're inspecting. 'n' is how many calls remaining that we'll support before stopping because of a suspected infinite loop. first call can put the count of characters in this cm instance.

trampoline helper for forward-kill-word. 'mark' is the index to start killing
from. 'i' is the index we're inspecting. 'n' is how many calls remaining that
we'll support before stopping because of a suspected infinite loop. first call
can put the count of characters in this cm instance.
sourceraw docstring

fwd-slurpcljs

(fwd-slurp cm cur n)

trampoline-able that looks for an ancestor closing bracket (parent, grandparent, etc) that has a sibling to slurp. returns a vector of the cur to the right of such a bracket, the cur to the right of the sibling that will be slurped, the string of the bracket to move. nil if there is no such anscestor that can slurp.

trampoline-able that looks for an ancestor closing bracket (parent,
grandparent, etc) that has a sibling to slurp. returns a vector of the cur to
the right of such a bracket, the cur to the right of the sibling that will be
slurped, the string of the bracket to move. nil if there is no such anscestor
that can slurp.
sourceraw docstring

fwd-string-barfcljs

(fwd-string-barf cm cur)

String barffing consists of simply 'go to end of string, mark as parent, reverse look for non whitespace, reverse look for whitespace, mark as sibling'

String barffing consists of simply 'go to end of string, mark as
parent, reverse look for non whitespace, reverse look for
whitespace, mark as sibling'
sourceraw docstring

fwd-string-slurpcljs

(fwd-string-slurp cm cur)

String slurping consists of simply 'go to end of string, mark as parent, go to next sibling end, mark as sibling'

String slurping consists of simply 'go to end of string, mark as
parent, go to next sibling end, mark as sibling'
sourceraw docstring

get-infocljs

(get-info cm)
(get-info cm cur)

make info from CodeMirror more conveniently accessed by our code. we'll use destructuring and just name what we rant. hypothesizing that performance hit won't be that bad.

make info from CodeMirror more conveniently accessed by our code.
we'll use destructuring and just name what we rant. hypothesizing
that performance hit won't be that bad.
sourceraw docstring

get-stringcljs

(get-string cm)
(get-string cm cur)

gets the string of the current token

gets the string of the current token
sourceraw docstring

get-text-to-end-of-linecljs

(get-text-to-end-of-line cm cur)
source

get-typecljs

(get-type cm)
(get-type cm cur)

get the type at the current cursor.

get the type at the current cursor.
sourceraw docstring

get-typescljs

(get-types cm c1 c2)

get the types from cursors c1 to c2. assumes 1 is to the left of 2 and not vice versa.

get the types from cursors c1 to c2. assumes 1 is to the left of 2 and not
vice versa.
sourceraw docstring

go-to-commentcljs

(go-to-comment cm)

moves cursor to ;;X

moves cursor to ;;X
sourceraw docstring

go-to-comment-and-indentcljs

(go-to-comment-and-indent cm)

moves cursor to the comment on the line and makes sure the comment starts on column 40 or greater. assumes last token is a comment

moves cursor to the comment on the line and makes sure the comment
starts on column 40 or greater. assumes last token is a comment
sourceraw docstring

go-to-end-of-stringcljs

(go-to-end-of-string cm)
(go-to-end-of-string cm cur)

moves cursor to end of the string you're in (but still inside the closing doublequote). assumes you're in a string. the end could be on a different line from where you start

moves cursor to end of the string you're in (but still inside the
closing doublequote). assumes you're in a string. the end could be
on a different line from where you start
sourceraw docstring

guardcljs

(guard)
source

idx-of-nextcljs

(idx-of-next cm i chars member max)
source

in-a-word?cljs

(in-a-word? cm)

true if in a word AND not at the end of that word. false if in whitespace or a string or a comment or at a bracket.

true if in a word AND not at the end of that word. false if in whitespace or
a string or a comment or at a bracket.
sourceraw docstring

in-code?cljs

(in-code? cm)

returns true if token is in the middle of code. assumes you've already ruled out comments.

returns true if token is in the middle of code. assumes you've already ruled
out comments.
sourceraw docstring

in-escaped-char?cljs

(in-escaped-char? cm cur)
(in-escaped-char? cm cur offset)

returns true if backslash is to the left and cursor is on an escaped char

returns true if backslash is to the left and cursor is on an escaped char
sourceraw docstring

in-regular-string?cljs

(in-regular-string? cm cur)

returns true if token is in the middle of a string.

returns true if token is in the middle of a string.
sourceraw docstring

in-string?cljs

(in-string? cm)
(in-string? cm cur)

returns true if token is in the middle of a string.

returns true if token is in the middle of a string.
sourceraw docstring

in-whitespace?cljs

(in-whitespace? cm)

returns true if token is to the right of whitespace

returns true if token is to the right of whitespace
sourceraw docstring

indent-current-linecljs

(indent-current-line cm)
source

indent-linecljs

(indent-line cm)

indent the current line

indent the current line
sourceraw docstring

indent-linescljs

(indent-lines cm a z)

indents lines from a to z (line numbers). assumes a is before z.

indents lines from a to z (line numbers). assumes a is before z.
sourceraw docstring

indexcljs

(index cm)
(index cm cur)

get the index i for the cursor's position

get the index i for the cursor's position
sourceraw docstring

index-of-nextcljs

(index-of-next cm i chars)
source

index-of-next-noncljs

(index-of-next-non cm i chars)
source

insertcljs

(insert cm text)
(insert cm text offset)
(insert cm text offset cur)

insert text at current cursor. move cursor to the end of inserted text minus optional offset. the offset is for moving the cursor immediately after the insert and before returning. example: inserting a pair of brackets and placing the cursor inside the pair. this returns the new cursor.

insert text at current cursor. move cursor to the end of inserted text minus
optional offset. the offset is for moving the cursor immediately after the
insert and before returning. example: inserting a pair of brackets and placing
the cursor inside the pair. this returns the new cursor.
sourceraw docstring

insert-line-comment-herecljs

(insert-line-comment-here cm)

creates and indents a ;; comment on this line

creates and indents a ;; comment on this line
sourceraw docstring

insert-spaces-to-col-40cljs

(insert-spaces-to-col-40 cm)

presses spacebar until we are at col 40

presses spacebar until we are at col 40
sourceraw docstring

is-bracket-type?cljs

(is-bracket-type? t)
source

join-sexpscljs

(join-sexps cm)
(join-sexps cm cur)

paredit join-sexps exposed for keymap.

paredit join-sexps exposed for keymap.
sourceraw docstring

just-one-spacecljs

(just-one-space cm)
(just-one-space cm cur)
(just-one-space cm cur indent-after)
source

killcljs

(kill cm)

paredit kill exposed for keymap.

paredit kill exposed for keymap.
sourceraw docstring

kill-from-tocljs

(kill-from-to cm i j)
source

kill-next-siblingcljs

(kill-next-sibling cm)

kills the next sibling to the right of the cursor

kills the next sibling to the right of the cursor
sourceraw docstring

kill-next-wordcljs

(kill-next-word cm i)

assumes i is in a comment or a string. kills text from i to the end of the next word in this comment/string

assumes i is in a comment or a string. kills text from i to the end
of the next word in this comment/string
sourceraw docstring

kill-paircljs

(kill-pair cm)

assumes a pair of brackets surround the cursor. deletes the pair.

assumes a pair of brackets surround the cursor. deletes the pair.
sourceraw docstring

kill-prev-word-in-commentcljs

(kill-prev-word-in-comment cm i)

assumes i is in a comment. kills text from i to the beginning of the previous word in this comment

assumes i is in a comment. kills text from i to the beginning of the previous
word in this comment
sourceraw docstring

kill-regioncljs

(kill-region cm)
source

kill-rest-of-linecljs

(kill-rest-of-line cm)
source

kill-rest-of-siblingscljs

(kill-rest-of-siblings cm)
source

kill-rest-of-stringcljs

(kill-rest-of-string cm)
source

last-curcljs

(last-cur cm)
(last-cur cm cur)

returns the last cursor of a line

returns the last cursor of a line
sourceraw docstring

last-tokencljs

(last-token cm cur)

returns the last token of a line

returns the last token of a line
sourceraw docstring

leftcljs

(left cm c1 c2)

given a pair of cursors c1 and c2, returns the left-most one

given a pair of cursors c1 and c2, returns the left-most one
sourceraw docstring

line-ends-with-comment?cljs

(line-ends-with-comment? cm)

true if the line ends with a comment

true if the line ends with a comment
sourceraw docstring

line-is-whitespace?cljs

(line-is-whitespace? cm)

returns true if line is all whitespace

returns true if line is all whitespace
sourceraw docstring

line-lengthcljs

(line-length cm)
(line-length cm cur)

gets the length of the current line

gets the length of the current line
sourceraw docstring

meta-doublequotecljs

(meta-doublequote cm)

paredit meta-doublequote exposed for keymap. if in a string, moves cursor out of the string to the right. if in a comment, insert a doublequote. if in an escaped char, do nothing. otherwise starts a string that that continues to the end of the next form, escaping backslashes and doublequotes.

paredit meta-doublequote exposed for keymap.
if in a string, moves cursor out of the string to the right.
if in a comment, insert a doublequote.
if in an escaped char, do nothing.
otherwise starts a string that that continues to the end of the next
form, escaping backslashes and doublequotes.
sourceraw docstring

movecljs

(move cm offset)

moves the cursor by 'offset' places, negative for left. returns the cursor.

moves the cursor by 'offset' places, negative for left. returns the cursor.
sourceraw docstring

move-leftcljs

(move-left cm)
source

move-past-parent-closercljs

(move-past-parent-closer cm)

moves cursor to just outside the closing bracket, or if there is none then doesn't move at all.

moves cursor to just outside the closing bracket, or if there is
none then doesn't move at all.
sourceraw docstring

move-rightcljs

(move-right cm)
source

move-to-end-of-linecljs

(move-to-end-of-line cm)
(move-to-end-of-line cm cur)

moves cursor to end of last non-whitespace token on a line. returns a vector of new index, new ch, and new cursor.

moves cursor to end of last non-whitespace token on a line.
returns a vector of new index, new ch, and new cursor.
sourceraw docstring

new-line-and-commentcljs

(new-line-and-comment cm)

creates and indents a ;; comment on a new line

creates and indents a ;; comment on a new line
sourceraw docstring

non-word-charscljs

source

not-code?cljs

(not-code? type)
source

open-bracecljs

(open-brace cm)

open curly brace with matching close brace

open curly brace with matching close brace
sourceraw docstring

open-roundcljs

(open-round cm)
(open-round cm c)

paredit-open-round exposed for keymap. unlike traditional emacs paredit, this supports brackets [] {} () but not double-quote

paredit-open-round exposed for keymap. unlike traditional emacs paredit, this
supports brackets [] {} () but not double-quote
sourceraw docstring

open-squarecljs

(open-square cm)
source

opener?cljs

(opener? s)
source

openerscljs

source

opening-delim-for-empty-pair?cljs

(opening-delim-for-empty-pair? cm cur)

returns true for an opening bracket of an empty pair ()

returns true for an opening bracket of an empty pair ()
sourceraw docstring

opening-delim-for-non-empty-pair?cljs

(opening-delim-for-non-empty-pair? cm)

returns true for an opening bracket of a pair that contains one or more chars.

returns true for an opening bracket of a pair that contains one or more
chars.
sourceraw docstring

opening-delim?cljs

(opening-delim? cm cur)

returns true for opening brackets and for opening double-quotes

returns true for opening brackets and for opening double-quotes
sourceraw docstring

opening-doublequote?cljs

(opening-doublequote? cm cur)
(opening-doublequote? cm type left-char right-cur)

returns true if cur is just to the right of an opening doublequote

returns true if cur is just to the right of an opening doublequote
sourceraw docstring

paircljs

source

pair?cljs

(pair? s1 s2)

true if the two strings are a matching open/close pair

true if the two strings are a matching open/close pair 
sourceraw docstring

parent-closer-spcljs

(parent-closer-sp cm cur state)

finds the parent closing bracket. behavior when used with skip: pushes opening brackets that appear along the way on a stack. closing brackets pop them off. stops when encountering a closing bracket while the stack is empty. assuming the cm has matched brackets for now. moves to the right.

finds the *parent* closing bracket. behavior when used with skip: pushes
opening brackets that appear along the way on a stack. closing brackets pop
them off. stops when encountering a closing bracket while the stack is empty.
assuming the cm has matched brackets for now. moves to the right.
sourceraw docstring

raise-sexpcljs

(raise-sexp cm)
(raise-sexp cm cur)

paredit raise-sexp exposed for keymap.

paredit raise-sexp exposed for keymap.
sourceraw docstring

reindent-defuncljs

(reindent-defun cm)
(reindent-defun cm cur)

paredit reindent-defun exposed for keymap.

paredit reindent-defun exposed for keymap.
sourceraw docstring

rest-of-siblingscljs

(rest-of-siblings cm)
source

rfind-blank-or-startcljs

(rfind-blank-or-start stg)
source

(right cm c1 c2)

given a pair of cursors c1 and c2, returns the right-most one

given a pair of cursors c1 and c2, returns the right-most one
sourceraw docstring

right-cur-would-be-whitespace?cljs

(right-cur-would-be-whitespace? cm cur right-cur)

true if this position would be whitespace if we pressed the spacebar.

true if this position would be whitespace if we pressed the spacebar.
sourceraw docstring

select-paircljs

(select-pair cm)

assumes a pair of brackets surround the cursor. selects the pair.

assumes a pair of brackets surround the cursor. selects the pair.
sourceraw docstring

select-rest-of-linecljs

(select-rest-of-line cm)

selects from current position to the end of the line

selects from current position to the end of the line
sourceraw docstring

select-rest-of-siblingscljs

(select-rest-of-siblings cm)
source

select-rest-of-stringcljs

(select-rest-of-string cm)

assumes you are in a string.

assumes you are in a string.
sourceraw docstring

selection-completely-non-code?cljs

(selection-completely-non-code? cm)
source

selection-completely-satisfies-pred?cljs

(selection-completely-satisfies-pred? cm pred)

true if every position's type satisfies pred, for the entire (first) selection

true if every position's type satisfies pred, for the entire (first)
selection
sourceraw docstring

selection-completely-whitespace?cljs

(selection-completely-whitespace? cm)
source

selection-infocljs

(selection-info cm)

like get-info but for the first selection. gets the cursor to the left of the selection, the start, the end, the text selected, the starting and ending line numbers. nil if nothing selected.

like get-info but for the first selection. gets the cursor to the left of the
selection, the start, the end, the text selected, the starting and ending line
numbers. nil if nothing selected.
sourceraw docstring

semicolonscljs

source

skipcljs

(skip cm sp)
(skip cm sp cur)

returns the cursor that satisfies sp or nil if either eof reached or we found out sp could not be satisfied. see skip-to for more info.

returns the cursor that satisfies sp or nil if either eof reached
or we found out sp could not be satisfied. see skip-to for more
info.
sourceraw docstring

skip-leftcljs

(skip-left cm sp)

returns the cursor that satisfies sp or nil if either bof reached or we found out sp could not be satisfied. see skip-to for more info.

returns the cursor that satisfies sp or nil if either bof reached
or we found out sp could not be satisfied. see skip-to for more
info.
sourceraw docstring

skip-tocljs

(skip-to cm sp)

moves to the cursor that satisfies sp or doesn't move if eof reached. starts at current cursor for cm. sp stands for 'skipping predicate' which returns:

  • :yes if sp is satisfied.
  • :stop if we know we will not be satisfied with any future result.
  • :left if the cursor to the left is what we want.
  • new non-nil state if not satisfied. this state is used with the next iteration after we skip to the end of the current token. an sp takes cm, cursor, state.
moves to the cursor that satisfies sp or doesn't move if eof reached.
starts at current cursor for cm. sp stands for 'skipping predicate'
which returns:
- :yes if sp is satisfied.
- :stop if we know we will not be satisfied with any future result.
- :left if the cursor to the left is what we want.
- new non-nil state if not satisfied. this state is used with the
next iteration after we skip to the end of the current token. an sp
takes cm, cursor, state.
sourceraw docstring

skip-trampoline-helpercljs

(skip-trampoline-helper cm cur sp state n)

returns the cursor that satsifies skipping predicate 'sp' or nil if eof reached. does this by making sp something we can trampoline. sp takes these args: cm, cursor, state. counts down 'n' to 0 in order to guard against infinite loops.

returns the cursor that satsifies skipping predicate 'sp' or nil if eof
reached. does this by making sp something we can trampoline. sp takes these
args: cm, cursor, state. counts down 'n' to 0 in order to guard against
infinite loops.
sourceraw docstring

skip-trampoline-helper-leftcljs

(skip-trampoline-helper-left cm cur sp state n)

like skip-trampoline-helper but in the opposite direction.

like skip-trampoline-helper but in the opposite direction.
sourceraw docstring

splice-sexpcljs

(splice-sexp cm)
(splice-sexp cm cur)

paredit splice-sexp exposed for keymap. unlike emacs' version, this does not splice a string by dropping its double-quotes.

paredit splice-sexp exposed for keymap. unlike emacs' version, this does not
splice a string by dropping its double-quotes.
sourceraw docstring

splice-sexp-killing-backwardcljs

(splice-sexp-killing-backward cm)
(splice-sexp-killing-backward cm cur)

paredit splice-sexp-killing-backward exposed for keymap. like emacs' version, this doesn't actually kill to the clipboard. it just deletes. but unlink emacs, this does not splice a string by dropping its double-quotes.

paredit splice-sexp-killing-backward exposed for keymap. like emacs' version,
this doesn't actually kill to the clipboard. it just deletes. but unlink
emacs, this does not splice a string by dropping its double-quotes.
sourceraw docstring

splice-sexp-killing-forwardcljs

(splice-sexp-killing-forward cm)
(splice-sexp-killing-forward cm cur)

paredit splice-sexp-killing-forward exposed for keymap. like emacs' version, this doesn't actually kill to the clipboard. it just deletes. but unlink emacs, this does not splice a string by dropping its double-quotes.

paredit splice-sexp-killing-forward exposed for keymap. like emacs' version,
this doesn't actually kill to the clipboard. it just deletes. but unlink
emacs, this does not splice a string by dropping its double-quotes.
sourceraw docstring

split-formcljs

(split-form cm cur)

split sexp for (forms like this)

split sexp for (forms like this)
sourceraw docstring

split-sexpcljs

(split-sexp cm)
(split-sexp cm cur)

paredit split-sexp exposed for keymap.

paredit split-sexp exposed for keymap.
sourceraw docstring

split-stringcljs

(split-string cm cur)

split sexp for "strings like this"

split sexp for "strings like this"
sourceraw docstring

start-of-a-string2?cljs

(start-of-a-string2? cm cur)
source

start-of-a-string?cljs

(start-of-a-string? cm cur)

returns true if at the start of a string.

returns true if at the start of a string.
sourceraw docstring

start-of-comment?cljs

(start-of-comment? cm cur)

true if block cursor is on the first ; of a line comment

true if block cursor is on the first ; of a line comment
sourceraw docstring

start-of-prev-siblingcljs

(start-of-prev-sibling cm)
(start-of-prev-sibling cm cur)

return the cursor at the start of the sibling to the left.

return the cursor at the start of the sibling to the left.
sourceraw docstring

start-of-prev-sibling-spcljs

(start-of-prev-sibling-sp cm cur stack)

returns the cursor at the start of the sibling to the left or nil if no sibling or eof. does not exit the containing form. does this by skipping past any comments or whitespace, and branches depending on whether a bracket or doublequote is encountered (sp satisfied when encountering an opening bracket that empties the stack) vs the beginning of a word (return token at the start of the word). assuming the cm has matched brackets for now.

returns the cursor at the start of the sibling to the left or nil
if no sibling or eof. does not exit the containing form. does this
by skipping past any comments or whitespace, and branches depending
on whether a bracket or doublequote is encountered (sp satisfied
when encountering an opening bracket that empties the stack) vs the
beginning of a word (return token at the start of the
word). assuming the cm has matched brackets for now.
sourceraw docstring

start-of-prev-wordcljs

(start-of-prev-word cm i)

assumes i is in a comment or a string. returns the i at the start of the prev word (going to the left) in this comment/string

assumes i is in a comment or a string. returns the i at the start of
the prev word (going to the left) in this comment/string
sourceraw docstring

start-of-token-atcljs

(start-of-token-at cm i)
source

str-ends-on-another-line?cljs

(str-ends-on-another-line? type string)

true if these values are from a string token that ends on another line

true if these values are from a string token that ends on another line
sourceraw docstring

stringifycljs

(stringify cm cur-1 cur-2)

turns the region from cur-1 to cur-2 into a string, escaping backslashes and doublequotes

turns the region from cur-1 to cur-2 into a string, escaping
backslashes and doublequotes
sourceraw docstring

stringify-selectioncljs

(stringify-selection cm)

turns selection into a string, escaping backslashes and doublequotes

turns selection into a string, escaping backslashes and doublequotes
sourceraw docstring

to-commentcljs

(to-comment s postscript)

starts each line in 's' with ;; and appends 'post-script'

starts each line in 's' with ;; and appends 'post-script'
sourceraw docstring

tokencljs

(token cm cur)

get token at cursor

get token at cursor
sourceraw docstring

token-endcljs

(token-end cm cur)
(token-end cm cur offset)

returns the cursor for the end of the current token

returns the cursor for the end of the current token
sourceraw docstring

token-end-indexcljs

(token-end-index cm i)

take an index. get its token. return index of that token's end.

take an index. get its token. return index of that token's end.
sourceraw docstring

token-startcljs

(token-start cm cur)

returns the cursor for the start of the current token

returns the cursor for the start of the current token
sourceraw docstring

top-most-openercljs

(top-most-opener cm)
(top-most-opener cm cur)

get the top most opening bracket for the specified location. nil if there is no such bracket.

get the top most opening bracket for the specified location. nil if
there is no such bracket.
sourceraw docstring

top-most-opener-candidatecljs

(top-most-opener-candidate cm cur n)

trampoline-able that looks for the top-most opening bracket for the specified location. returns the current cursor if there is no such anscestor

trampoline-able that looks for the top-most opening bracket for the specified
location. returns the current cursor if there is no such anscestor
sourceraw docstring

uncommentcljs

(uncomment s)

removes leading whitespace and semicolons from lines in 's'

removes leading whitespace and semicolons from lines in 's'
sourceraw docstring

uncomment-selectioncljs

(uncomment-selection cm)

removes whitespace and leading semicolons from selection, replaces selection with the result, indents lines affected.

removes whitespace and leading semicolons from selection, replaces
selection with the result, indents lines affected.
sourceraw docstring

whitespace?cljs

(whitespace? cm cur)

returns true if cursor indicates whitespace

returns true if cursor indicates whitespace
sourceraw docstring

word?cljs

(word? type)
source

wrap-roundcljs

(wrap-round cm)
(wrap-round cm cur)

paredit wrap-round exposed for keymap.

paredit wrap-round exposed for keymap.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close