Closed czhang03 closed 7 years ago
If you don't like Dired (that's what you're seeing), you can use one of the other file browsers: Deer, Ranger or Neotree.
Sorry, I am not familiar with this, can you tell me how do I change the default file explore to Neotree?
Sorry, I'm kind of busy. There's plenty of documentation available - both in the Spacemacs documentation and in other places.
Thank you! I will check it out.
If it's a project I have already opened before I use SPC p p
so I can get a Helm Projectile buffer instantly.
Neotree is also quite useful if you want to have IDE like tree structures. You can call it with SPC p t
for a project or SPC f t
to open it for a generic file.
yes, but what I want is like in vim, when I type:
vim .
it opens nerdtree next to a empty buffer. but when I do
emacs .
it opens dired
Just a quick thing that I wrote, no guarantees that it will work consistently: (in fact it throws some error but still seems to do enough of the job)
;; based on neotree-show
(defun my-neotree-dir (dir)
(let ((cw (selected-window))) ;; save current window
(neotree-find dir)
(neo-global--select-window)
(selected-window cw)
(neo-global--get-buffer))
(add-to-list 'find-directory-functions 'my-neotree-dir)
This can be improved to get a proper solution.
Shall we close this? Or at least modify the title / question to reflect what is being asked in this thread?
I'm finding that I have a similar frustration with projects (and I realize this widely varies for each individual) but It'd (that's a word right?) be nice if there were some way to auto-add all project dirs under a given dir (so any dir with a .gitconfig
for example). VSCode has a really awesome plugin someone wrote here https://github.com/alefragnani/vscode-project-manager (look for Automatic Detection of Projects
) - that's exactly what I'm after (and perhaps OP?)
@kevindashgit I had a look at the VC plugin and for me this looks pretty similiar to SPC p p
to switch between projekts. This shows a helm buffer, which is an intelligent fussy search, of all projects spacemacs knows about. By selecting one you can either decide to open a folder which opens your emacs file manager or a file you want to work with.
A project is either a git repo or a folder containing a .projectile file.
This is even better than what VScode does as you do not need to maintain any json files for this.
thank you for your reply @smile13241324
This shows a helm buffer, which is an intelligent fussy search, of all projects spacemacs knows about.
The operative phrase "all projects spacemacs knows about".
By selecting one you can either decide to open a folder which opens your emacs file manager or a file you want to work with.
I think I lost you - I have numerous projects sitting at my home dir ~/
that I'd love for SPC p p
to pick up - but it doesn't show up - even if I enter the full path? Am I doing something wrong? How do I open the project (without like opening an empty buffer or having to select a specific file etc... like is there an "auto detection" of projects in a directory)? I feel dumb for asking that but its not obvious to me at all!
@kevindashgit hmm when you do not see your projects with SPC p p
it means that emacs do not know about these. When you open a file in a directoy which contains a git repository or a file named .projectile
, the emacs package projectile
remembers whether that file is part of a project folder and adds an entry in your cache folder within your .emacs.d
.
Next time you call helm-projectile-switch-project
, this is what is bound at SPC p p
, should show you a list of all the project folders you have in a helm buffer where you can select a project and then filter for files in there.
[...] and adds an entry in your cache folder within your .emacs.d.
oh? I'll poke around and see if I can figure out where within that directory its sticking these "known projects." Maybe I can automate something myself.
@kevindashgit would love to see what you come up with - i have a similar frustration
Soooooo I've decided spacemacs was not for me (too slow and buggy unfortunately - and I'm much faster with vanilla vim + tmux).
Its still a bit of a work in progress - but I decided to go with this (note: some prereqs: vim rooter, and fzf)
" list all directories in ~ that contain a package.json
function! s:listpkgs()
call fzf#run(fzf#wrap({'source':'find /Users/kevindashgit/. -maxdepth 2 -name package.json -print0 | xargs -0 -n1 dirname | sort --unique', 'sink': 'tabedit'}))
endfunction
" open a project in a new split
nnoremap <silent><leader>p :call <sid>listpkgs()<cr>
Although this works - its still not satisfying enough for me. I think I might spend some more time with tmux instead (perhaps even using something like the above but instead open a new tmux window per project)
I personally find C-x + d more pleasing. It opens a dired buffer in current directory
I personally find C-x + d more pleasing. It opens a dired buffer in current directory
Just to add to that: I believe in evil mode, by default (?) -
is bound to dired-jump
to do just that. (I remember this binding being either a default or common practice in Vim configs.)
I tried to use
SPC-f-f
but it just pure ugly...what is the best way to open a project in specemacs?