Fork me on GitHub
#spacemacs
<
2019-09-20
>
jumar14:09:41

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)

jumar17:09:14

hmmmm, that variable is true in my setup but it doesn't work for some reason..

jumar17:09:09

At least SPC f T seems to work

jumar17:09:01

Unrelated - this looks cool

practicalli-johnny17:09:53

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

jumar18:09:26

Well, I haven't configured anything - it's enabled automatically

jumar18:09:13

(at least nothing I know about - I just fetched changes from the develop branch)

murtaza5215:09:09

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 ?

practicalli-johnny17:09:01

@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)

murtaza5217:09:37

@jr0cket I am on the develop branch. SPC h SPC brings up helm-spacemacs-help

practicalli-johnny17:09:13

which should also list all the layers... try typing javascript in the helm popup

practicalli-johnny17:09:51

where it says pattern

murtaza5218:09:16

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

practicalli-johnny18:09:41

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.

practicalli-johnny18:09:25

What settings do you have for auto-completion layer in your .spacemacs file?

practicalli-johnny18:09:47

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)

practicalli-johnny18:09:41

@murtaza52 did you install tern to get the auto-completion and documentation features npm install -g tern

murtaza5218:09:57

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.

murtaza5218:09:56

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 ?

johanatan20:09:28

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?

johanatan20:09:16

[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].

flefik20:09:55

looking at the source there doesn’t appear to be a config for it, but you can use evil-forward-WORD-xxx ?

flefik20:09:37

so maybe you just want to remap that?

flefik20:09:10

it defaults to w -> W, b -> B, e -> E etc.

johanatan20:09:10

nah, the setup i had was somewhere in between the two

johanatan20:09:26

W is a little too coarse grained for my tastes

johanatan20:09:22

but yea what i want is probably closer to W than w

flefik20:09:49

it must’ve been a custom function then

johanatan20:09:05

no, it was a reconfig of what is considered a token for that function's purpose

johanatan20:09:12

like a map tweak

johanatan20:09:50

here's the code that i copied several years ago to pull it off

johanatan20:09:53

(if nil (with-eval-after-load 'clojure-mode
            (dolist (c (string-to-list ":_-?!#*"))
              (modify-syntax-entry c "w" clojure-mode-syntax-table ))))

johanatan20:09:12

i had pulled it from a blog post somewhere

johanatan20:09:22

but for some reason, it stopped working in the last month or two

flefik20:09:22

could it be in thing-at-point?

johanatan20:09:38

what do you mean?

flefik20:09:36

something like this?

johanatan20:09:03

that looks like another way to achieve it yes. but i am asking about the code that i pasted above

johanatan20:09:33

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...

flefik20:09:44

ah yes, that’s what evils forward word is using under the hood

flefik20:09:50

it uses thing at point which uses that syntax table

johanatan20:09:17

so do you see why my code above to modify the syntax table would have suddenly stopped working in the last couple of months?

flefik20:09:44

im not great at elisp

flefik20:09:54

but (if nil looks suspicious

johanatan21:09:01

oh, wow. haha

johanatan21:09:03

you're right.

johanatan21:09:11

i think i commented it out because it started acting funky

johanatan21:09:22

oh, that's right. it was getting "stuck"

johanatan21:09:33

like a 'w' would just not move the cursor any further in the file

flefik21:09:31

was that it?

flefik21:09:10

that works for me.

flefik21:09:39

gonna stick this in my user-config, thanks

johanatan21:09:56

i haven't tried it yet but let me give it another try

johanatan21:09:06

could have been something else at the time that was conflicting with it

flefik21:09:14

i deleted the trailing space too, but that shouldnt matter

johanatan21:09:29

glad i could be of assistance lol

johanatan21:09:34

nope, still doesn't work for me

johanatan21:09:39

gets stuck at the ends of lines

johanatan21:09:04

must be bad interaction with something else i have going on

flefik21:09:10

im not seeing that

johanatan21:09:41

wanna see my whole .spacemacs file?

flefik21:09:25

if you drop it here i can take a look tomorrow

flefik21:09:29

have to go to sleep now 😞

flefik21:09:55

Try commenting this out

flefik21:09:57

(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))))

flefik21:09:59

looks related

flefik21:09:17

good night!

johanatan21:09:15

Those are just free functions

johanatan21:09:29

They’re not invoked except explicitly by meta-x.

johanatan21:09:36

Good night!

flefik11:09:52

Did you figure it out?

ag21:09:21

@johanatan https://clojurians.slack.com/archives/C09C8GRLY/p1569012833061100?thread_ts=1569010396.058500&amp;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)

johanatan21:09:16

@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 )))
?

ag21:09:57

hmm… actually you’re right. I wasn’t paying attention. Yeah, this way should work and it’s better

ag21:09:58

however, I just found that there’s also clojurescript-mode-syntax-table

johanatan21:09:13

yea, i could add that one but i don't think it will help my "getting stuck at end of line" problem

johanatan21:09:22

although perhaps it would since i am in fact in cljs at the moment

ag21:09:42

you mean it’s getting “stuck” at the end of sexp? at closing paren or bracket?

johanatan05:09:42

seems to be almost any line actually.

Mario C.23:09:46

I upgraded my packages and now spacemacs freezes when I connect to a repl

Mario C.23:09:07

maybe i shouldn't have upgraded all 150 packages

Mario C.23:09:57

The moment I get the Direct connection to localhost established message and I type anything it freezes.

Mario C.23:09:09

using CIDER 22.3