Vertical Split in spacemacs like emacs - emacs

I would like to open two windows in spacemacs side by side like I used to do in vanilla emacs with the following line in my .emacs file:
(add-hook 'emacs-startup-hook '2-windows-vertical-to-horizontal)
and from the terminal
emacs file1 file2
The spacemacs library was suggested to me, and I think I dig it but I cannot for the life of me figure out how to replicate this functionality in the .spacemacs file
what do I need to add and where does it need to go so that I can have my preferred configuration back?

put (add-hook 'emacs-startup-hook '2-windows-vertical-to-horizontal)in
dotspacemacs/user-config in your .spacemacs file.it will work as you expect

Related

how to open ede projects after closing emacs

I've tried to find an answer to this specific question but had no luck. Or maybe I'm simply asking the wrong question.
To keep it simple: I follow the emacs' EDE Quick Start guide. Everything flows just fine and I get the expected results.
The problem arises when i close emacs and try to open the project again.
At that point I get the infamous "Corrupt object on disk" error.
I see it can be used another kind of project (ede-cpp-root-project) but it lacks all basic functionalities that should be hand-made, but that's not what I'm interested in. I would like to use ede-proj-project.
I'm interested in understanding why this happens. Why I can't open a project that worked just fine before closing emacs? What's changed just by closing emacs?
Am I missing something?
FYI: If it is useful information, I'm using emacs version 25.3.1 but I've tried few other earlier versions with the same result.
PS: As you can probably tell, I'm not really skilled so, please, forgive me if it is an annoying question.
I had the same problem.
Copy this into your .emacs startup configuration file
(require 'cedet)
(require 'eieio)
(require 'eieio-speedbar)
(require 'eieio-opt)
(require 'eieio-base)
(require 'ede/source)
(require 'ede/base)
(require 'ede/auto)
(require 'ede/proj)
(require 'ede/proj-archive)
(require 'ede/proj-aux)
(require 'ede/proj-comp)
(require 'ede/proj-elisp)
(require 'ede/proj-info)
(require 'ede/proj-misc)
(require 'ede/proj-obj)
(require 'ede/proj-prog)
(require 'ede/proj-scheme)
(require 'ede/proj-shared)
I found the solution here:
https://emacs.stackexchange.com/questions/17950/ede-load-project
which lead to CEDE project:
https://www.emacswiki.org/emacs/CEDET_Quickstart
It worked for me. - GNU Emacs 25.2.2

How to run jshint in emacs web-mode?

As stated on the web-mode.org page, since May 2014 web-mode supports jshint.
I've been using jshint in js-mode, for which purpose I installed flycheck and added the following setting to the .emacs file:
(require 'flycheck)
(add-hook 'js-mode-hook
(lambda () (flycheck-mode t)))
I would also like to make jshint work in web-mode, but failed to do so. Here’s what I tried:
open .js file
M-x web-mode
M-x web-mode-jshint
M-x flycheck
But no luck. Could you please suggest how to make jshint work in emacs's web-mode?
UPDATE: fxbois pointed out below that the only command that needs to be executed is
M-x web-mode-jshint. This works on regular .js files, but does not work on .js.erb files (which are recognized by the regular web-mode). So the next part of my question is, does anybody know how to make web-mode-jshint work with .js.erb files?
You should only have to execute M-x web-mode-jshint
(of course, jshint should be installed)
I just ran into this in the past 20 minutes and found that web-mode-jshint does not run automatically, use C-c C-j to evaluate the buffer manually. I am still searching for a way to run the evaluation automatically.
(IMO) It is unfortunate that web-mode-jshint does not integrate existing jshint solutions, e.g. flycheck, but implements its own highlighting.

python-mode-hook not working as I'd expect

I'm trying to tweak my emacs configuration to treat _ as a word character.
I've added (add-hook 'python-mode-hook #'(lambda () (modify-syntax-entry ?_ "w"))) to my .emacs file, but it doesn't seem to work.
If I execute (modify-syntax-entry ?_ "w") directly in the mini-buffer, then it starts working.
I'm guessing that one of my minor modes may be changing the syntax table back.
I'm relatively new to emacs. How do I go about tracking down the source of the problem?
I had the mode hook in my ~/.emacs.d/el-get-init-files/init-python-mode.el. I put a call to (message "FOO BAR") in the file and noticed it wasn't being loaded on startup.
Looks like el-get only loads files from the el-get-init-files directory for packages it has installed. Since python mode comes with emacs, and wasn't installed via el-get, my python init files wasn't being loaded.
I moved the mode hook into my .emacs files and it started working right away!

EMACS mumamo/nxhtml mode is overriding js2-mode for js files

How do you choose which files mumamo loads on? It is now the default for all files despite what I have in my .emacs file.
I'd like to use js2-mode when it's a js file, mumamo if it's html/php/etc.
I suggest that you contact the author, Lennart Borgman, directly. He is usually quite helpful.
It worked for me when I added the following lines in my .emacs:
;; js2-mode configuration
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
;; because nxhtml-mode forces loading .js files with javascript-mode
(defalias 'javascript-mode 'js2-mode)

Can't make Yasnippets work in Emacs, help!

I can't make Yasnippets work (normal version).
When I start Emacs it says:
error: Error ~/.emacs.d/plugins/yasnippet-0.6.1c/snippets/ not a directory
I added this to my .emacs file:
(add-to-list 'load-path
"~/.emacs.d/plugins/yasnippet-0.6.1c")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "~/.emacs.d/plugins/yasnippet-0.6.1c/snippets/")
and my yasnippets files are placed in the following folders:
D:\Program Files\emacs-23.1\site-lisp\plugins\yasnippet-0.6.1c
and the snippets:
D:\Program Files\emacs-23.1\site-lisp\plugins\yasnippet-0.6.1c\snippets
All others plugins work so I'm sure its the right load-path
Help!
Perhaps you could write the whole path, instead of a relative one, like this:
add-to-list 'load-path
"D:/Program Files/emacs-23.1/site-lisp/plugins/yasnippet-0.6.1c")
(require 'yasnippet) ;; not yasnippet-bundle
(yas/initialize)
(yas/load-directory "D:/Program Files/emacs-23.1/site-lisp/plugins/yasnippet-0.6.1c/snippets")
Notice the forward slashes, and please make sure that emacs doesn't mind the spaces... Windows is less forgiving than Linux with these kinds of paths. Also, make sure your emacs install reads that dir. Usually, you should put an emacs dir where your .emacs is (in Windows), that makes it more clear. It
Another thing: 1) maybe you're trying your snippet in the wrong mode. Make sure there is a snippet for the mode you're in.
See here as well, lots of info here: GNU Emacs for Windows