parsed.org

Tips by tag: keystrokes

Attaching Messages by xinu on Jan 12, 2005 11:06 AM

While looking at the summary of your message press A to attach a message in one of your spools. You'll be prompted for the mailbox. Then, tag (t) the messages you want attached and quit (q).

attachmentsconfigurationkeystrokesmailboxmessagesmuamutt
Audible Bell by xinu on Jan 12, 2005 10:13 AM

To switch back and forth between the audible bell and the visual bell, run the following:

C-a C-g
bellkeystrokesscreenscreenrcterminal

Use these screenrc commands to bind specific key sequences to commands outside of the escape sequence (normally C-a). You can bind key combos to commands this way so you don't always have to prefix commands with your escape key sequence:

# Bind Control-PageDown to 'next', Control-PageUp to 'prev'
# to navigate between windows
bindkey ^[[5;5~ prev
bindkey ^[[6;5~ next

# Bind arrow keys Control-Down to 'next', Control-Up to 'prev'
# to navigate between windows
bindkey ^[[1;5A prev
bindkey ^[[1;5B next

(The keycodes for these keys can be obtained by running cat > /dev/null and pressing the desired key combination.)

bindingbindkeycommandsconfigurationescapekeystrokesscreenscreenrc
Bookmarking by xinu on Jan 12, 2005 10:48 AM

To set a bookmark for the visited file at point:

C-x r m <RET>

To set a named bookmark at point:

C-x r m BOOKMARK <RET>

To open and move to a bookmarked location:

C-x r b BOOKMARK <RET>

To list all bookmarks:

C-x r l
bookmarkseditorsemacskeystrokes
Change Default Escape Binding by cygnus on Jan 13, 2005 08:59 AM

The default binding is typically C-a. I like to use C-j:

escape "^j^j"

I also like to use C-j l to get a window list instead of C-j ":

bind 'l' windowlist -b
bindbindingescapegotchakeystrokesscreenscreenrcwindowlist

You can use M-/ to complete strings that emacs has seen in documents you are editing. It's useful for completing (or cycling through) long variable and function names to prevent misspellings.

autocompleteeditorsemacskeystrokes
Count Page Lines by xinu on Jan 12, 2005 10:54 AM

Use C-x l to count lines in a page (see the Emacs manual on pages). Without page boundaries, this will count lines in the entire buffer.

editorsemacskeystrokes
Customization of global shortcut keys by cygnus on Jan 12, 2005 10:30 AM

To set your own global keybinding to a function, use global-set-key in your ~/.emacs as follows:

(global-set-key "C-cl" 'enlarge-window-horizontally)
configurationdot-emacseditorselispemacskeystrokes
Dragging Windows Between Desktops by cygnus on Oct 03, 2005 10:59 AM

You can send windows to other desktops in Openbox by right-clicking on the title bar and clicking the appropriate desktop name from the Send to desktop submenu. An easier way to do this is to click and hold on a window title bar and use your desktop switching keys (usually C-A-PgDown and C-A-PgUp by default). As you change desktops, the window you're holding onto will move to each desktop you visit. Just release the mouse button when you've reached the desired desktop.

These keybindings also facilitate the same behavior if you press the keys while focused on the window you want to move:

<keybind key="S-A-Left">
  <action name="SendToDesktopLeft"><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Right">
  <action name="SendToDesktopRight"><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Up">
  <action name="SendToDesktopUp"><wrap>no</wrap></action>
</keybind>
<keybind key="S-A-Down">
  <action name="SendToDesktopDown"><wrap>no</wrap></action>
</keybind>

This has been tested with Openbox 3.2.

configurationkeybindingskeystrokesopenboxwmx11xml
Executing Multiple Commands by cygnus on Oct 03, 2005 10:52 AM

If you want Openbox to invoke multiple commands for a keybinding, you can just add extra action elements inside the keybind element. Sometimes XMMS freezes up on my machine, so I use this in my rc.xml file:

<keybind key="C-A-k">
  <action name="Execute"><execute>killall -9 xmms</execute></action>
  <action name="Execute"><execute>xmms</execute></action>
</keybind>

This has been tested with Openbox 3.2.

configurationinvocationkeybindingskeystrokesopenboxrc.xmlwmx11xmlxmms
File Insertion by xinu on Jan 12, 2005 10:56 AM

Use C-x i to insert a file into the current buffer.

editorsemacskeystrokes
Fill Column by xinu on Jan 12, 2005 10:52 AM

If you want to change the fill column, do the following:

C-u 60 C-x f

(where '60' is the fill column setting you want to use.)

configurationeditorsemacskeystrokes
Filling a Paragraph by cygnus on Jan 12, 2005 10:33 AM

Use M-q to "fill" a contiguous body of text according to the mode's rules. This will wrap lines at the standard fill-column.

editorsemacskeystrokeswrapping
Fixing the Backspace Key by cygnus on Nov 14, 2005 11:14 AM

On some systems (and for some terminal types), Emacs' use of the backspace key can be confusing. The backspace key may behave like the Delete key. You can fix this either by using this elisp in your ~/.emacs as follows:

(keyboard-translate ?\C-h ?\C-?)

This shell command may work if the elisp does not:

stty erase '^?'
backspacecrapdeletedot-emacseditorsemacsgotchakeystrokesterminal
Flush Inbox by xinu on Jan 17, 2005 09:57 AM

If you want to flush your inbox and move the messages you've read into the =read box without leaving mutt, just revisit your INBOX again by pressing c!.

configurationinboxkeystrokesmailboxmessagesmuamutt
Goto-line by cygnus on Jan 12, 2005 10:31 AM

Use this in your ~/.emacs to bind a key to goto-line:

(global-set-key "C-cl" 'goto-line)
configurationdot-emacseditorselispemacskeystrokes
Jump-to-line in view-source mode by xinu on Jan 12, 2005 10:15 AM

Pressing C-l will ask you for the line number you wish to view and will jump you to it and highlight it for you.

browserfirefoxkeystrokes
Macros by xinu on Jan 12, 2005 10:50 AM

To create a macro:

C-x (

Once in macro recording mode, enter a series of commands. When finished:

C-x )

To name the most recently recorded macro:

M-x name-last-kbd-macro

Enter a name for the macro. The name will now be accessible as M-x <name>.

To generate macro elisp suitable for reload, run M-x insert-kbd-macro and enter the name of a defined macro. Paste the resulting code into ~/.emacs.

configurationdot-emacseditorsemacskeystrokesmacros
Multi-user screen sessions by cygnus on Jan 12, 2005 10:00 AM

In a running screen, run:

C-a : multiuser on
C-a : acladd $user

Then run:

screen -x [pid]

to connect to (and control) the mulituser screen from another terminal.

keystrokesmulti-userscreensessionsterminal
Mutt Templates by xinu on Jan 12, 2005 12:11 PM

If you know you want to use a previous email as a template, find the message and press M-e. It will dump you in an editor with the same headers and content.

configurationeditorheaderskeystrokesmuamutttemplate
Narrowing by cygnus on Jan 12, 2005 10:28 AM

Narrowing is the act of making only a certain region of text visible. To narrow your view to a given textual region, set the mark (C-Spc) at the beginning of the desired area and move the point to the end of the area.

To narrow the text to the region you've marked:

C-x n n

To show the entire buffer:

C-x n w
editorsemacskeystrokesnarrowing
Opening a file into the same buffer by xinu on Jan 12, 2005 10:55 AM

It will kill the buffer you have open and visit a different file instead (for mistakes, etc), use 'C-x C-v' or 'M-x find-alternate-file'.

editorsemacskeystrokes
Operating on tagged messages by pattern by xinu on Jan 13, 2005 09:03 AM

Press T and enter a pattern like:

~s foo

or:

~c bogus@example.com

After you've tagged the messages you want to operate on, press ; followed by an action (e.g. s some_folder).

configurationkeystrokesmessagesmuamutttagging
Pipe a Region to a Shell Command by xinu on Dec 31, 2005 04:05 PM

Use M-| to pipe the selected region of text to a specified shell command.

editorsemacskeystrokespiperegion
Quick Access To Folders by xinu on Jan 12, 2005 10:13 AM

Some of your commonly accessed mutt folders have shortcut names. Press c to change folders and then use the following:

! - inbox
< - sent messages
> - read messages
aliasesconfigurationfolderskeystrokesmuamutt

Use this to remove all characters from the point to the specified character: M-z <CHAR>.

editorsemacskeystrokes
Split Screens by xinu on Jan 12, 2005 10:13 AM

While running screen, run the following sequence:

C-a S

Then run the following sequence to change focus:

C-a C-i

To collapse the splits to the one you're currently on:

C-a Q
keystrokesscreensplit
RSS