mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
To prevent database decay, set the env var AUTOJUMP_KEEP_ALL_ENTRIES=1 instead of using --preserve or --competion
This commit is contained in:
parent
788255030b
commit
9ad889a706
18
README.md
18
README.md
@ -114,8 +114,6 @@ Options must be passed to 'autojump' and not the 'j' wrapper function.
|
|||||||
|
|
||||||
-a, --add DIR manually add path to database
|
-a, --add DIR manually add path to database
|
||||||
|
|
||||||
--preserve prevent key weight decay over time
|
|
||||||
|
|
||||||
--stat show database entries and their key weights
|
--stat show database entries and their key weights
|
||||||
|
|
||||||
--version show version information and exit
|
--version show version information and exit
|
||||||
@ -127,8 +125,8 @@ INTERNAL OPTIONS
|
|||||||
|
|
||||||
--complete used for tab completion
|
--complete used for tab completion
|
||||||
|
|
||||||
ADVANCED USAGE
|
ADDITIONAL CONFIGURATION
|
||||||
--------------
|
------------------------
|
||||||
|
|
||||||
- Always Ignore Case
|
- Always Ignore Case
|
||||||
|
|
||||||
@ -139,6 +137,15 @@ ADVANCED USAGE
|
|||||||
|
|
||||||
export AUTOJUMP_IGNORE_CASE=1
|
export AUTOJUMP_IGNORE_CASE=1
|
||||||
|
|
||||||
|
- Prevent Database Entries' Decay
|
||||||
|
|
||||||
|
Default behavior is to decay unused database entries slowly over
|
||||||
|
time. Eventually when database limits are hit and maintenance is
|
||||||
|
run, autojump will purge older less used entries. To prevent decay,
|
||||||
|
add the following variable in your \~/.bashrc:
|
||||||
|
|
||||||
|
export AUTOJUMP_KEEP_ALL_ENTRIES=1
|
||||||
|
|
||||||
- Prefer Symbolic Links
|
- Prefer Symbolic Links
|
||||||
|
|
||||||
Default behavior is to evaluate symbolic links into full paths as to
|
Default behavior is to evaluate symbolic links into full paths as to
|
||||||
@ -149,6 +156,9 @@ ADVANCED USAGE
|
|||||||
|
|
||||||
export AUTOJUMP_KEEP_SYMLINKS=1
|
export AUTOJUMP_KEEP_SYMLINKS=1
|
||||||
|
|
||||||
|
ADVANCED USAGE
|
||||||
|
--------------
|
||||||
|
|
||||||
- Change Directory Weight
|
- Change Directory Weight
|
||||||
|
|
||||||
To manually change a directory's key weight, you can edit the file
|
To manually change a directory's key weight, you can edit the file
|
||||||
|
12
bin/autojump
12
bin/autojump
@ -22,6 +22,12 @@ else:
|
|||||||
xdg_data_dir = os.environ.get('XDG_DATA_HOME') or os.path.join(os.environ['HOME'], '.local', 'share')
|
xdg_data_dir = os.environ.get('XDG_DATA_HOME') or os.path.join(os.environ['HOME'], '.local', 'share')
|
||||||
CONFIG_DIR = os.path.join(xdg_data_dir, 'autojump')
|
CONFIG_DIR = os.path.join(xdg_data_dir, 'autojump')
|
||||||
|
|
||||||
|
if 'AUTOJUMP_KEEP_ALL_ENTRIES' in os.environ:
|
||||||
|
if os.environ.get('AUTOJUMP_KEEP_ALL_ENTRIES') == 1:
|
||||||
|
KEEP_ALL_ENTRIES = True
|
||||||
|
else:
|
||||||
|
KEEP_ALL_ENTRIES = False
|
||||||
|
|
||||||
if 'AUTOJUMP_IGNORE_CASE' in os.environ:
|
if 'AUTOJUMP_IGNORE_CASE' in os.environ:
|
||||||
if os.environ.get('AUTOJUMP_IGNORE_CASE') == 1:
|
if os.environ.get('AUTOJUMP_IGNORE_CASE') == 1:
|
||||||
ALWAYS_IGNORE_CASE = True
|
ALWAYS_IGNORE_CASE = True
|
||||||
@ -165,8 +171,6 @@ def options():
|
|||||||
help='enclose directory quotes to prevent errors')
|
help='enclose directory quotes to prevent errors')
|
||||||
parser.add_argument('--complete', action="store_true", default=False,
|
parser.add_argument('--complete', action="store_true", default=False,
|
||||||
help='used for bash tab completion')
|
help='used for bash tab completion')
|
||||||
parser.add_argument('--preserve', action="store_true", default=False,
|
|
||||||
help='prevent key weight decay over time')
|
|
||||||
parser.add_argument('--stat', action="store_true", default=False,
|
parser.add_argument('--stat', action="store_true", default=False,
|
||||||
help='show database entries and their key weights')
|
help='show database entries and their key weights')
|
||||||
parser.add_argument('--version', action="version", version="%(prog)s " + VERSION,
|
parser.add_argument('--version', action="version", version="%(prog)s " + VERSION,
|
||||||
@ -227,7 +231,7 @@ def match_last(pattern):
|
|||||||
if (len(last_pattern_path) > 0 and
|
if (len(last_pattern_path) > 0 and
|
||||||
last_pattern_path[0] == "/" and
|
last_pattern_path[0] == "/" and
|
||||||
os.path.exists(last_pattern_path)):
|
os.path.exists(last_pattern_path)):
|
||||||
if not ARGS.preserve:
|
if not ARGS.complete:
|
||||||
output(last_pattern_path)
|
output(last_pattern_path)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@ -364,7 +368,7 @@ def shell_utility():
|
|||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
if not ARGS.preserve:
|
if not KEEP_ALL_ENTRIES:
|
||||||
db.maintenance()
|
db.maintenance()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
@ -35,8 +35,6 @@ wrapper function.
|
|||||||
\f[C]
|
\f[C]
|
||||||
-a,\ --add\ DIR\ \ \ \ \ \ \ manually\ add\ path\ to\ database
|
-a,\ --add\ DIR\ \ \ \ \ \ \ manually\ add\ path\ to\ database
|
||||||
|
|
||||||
--preserve\ \ \ \ \ \ \ \ \ \ prevent\ key\ weight\ decay\ over\ time
|
|
||||||
|
|
||||||
--stat\ \ \ \ \ \ \ \ \ \ \ \ \ \ show\ database\ entries\ and\ their\ key\ weights
|
--stat\ \ \ \ \ \ \ \ \ \ \ \ \ \ show\ database\ entries\ and\ their\ key\ weights
|
||||||
|
|
||||||
--version\ \ \ \ \ \ \ \ \ \ \ show\ version\ information\ and\ exit
|
--version\ \ \ \ \ \ \ \ \ \ \ show\ version\ information\ and\ exit
|
||||||
@ -51,7 +49,7 @@ wrapper function.
|
|||||||
--complete\ \ \ \ \ \ \ \ \ \ used\ for\ tab\ completion
|
--complete\ \ \ \ \ \ \ \ \ \ used\ for\ tab\ completion
|
||||||
\f[]
|
\f[]
|
||||||
.fi
|
.fi
|
||||||
.SS ADVANCED USAGE
|
.SS ADDITIONAL CONFIGURATION
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
Always Ignore Case
|
Always Ignore Case
|
||||||
.RS 2
|
.RS 2
|
||||||
@ -69,6 +67,21 @@ export\ AUTOJUMP_IGNORE_CASE=1
|
|||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
|
Prevent Database Entries\[aq] Decay
|
||||||
|
.RS 2
|
||||||
|
.PP
|
||||||
|
Default behavior is to decay unused database entries slowly over time.
|
||||||
|
Eventually when database limits are hit and maintenance is run, autojump
|
||||||
|
will purge older less used entries.
|
||||||
|
To prevent decay, add the following variable in your ~/.bashrc:
|
||||||
|
.IP
|
||||||
|
.nf
|
||||||
|
\f[C]
|
||||||
|
export\ AUTOJUMP_KEEP_ALL_ENTRIES=1
|
||||||
|
\f[]
|
||||||
|
.fi
|
||||||
|
.RE
|
||||||
|
.IP \[bu] 2
|
||||||
Prefer Symbolic Links
|
Prefer Symbolic Links
|
||||||
.RS 2
|
.RS 2
|
||||||
.PP
|
.PP
|
||||||
@ -85,6 +98,7 @@ export\ AUTOJUMP_KEEP_SYMLINKS=1
|
|||||||
\f[]
|
\f[]
|
||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
|
.SS ADVANCED USAGE
|
||||||
.IP \[bu] 2
|
.IP \[bu] 2
|
||||||
Change Directory Weight
|
Change Directory Weight
|
||||||
.RS 2
|
.RS 2
|
||||||
|
12
docs/body.md
12
docs/body.md
@ -4,8 +4,6 @@ Options must be passed to 'autojump' and not the 'j' wrapper function.
|
|||||||
|
|
||||||
-a, --add DIR manually add path to database
|
-a, --add DIR manually add path to database
|
||||||
|
|
||||||
--preserve prevent key weight decay over time
|
|
||||||
|
|
||||||
--stat show database entries and their key weights
|
--stat show database entries and their key weights
|
||||||
|
|
||||||
--version show version information and exit
|
--version show version information and exit
|
||||||
@ -16,7 +14,7 @@ Options must be passed to 'autojump' and not the 'j' wrapper function.
|
|||||||
|
|
||||||
--complete used for tab completion
|
--complete used for tab completion
|
||||||
|
|
||||||
## ADVANCED USAGE
|
## ADDITIONAL CONFIGURATION
|
||||||
|
|
||||||
- Always Ignore Case
|
- Always Ignore Case
|
||||||
|
|
||||||
@ -24,12 +22,20 @@ Options must be passed to 'autojump' and not the 'j' wrapper function.
|
|||||||
|
|
||||||
export AUTOJUMP_IGNORE_CASE=1
|
export AUTOJUMP_IGNORE_CASE=1
|
||||||
|
|
||||||
|
- Prevent Database Entries' Decay
|
||||||
|
|
||||||
|
Default behavior is to decay unused database entries slowly over time. Eventually when database limits are hit and maintenance is run, autojump will purge older less used entries. To prevent decay, add the following variable in your ~/.bashrc:
|
||||||
|
|
||||||
|
export AUTOJUMP_KEEP_ALL_ENTRIES=1
|
||||||
|
|
||||||
- Prefer Symbolic Links
|
- Prefer Symbolic Links
|
||||||
|
|
||||||
Default behavior is to evaluate symbolic links into full paths as to reduce duplicate entries in the database. However, some users prefer a shorter working directory path in their shell prompt. To switch behavior to prefer symbolic links, add the following environmental variable in your ~/.bashrc:
|
Default behavior is to evaluate symbolic links into full paths as to reduce duplicate entries in the database. However, some users prefer a shorter working directory path in their shell prompt. To switch behavior to prefer symbolic links, add the following environmental variable in your ~/.bashrc:
|
||||||
|
|
||||||
export AUTOJUMP_KEEP_SYMLINKS=1
|
export AUTOJUMP_KEEP_SYMLINKS=1
|
||||||
|
|
||||||
|
## ADVANCED USAGE
|
||||||
|
|
||||||
- Change Directory Weight
|
- Change Directory Weight
|
||||||
|
|
||||||
To manually change a directory's key weight, you can edit the file _$XDG_DATA_HOME/autojump/autojump.txt_. Each entry has two columns. The first is the key weight and the second is the path:
|
To manually change a directory's key weight, you can edit the file _$XDG_DATA_HOME/autojump/autojump.txt_. Each entry has two columns. The first is the key weight and the second is the path:
|
||||||
|
Loading…
Reference in New Issue
Block a user