This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-22
Channels
- # aws (1)
- # beginners (102)
- # boot (5)
- # cljs-dev (59)
- # cljsjs (1)
- # clojure (154)
- # clojure-australia (1)
- # clojure-brasil (1)
- # clojure-dusseldorf (4)
- # clojure-greece (36)
- # clojure-italy (10)
- # clojure-poland (5)
- # clojure-romania (1)
- # clojure-russia (7)
- # clojure-spec (32)
- # clojure-uk (113)
- # clojure-ukraine (3)
- # clojurescript (107)
- # cursive (13)
- # data-science (25)
- # datomic (23)
- # emacs (3)
- # events (1)
- # fulcro (72)
- # funcool (10)
- # graphql (1)
- # leiningen (1)
- # luminus (2)
- # lumo (38)
- # off-topic (14)
- # onyx (78)
- # planck (4)
- # re-frame (55)
- # reagent (1)
- # ring (3)
- # ring-swagger (2)
- # rum (19)
- # shadow-cljs (89)
- # spacemacs (101)
- # sql (2)
- # unrepl (88)
I made a new file that ended with .cljs, but when I opened the file I was in fundamental mode not clojurescript mode, so I don't get any coloring, bracket matching, etc. How do I change the mode? Why didn't it automatically go into the appropriate mode in the first place?
Hello developers, i have now been using spacemacs for my clojure development since last 4 months but there is one feature which i am still not able to configure. That is auto-complete for inbuilt library functions, eg. when i type fil then it should already suggest me filter or any other functions available for it Currently i have installed auto-completion layer in my spacemacs and set (global-company-mode t) which enables dumb auto-complete everywhere that is now when i type anything if that function or variable name is used previously only then it will suggest me, its not smart. I have did alot of research and read ac-cider gives it but it shows now its depricated and i am not able to configure it in my spacemacs. I have been stuggling for this since long now and i am pretty sure someone might have configured this in there setup can anyone help me out.??
(spacemacs/add-flycheck-hook 'clojure-mode)
(eval-after-load 'clojure-mode '(sayid-setup-package))
i think that might be the issue i am not connected to any repl currently as doing an cljs project
just to mention but cljs also provides a repl
yes, I got the auto complete even with basic clojure repl (although I can't eval buffer without proper cljs repl)
I don't do much cljs work, but I usually use figwheel and when I run
(use 'figwheel-sidecar.repl-api)
(start-figwheel!)
(cljs-repl)
It works completelyi usually do an lein figwheel where i get a cljs repl but i dont connect it in my spacemacs.
I also tried to run lein figwheel
externally and then connect to the figwheel repl server via cider-connect
but in that case auto-complete doesn't work (I guess it doesn't work in figwheel repl either)
yes, it should - I associated the buffer with completely unrelated clojure project repl and basic clojure autocomplete works
do you mind sharing your .spacemacs? i will move my .spacemacs to backup and maybe try urs
you obviously have problem with the basic auto complete.
I'd suggest to experiment on a very basic clojure project.
How do you run the repl?
Did you run it through cider-jack-in
?
(global-company-mode t) (add-hook 'clojure-mode-hook 'linum-mode) (add-hook 'clojure-mode-hook 'paredit-mode) (spacemacs/add-flycheck-hook 'clojure-mode) (add-hook 'clojure-mode-hook 'show-paren-mode) (global-visual-line-mode t)
when I run it in terminal it doesn't work for me either. Why don't run it with cider itself?
(I guess, there are some crucial config/dependencies missing that cider will inject automatically)
it used to be the case that you had to add cider-nrepl
& company to your profiles.clj but everything is injected automatically by cider now
and just opened it now creating a local repl and will try to connect it in spacemacs and then tell you in a min
ivy auto-completion better-defaults emacs-lisp git markdown (org :variables org-enable-github-support t) sql nginx javascript yaml html csv clojure (shell :variables shell-default-height 30 shell-default-position 'bottom) spell-checking syntax-checking
if that's of any use for you, then here's my (almost complete) user-config
;; of Emacs functions like `get-buffer-window`
(setq source-directory "/Users/jumar/workspace/emacs/emacs-sources/emacs-25.2")
;; for some reason setting source-directory didn't help Spacemacs to find proper sources
;; although it should:
(setq find-function-C-source-directory "/Users/jumar/workspace/emacs/emacs-sources/emacs-25.2/src")
;; set indent level to 2 for pascal (default is 3) since this is the standard indentation
;; suggested by coding style
(setq pascal-indent-level 2)
;; web mode indentation is 2 spaces - HTML, CSS, JavaScript
(setq js2-basic-offset 2)
(setq js-indent-level 2)
(setq css-indent-offset 2)
(setq web-mode-markup-indent-offset 2)
(setq web-mode-css-indent-offset 2)
(setq web-mode-code-indent-offset 2)
(setq web-mode-attr-indent-offset 2)
;; skewer for live editing HTML, CSS, JavaScript
;; ?
;; (skewer-setup)
(add-hook 'js2-mode-hook 'skewer-mode)
(add-hook 'css-mode-hook 'skewer-css-mode)
;; this is different from standard `html-mode-hook` used by `skewer-setup` by default
(add-hook 'web-mode-hook 'skewer-html-mode)
;;; CIDER
;; cider pretty print to avoid large strings freeze the REPL
;; check
;; you can also use M-x cider-repl-toggle-pretty-printing RET
(setq cider-repl-use-pretty-printing t)
;; save history to file:
(setq cider-repl-wrap-history t)
(setq cider-repl-history-size 1000)
(setq cider-repl-history-file "~/.cider-repl-history")
;; cider debugger - greater output length; default is 10
(setq cider-debug-print-length 30)
;; eclim for java code completion:
eclim-executable "~/tools/java/eclipse/Eclipse.app/Contents/Eclipse/eclim"
eclimd-executable "~/tools/java/eclipse/Eclipse.app/Contents/Eclipse/eclimd")
;; clojure syntax checking using flycheck-joker:
(require 'flycheck-joker)
(spacemacs/add-flycheck-hook 'clojure-mode)
(spacemacs/add-flycheck-hook 'clojurescript-mode)
;; and
;; (eval-after-load 'flycheck '(flycheck-clojure-setup))
;; (add-hook 'after-init-hook #'global-flycheck-mode)
;; sayid tracing support:
(eval-after-load 'clojure-mode '(sayid-setup-package))
;; java class files diassembler
;; without this, automatic disassembling doesn't work
(require 'autodisass-java-bytecode)
;;; projectile
;; automatically create test file if it's missing
(setq projectile-create-missing-test-files t)
and here are my layers
(
graphviz
nginx
haskell
csv
asciidoc
yaml
python
javascript
php
sql
html
markdown
clojure
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press <SPC f e R> (Vim style) or
;; <M-m f e R> (Emacs style) to install them.
;; ----------------------------------------------------------------
helm
auto-completion
better-defaults
emacs-lisp
git
github
;; org
shell
;; (shell :variables
;; shell-default-height 30
;; shell-default-position 'bottom)
;; spell-checking
;; version-control
;; my custom layers
syntax-checking
java
;; django-web-mode for Selmer templates:
django
;; for integration with Dash documentation tool:
dash
;; nice REST client - see
restclient
;; ranger layer - alternative to dired mode
ranger
)
omg. sorry, than the last tip I can give you is to try fresh spacemacs installation and add only the auto-completion layer and see how this works.
just last thing can you share a screenshot of you minor modes when you are in clojure file
can't see much there.
btw. I'm not even sure if auto-completion
is required for the thing you want. I remember I had to install it to get proper expansion on TAB
@eggsyntax and @chris here’s a nice gist with a bunch of keybindings: https://gist.github.com/robphoenix/9e4db767ab5c912fb558
@sam16 you can start a clojure repl from within Spacemacs using clojure-jack-in
or clojurescript repl using clojurescript-jack-in
(this starts both a clojure & clojurescript repl). You should only need the clojure layer for this to work, no hooks required. Adding the autocomplete layer will automatically give you autocomplete (usually need to restart emacs after adding this layer)
My .spacemacs
configuration is at: https://gist.github.com/jr0cket/53cb480eba71fa9867adeb8db712393c
Also, create a simple project to test your Spacemacs setup, eg. lein new figwheel hello-world
.