/Spacemacs-rocks

Show you some cool parts of Spacemacs,specially powered by the configs of mine :)

Primary LanguageEmacs Lisp

Spacemacs Rocks

Navigation Your Lisp Code Faster

Features

Find Function definition

C-h f & C-h C-f

Find variable definition

C-h v & C-h C-v

Navigation functions in current file

SPC s l

Go to your .spacemacs file

SPC f e d

Go to .emacs.d/init.el

SPC f e i

Find an elpa library

SPC h L

Find Spacemacs layers, docs and package configuration

SPC f e h

Workflow

Navigation spacemacs layers/docs

SPC h SPC -> SPC s l -> c-h c-f/c-v/f/v

Navigation elpa libraries

SPC h L -> SPC s l -> c-h c-f/c-v/f/v

Navigation you own configuration

SPC f e d -> SPC s l -> c-h c-f/c-v/f/v

navigation spacemacs repository

SPC f e i -> SPC s l -> c-h c-f/c-v/f/v

Use Org-mode to Management Your Time

Org-agenda is your friend

Never start to do anything before looking at the agenda view. Why agenda matters? Every successful people almost have a secret who will organize your time and maximize the value of your time. This is the key to long term success. Remember how many times you waste your time with QQ, WeChat, Weibo and B site.

What should be in org agenda view?

  1. Important and emergency things goes first, they got A priority, along with important and not emergency tasks.
  2. A few habits to keep you update to date. Good habit always makes you a good person.

Like: Health, Reading, blogging, family and friendship.

When you start to do a task in the org-agenda view, don’t forget to clock in with pomodoro technicals

  1. This way you could track your time and effect.
  2. All the goodness of the pomodoro technicals

Weekly review and adjust the priority of todo items. And weekly archive done items.

You need only one gtd.org file. And many files in org agenda files.

Keep a eye on what you have spent on each day, each week and each month.

Show it in my gtd.org file.

demonstration the usage of Org capture

  1. Capture a todo with priority and tags.
  2. capture a chrome links for later reading.
  3. capture a task with a source code file.

A few tips.

  1. embed pdf links to todo items such that you could easily access them.
  2. insert the current chrome tab into place.
  3. Learn GTD method now!

Emacs as a C/C++ IDE

Jump to definition (of class, function, etc.)

  1. Gtags
  2. ycmd.

tips: Call helm-gtags-update in the .cpp file.

Autocompletion

ycmd + comapny-mode

On-the-fly syntax check

flycheck-ycmd

Find file in project

projectile and find-file-in-project

Compile??

Debugging??

Magit workflow

Magit init, commit and commit messages

  1. SPC g i(magit-init)
  2. SPC g s(magit-status)
  3. s-1 (goto unstaged section)
  4. press tab to view diffs(code review)
  5. s to stage all changes
  6. c c -> c-c c-c to commit
  7. editing the commit message and the diff on the right

Commits in Action

  1. Ammend ( c a)
  2. write good commit messages
  3. squash unpushed commits (r l)
  4. reset commits (l l #)
  5. select a few line to commits
  6. discard changes, file wide or line wide
  7. revert commits

Branching basics

  1. b B to create branch
  2. m m to merge
  3. b b to switch branch

Rebase

  1. squash unpushed
  2. rebase to other branch
  3. interactive rebase

pull, push & send Pull request

  1. P P
  2. f f / f o to fetch branch
  3. F to pull
  4. s-g to send pull request

Misc

  1. cherry pick
  2. view github files

Find, Search and replace

Evil search

  1. Use / and * to start search.
  2. Use n & N to search forward and backward

Swiper

C-s to start search. C-c C-o to enter ivy-occur

Helm-swoop

SPC s s/S to search search C-c C-e to enter edit mode SPC h l(helm-resume)

Helm-imenu-or-semantic

To search structured word. SPC s l

Occur to search and multiple editing

M-s o to use occur and e to enter edit mode. C-c to finish editing. Edit search result one by one. Edit search result with iedit and multiple cursor.

Helm -ag

F3 to save search result, SPC s L to open last save search buffer.

SPC s p to search project wide

C-c c-e

SPC s f to search for files and certain suffix files.

SPC s b to search all the open buffer

SPC n f to narrow to function, SPC n w to restore

After narrowing, you could use :%s/old/new/g to replace

Org-mode as a blogging engine.

Start to blogging any place and any time.

Press F1 to launch a menu and type blog to choose. Navigation all the blog posts

Press W to new post

Enter the title of your new post

Start writing

You could use all the Org syntax here. But org table is not well supported.

  1. Headings.
  2. Insert links.
  3. Insert Images
  4. Insert Code(We can even execute the code in the documents, oh my!)

Preview and publish

Spacemacs buffer, file, project and layout management

SPC f —> file related operations

SPC f f –> helm-find-file SPC f r –> open recent file SPC f R –> rename file SPC f c –> copy file SPC f j –> jump to dired SPC f t –> open neo tree SPC f o –> open in external application

SPC b —> buffer related operations

SPC b b & SPC b B(i) SPC b h (spacemacs home buffer) SPC b s (scratch buffer) SPC b f (reveal in finder) SPC b w in dired buffer. SPC b n/p (previous or next buffer) SPC b TAB to switch back and forth.

SPC p —> project related operations

SPC p f and SPC p b

SPC l —> layout replated operations

SPC l o –> custom layout SPC l L/s –> load or save layout SPC l l –> switch bewteen layout SPC l TAB –> quick way to switch SPC l ? –> open up the help. SPC p l –> switch to project and create a layout

dired related operations

new file/delete file/rename file new folder/delete folder/rename folder

Ranger

SPC a r h l to navigate folder j k to preview file

Spacemacs as a JavaScript/Node.js IDE

Autocompletion

  1. company-etags vs company-tern
  2. hippie-expand

Jump to definition

  1. SPC s l to jump to function definitions. ctags.
  2. SPC m g d/ etags-select
  3. SPC s p / SPC o s to search keywords
  4. SPC m g g if use tern.js

Syntax check

  1. flycheck with jshint / eslint
  2. js2-mode checking

REPL

  1. jscomint

jscomint has better ES6 support. But the keybinding are not perfect

  1. nodejs repl

ES6 support is not good, but has better keybinding.

Format code

  1. js beautify