This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-09-20
Channels
- # announcements (5)
- # beginners (37)
- # calva (3)
- # cider (23)
- # clojure (98)
- # clojure-dev (16)
- # clojure-europe (5)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-spec (7)
- # clojure-uk (52)
- # clojurescript (14)
- # cursive (15)
- # data-science (1)
- # datomic (20)
- # emacs (7)
- # flambo (2)
- # fulcro (10)
- # jackdaw (1)
- # jobs (3)
- # joker (2)
- # juxt (3)
- # keechma (3)
- # leiningen (8)
- # luminus (3)
- # music (1)
- # off-topic (83)
- # pathom (19)
- # re-frame (19)
- # reitit (4)
- # shadow-cljs (76)
- # spacemacs (95)
- # tools-deps (16)
I recently updated my spacemacs (develop branch) and now I got a different tree viewer - Treemacs instead of Neotree. Is it possible to "synchronize" the tree with the current buffer?
Before it would select the current buffer in the tree automatically after pressing SPC p t
now it just (it seems) stays at the last position.
Btw. I often have multiple projects/layouts open at the same time (not sure if that can affect it)
For me it works out of the box, when the project is present in treemacs. https://github.com/syl20bnr/spacemacs/blob/develop/layers/+filetree/treemacs/README.org#follow-mode
I assume you replaced neotree
with treemacs
in the dotspacemacs/layers
section of your .spacemacs
file.
Maybe it just needs Emacs to be restarted for treemacs
to start working correctly
I enabled the javascript layer on the spacemacs, however I dont see documentation (SPC m h - in other layers) - is there a way to enable / add it ?
@murtaza52 On the Spacemacs develop
branch the JavaScript layer docs are there under SPC h SPC
and selecting javascript
in the layer list. If you are on Spacemacs master
then perhaps you found a bug or something missing (sorry, I havent used Spacemacs master
for several years)
You could always read the javascrtipt docs online http://spacemacs.org/layers/+lang/javascript/README.html
or if you are using develop
then they are here http://develop.spacemacs.org/layers/+lang/javascript/README.html
which should also list all the layers... try typing javascript
in the helm popup
where it says pattern
typing in javascript
brings up the documentation for the javascript layer.
However I would like to see docs for js functions ex [1,2].unshift()
, I would like to see the doc for unshift
Ah, you mean the auto-completion documentation. If auto-completion already works for other languages, it should just work for JavaScript too (assuming its supported). You shouldnt need to configure anything, unless something is broken.
What settings do you have for auto-completion layer in your .spacemacs
file?
I have this in dotspacemacs/layers
(auto-completion :variables
auto-completion-enable-help-tooltip t
auto-completion-enable-snippets-in-popup t
auto-completion-enable-sort-by-usage t)
;; To have auto-completion on as soon as you start typing
;; (auto-completion :variables auto-completion-idle-delay nil)
@murtaza52 did you install tern to get the auto-completion and documentation features
npm install -g tern
yup have installed tern, and auto complete is working, however documentation is not. I am not even sure if the documentation feature is there bcoz neither do I see it in the shortcuts or in the docs on the webpage.
This is what I am trying to do - in clojure if I write repeat
and then SPC m h
, it will show me the docs for that fn. Can I get similar docs for js functions ?
hi, at one point, i had my emacs clojure mode to consider full clojure tokens as a "word" from vi perspective. i seem to have somehow lost that (even though the code for it is still in my .spacemacs). does anybody else have this enhancement currently working?
[it would consider things like :a-keyword
or aCamelCasedWord
or a_snake_cased_word
a full-word for the purposes of the evil-forward-word-xxx
and evil-backward-word-xxx
functions].
looking at the source there doesn’t appear to be a config for it, but you can use evil-forward-WORD-xxx ?
(if nil (with-eval-after-load 'clojure-mode
(dolist (c (string-to-list ":_-?!#*"))
(modify-syntax-entry c "w" clojure-mode-syntax-table ))))
that looks like another way to achieve it yes. but i am asking about the code that i pasted above
no need to switch approaches entirely especially when one approach has worked for literally 5 years and probably just needs a tweak to stay current with other changes...
so do you see why my code above to modify the syntax table would have suddenly stopped working in the last couple of months?
(defun delete-sexp ()
(interactive)
(delete-region (point) (save-excursion (forward-sexp) (point))))
(defun delete-file-form-at (filename line column)
(do-file-action-at filename line column 'delete-sexp))
(defun symbol-at-point ()
(interactive)
(message (thing-at-point 'symbol 'no-properties)))
(defun list-at-point ()
(interactive)
(message (thing-at-point 'list 'no-properties)))
(defun sexp-at-point ()
(interactive)
(message (thing-at-point 'sexp 'no-properties)))
(defun word-at-point ()
(interactive)
(message (thing-at-point 'word 'no-properties)))
(defun sentence-at-point ()
(interactive)
(message (thing-at-point 'sentence 'no-properties)))
(defun skip-whitespace ()
(skip-chars-forward " \t\n"))
(defun next-thing (thing)
(save-excursion
(evil-forward-word-begin)
(thing-at-point thing 'no-properties)))
(defun sexp-word-at-point? (brace word)
(let ((nxt-sexp (next-thing 'sexp)))
(and (string-prefix-p brace (thing-at-point 'sexp 'no-properties))
(string= nxt-sexp word))))
@johanatan https://clojurians.slack.com/archives/C09C8GRLY/p1569012833061100?thread_ts=1569010396.058500&cid=C09C8GRLY that might not be enough, you may want to consider something like:
(defun clojure--hyphens-in-words () (modify-syntax-entry ?- "_-?!#*"))
(add-hook 'clojure-mode-hook #'clojure--hyphens-in-words)
(add-hook 'clojurescript-mode-hook #'clojure--hyphens-in-words)
(add-hook 'clojurec-mode-hook #'clojure--hyphens-in-words)
@ag is that substantially different from:
(with-eval-after-load 'clojure-mode
(dolist (c (string-to-list ":_-?!#*"))
(modify-syntax-entry c "w" clojure-mode-syntax-table )))
?hmm… actually you’re right. I wasn’t paying attention. Yeah, this way should work and it’s better
yea, i could add that one but i don't think it will help my "getting stuck at end of line" problem