0

I want to open a few (or at least one) .org file(s) upon starting spacemacs and I can not achieve this. I suspect it would be the same lisp code for spacemacs and emacs.

Thus far I found this little snippet (find-file "~/todo.org") from this blog post

but it doesn't work when I put it down in the end of my .spacemacs file. I'm not sure if I should put it in init.el file because I think part of spacemacs philosophy is to just add everything to the .spacemacs file to make it easy.

Rorschach
  • 31,301
  • 5
  • 78
  • 129
karrot42
  • 13
  • 2
  • Define "doesn't work". – Drew Jun 09 '19 at 14:10
  • when I launch spacemacs it doesn't automatically open the ~/todo.org file – karrot42 Jun 09 '19 at 17:25
  • So you actually use `(find-file "~/todo.org")` at the end of your init file? Are you sure there is no buffer for that file, perhaps not displayed? What happens if you put *only* that in your init file? If it works in that case then bisect your init file to find the culprit. – Drew Jun 09 '19 at 18:56
  • @Drew "Are you sure there is no buffer for that file, perhaps not displayed?" This is the correct answer. I expected spacemacs to start with that file open, but it actually just starts at a splash screen and once I open another buffer, the ~/todo.org buffer is there.@Drew "Are you sure there is no buffer for that file, perhaps not displayed?" This is the correct answer. I expected spacemacs to start with that file open, but it actually just starts at a splash screen and once I open another buffer, the ~/todo.org buffer is there. – karrot42 Jun 10 '19 at 06:29

2 Answers2

0

Are you sure there is no buffer for that file, perhaps not displayed? (From your comment the answer to this is that the buffer is present but not displayed.)

Try with an init file that has only that find-file expression. If that works (displays the file buffer) then ensure that you put that expression last in your init file.

If that simple change (putting the sexp last) doesn't (also) work then bisect your init file to find out what other code there is interfering.

Drew
  • 29,895
  • 7
  • 74
  • 104
0

You should add (find-file "your-file") inside the function dotspacemacs/user-config. Try adding it as the last line in the function (I tested it here and it worked).

To find the "correct" init.el file use the command SPC f e d (or M-x spacemacs/find-dotfile).

nonDucor
  • 2,057
  • 12
  • 17