Fork me on GitHub
#spacemacs
<
2017-10-18
>
practicalli-johnny10:10:13

@paulspencerwilliams for indenting of javascript, & css its recommended to use a a hook for the specific mode, in this case it would be web-mode-hook. Here is an example of the code I put in dotspacemacs/user-config section of .spacemacs

;; Changing auto indent size for languages in html layer (web mode) to 2 (defaults to 4)
  (defun jr0cket-web-mode-indent-hook ()
    "Indent settings for languages in Web mode, markup=html, css=css, code=javascript/php/etc."
    (setq web-mode-markup-indent-offset 2)
    (setq web-mode-css-indent-offset  2)
    (setq web-mode-code-indent-offset 2))

  (add-hook 'web-mode-hook  'jr0cket-web-mode-indent-hook)

practicalli-johnny10:10:51

I have not looked at syntax highlighting for javascript. For css highlighting I added the colours layer which will highlight any colour hex numbers you have in your css styles in the colour they represent

paulspencerwilliams11:10:12

Cheers @jr0cket, I’ll apply that and see how it reflects again react-mode. I’ve still not quite got the major / minor mode deferences clear in my mind. What’s particularly confusing is that loading up my JS React project, Spacemac defaults to react, but refused to work well with embedded JSX, but by doing a M-x js2-jsx-mode followed by a M-x react-mode thus switching back to react-mode gives be a workable environment. I would expect switching modes, and back again would equate to a no-op, but apparently not 😉

practicalli-johnny14:10:23

Emacs has only one major mode active at a time, often these major modes named after the programing language you are using or things like org-mode and magit version control. To add common features in different major modes you can add lots of minor modes. For example, flycheck for spelling.

practicalli-johnny14:10:43

The major mode should have the syntax highlighting, formatting rules, etc built in. Along with a menu of all the functions specific to that mode. This can be quite extensive, for example the Clojure major mode includes CIDER and several other Emacs projects. Then you have things like autocomplete as a minor mode. Does that make sense ??

pesterhazy13:10:03

Is there a way to see the "dirty" files in your repository/current project? I often find myself hunting for the location where I made unstaged changes.

eggsyntax13:10:26

@pesterhazy magit-status (`SPC g s` by default)

jumar13:10:34

yes, that's the best think I can imagine. you can use TAB to expand/collapse the changes for quick review (better to go through some quick magit tutorial)

eggsyntax13:10:09

Assuming you've got git in your dotspacemacs-configuration-layers, that is.

eggsyntax13:10:16

If not, I recommend it 🙂

pesterhazy13:10:23

@eggsyntax that's ... pretty much what I was looking for

jeff.terrell19:10:34

Careful, magit might change your life… simple_smile

ag20:10:59

yup - I confirm. "magit" and "org-mode" have ruined my life - I am now forever stuck in the Emacsland.

practicalli-johnny22:10:37

Or being elevated to a higher plane of existence as I like to call it :)