Working with Projects

  • Projectile
  • Navigating with Buffers
  • Visual file manager with NeoTree

You can navigate the directories of your project using find files, as we have seen with opening a file. This works well when adding individual files as you work on them. You can then switch between these files using buffer commands, SPC b

Spacemacs - Buffer menu

File, Buffer and Project menus

Spacemacs gives you several options for managing the files in your project and you will use commands from the following menus

  • File
  • Buffer
  • Project

When starting a new project, you can use the File menu to open a file from the project, eg. project.clj. Once one file is open from a project you can use the Project menu to open a file, SPC p f or switch to the buffer of other file, SPC p b.

When you want to switch to an already open file outside the project you can use the Buffer menu, SPC b b.

If you want to open a file outside of the current project, then use the File menu to find the file, SPC f f.

When creating a new file, use the File Find command, SPC f f and enter the full path and name of the new file. You are prompted to confirm that you want a new file created.

NeoTree: a visual file browser

If you prefer to use a visual browser, like an operating system file browser, you can use NeoTree.

Classic Emacs file management

  • dird

Projectile

Projectile is a project interaction library for Emacs. Its goal is to provide a nice set of features operating on a project level without introducing external dependencies (when feasible). For instance - finding project files has a portable implementation written in pure Emacs Lisp without the use of GNU find (but for performance sake an indexing mechanism backed by external commands exists as well).

Projectile tries to be practical - portability is great, but if some external tools could speed up some task substantially and the tools are available, Projectile will leverage them.

This library provides easy project management and navigation. The concept of a project is pretty basic - just a folder containing special file. Currently git, mercurial, darcs and bazaar repos are considered projects by default. So are lein, maven, sbt, scons, rebar and bundler projects. If you want to mark a folder manually as a project just create an empty .projectile file in it. Some of Projectile's features:

  • jump to a file in project
  • jump to files at point in project
  • jump to a directory in project
  • jump to a file in a directory
  • jump to a project buffer
  • jump to a test in project
  • toggle between files with same names but different extensions (e.g. .h <-> .c/.cpp, Gemfile <-> Gemfile.lock)
  • toggle between code and its test (e.g. main.service.js <-> main.service.spec.js)
  • jump to recently visited files in the project
  • switch between projects you have worked on
  • kill all project buffers
  • replace in project
  • multi-occur in project buffers
  • grep in project
  • regenerate project etags or gtags (requires ggtags).
  • visit project in dired
  • run make in a project with a single key chord
  • check for dirty repositories

results matching ""

    No results matching ""