|
NAMEcdargs - bookmarks and browser for cd shell built-inSYNOPSIScdargs [OPTIONS]function cv () { cdargs "$1" && cd "`cat "$HOME/.cdargsresult"`" ; } cv [Needle] DESCRIPTIONWith cdargs you can jump to various places throughout the file-system that are defined using a plain text, line oriented bookmarks file.You can create bookmarks by editing your bookmarks file "$HOME/.cdargs" using your favorite editor, by using the "--add" option to cdargs or by using the built-in mechanism that will be described later. While you are in cdargs you can use various commands to navigate through your list of bookmarks and through the file-system. These are described below in the section "COMMANDS". The most commonly used and most obvious commands are the up/down keys for navigation, "ENTER" for selection of a path and "q" for quit. To be able to actually use this program together with the shell built-in "cd" command you must use a little trick by defining a shell function. Of course the syntax for this is different between the csh-like shells (like tcsh) and the sh-like shells (like bash). For sh-like shells:
For csh-like shells:
Now you only have to put the cdargs binary somewhere into your path. Of course you can create functions and/or aliases for different purposes. You might want to add a pwd call to echo your current directories or put --nowrap in your functions to enable a different scrolling behavior. See section SHELL FUNCTIONS below. Since version 1.19 cdargs brings a collection of bash functions (and since 1.20 tcsh aliases, too) with it. You only have to source this in your ~/.profile or ~/.bashrc (or ~/.tcsh) and you get nice kinds of magic prepared (completion...). Please read the cdargs-bash.sh or cdargs-tcsh.csh respectively for the documentation of these functions. COMMAND-LINE OPTIONSYou can call cdargs with a few options, but otherwise you probably won't call it directly but via the function you defined.
COMMANDSWhen you are in cdargs you have two modes and several commands at your hands.The two modes are LIST (when your bookmark list is displayed) and BROWSE (when you navigate through the file-system). The navigation keys are mostly available in Emacs and vi style for all maniacs out there. Common Keys
Keys in BROWSE mode
Keys in LIST mode
SHELL FUNCTIONSIn addition to the shell function mentioned above you might wish to add other commands to your function. One example is to echo the directory you changed to:function cv () {
cdargs "$1" && cd "`cat
"$HOME/.cdargsresult"`"
&& pwd;
Or you can remove the file in which cdargs reports it's result: function cv () {
cdargs "$1" && cd "`cat
"$HOME/.cdargsresult"`"
&& rm -f "$HOME/.cdargsresult";
Since version 1.19 cdargs comes with a file of preset functions for bash: see cdargs-bash.sh in the distribution. From now on you only have to source that file if you are using a sh-like shell. Then you can use the shell completion to switch directories even faster by typing cv [TAB] Since version 1.20 cdargs comes with a file of rudimentary aliases
(and completion) for the tcsh.
DISPLAYThe cdargs window has one line at the bottom for the display of messages like when you added to your list or when you hit an unknown key.The second line from the bottom is a status line which shows the current directory and a one letter code for the current operation mode:
The largest part of the display is used to show you either the list of your bookmarks or the contents of the current directory. On the left side you'll probably find a number which you can use for a slightly quicker jumping compared to using the cursor movement. These numbers can be moved as described above. Next comes the short description of an entry in brackets. This is convient when you have quite long paths in your bookmarks and most of them start with the same base (e.g. /home/user). Finally there is the actual absolute path you'll be warping to when finishing. Obviously the current entry is highlighted. If the path is preced by a "!" it points to an invalid directory. A bookmark pointing to the current working directory is displayed in bold font (if the terminal emulation understands that attribute). FILES$HOME/.cdargs personal bookmarks file.
REPORTING BUGSReport bugs to <mail@skamphausen.de>.AUTHORcdargs was written by Stefan Kamphausen with add-ons by Claus Brunzema. Many user-interface improvements came from Dan Allen.SEE ALSOThe current version of cdargs is located at
You might want to visit that site. Other than that pressing the 'H' key in cdargs fires up a help screen. COPYRIGHTCopyright © 2001-2003 Stefan Kamphausencdargs is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Visit the GSP FreeBSD Man Page Interface. |