Coder Social home page Coder Social logo

emacs.d's Introduction

Warning

  • I’m using Vim key binding. Please see “Tips” section if you prefer the Emacs key binding.
  • People in Mainland China may need goagent to download packages from ELPA. Run command “http_proxy=http://127.0.0.1:8087 emacs -nw” after starting goagent server (or any proxy server).
  • C++/C developers, you need tell Emacs where to search headers to make auto-complete work. See section `clang` for details.
  • I suggest Windows users using Cygwin version Emacs to avoid some overhead of setting up third party tools. But this configuration is still usable even in native windows Emacs.
  • I whitelist packages from melpa because it is too cutting edge. Modify variable “melpa-include-packages” in init-elpa.el if prefer some package from it.
  • Many users have issue to fetch packages from elpa/marmalade/melpa. Check the section “Install packages without elpa/marmalade/melpa” for solutions.
  • When running certain commands in minibuffer, you may get “Can’t expand minibuffer to full frame” error. That’s helm issue! “C-h v helm-completing-read-handlers-alist” for workaround.

General

My first priority is -stable-. So I use fewer cutting-edge packages from melpa.

Most modern popular programming languages are supported (C/C++/Java/Ruby/Perl/Python/C#/Lua/Javascript …).

Features

  • All key binding and plugins are usable in terminal
  • Real time HTML syntax checker enabled (you need install tidy)
  • git or subversion is NOT needed. You DONOT need run ‘git submodule update’.
  • optimized for cross-platform C++ development with CMake and wxWidgets
  • emacs-w3m (console browser)
  • eim (Chinese pinyin input method)
  • org2blog (post wordpress blog with org-mode)
  • make the configuration work on ALL platforms (Linux/Cygwin/Mac).
  • The configuration work with Emacs version >=24 but still usable with Emacs version 23 (tested with Emacs 23.4.1).
  • evil-mode and its plugins (Vim key binding)
  • yasnippet and my customized snippets (insert code snippet by typing less keys)

Install

Download this zip file and extract its content into ~/.emacs.d. Ensure that the ‘init.el’ contained in this repo ends up at ~/.emacs.d/init.el and old -~/.emacs IS REMOVED.

Make sure you are connected to the internet.

you may need run the below command in the terminal at least once to update the content from package repositories:

emacs -nw --batch -l ~/.emacs.d/init.el -f package-refresh-contents

Package repository is like Emacs App stores but all the Apps are FREE.

Directory structure

init.el is main file which include all the other *.el files.

init-elpa define how and what packages will be installed from elpa/marmalade/melpa by package manager.

The package manager will extract packages into ~/.emacs.d/elpa/.

I also manually download and extract some packages into ~/.emacs.d/site-lisp/. Packages in ~/.emacs.d/site-lisp/ is not visible to Emacs package manager.

My own snippets for Yasnippet is in ~/.emacs.d/snippets.

Other directoris do not matter.

Third party command line tools

These tools are OPTIONAL. Your Emacs will NOT crash if they are not installed.

w3m (web browser in console)

  • needed by `w3m` (w3m is emacs package name written in elisp)
  • install through OS package manager
  • please note only emacs with GUI can display image

lua

  • required by `flymake-lua`
  • install through OS package manager

aspell or hunspell (RECOMMENDED), and corresponding dictionary (aspell-en, for example)

  • needed by `flyspell`
  • hunspell is the alternative of `aspell`. So you need only install either aspell or hunspell.
  • install through OS package manager
  • I force the dictionary to “en_US” in init-spelling.el. You can modify it in init-spelling.el.

sbcl (lisp environment)

  • needed by lisp `slime`
  • install through OS package manager

tidy (html tidy program)

  • needed by `web-mode` for real time HTML syntax check
  • install through OS package manager

csslint

  • install `node.js` through OS package manager, then `sudo npm install -g csslint`

zip and unzip

  • needed by `org-mode` to export org to odt
  • install through OS package manager

xsel

  • needed by my clipboard command `copy-to-x-clipboard` and `paste-from-x-clipboard` under Linux
  • install through OS package manager
  • needed by `cpputils-cmake`, `flymake`, `company-clang`
  • install through OS package manager
  • If you use `company-clang` (default), add `(setq company-clang-arguments ‘(“-I/example1/dir” “-I/example2/dir”))` into ~/.emacs.d/init.el
  • If you use `cpputils-cmake` and `cmake`, `cpputils-cmake` will do all the set up for you.
  • needed by MozRepl
  • install using firefox
  • needed by many tags related plugins
  • install through OS package manager
  • needed by `gtags`
  • You use this tool to navigate the C/C++/Java/Objective-C code.
  • install through OS package manager

pyflakes

  • You need pyflakes for real time python syntax checker like `flymake-python`
  • Install pip through OS package manager, then `pip install pyflakes`
  • On cygwin you need install `setuptool` in order to install `pip`.

libreoffice

  • Only one executable `soffice` needed when converting odt file into doc (Microsoft Word 97)
  • conversion will happen automatically when exporting org-mode to odt
  • The conversion command is in variable `org-export-odt-convert-processes`
  • Install through OS package manager

js-beautify

  • To beautify javascript code (insert extra space, for example)
  • Install pip through OS package manager, then `pip install jsbeautifier`

OS package manager recommended

Install packages without elpa/marmalade/melpa

Solution 1

Here are the exact steps you need follow:

  • Go to https://github.com/redguardtoo/myelpa.
  • Click “Download ZIP”
  • Extract zip somewhere say “~/myelpa”.
  • Double check that there is a file name “archive-contents” in the directory “~/myelpa”.
  • insert below code into of ~/.emacs.d/init.el.
(setq package-archives '(("myelpa" . "~/myelpa/")))

That’s it. You will never need internect connection in the future.

Please note that all your packages are locked to the versions I’m using. So there is no way you can upgrade package online.

I don’t recommend advanced users locking their package version.

Solution 2

If you are too lazy to download ZIP file, you can insert one line into your init.el,

(setq package-archives '(("myelpa" . "https://raw.github.com/redguardtoo/myelpa/master/")))

Then you are good to go. Obviously you need internet connection to access github.com. So your choice.

Report bug

Please file bug report at https://github.com/redguardtoo/emacs.d. Don’t send me email!

Tips

By default EVIL (Vim emulation in Emacs) is used. You can comment out line containing “(require ‘init-evil)” in init.el to unload it.

Some package cannot be downloaded automatically because of network problem.

You need manually `M-x list-packages` and install it or just `M-x package-refresh-content` and restart Emacs.

You can speed up the start up by NOT loading some heavy weight components like evil or yasnippet. All you need to do is add below code into ~/.bashrc:

alias e=emacs -q --no-splash --eval="(setq light-weight-emacs t)" -l "$HOME/.emacs.d/init.el"

If you use `gnus` for email (Gmail, for example). Check ~/.emacs.d/init-gnus.el which includes my most settings except my private stuff. Here is my Gnus tutorial.

To toggle Chinese input method (eim, for example), press `C-` or run command `M-x toggle-input-method`.

My personal custom.el (OPTIONAL)

It’s publicized at http://blog.binchen.org/?p=430. It contains my personal stuff like color-theme and time locale.

emacs.d's People

Contributors

purcell avatar demon386 avatar ozanmakes avatar

Watchers

xingwenpeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.