I couldn't care less about whether or not the cursor blinks. (note proper use of that phrase, rare in this culture)
However, some people really like it, need it, and some people don't like it at all. A recent thread in comp.emacs brought this to light.
So, if you'd like your cursor to blink (or not), add the line:
(blink-cursor-mode 1) ;; or pass in -1 to turn it off
to your .emacs. By default the cursor will blink.
You can also have the cursor stretch to cover the full width of the glyph (character) under it. e.g. it'd be as wide as the tab character (should there be one in your buffer):
(setq x-stretch-cursor t)
For more documentation on cursor display, read the manual.
Tuesday, May 20, 2008
Emacs Tip #22: blink-cursor-mode
Posted by
a
at
8:04 AM
0
comments
Labels: emacs-basic, emacs-tip
Monday, May 12, 2008
Emacs Tip #21: pabbrev (predictive abbreviation expansion)
pabbrev
is a yet another package for abbreviation expansion in Emacs. Unlike dabbrev
, this one analyzes the contents of the buffers during idle time, and shows potential expansions based on word frequency. This package also shows potential expansions as you are typing. For example if you were typing 'pred', this is what you would see:
p[oint]
pr[ogn]
pre[-command-hook]
pred[ictive]
A
TAB
at any time will expand the word to the shown choice. If you do not like what was chosen, you can press TAB
again and get a list of possible choices from which to chose.To use it, download the source, and add this to your .emacs:
(require 'pabbrev "/path/to/package/pabbrev.el")
(global-pabbrev-mode)
Documentation can be found in the source file. (I copied the example from the code itself.)
Posted by
a
at
9:55 AM
0
comments
Labels: emacs-intermediate, emacs-tip
Monday, May 5, 2008
Emacs Tip #20: Exiting Emacs
I almost never use this tip, but some might find it handy:
C-x C-cThat is the key-binding to exit emacs, it runs
save-buffers-kill-emacs
, and the documentation for exiting emacs can be read here: Exiting - GNU Emacs Manual
Posted by
a
at
8:29 AM
5
comments
Labels: emacs-basic, emacs-tip
Monday, April 28, 2008
Emacs Tip #19: Startup Options (-q)
The most useful two options I've found for starting up emacs are:
-q
and
-debug-initThe first disables the loading of your .emacs and default.el files, which is handy when you want to differentiate between problems in your .emacs file and problems outside (.Xdefaults, site specific .emacs, etc.).
The second gives you a backtrace when any error happens during loading of your .emacs file. While it doesn't often pinpoint the exact line where things went wrong, it usually gives you a clue as to where to start looking for problems.
For all options, read the manual here: Initial Options - GNU Emacs Manual
Posted by
a
at
9:11 AM
1 comments
Labels: emacs-basic, emacs-tip, link
Monday, April 21, 2008
Emacs Tip #18: Keyboard Macros
If you find yourself doing a repetitive set of keystrokes, but don't want to bother with learning how to actually write a script for that, then record a keyboard macro.
C-x ( begins recording
C-x ) ends recording
C-x e executes the last keyboard macro
C-x C-k lets you edit the keyboard macro you just wrote
If find yourself using lots of macros, you can even save them to your
.emacs and name them (for later use).
For more documentation, see the info page:
C-h K C-x (
Or check out the Keyboard Macros section in the Emacs wiki.
Posted by
a
at
12:43 PM
2
comments
Labels: emacs-advanced, emacs-tip
Monday, April 7, 2008
Emacs Tip #17: flyspell and flyspell-prog-mode
Being in front of the computer hasn't helped my spelling because it's so easy to let the computer catch and fix the spelling errors for me. Of course Emacs has spell checking (M-x spell-{buffer,region,string,word}
), but what is really handy is spell-checking as you type.
Enter flyspell
.flyspell
is a minor-mode, so enabling it only causes spell-checking in that buffer, so it's handy to add the hooks to turn it on for the modes you deem appropriate (mail messages, text files, etc.). But wait, you do most of your work programming, right? Just turn on flyspell-prog-mode
, and only your comments and strings will be checked for spelling errors.
It has the standard installation - only the major entry point is the routine 'flyspell-mode
where the filename is "flyspell.el", so you need to tell Emacs to look for that appropriately. Here's what I use to enable flyspell
and turn it on for a couple of different modes.
(autoload 'flyspell-mode "flyspell" "On-the-fly spelling checker." t)
(add-hook 'message-mode-hook 'turn-on-flyspell)
(add-hook 'text-mode-hook 'turn-on-flyspell)
(add-hook 'c-mode-common-hook 'flyspell-prog-mode)
(add-hook 'tcl-mode-hook 'flyspell-prog-mode)
(defun turn-on-flyspell ()
"Force flyspell-mode on using a positive arg. For use in hooks."
(interactive)
(flyspell-mode 1))
Posted by
a
at
10:31 AM
8
comments
Labels: emacs-basic, emacs-tip, link
Tuesday, April 1, 2008
Emacs Tip #16: check-parens
Ever had trouble finding a mismatched parentheses in a file? Of course not, you don't make mistakes.
But, if you do, you can use the built in functionality of M-x check-parens
The documentation is here Parentheses - GNU Emacs Manual
It doesn't pinpoint the problem as closely as I would have hoped in some modes, but it's better than nothing.
Posted by
a
at
9:11 AM
0
comments
Labels: emacs-basic, emacs-tip, link