Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: New user questions



On Mar 30,  3:14am, Andrew Morton wrote:
} Subject: New user questions
}
} 1: When I printed zsh_a4.ps on an HP LaserJet 4 the last few columns
} were truncated.

Silly question, but ... were you actually printing on size A4 paper?

I'm jumping into the rest of this a bit late, but ...
 
} insert-previous-line
} --------------------
} 
} pwold011:~> /sbin/shutdown
} shutdown: must be root.
} pwold011:~> sudo ^W
} 
} Here, typing ^W will insert _all_ of the previous line at the prompt.
} (I'd expected get-line to do this, but it just beeps...)

Assuming that you have:
	bindkey "^N" down-line-or-history
	bindkey "^P" up-line-or-history
	bindkey "^U" kill-whole-line
	bindkey "^Y" yank

Then:
	bindkey -s "^W" "^P^U^Y^N^Y"

No need to write a widget for something as simple as this.  The only
tricky bit is the extra ^Y in the middle, needed to "leave the history
as you found it" for other editing commands later.

It's possible that you meant "insert the previous history line at the
cursor" ... that really does require a widget, because zsh loses the
cursor and mark positions when moving up and down through the history.

} ^C
} --
} 
} This normally generates interrupt.  Is there a way of making it
} available to the interactive editor without globally sttying it? (The
} shell would need to restore the intr char when it leaves editing mode).

Check out the STTY parameter.

	stty intr '^G'		# Change interrupt character for zsh
	ttyctl -f		# Freeze settings, just in case
	export STTY='intr ^C'	# Restore interrupt for external commands
 
} Bidirectional directory history
} -------------------------------
} 
} I'd like to be able to 'cd' back to somewhere where I used to be.  I
} have this set up nicely using popd.  But once I've gone back a few
} levels with multiple popd's I would like to go forward again.  A ring,
} rather than a stack.
} 
} Possible?

The pushd/popd commands used to work this way (I still have a local hack
to enable it via setopt).  There's an example in the FAQ document that
shows how to do it with shell functions.

} Changing separators
} -------------------
} 
} All the editor commands define a word separator as a space.  Is there a
} way of changing zsh's idea of word separators?  I would prefer that it
} consider '/' to be a separator as well.

In addition to WORDCHARS (which others have pointed out), you might try
using the vi-* word motion widgets instead of the emacs ones.

One additional comment:

On Mar 30,  7:27am, Friedrich Dominicus wrote:
} Subject: Re: New user questions
}
} > insert-previous-line
} > --------------------
} > 
} > pwold011:~> /sbin/shutdown
} > shutdown: must be root.
} > pwold011:~> sudo ^W
} 
} sudo !!$

Get that `$' out of there.  Just `sudo !!' does it.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



Messages sorted by: Reverse Date, Date, Thread, Author