Commit Graph

143 Commits

Author SHA1 Message Date
JunghanKim fb3b566164
fix(clojure): typo clojure/post-init-company function (cide -> cider) (#15886)
cide-clojure-interaction-mode -> cider-clojure-interaction-mode
2023-01-10 09:33:35 -05:00
Arif Er 00f9ab19ac chore: update copyright headers to 2022
The script used to identify and update the change is added into the GitHub
workflows script directory. A workflow action can be created to trigger the
script to update the headers on the first of every new year. Possibly a task for
a consequent PR.
2022-06-03 17:32:20 +02:00
Maxi Wolff 39b9def6d5
Fix variable is void warnings at startup
which were caused by invocing
evilified-state-evilify-map in the init section.
2022-05-29 15:04:18 +02:00
Daniel Nicolai f4b04bcf22 Add obsoletion notification evilified-state-evilify 2022-05-29 14:05:07 +02:00
John Practicalli 84033e168d [clojure] add kaocha-runner as optional package
Add kaocha-runner.el to the Clojure layer to enable running the kaocha test
runner from Emacs Cider

Kaocha runner added to the layer via the clojure-enable-kaocha-runner variable

Add key bindings to call Kaocha runner
2022-01-14 18:03:53 +01:00
Daniel Nicolai d02fae3c7a
Evilify and add cider-repl-history-mode keybindings (#14842)
Cider provides the possibility to search the REPL history, for which it opens
the history in a read-only buffer (which as usual, is best initialized in
evilified state).

This commit evilifies the cider-repl-history-mode buffer and defines some common
sense cider-repl-history-mode keybindings.
2021-08-24 01:20:26 +00:00
Maximilian Wolff 3f795aebdb [parinfer] Remove path hack and obsolete layer specific hooks 2021-04-15 20:51:31 +00:00
Lucius Hu 03da968a98 squash! clojure: refactor
- Replaced `(when (not foo) bar)` with `(unless foo bar)`
2021-04-04 12:48:21 +02:00
syl20bnr 97cd83e169 Apply GPLv3 terms explicitly to all elisp files 2021-03-25 22:59:32 -04:00
syl20bnr d55a9e2e67 Update header for year 2021 2021-03-25 22:59:32 -04:00
Maximilian Wolff 6018580958 Make layers activate/deactivate the right version of smartparens
Before layers were sometimes only activating the non strict
version of smartparens. Also some were only disabling
the non-strict version leaving some of the smartparens
advices intact.

With this PR, all layers set the right version of smartparens.
Also if the layer is trying to disable it a standard function
will now take care to disable all versions of smartparens.
2021-03-16 17:47:15 +00:00
John Practicalli Stevenson f9123b1cc5 [clojure] add namespace eval and reload key bindings
Add key binding to evaluate the current namespace form (very useful when
starting CIDER as it loads in clojure.core to enable the cider-clojure-docs
functions to work)

Add keybinding to reload all namespaces into the REPL process

Adjusted key bindings to be lower case under `en` sub-menu.
2020-11-24 21:46:23 +01:00
Maximilian Wolff 6d39cd5548
[clojure] Add lsp server support 2020-11-24 21:35:31 +01:00
John Practicalli Stevenson d929079f28 [clojure] add cider-inspect key bindings
Add cider inspect key bindings missing from Spacemacs
2020-11-21 07:26:20 +01:00
John Practicalli Stevenson f2c075b673 [clojure] key binding for cider eval list around point
New command added to CIDER in version 0.26 to evaluate the list around the
current point, different to evaluate sexp around point which also evaluates
symbols.

https://github.com/clojure-emacs/cider/pull/2881
2020-10-01 12:29:35 +02:00
Robert O'Connor 82ba73a1c0
update copyright to 2020 2020-09-23 21:25:01 +02:00
Maximilian Wolff c70f322836
[clojure] Make sayid workaround also fix duplicate key in cider
When the corrupted `elc` file is detected
`cider-jack-in-lein-plugin` has a nil value
value added already which causes `cider` to fail.

This commit removes such a row in that case.
2020-09-11 21:55:00 +02:00
Maximilian Wolff 10e997338d
[clojure] Add workaround for corrupted sayid.elc file
It seems to happen from time to time that sayid is not
properly compiled after the installation. In this case
the variable `sayid-version` is `nil` causing
nRepl to fail.

This commit tries to work around this problem by
reinstalling the package if this corruption is detected.

This normally fixes the issue described in #13906.
2020-09-11 21:34:29 +02:00
romain.gautier@nimamoh.net ba982822c6
Replace deprecated clojure-cheatsheet with helm-cider 2020-08-09 23:59:34 +02:00
John Practicalli Stevenson 5f7e56fecc [clojure] refactor namespace key bindings
Add key bindings to refactor namespace forms for existing functions in CIDER.

"ran" 'clojure-insert-ns-form
"raN" 'clojure-insert-ns-form-at-point
"run" 'clojure-update-ns
2020-07-12 21:01:57 +02:00
Shunya Ishii c54de3caa4 [clojure] Change leader key to fix warning
Fix this warning when reloading spacemacs configuration:

```
Error (use-package): cider/:init: Key sequence e p ; starts with non-prefix key e p
```
2020-05-11 09:39:15 +02:00
Didier A b5eea24926 Modified Clojure layer's major leader binding sl to be smarter and find the associated repl when in a non cider repl buffer and clear it, instead of throwing an exception, which is what it currently did. 2020-04-16 23:06:37 +02:00
John Practicalli Stevenson 587ae8ebac
[clojure] Pretty print evaluation keybindings
Show results of evaluating Clojure code in the same format they would be written
in the source code.  This is especially useful for results that are
collections and nested collections.

Pretty print results as a comment.
2020-03-27 21:02:06 +01:00
jr0cket af2d7e320e
[clojure] keybindings for browsing clojure specs
Browse a specific clojure spec or browse all specs in a project.
2020-03-12 20:54:09 +01:00
jr0cket 2a17228ef8
[clojure] Add goto end of line eval sexp
Clojure (CIDER) is missing the incredibly useful function that jumps to the end
of the line and evaluates the last s-expression.

This function is in Emacs Lisp major mode under `SPC m e $` and `SPC m e l`

The function `spacemacs/cider-eval-sexp-end-of-line` is a copy of
`lisp-state-eval-end-of-line` with the last line replaced to call the equivalent
cider function, `cider-eval-last-sexp`.

The same keybindings are added to the Clojure layer as used for elisp.

The keybindings follow the Spacemacs convention for evaluation, as defined in
https://github.com/syl20bnr/spacemacs/blob/master/doc/CONVENTIONS.org#evaluation

Resolves #4124
2020-03-01 00:14:32 +01:00
jr0cket 79842c89cf [Clojure] Sesman and missing eval / format keybindings
Added keybindings for the Sesman REPL session management commands to the Clojure
layer, following the Spacemacs keybinding conventions.
https://docs.cider.mx/cider/0.23/usage/managing_connections.html

Sesman has been a part of CIDER for many versions now and provides session
management for nREPL connections (in fact any connections).

Sesman keybinds are placed in the `SPC m c` menu, providing a cleaner separation
between sending code to the repl and session management.

See issue #12593 and PR #13140 which covers the background for the design of
these additional keybindings.

Formatting the region and defun keybinds have been added, along with formatting
for edn files.  Moved to `=` menu to match Spacemacs convention.

Evaluation up to point keybinding has also been added.

Documentation in the README has been updated to complete the description of the
existing Clojure layer, as well as including details specific to the new
keybindings.
2020-02-01 15:33:04 -05:00
syl20bnr 52d1b0f323 Revert "[clojure] Add sesman keybindings"
This breaks Spacemacs convention:
https://github.com/syl20bnr/spacemacs/blob/develop/doc/CONVENTIONS.org#repls

Need to add session management under an unused prefix, I suggest SPC m S

This reverts commit e47494229b.
2020-01-25 10:17:08 -05:00
jr0cket e47494229b [clojure] Add sesman keybindings
Add Spacemacs keybindings to the Clojure layer for all the sesman functions.

Sesman has been a part of CIDER for many versions now and provides session
management for nREPL connections (in fact any connections).

Several keybindings relating to the use of a specific repl been migrated the
`e` evaluation menu and `es` sent-to-repl-buffer sub-menu, providing a cleaner
separation between repl connection and session management and interacting with a
specific repl.

Updated layer documentation and keybindings in README.org file.
Added changes to CHANGELOG.develop

Resolves #12593
2020-01-23 11:43:38 +01:00
Didier A 58dcd6320b [clojure] Added support for joker linter and having mutliple active linters
The variable clojure-enable-linters can now be set to a list of linters:

'(clj-kondo joker)
  or
'(joker squiggly)
  or any other combination of the available linters.

In which case, all linters in the list will be active if they are
available to be. In that flycheck is configured so that each linter
in the list has as next-checker the next linter in the list.

The variable can also now be set to:

'joker

If only the newly added joker linter should be used.

This will pull down flycheck-joker and add Joker as a checker for
Clojure modes.

--

Implementation Details

The way it works is that for each Clojure linting mode, clj, cljc,
cljs and edn, a primary linter is chosen based on the order the
user specifies in clojure-enable-linters which support that mode.
It is made the primary linter for flycheck to use by being promoted
to the front of the flycheck-checkers list. All other linters specified
by the user which the mode also supports get added to it as a
next-checker.

Tested with clj-kondo, joker and squiggly. The only issue I saw was that
the way flycheck-clojure works, and the way I currently have setup the
logic for multiple checkers mean that we can't add to a mode multiple
checkers for the same linter. flycheck-clojure has eastwood, kibit and
core.typed. If you have it configured to use eastwood linter, then it
will all work, as eastwood gets added as the next-checker. But if you
have it disabled in flycheck-clojure, there won't be any
flycheck-clojure linters to activate. I'm not sure as of now how to best
support that. Ideally, we would not clubber linters into a single packge
like that, and so the layer would have instead of squiggly: eastwood,
kibit, core.typed. But that's not how flycheck-clojure works. Future
commit might be able to do something smarter about this.
2019-10-20 00:23:58 +02:00
Gia Thanh Vuong 18715b872b bind c-ret to cider-repl-newline-and-indent in repl
For evil insert mode
2019-10-19 00:32:51 +02:00
Thanh Vuong d71b0a4b87 [clojure] add c-k c-j bindings company dropdown menu in repl
Make c-j and c-k bind to down and up in company dropdown menu when it shows up
in clojure repl.
2019-09-17 13:22:09 +02:00
Dieter Komendera 578689c497 [clojure] Fix jumping backwards after cider-find-var
`cider-jump-to-var` was renamed to `cider-find-var` here:
ceb2d7df75 (diff-e39c33031dc8d3e78b32ebee83293cd6L809-R846)

In https://github.com/syl20bnr/spacemacs/pull/9792/ `spacemacs/clj-find-var`
was added to be used as the jump handler for clojure modes. It uses
`cider-find-var` which doesn't push jump positions onto the evil jump stack so
the no longer current defadvice was more apparent.
2019-09-01 01:10:29 +02:00
Luo Tianj b71c78655f add flycheck-clj-kondo as an optional package 2019-08-31 20:58:30 +02:00
Sam Hedin 62ea30b479 Add cider clojuredocs keybind, remove grimoire 2019-08-27 21:31:59 +02:00
Russell Mull b110ac09f9 Restore standard "si" binding for cider-jack-in-clj
It appears that this is still the common binding across all +lang layers.
2019-07-31 15:55:35 +02:00
John Stevenson cc43d5c898 [Clojure] keybinding spacemacs/clj-find-var
Update the existing `SPC m g g` keybinding to use the command
`spacemacs/clj-find-var`.  This makes finding a function definition a much
better experience as you dont have to have the REPL running to find a
definition, but when it is you can use a CIDER specific function.

`spacemacs/clj-find-var` is a wrapper that calls `cider-find-var` if the REPL is
running, otherwise it uses `dump-jump-go`.

Wrapper added in #9792
2019-07-13 15:12:55 +02:00
John Stevenson 8fd218f1e8 [Clojure] keybinding for updated repl jack-in commands
Latest CIDER release uses the following commands for starting the REPL from
within Emacs

`cider-jack-in-clj` to start a Clojure REPL
`cider-jack-in-clj&cljs` to start a Clojure and ClojureScript REPL
`cider-jack-in-cljs` to start a ClojureScript repl

The older aliases are deprecated and are being removed in the latest beta
release of CIDER

`cider-jack-in`
`cider-jack-in-clojurescript`

Keybindings for these jack-in commands have been updated and as there are three
options they have been moved under the repl > jack-in

The top level of the Clojure mode menu has the existing keybindings updated to
use the new commands.  A third top-level keybinding `&` has been added for
`cider-jack-in-clj&cljs`
2019-07-13 14:41:06 +02:00
duianto e12278a323 Revert "[Clojure] Keybinding require Clojure repl utils in current namespace"
This reverts commit 034ee0c311.

It was rebased with the previous commits message.
2019-07-13 14:40:44 +02:00
John Stevenson 034ee0c311 [Clojure] Keybinding require Clojure repl utils in current namespace
Although the Clojure repl utils (clojure.repl) are including in the user
namespace in Clojure projects, they are not available in your application
namespace.

The existing CIDER function cider-repl-require-repl-utils adds the Clojure
repl utils into the current namespace, so you can use functions such as doc
and source.

This is often a source of confusion for those new to Clojure / CIDER.
2019-07-13 12:50:11 +02:00
John Stevenson cd95789170 [Clojure] Keybinding require Clojure repl utils in current namespace
Although the Clojure repl utils (clojure.repl) are including in the user
namespace in Clojure projects, they are not available in your application
namespace.

The existing CIDER function cider-repl-require-repl-utils adds the Clojure
repl utils into the current namespace, so you can use functions such as doc
and source.

This is often a source of confusion for those new to Clojure / CIDER.
2019-07-13 11:52:32 +02:00
Jonathan Chen 28adf374fe feat(clojure-lang): add `cider-eval-sexp-at-point`
Adds a useful CIDER command that doesn't have an idiomatic Spacemacs command.

Ref:
https://cider.readthedocs.io/en/latest/interactive_programming/#using-cider-mode
2019-07-06 00:17:03 +02:00
John Stevenson bb34374818 Add keybinding for cider-interupt
Interrupt longer running evaluations without having to kill or reset the REPL
connection.

Placed in the evaluate section, as it is specific to the currently running
evaluation.
2019-06-13 15:27:02 +02:00
JAremko 5cc823cc0f add flycheck-clojure 2019-05-18 02:17:43 +03:00
John Stevenson 831107f478 [clojure] keybinding - cider-undef - remove symbol from current ns
Adds `SPC m e u` to the Clojure layer to call `cider-undef`, removing an
existing definition from the current namespace.

This provides a Spacemacs style keybinding for the existing Emacs style
keybinding `C-c C-u`
2019-04-20 15:26:55 +02:00
Martin Račák f85acca55d Fix post-init of parinfer in the clojure layer
Reverted clojure/post-init-parinfer back to a state before the refactor, which
introduced spacemacs|forall-clojure-modes. That macro deals with modes, not
hooks, therefore we can't use it for add-hook.
2019-04-08 18:17:22 +02:00
Ag Ibragimov 1dadfcd0e1 [clojure] Improves spacemacs-jump-handlers
jump handlers in clojure modes now correctly work
for: `, g g` `, g G` `gd` and `gD`
2019-04-07 18:22:51 +02:00
JAremko 9509cf6bcf Clojure cheatsheet is now a part of CIDER 2019-01-20 16:59:48 +02:00
duianto ee811f7b13 Unify packages list parentheses style
problem:
some layer packages lists have the open and closing parentheses on the same line
as the first and last listed package, but most seem to have them on a separate
lines.

solution:
put the open and close parentheses on separate lines, except for lists with only
a single package, they are written on the same line as the variable name and
parentheses.

fix the lists indentation
2018-11-21 21:35:38 +00:00
yuhan0 f13f99d967 Enable clojure-mode refactorings without clj-refactor
- Add clojure-mode refactorings and which-key prefixes in default layer
configuration.

- Improve discoverability of the refactoring features which are not enabled
by default. When clj-refactor is installed, "SPC mr?" runs
cljr-describe-refactoring

- Refactor out repeated dolist clauses into `forall-clojure-modes` macro
which executes body forms for all clojure derived modes, and adds missing
functionality of parinfer, fancify-symbols and evil-cleverparens to
cider-repl-mode and cider-clojure-interaction-mode.
2018-11-16 19:51:21 +00:00
Dieter Komendera 8f30ba8390
Allow to send input to the repl via RET in normal mode 2018-10-23 07:27:31 +03:00