1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00
Commit Graph

260 Commits

Author SHA1 Message Date
William Ting
13377acbbd add match anywhere implementation 2013-12-17 16:25:45 -06:00
William Ting
c259978585 add ignore_case to fuzzy matching 2013-12-17 16:12:26 -06:00
William Ting
1e4ca4d67e add quotes for bash output 2013-12-17 16:06:27 -06:00
William Ting
3125c65378 add fuzzy matching 2013-12-17 15:57:36 -06:00
William Ting
551b2f3853 make a bunch of functions pure 2013-12-17 14:48:12 -06:00
William Ting
6ea43c4267 minor reorganization 2013-12-17 13:52:34 -06:00
William Ting
39e5b0b4cc minor cleanup 2013-12-17 13:24:16 -06:00
William Ting
d115075295 remove current directory from matches 2013-12-17 12:20:18 -06:00
William Ting
1472b417c3 clarify detect_smartcase docstring 2013-12-17 12:04:11 -06:00
William Ting
b695cc3f7d minor cleanup 2013-12-17 12:03:57 -06:00
William Ting
067f653b50 match consecutive needles to paths 2013-12-17 11:54:40 -06:00
William Ting
30d1b6d6f2 implement ignore_case for match_end() 2013-12-17 11:11:27 -06:00
William Ting
c2189efb7b handle no results situation 2013-12-17 11:04:44 -06:00
William Ting
1a2a5a86f6 move existence of directories checking to end 2013-12-17 11:01:18 -06:00
William Ting
e51f595018 match end for single arguments finished 2013-12-17 10:55:56 -06:00
William Ting
d9b205c935 implement smartcase detection 2013-12-17 10:35:43 -06:00
William Ting
bb04405cd6 add unicode and ignore case regex flags 2013-12-17 10:07:39 -06:00
William Ting
bd091b8766 add no os.path.realpath() comment 2013-12-17 09:52:41 -06:00
William Ting
f84dffb7c7 add regex exact match 2013-12-17 09:52:30 -06:00
William Ting
fdeedb4f70 add multiple argument exact match support 2013-12-17 09:35:14 -06:00
William Ting
4c432fc5f1 overwrite old autojump 2013-12-16 20:28:54 -06:00
William Ting
9112dc97d9 exact match with single argument finished 2013-12-16 20:27:41 -06:00
William Ting
92b6047962 handle missing current directory errors 2013-12-16 17:07:41 -06:00
William Ting
95c81b7665 add purge feature 2013-12-16 16:54:27 -06:00
William Ting
bde9ac1d9f add decrease_path 2013-12-16 16:32:35 -06:00
William Ting
35a0991385 add increase directory weight 2013-12-16 16:26:41 -06:00
William Ting
694d150882 finished add directory, stats, remove bad entries 2013-12-16 16:13:45 -06:00
William Ting
8cbd19cc79 add unicode helpers back 2013-12-16 15:40:51 -06:00
William Ting
7671fcbd06 simplify unicode encode/decoding 2013-12-16 15:19:04 -06:00
William Ting
39b5e3030d implement load, backup, and save data functionality 2013-12-16 14:08:28 -06:00
William Ting
5fd2859f19 add legacy migration 2013-12-16 11:20:40 -06:00
William Ting
b4dcdffa9c rename argparse library 2013-12-15 13:13:49 -06:00
Wieland Hoffmann
26db68a8e8 zsh/jo: Defer -options to j 2013-11-24 23:26:23 +01:00
William Ting
0b25bef134 Creates data directory before attempting to save the database.
Fixes #218.
2013-09-26 15:40:34 -05:00
Manpreet Singh
adde814ed3 Prevent duplicates in chpwd_functions on re-source 2013-07-16 20:50:39 -07:00
William Ting
195312acad update docs, copyright year 2013-07-06 21:17:54 -05:00
William Ting
72b8c0a660 minor refactor 2013-07-06 20:23:34 -05:00
William Ting
fca26f3ef4 merge fish_support branch 2013-06-04 08:01:18 -05:00
William Ting
2a7b9835eb Merge pull request #209 from spice/master
add fish support
2013-06-04 06:01:10 -07:00
William Ting
e22a346b56 update install.sh to source shell specific file 2013-06-04 08:00:39 -05:00
William Ting
f232f9afa8 bump to v21.6.9 2013-05-29 12:19:26 -05:00
Alexander Bolodurin
e72369c1a9 Use correct export syntax. 2013-05-25 22:28:06 +10:00
William Ting
e491a63175 Merge branch 'master' of git://github.com/spice/autojump into fish_support 2013-05-25 05:03:58 -07:00
William Ting
d89c25a4fc stop adding home directory to database 2013-05-21 08:36:44 -07:00
William Ting
590909bafc reorder imports so vendorized argparse works correctly 2013-05-21 07:28:39 -07:00
Alexander Bolodurin
701e454dd6 Add Fish support. 2013-05-18 21:58:41 +10:00
William Ting
3e6f115ed8 remove old migration code 2013-05-14 23:05:49 -05:00
William Ting
286c099848 minor formatting changes 2013-05-14 23:00:22 -05:00
William Ting
a489a8de70 fix tab completion 2013-05-14 22:53:07 -05:00
William Ting
3b8231c0b2 fix output_quotes() calls 2013-05-14 22:00:44 -05:00
William Ting
400cd62613 simplify tab completion 2013-05-14 21:58:43 -05:00
William Ting
78e0bb2880 explicit imports for NamedTemporaryFile 2013-05-14 21:58:23 -05:00
William Ting
57de0881da move max_matches logic into parse_args() 2013-05-14 21:58:00 -05:00
William Ting
2fcaefb017 refactor output(), add output_quotes() 2013-05-14 21:56:15 -05:00
William Ting
ac538503e1 minor formatting changes 2013-05-14 20:58:24 -05:00
William Ting
dd7a0fbbc7 add weights decay back 2013-05-14 20:22:44 -05:00
William Ting
776f109b3a remove maintenance based on weights, remove AUTOJUMP_KEEP_ALL_ENTRIES 2013-05-14 19:43:43 -05:00
William Ting
2b6cfe7cdf remove zsh tab completion redundant code 2013-05-14 19:11:16 -05:00
William Ting
e21292e573 update documentation 2013-05-14 19:07:55 -05:00
William Ting
96a2206931 separate --increase from --add, print out directory weights, don't add home directory to database 2013-05-14 19:03:08 -05:00
William Ting
fcd7465ed8 switch away from global variables 2013-05-14 18:30:00 -05:00
William Ting
3b89c13cd2 fix stats 2013-05-14 17:46:28 -05:00
William Ting
2582ad6421 Refactor away from global variables, use defaultdict/iteration instead. 2013-05-14 17:34:19 -05:00
William Ting
f5ff5a126f Update changelog, version butmp to v21.5.9.
Related: #206
2013-05-14 10:16:36 -05:00
William Ting
de98e83b25 fix error log location 2013-04-29 12:53:36 -05:00
William Ting
c763b2afad better fix for custom installation directories 2013-04-24 19:05:56 -05:00
William Ting
ad09ee27d4 Fix security bug that allows running arbitrary user code.
https://bugzilla.redhat.com/show_bug.cgi?id=950777
2013-04-24 15:34:53 -05:00
William Ting
d3c1765255 minor fix 2013-04-19 09:49:53 -05:00
William Ting
81400f02a3 version bump to v21.5.4 2013-04-18 16:44:58 -05:00
William Ting
72fe7e391d Prevents circular sourcing if shell is #/bin/sh
Closes #203.
2013-04-18 16:43:43 -05:00
Rogério Brito
2a49b8ca47 Use non-lazy enumeration for removal of dictionary keys.
In the current situation, iterating over `self.data.keys()` is OK only when
the dictionary is not modified, as `self.data.keys()` is lazily generated,
at least in Python 3.

Unfortunately, as we intend to change the dictionary with the `--purge`
option, we get a runtime exception when iterating the loop.

This commit fixes it by making the generation of the list of keys occur only
once, so that the dictionary itself can be modified in the body of the loop.

Tested with both Python 2.7 and Python 3.3.

Signed-off-by: Rogério Brito <rbrito@ime.usp.br>
2013-04-14 12:58:26 -03:00
Ahmed Aeon Axan
f7e98ea498 fixed typo
The previous code was most probably a typo if i think.
2013-04-14 00:57:59 +05:30
jostber
a97c516758 Updated cygwin code as for autojump.bash 2013-04-03 13:50:37 +02:00
jostber
4284307579 Updated cygwin code to start file explorer correctly 2013-04-03 13:48:23 +02:00
Rasmus
e83ee24ea7 updated autojump.bash, removing export
exporting the prompt seems to be too harsh and breaks the shell in Emacs as the PROMPT_COMMAND for xterm (say) overwrites the 'dumb' PROMPT_COMMAND, which now is 'contaminated' with ASCII escape strings.
2013-03-30 03:36:41 +01:00
Sven Taute
4685d86a17 normalize path ending before adding to the DB 2013-03-11 20:38:23 +01:00
William Ting
54aeff1cae Show database file when printing stats.
Closes #188.
2013-02-25 00:03:46 -06:00
William Ting
6f887a2000 fix unit tests to match new decrease calculation 2013-02-24 23:55:29 -06:00
William Ting
79cf76bcf5 fix some pep 8 issues 2013-02-24 23:49:45 -06:00
William Ting
4237861aba v21.5.0: add --increase and --decrease options to manually change weight. 2013-02-24 23:45:22 -06:00
Xavier Lepaul
b8901586cb adding option to decrease weight
added a new option, -d/--decrease to decrease the weight of a path.
added --increase as an alias to --add for symetry.
2013-02-24 20:52:09 -08:00
William Ting
f4fa47fd22 version bump to 21.4.6 2013-02-14 13:41:20 -06:00
Jui-Shan Liang
c76ce0d083 Fix Issue #182 2013-02-15 03:26:54 +08:00
Jui-Shan Liang
fa756cd7e9 Trying to fix Issue #177 2013-02-15 02:59:01 +08:00
William Ting
48487e3050 minor version bump 2013-02-13 22:25:53 -06:00
William Ting
022b43edd2 Merge branch 'master' of github.com:joelthelion/autojump 2013-02-13 12:15:48 -06:00
William Ting
17d31d881e Revert "remove _j() as it was never used to begin with."
This reverts commit 49a0d702ba.

Conflicts:
	bin/autojump

Closes #178, #181.
2013-02-13 12:14:52 -06:00
Jui-Shan Liang
1d31f720f4 Fixed issue: Command "jc" doesn't jump correctly if sibling directories have same prefix 2013-02-12 03:18:12 +08:00
William Ting
833dcca408 version bump 2013-02-11 10:48:31 -06:00
William Ting
c7d0533dd8 handle white space properly when opening with file manager 2013-02-03 09:12:24 -06:00
William Ting
ae978d3319 use zsh change directory hook rather than pre-command hook 2013-02-01 15:00:26 -06:00
William Ting
214440af65 minor code cleanup 2013-02-01 14:59:34 -06:00
William Ting
49a0d702ba remove _j() as it was never used to begin with. 2013-02-01 14:04:02 -06:00
William Ting
d57e7b779c add option to open file explorer window from the commandline, bump to 21.4.0 2013-02-01 13:50:52 -06:00
William Ting
4ce2cb5929 Remove jumpapplet. 2013-01-05 10:36:52 -06:00
William Ting
201e079c07 merging blueyed's changes to reduce stat() calls 2012-12-18 11:55:30 -06:00
William Ting
12805b0f58 Merge pull request #170 from blueyed/gh-find_matches-named-args
Use named args when calling find_matches
2012-12-18 09:41:32 -08:00
William Ting
182400ae8c Reduce lag for using when using sshfs mounts caused by checking pwd. 2012-12-18 11:33:36 -06:00
Daniel Hahler
10a8a3f785 Avoid file stats in find_matches for fuzzy=True, too 2012-12-18 17:14:53 +01:00
Daniel Hahler
4bd574aaf9 Use named args when calling find_matches
This should make it clearer at first glance where True and False is
referring to.
2012-12-18 16:03:29 +01:00
Daniel Hahler
586ce0deee Skip current_dir in find_matches for fuzzy=False, too 2012-12-18 15:46:24 +01:00
Daniel Hahler
6d98cf886d Do not decode os.path.realpath / path
`path` is decoded already (coming from `db`) and this caused the
following error:

    Traceback (most recent call last):
      File "/home/user/.autojump/bin/autojump", line 460, in <module>
        if not shell_utility(): sys.exit(1)
      File "/home/user/.autojump/bin/autojump", line 429, in shell_utility
        results = find_matches(db, patterns, max_matches, False)
      File "/home/user/.autojump/bin/autojump", line 374, in find_matches
        if current_dir == decode(os.path.realpath(path)) :
      File "/home/user/.autojump/bin/autojump", line 277, in decode
        return text.decode(encoding, errors)
      File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
        return codecs.utf_8_decode(input, errors, True)
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xb4' in
    position 52: ordinal not in range(128)
2012-12-18 11:52:57 +01:00
Daniel Hahler
0547e23411 Avoid calls to stat() in find_matches
Instead of stating every directory to check if its realpath is the
current directory, only do so for any potential matches.
2012-12-18 11:32:58 +01:00
William Ting
a99183bf8b Never jump to pwd, use next best option.
This regression bug was introduced when adding the KEEP_SYMLINKS option. The
current_dir was always set to '.' which would never match any database entries.
2012-12-17 12:35:33 -06:00
William Ting
f0e45478a7 Add jc function, jump to a subdirectory of the current working directory.
Closes #156.
2012-12-14 22:58:20 -06:00
William Ting
da69e15efb add shorthand shortcut -v for --version 2012-12-14 20:52:03 -06:00
JrCs
b829fd5a4a Fix PROMPT_COMMAND issues 2012-12-14 19:42:46 -06:00
William Ting
2c75c36229 only open files as utf-8 with Python 3.0+ 2012-11-23 23:26:09 -06:00
William Ting
024d550c8c Disable bash autocompletion, make it optional. Add relevant documentation. Closes #140. 2012-11-23 08:32:15 -06:00
William Ting
d0e0a990ce Set default encoding to UTF-8 when opening database file. Closes #162. 2012-11-22 17:19:59 -06:00
William Ting
50e6054e13 Version bump to v21.1.0, update relevant documentation. 2012-11-22 16:44:05 -06:00
William Ting
8b13949173 Consolidate source calls to use autojump.sh. Modify autojump.sh to support
custom installations.
2012-11-22 16:33:05 -06:00
William Ting
837671fe0b refactoring 2012-11-22 14:15:28 -06:00
William Ting
2554fc7ed4 refactor a few lines for legibility 2012-11-21 17:48:47 -06:00
William Ting
fd287eab04 Reverts commit 74c50133d2. Fixes #159, #160.
Even though the previous version works fine on OS X 10.6.8, it seems to be
causing problems for other Mac users on 10.8.x. Unfortunately I do not have
access to a newer Mac to test on.
2012-11-21 17:33:31 -06:00
William Ting
48c52a7422 Test for brew existence before testing for brew zsh site functions directory.
The previous test condition would cause errors because even though brew didn't
exist, the directory /share/zsh/site-functions did and it would throw error
messages on non-homebrew systems.
2012-11-03 18:27:41 -05:00
William Ting
f46b541105 remove adding git version to autojump install 2012-11-01 04:25:42 -05:00
William Ting
ac1bfeb784 version bump to v21.0.3 2012-11-01 03:59:44 -05:00
JrCs
74c50133d2 Add autojump to the end of PROMPT_COMMAND 2012-11-01 09:12:21 +01:00
William Ting
1b5d9df854 minor documentation reformat 2012-10-30 22:27:54 -05:00
William Ting
1a032a97b4 Fix #148, add documentation regarding PROMPT_COMMAND. Bump to v21.0.1 2012-10-30 21:19:04 -05:00
William Ting
5745c34c23 version numbering 2012-10-30 21:05:16 -05:00
Daniel Hahler
4382116b55 Vendorize argparse
This adds the argparse library [1] as autojump_argparse and imports it
via sys.path mangling in case argparse does not exist (Python 2.6 or
below without argparse installed).

This makes autojump effectively work with Python 2.6 again by default.

I have not verified license compatibility, but given the intention of
the (backport) project this is likely OK (it is licensed under the
Python license).

1: http://code.google.com/p/argparse/

Fixes issue #121.
2012-09-26 22:04:45 +02:00
William Ting
3acedf2ed8 Remove loading compinit module from autojump.zsh.
I've updated the documentation to notify end users to add compinit to their
~/.zshrc if they want tab completion.
2012-07-02 17:36:27 -10:00
William Ting
ca8763aa02 Fix #135. Autojump was failing for directories with - due to bad regex. 2012-06-28 18:52:00 -10:00
William Ting
c62a8923ae Add v21 release notes, minor documentation update. 2012-06-23 14:38:26 -10:00
William Ting
f41d0fb7b3 Remove database migration code support for v17 and older.
The migration code was never working to begin with. Users migrating from v17 or
older will be starting from an empty, new database.
2012-06-23 13:21:24 -10:00
William Ting
e96dc4c9d8 Fix #86: ZSH tab completion
Forces zsh to load compinit required for tab completion.
2012-06-23 10:20:27 -10:00
Mark Tran
3c439a278e _j is now installed to /usr/local/share/zsh/site-functions in the autojump homebrew formula 2012-06-19 18:49:36 -07:00
William Ting
b510aa6824 switch to semantic versioning 2012-06-16 13:57:40 -10:00
William Ting
3a7f211fb6 Obey AUTOJUMP_KEEP_SYMLINKS when testing current directory against paths.
This is to make sure we don't jump into our current directory when the symlinks
option is enabled.
2012-06-04 08:06:25 -10:00
William Ting
05026ff54e break db load into smaller functions, load backup if opening primary db fails 2012-05-28 09:44:09 -10:00
William Ting
626fa8b080 version bump to v20-9 2012-05-28 09:24:04 -10:00
William Ting
b00e0e85e1 Fix #123, new installations were not initializing database properly.
Also added unit test coverage to check database initialization, saving, and
loading.  Unit tests also revealed that migration code was not working properly
(starts database from scratch instead of copying existing entries over).
2012-05-28 09:21:31 -10:00
William Ting
183fa795d7 Update scripts to use version agnostic pattern matching and corresponding documentation. 2012-05-27 13:14:01 -10:00
William Ting
1b765ab8a6 Use zsh version agnostic approach regarding substring matching 2012-05-27 13:04:24 -10:00
William Ting
32566eb89d Implements #126. Options passed to j will now be parsed. -s short option for
--stat added, jumpstat alias removed.

Options passed to the `j` function will now be passed on autojump. As a result,
directories beginning with `-` are no longer supported.

A -s short alias for --stat is added. Instead of using jumpstat, use `j --stat`
or `j -s` instead.
2012-05-27 11:24:49 -10:00
William Ting
d194429782 Test zsh version before using appropriate regex test conditional.
As best I can tell, ZSH introduced the "=~" condition somewhere around 4.3.5 or
4.3.9. In either case, autojump will use =~ for versions higher than 4.3.5 and
  -pcre-match for older versions of ZSH.
2012-05-27 10:53:33 -10:00
Kenny MacDermid
ee1be0310b Use -pcre-match in .zsh instead of =~.
Before zsh 4.3.5 =~ was not supported. This results in the message
'autojump.zsh:18: condition expected: =~'.
2012-05-20 12:16:31 -03:00
William Ting
e62e720765 move config back to global space 2012-05-12 17:00:38 -10:00
William Ting
7123e23706 minor version bump to v20-6 2012-05-12 16:38:51 -10:00
William Ting
13e385a0ef reformat doc strings, move config into own function, add global variable for testing purposes 2012-05-12 16:31:37 -10:00
William Ting
0818bf8164 Fix #110, autojump_ignore_case now working properly 2012-05-08 09:08:50 -10:00
William Ting
60a9c1c2f1 add purge option to clear database of missing entries 2012-05-06 20:50:40 -10:00
William Ting
a4cbff774b add copyright back into main file 2012-05-06 20:24:11 -10:00
William Ting
be82be31d5 fix env var settings 2012-05-06 19:51:09 -10:00
William Ting
9ad889a706 To prevent database decay, set the env var AUTOJUMP_KEEP_ALL_ENTRIES=1 instead of using --preserve or --competion 2012-05-06 18:40:19 -10:00
William Ting
788255030b Implements #110: use 'export AUTOJUMP_IGNORE_CASE=1' to make autojump case insensitive 2012-05-06 18:30:22 -10:00
William Ting
d7cea40619 implement basic fuzzy search 2012-05-06 18:10:06 -10:00
William Ting
f98b13641f increment path weights on a log scale 2012-05-06 15:54:27 -10:00