Emacs Plugins
Table of Contents
2 ERC
erc: connecterc-iswitch:C-c C-berc-join-channel:C-c C-jerc-save-buffer-in-logs:C-c C-lerc-channel-names:C-c C-n: run/names #channelcommand in the current channel.erc-part-from-channel:C-c C-p: leave the channelerc-quit-server:C-c C-q: disconnect server
IRC commands
- identify:
/msg NickServ identify <password> - join:
/join #linux - register:
/msg NickServ register <psssword> <email> - private talking:
/query <nick>. Only registered people can be queried
3 Flycheck
The default (at least the one I'm using) for C/C++ is c/c++-clang.
flycheck-describe-checkerflycheck-list-errors
4 AUCTex
C-c C-c: tex-compile
5 DocView
Can view pdf in emacs. It is convenient to use the same keybinding for tex-compile:
when you press C-c C-c the second time after compilation, it will default to \doc-view.
5.1 navigation
C-pC-nC-bC-fstill works+and-to adjust scalenandpfor page navigationspaceanddeleteto page up and down across pagesM-<andM->still worksM-g M-gworks as jump to page
6 pdf-tools
The doc view produce very blur text. The pdf-view-mode provided by pdf-tools solved this. Also, this package is said to open pdf on demand. It seems to solve my concern for pdf greatly.
Extra bonus:
- search in text
- view and edit annotations!
http://emacs.stackexchange.com/questions/19686/how-to-use-pdf-tools-pdf-view-mode-in-emacs
6.1 Installation
sudo aptitude install libpng-dev libz-dev sudo aptitude install libpoppler-glib-dev sudo aptitude install libpoppler-private-dev sudo aptitude install imagemagick
cd /path/to/pdf-tools
make install-server-deps # optional
make -s
make install-package
# or M-x package-install-file RET pdf-tools-${VERSION}.tar RET
activate in emacs by (pdf-tools-install)
6.2 key binding
o: open outlineQ: kill bufferq: kill window
7 Paredit
| command | Key | description |
|---|---|---|
| paredit-forward-slurp-sexp | C-) | enclose the next into this sexp |
| paredit-forward-barf-sexp | C-} | exclude |
| paredit-backward-slurp-sexp | C-( | |
| paredit-backward-barf-sexp | C-{ | |
| paredit-wrap-round | M-( | |
| paredit-join-sexp | M-J | |
| paredit-splice-sexp | M-s | |
| paredit-split-sexp | M-S | |
| paredit-raise-sexp | M-r | |
| paredit-convolute-sexp | M-? | exchange child and parent |
8 Magit
C-x g to enter, and
c cto commmitc ato amend commitP uto pushF uto pull
9 Speedbar
This is strictly not a plugin. Toggle by speedbar.
- q
- quit
- g
- refresh
- t
- toggle slowbar mode, which stop update until activate
- n,p
- next, previous
- M-n,M-p
- restricted next/previous. Will 1) skip subdirectory, and 2) will not leave subdirectory
- f
- file mode
- b
- buffer mode
- r
- previous mode
- =
- expand
- -
- hide
- RET
- open
9.1 Buffer Mode
- k
- kill the buffer
- r
- revert the buffer
10 EDBI
This is database viewer for MySQL, Sqlite, Postgresql.
Install edbi and edbi-sqlite package and run as root:
cpan RPC::EPC::Service DBI DBD::SQLite DBD::Pg DBD::mysql
Run edbi-sqlite to open a sqlite database. This will open database view.
To sum up:
- n/p
- nav rows
- c
- query editor
- C-c C-c
- execute
- q
- quit
- RET
- go into
- SPC
- display info
- V
- show table data
10.1 Database View
- n/p
- nav rows
- c
- switch to query editor buffer
- RET
- show table data
- SPC
- show table definition
- q
- quit and disconnenct
10.2 Table definition View
- n/p
- c
- V
- show table data
- q
- kill buffer
10.3 Query Editor
- C-c C-c
- execute
- C-c q
- kill buffer
- M-p/n
- SQL history back/forward
10.4 Query Result Viewer
- n/p
- SPC
- display whole data at current cell, hit SPC again to dismiss
- q
- quit
11 EMMS
11.1 Add files into playlist
- emms-add-file
- emms-add-directory
- emms-add-directory-tree (recursive)
- emms-add-playlist (m3u)
- emms-add-find: use regexp with find
11.2 Interactive control in playlist mode
- emms-start
- emms-stop (s)
- emms-next (n)
- emms-previous
- emms-shuffle
- emms-pause (P)
- emms-random (r): go to a randomly selected track in the playlist
- emms-sort
- emms-show (f): show the current track in minibuffer
- emms-seek-forward (>)
- emms-seek-backward (<)
- emms-playlist-mode-center-current (c): center the current song
- emms-playlist-mode-play-smart (RET): play the song under cursor
- emms-playlist-mode-bury-buffer (q): bury buffer
- emms-playlist-mode-clear (C)
In playlist mode, you can kill and yank as normal, use C-j to insert
newline.
In addition to the default playlist, we also have the markable
playlist. The emms-mark-mode and emms-mark-mode-disable can switch
between them. In the mark mode, you can:
- emms-mark-forward (m)
- emms-mark-unmark-all (U)
- emms-mark-toggle (t)
- emms-mark-unmark-forward (u)
- emms-mark-regexp (% m)
When tracks are marked, you can
- emms-mark-delete-marked-tracks (D)
- emms-mark-kill-marked-tracks (K): like D, but put into kill ring, so we can yank it back
- emms-mark-copy-marked-tracks: just kill, ready for yank
Play Property
emms-repeat-playlist: variable, non-nil means repeat the playlistemms-toggle-repeat-playlist: changeemms-repeat-playlistemms-toggle-random-playlist: random
Play list
emms-playlist-newemms-playlist-save(C-x C-s): just use m3u format
11.3 Edit the tags:
- emms-tag-editor-edit (E): need to have software support. E.g
mp3info - emms-tag-editor-rename-format: this variable controls how to generate file name from meta data, nice!
- emms-tag-editor-rename: this function perform file renaming according to above format
11.4 Smart Browser
emms-smart-browse to enter the smart browsing page.
11.4.1 TODO when I start emacs, it can find all the music, how did it remember?
In browser, you can update by relist the browser
- emms-browse-by-artist (b 1)
- emms-browse-by-album
- emms-browse-by-genre
- emms-browse-by-year
Interact:
- emms-browser-add-tracks (RET)
- emms-browser-add-tracks-and-play (C-j)
- emms-browser-toggle-subitems (SPC): toggle subitems
- emms-browser-collapse-all (1)
- 2: expand one level
- 3: expand two levels
- 4: expand three levels
- emms-browser-clear-playlist (C): also clear the playlist, but use capital
- E: expand everything
- d: visit the current directory
- r: jump to a random track
- /: search