Skip to content

yydai/emacs.d

Repository files navigation

My Personal Emacs

How to install Emacs on OSX

brew install --with-cocoa emacs
# finally link it to your Applications folder
brew linkapps emacs

You can visit here for more details.

Org mode

Org mode can help you write more better and you will enjoy writing in this way.

There are many features:

  • Screenshot
  • Drag images file from local disk
  • Insert github gist
  • Insert Youtube link
  • Set org mode bullets
  • Support org mode to html blog
    Keybindingcommanddescription
    s-<SPC> c smy-org-screenshotTake a screenshot into a time stamped file
    insert-gistInsert embeded gist link

    You can insert a Youtube share like:

    [[yt:share_id]]
        

Blog

You can find my blog config in the /lisp/init-blog.el.

I often write my blog with the workflow of blow:

  • With command blog-create to create a new blog.
  • Enter the file name and the directory you want to store
  • Enter the title of the blog you want to show
  • Use command blog-preview to preview the current blog locally
  • If all things is ok, you can use command of publish-site .

    You need write a makefile in your blog site file, because we’ll use make to publish the site.

    This is my makefile.

Some minor modes

Disable mouse mode

This mode is default open, so you can’t use mouse in Emacs.

Text process mode

The goal of this mode is to process text more easily.

Now, I only support the line process including SELECT, COPY, KILL, CUT.

Key bindings

The prefix key is C-c t.

keybindingcommanddescription
C-c t sselect-current-lineSelect the current line
C-c t kkill-current-lineDelete the current line, like dd of vim
C-c t wcopy-current-lineCopy the current line
C-c t ccut-current-lineCut the current line

You can find the source file in /lisp/init-text-process.el.

Keybindings

window/buffer in init-windows.el

M-o is a prefix key defined by myself.

  1. swap two buffer M-o s
  2. maximize buffer M-o m
  3. balance buffers M-o b
  4. enlarge buffer M-o M-=
  5. shrunk buffer M-o M–

Other keybindings

The prefix key is s-<SPC>. In this place, s is command key on MAC.

keybindingcommanddescription
s-<SPC> s ;avy-goto-char
s-<SPC> s ddash-at-pointWill look up the things in dash
s-<SPC> s sprojectile-agUse ag search
s-<SPC> f fprojectile-find-fileFind file in project
C-;ace-jump-char-modeJump to the char
C-,ace-jump-line-modeJump to some line

Locals set

Key mappings

I have mapped some key to numbers.

currentoriginal
%8
&7
-9
=0

Insert link in org mode

Use the command link to insert a link more easily. This will prompt user to input adress and description.

Delete trailing whitespace

I add this to my config file. This will ensure to delete the trailing whitespace when I save a file.

(add-hook 'before-save-hook
  'delete-trailing-whitespace)

Switch the key bindings for C-w and M-w.

I will use the C-w for copy and M-w for cut.

issues

Other features

gallery of images

https://github.com/nanostudio-org/nanogallery2 is the tool. Update file of gallery_books/index.org will be ok.

About

My personal emacs config

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published