diff --git a/.gitmodules b/.gitmodules index d74ae3056cec..6a1fe27d6a05 100644 --- a/.gitmodules +++ b/.gitmodules @@ -20,10 +20,6 @@ [submodule "spacemacs/extensions/nose"] path = spacemacs/extensions/nose url = http://github.com/syl20bnr/nose.el -[submodule "spacemacs/snippets"] - path = spacemacs/snippets - url = http://github.com/syl20bnr/yasnippet-snippets - ignore = dirty [submodule "spacemacs/extensions/use-package"] path = spacemacs/extensions/use-package url = http://github.com/jwiegley/use-package @@ -42,3 +38,6 @@ [submodule "contrib/syl20bnr/extensions/o-blog"] path = contrib/syl20bnr/extensions/o-blog url = https://github.com/renard/o-blog.git +[submodule "spacemacs/extensions/yasnippet-snippets"] + path = spacemacs/extensions/yasnippet-snippets + url = http://github.com/AndreaCrotti/yasnippet-snippets.git diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 000000000000..9dbd1b3cd4bb --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,43 @@ +# Contribute to Spacemacs + + +**Table of Contents** + +- [Contribute to Spacemacs](#contribute-to-spacemacs) + - [Pull Request Guidelines](#pull-request-guidelines) + - [Submitting a contribution layer upstream](#submitting-a-contribution-layer-upstream) + + + +## Pull Request Guidelines + +`Spacemacs` uses the `git-flow` model, so you'll have to submit your +contributions and fixes within a pull-request to apply against the `develop` +branch. + +_PR = pull request_ + +**Guidelines:** +- branch from `develop` only +- one topic per PR +- one commit per PR + - if you have several commits on different topics, close the PR and create + one PR per topic + - if you still have several commits, squash them into only one commit +- rebase your PR branch on top of upstream `develop` before submitting the PR + +**Getting Help:** +If you have any question on this process, join the [gitter chatroom][gitter] +and ask your questions there. Do not hesitate to ask your questions even the +simplest one, it will be a pleasure to help you to contribute! + +## Submitting a contribution layer upstream + +It is recommended to join a `README.md` file with your layer, ideally this file +should document the packages of your layer as well as the key bindings +associated with them. + +To submit your contribution layer follow the above +[guidelines](#pull-request-guidelines) for pull requests. + +**Note:** by submitting a configuration layer you become the maintainer of it. diff --git a/README.md b/README.md index ab5a37702dce..44855b024115 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ git clone --recursive http://github.com/syl20bnr/spacemacs .emacs.d -_Jump to [Install](#install) for more info and [here](#pull-request-guidelines) +_Jump to [Install](#install) for more info and [here][CONTRIBUTE.md-PR] for contribution guidelines_ @@ -72,6 +72,7 @@ for contribution guidelines_ - [Vim motions with ace-jump mode](#vim-motions-with-ace-jump-mode) - [Buffers and Files](#buffers-and-files) - [Ido](#ido) + - [NeoTree file tree](#neotree-file-tree) - [Bookmarks](#bookmarks) - [Symbols](#symbols) - [Listing symbols by semantic](#listing-symbols-by-semantic) @@ -390,14 +391,7 @@ layer). ### Submitting a contribution layer upstream -It is recommended to join a `README.md` file with your layer, ideally this file -should document the packages of your layer as well as the key bindings -associated with them. - -To submit your contribution layer follow the [guidelines](#pull-request-guidelines) -for pull requests. - -_Note: by submitting a configuration layer you become the maintainer of it._ +See the [CONTRIBUTE.md-CL][] file. ### Themes Megapack example @@ -409,34 +403,7 @@ installed around 100 themes you are free to try with ` h t` (helm-themes). ## Pull Request Guidelines -`Spacemacs` uses the `git-flow` model, so you'll have to submit your -contributions and fixes within a pull-request to apply against the `develop` -branch. - -_Guidelines:_ -- always create a branch for your pull request. -- branch from develop for new features or fixes. -- branch from `master` for hot fixes. -- if you don't know if you must branch from `master` or `develop` then branch -from `develop`. -- commit often in your pull request branch with a concise and clear commit -message. The first line of a commit message should be short, you can explain -in details what you did in a paragraph by skipping a line after the first line. -`often` is subtle, see `Notes` below. -- it is recommended to rebase your pull request branch on top of `master` or -`develop` (depending on your base branch) before submitting. - -If you have any question on this process, join the [gitter chatroom][gitter] -and ask your questions there. Do not hesitate to ask your questions even the -simplest one, it will be a pleasure to help you in your desire to contribute! - -_Notes:_ -I encourage you to not squash too much your commits. Good candidates for squash -are commits which contain reverted modifications. For instance when you was -experimenting on a feature and performed a lot of refactoring in the process, -you can squash the intermediary refactoring commits. Typo commits are also good -candidates for squashing. Anyway, just try to find a good balance between one -huge commit and lot of small commits. +See the [CONTRIBUTE.md-PR][] file. ## Dotfile Configuration @@ -763,6 +730,7 @@ They are both extended with various packages to build on their foundations. [evil-exchange][] | port of [vim-exchange][] [evil-surround][] | port of [vim-surround][] [evil-nerd-commenter][] | port of [nerdcommenter][] +[NeoTree][neotree] | mimic [NERD Tree][nerdtree] ### Helm extensions @@ -883,7 +851,7 @@ Key Binding | Description ` f i` | open your `init.el` file ` f s` | save a file ` f S` | save all files -` f t` | toggle file tree side bar using [neotree][neotree] +` f t` | toggle file tree side bar using [NeoTree][neotree] ` f y` | show current file absolute path in the minibuffer #### Ido @@ -904,6 +872,30 @@ Key Binding | Description `C-S-j` | go to next directory `C-S-k` | go to previous directory + +#### NeoTree file tree + +`Spacemacs` provides a quick and simple way to navigate in an unknown project +file tree with [NeoTree][neotree]. + +To toggle the `NeoTree` buffer press: + + f t + +In the `NeoTree` buffer: + +Key Binding | Description +---------------|---------------------------------------------------------------- +`TAB` or `RET` | expand/open +`a` | toggle stretch the buffer +`c` | create a node +`d` | delete a node +`g` | refresh +`H` | toggle hidden files +`K` | kill corresponding buffer +`q` or `fd` | hide `NeoTree` buffer +`r` | rename a node + #### Bookmarks Bookmarks can be set anywhere in a file. Bookmarks are persistent. They are very @@ -1644,14 +1636,6 @@ your `~/.spacemacs` the following snippet: (add-hook 'emacs-lisp-mode-hook 'evil-lisp-state)) ``` -2) Do not use popwin for `helm` buffers: - -```elisp -(defun dotspacemacs/config () - (spacemacs/remove-popwin-display-config "helm") -``` - - ## TODO list - Add support for [multiple-cursors][multiple-cursors] mode. @@ -1717,7 +1701,6 @@ Thank you to the whole Emacs community from core developers to elisp hackers! [smeargle]: https://github.com/syohex/emacs-smeargle [git-timemachine]: https://github.com/pidu/git-timemachine [git-messenger]: https://github.com/syohex/emacs-git-messenger -[neotree]: http://www.emacswiki.org/emacs/NeoTree [evil-lisp-state]: https://github.com/syl20bnr/evil-lisp-state [ido-vertical-mode]: https://github.com/gempesaw/ido-vertical-mode.el [emacs_live]: https://github.com/overtone/emacs-live @@ -1731,3 +1714,7 @@ Thank you to the whole Emacs community from core developers to elisp hackers! [guide-key]: https://github.com/kai2nenobu/guide-key [guide-key-tip]: https://github.com/aki2o/guide-key-tip [gitter]: https://gitter.im/syl20bnr/spacemacs +[CONTRIBUTE.md-PR]: https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTE.md#pull-request-guidelines +[CONTRIBUTE.md-CL]: https://github.com/syl20bnr/spacemacs/blob/master/CONTRIBUTE.md#submitting-a-contribution-layer-upstream +[neotree]: https://github.com/jaypei/emacs-neotree +[nerdtree]: https://github.com/scrooloose/nerdtree diff --git a/contrib/ranger-control/config.el b/contrib/ranger-control/config.el index 07291d281cd3..8a9d9c7c454e 100644 --- a/contrib/ranger-control/config.el +++ b/contrib/ranger-control/config.el @@ -1,2 +1,2 @@ (evil-leader/set-key - "pc" 'ranger-control/projectile-cd) + "oc" 'ranger-control/projectile-cd) diff --git a/contrib/trishume/config.el b/contrib/trishume/config.el new file mode 100644 index 000000000000..5f26ce59dc3b --- /dev/null +++ b/contrib/trishume/config.el @@ -0,0 +1,8 @@ +(dolist (mode '(c++ + json + racket + elisp + LaTeX + yaml)) + (add-hook (intern (concat (symbol-name mode) "-mode-hook")) + 'flycheck-mode)) diff --git a/contrib/trishume/packages.el b/contrib/trishume/packages.el index a6aa640b4d28..c01ce21098af 100644 --- a/contrib/trishume/packages.el +++ b/contrib/trishume/packages.el @@ -9,6 +9,9 @@ julia-mode helm-ag lua-mode + racket-mode + go-mode + yaml-mode ag )) @@ -86,3 +89,19 @@ (defun trishume/init-lua-mode () (use-package lua-mode :defer t)) + +(defun trishume/init-go-mode () + (use-package go-mode + :defer t)) + +(defun trishume/init-yaml-mode () + (use-package yaml-mode + :defer t)) + +(defun trishume/init-racket-mode () + (use-package racket-mode + :defer t + :config + (add-hook 'racket-mode-hook + '(lambda () + (define-key racket-mode-map (kbd "H-r") 'racket-run))))) diff --git a/core/spacemacs-mode.el b/core/spacemacs-mode.el index e2f1fbaec26f..691f584b9e82 100644 --- a/core/spacemacs-mode.el +++ b/core/spacemacs-mode.el @@ -11,7 +11,10 @@ (setq truncate-lines t) (setq cursor-type nil) ;; no welcome buffer - (setq inhibit-startup-screen t)) + (setq inhibit-startup-screen t) + ;; motion state since this is a special mode + (eval-after-load 'evil + '(add-to-list 'evil-motion-state-modes 'spacemacs-mode))) (defun spacemacs/emacs-version-ok () (not (version< emacs-version spacemacs-min-version))) diff --git a/spacemacs/extensions/yasnippet-snippets b/spacemacs/extensions/yasnippet-snippets new file mode 160000 index 000000000000..32bbd36d9a77 --- /dev/null +++ b/spacemacs/extensions/yasnippet-snippets @@ -0,0 +1 @@ +Subproject commit 32bbd36d9a774b9cab6207523ffb5b24179b6505 diff --git a/spacemacs/packages.el b/spacemacs/packages.el index 97b312046664..a89a06eb9b9b 100644 --- a/spacemacs/packages.el +++ b/spacemacs/packages.el @@ -272,10 +272,6 @@ DELETE-FUNC when calling CALLBACK. (if shadowed (call-interactively shadowed))))))) ;; easier toggle for emacs-state (evil-set-toggle-key "s-`") - ;; moves `evil-insert-digraph' to C-i in order to free up C-k for - ;; candidate selection in auto-complete. - (define-key evil-insert-state-map (kbd "C-k") nil) - (define-key evil-insert-state-map (kbd "C-i") 'evil-insert-digraph) ;; escape state with a better key sequence than ESC (let* ((seq spacemacs-normal-state-sequence) (key (char-to-string (car spacemacs-normal-state-sequence))) @@ -628,9 +624,9 @@ DELETE-FUNC when calling CALLBACK. (ac-config-default) (add-to-list 'completion-styles 'initials t) (evil-leader/set-key "ta" 'auto-complete-mode) - (define-key ac-mode-map (kbd "C-j") 'ac-next) - (define-key ac-mode-map (kbd "C-k") 'ac-previous) - (define-key ac-mode-map (kbd "") 'ac-previous) + (define-key ac-completing-map (kbd "C-j") 'ac-next) + (define-key ac-completing-map (kbd "C-k") 'ac-previous) + (define-key ac-completing-map (kbd "") 'ac-previous) ;; customization (setq ac-auto-start 2 ac-delay 0. @@ -1549,16 +1545,16 @@ DELETE-FUNC when calling CALLBACK. (lambda () (define-key evil-motion-state-local-map (kbd "TAB") 'neotree-enter) (define-key evil-motion-state-local-map (kbd "RET") 'neotree-enter) - (define-key evil-motion-state-local-map (kbd "D") 'neotree-delete-node) - (define-key evil-motion-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-motion-state-local-map (kbd "?") 'evil-search-backward) (define-key evil-motion-state-local-map (kbd "a") 'neotree-stretch-toggle) - (define-key evil-motion-state-local-map (kbd "A") 'neotree-stretch-toggle) - (define-key evil-motion-state-local-map (kbd "R") 'neotree-rename-node) - (define-key evil-motion-state-local-map (kbd "C") 'neotree-create-node) + (define-key evil-motion-state-local-map (kbd "c") 'neotree-create-node) + (define-key evil-motion-state-local-map (kbd "d") 'neotree-delete-node) (define-key evil-motion-state-local-map (kbd "g") 'neotree-refresh) + (define-key evil-motion-state-local-map (kbd "H") 'neotree-hidden-file-toggle) + (define-key evil-motion-state-local-map (kbd "K") 'kill-this-buffer) (define-key evil-motion-state-local-map (kbd "q") 'neotree-hide) - (define-key evil-motion-state-local-map (kbd "?") 'evil-search-backward) - (define-key evil-motion-state-local-map (kbd "Q") 'kill-this-buffer))) + (define-key evil-motion-state-local-map (kbd "r") 'neotree-rename-node) + )) )) (defun spacemacs/init-org () @@ -1828,6 +1824,19 @@ DELETE-FUNC when calling CALLBACK. (spacemacs//diminish smartparens-mode " (Ⓢ)")) :config (progn + (defun spacemacs/smartparens-pair-newline (id action context) + (save-excursion + (newline) + (indent-according-to-mode))) + + (defun spacemacs/smartparens-pair-newline-and-indent (id action context) + (spacemacs/smartparens-pair-newline id action context) + (indent-according-to-mode)) + + (sp-pair "{" nil :post-handlers + '(:add (spacemacs/smartparens-pair-newline-and-indent "RET"))) + (sp-pair "[" nil :post-handlers + '(:add (spacemacs/smartparens-pair-newline-and-indent "RET"))) (sp-local-pair 'emacs-lisp-mode "'" nil :actions nil)))) (defun spacemacs/init-smeargle () @@ -1926,8 +1935,8 @@ DELETE-FUNC when calling CALLBACK. (defun spacemacs/load-yasnippet () (if (not (boundp 'yas-minor-mode)) (progn - (let* ((dir (contribsys/get-layer-property 'spacemacs :dir)) - (yas-dir (list (concat dir "snippets")))) + (let* ((dir (contribsys/get-layer-property 'spacemacs :ext-dir)) + (yas-dir (list (concat dir "yasnippet-snippets")))) (setq yas-snippet-dirs yas-dir) (yas-global-mode 1))))) (add-to-hooks 'spacemacs/load-yasnippet '(prog-mode-hook @@ -1937,7 +1946,7 @@ DELETE-FUNC when calling CALLBACK. (progn (spacemacs//diminish yas-minor-mode " Ⓨ") (require 'helm-c-yasnippet) - (evil-leader/set-key "hy" 'helm-yas-complete) + (evil-leader/set-key "is" 'helm-yas-complete) (setq helm-c-yas-space-match-any-greedy t)))) (defun spacemacs/init-zenburn-theme () diff --git a/spacemacs/snippets b/spacemacs/snippets deleted file mode 160000 index 60dd937aa338..000000000000 --- a/spacemacs/snippets +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 60dd937aa338e1669bbf3a00bcb028eee2c2a9d8