Skip to content

Instantly share code, notes, and snippets.

@JuanCaicedo
Last active June 18, 2018 19:02
Show Gist options
  • Save JuanCaicedo/04c9341783b65f8ac73b to your computer and use it in GitHub Desktop.
Save JuanCaicedo/04c9341783b65f8ac73b to your computer and use it in GitHub Desktop.
Questions I've had while learning spacemacs

Questions

  • How do you navigate around directories?
    • Open tree view in files neotree
      • Shortcuts for neotree in evilmode in the docs
      • Using search (/) can be super useful to move around quickly
    • Use SPC p D to open the project root in Dired, and use SPC f j to jump to the Dired buffer corresponding to current buffer.
      • Dired shortcuts
        • copy C
        • rename R
        • delete D
        • compress Z files
        • create directories +
        • mark m
        • unmark u
        • refresh g
  • How do you add syntax highlighting for new languages?
    • You can add that language into the languages list in .spacemacs
  • How do you make new folders?
    • You can call into the terminal (SPC !) and run mkdir.
    • SPC : make-directory RET dirname RET
  • How do you make new files?
    • You can call into the terminal (SPC !) and run touch.
  • How to view all buffers?
    • There is an emacs shortcut to do it, C-x C-b
    • SPC b b
    • add the ibuffer layer and then SPC b B
  • Split tabs?
    • In the space windows commands there's a command for split right
  • Move between tabs?
    • Same as above (SPC w h/l)
  • How to access projects easily?
  • Why does evil mode's gg and G not work in normal navigation?
  • How do you cycle through matches in a search?
    • Once you perform a search using / you can use n/N for going to next/previous match.
  • How do you change indentation for a language (javascript 2 spaces)? For only the current file (specific project needs 6)?
    • To change javascript indentation
    • For project-specific indentation configuration, you can use .dir-locals.el (or .dir-locals*.el in Emacs 25 or later).
    • For file-specific indentation, you can use file variables
  • What's a normal startup time for Spacemacs?
  • How to do a text search in directory (similar to Sublime's CMD SHIFT f)
    • Spacemacs is integrated with different search utilities like ack, grep, ag, and pt. The search commands in Spacemacs are organized under the SPC s prefix.
    • To search in files in an arbitrary directory, use SPC s f. To search in a project, use SPC / (or SPC s p).
@robbyoconnor
Copy link

How to view all buffers

  • SPC b b
  • or add the ibuffer layer

@JuanCaicedo
Copy link
Author

@robbyoconnor thanks! Added

@nixmaniack
Copy link

How do you cycle through matches in a search?

Once you perform a search using / you can use n/N for going to next/previous match.

@xfq
Copy link

xfq commented Jan 24, 2016

How do you navigate around directories?

Besides emacs-neotree, you can also use Dired.

Use SPC p D to open the project root in Dired, and use SPC f j to jump to the Dired buffer corresponding to current buffer.

In Dired, you can copy (C), rename (R), delete (D), or compress (Z) files; you can create directories (+); you can mark (m) or unmark (u) files and apply a command on all marked files. You can also refresh the Dired buffer with g.

See also:

@xfq
Copy link

xfq commented Jan 24, 2016

How do you make new folders?

You can use SPC : make-directory RET dirname RET.

You can also use + in a Dired buffer (see above).

How to access projects easily?

It's a long story. Personally, I like the new project package in Emacs 25, although its API is still unstable.

How do you change indentation for a language (javascript 2 spaces)? For only the current file (specific project needs 6)?

It depends on the major mode you use. For example, in CC Mode, you can customize c-basic-offset.

For project-specific indentation configuration, you can use .dir-locals.el (or .dir-locals*.el in Emacs 25 or later).

For file-specific indentation, you can use file variables.

@JuanCaicedo
Copy link
Author

Thanks @nixmaniack and @xfq, updated with your comments!

@xfq
Copy link

xfq commented Jan 30, 2016

How to do a text search in directory (similar to Sublime's CMD SHIFT f)

Spacemacs is integrated with different search utilities like ack, grep, ag, and pt. The search commands in Spacemacs are organized under the SPC s prefix.

To search in files in an arbitrary directory, use SPC s f. To search in a project, use SPC / (or SPC s p).

@Fetz
Copy link

Fetz commented Feb 5, 2016

How to access projects easily?

do you mean SPC p p?

@xfq
Copy link

xfq commented Feb 6, 2016

@fiveNinePlusR
Copy link

Why does evil mode's gg and G not work in normal navigation?

it definitely should work in most modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment