Commit Graph
44 Commits
Author SHA1 Message Date
Marc Cornellà 3704fbb71e Extract CWD notifier back out of auto-title hooks 2015-02-13 15:57:18 +01:00
Marc Cornellà 0edf416bea Temporarily delete over-engineered solution 2015-02-10 20:38:06 +01:00
Marc Cornellà 732c7b8070 Simplify adding workon_cwd to chpwd hook 2015-02-10 20:32:52 +01:00
Marc Cornellà b62911660d Organize error checking in virtualenwrapper plugin 2015-02-10 20:32:52 +01:00
Marc Cornellà 2e41d06b76 Use quoted $TERM value everywhere 2015-02-10 19:53:40 +01:00
Marc Cornellà b7e5dd35ef Quick-fix code style 2015-02-10 19:52:58 +01:00
Marc Cornellà 6fb866183d Remove composer.json file requirement
This is because we can't be sure which arguments require a json file
and which don't, so the `else' statement will always be difficult to
check for correctness.
2015-02-10 19:32:59 +01:00
Marc Cornellà 02d75684f3 Force using https in Yandex search engine 2015-02-10 19:32:52 +01:00
Marc Cornellà e8daf8150e Fix yahoo search URL in web-search plugin 2015-02-10 19:32:52 +01:00
Marc Cornellà c45885093f Add support for cygwin open in web-search plugin 2015-02-10 19:32:52 +01:00
Marc Cornellà adaea31ca0 Silence nohup output in web-search plugin 2015-02-10 19:32:52 +01:00
Marc Cornellà 80ba54a94f Add Yandex support to web-search plugin 2015-02-10 19:32:52 +01:00
Marc Cornellà 80d856e165 Clean up web-search plugin logic to allow easier changes 2015-02-10 19:32:52 +01:00
Marc Cornellà 2193135ebc Clean up appearance lib file and redundant colors calls in other files 2015-02-10 19:22:50 +01:00
Marc Cornellà 51946eb3ce Implement deletion of sl alias as per #3055 2015-02-10 19:22:39 +01:00
Marc Cornellà 282240bf37 Account for iTerm2 sent keys in dircycle plugin 2015-02-10 19:18:15 +01:00
Marc Cornellà 999bab187c Emulate zsh in zlewidgets instead of static setopt command
This way the user can keep their preferred pushd syntax while enabling
us to use a standard syntax in our defined functions.

To explain further, without a clear value on the PUSHD_MINUS option, we
could be changing the +1/-0 values all we want, that some user would
find that it didn't work for him.

We have two options, then:
- Setting a particular value, which was my first approach.
- Using `emulate -L zsh` to ensure all options defined in the function's
  body won't be passed along to the main zsh instance.
  For more info see:
  http://zsh.sourceforge.net/Doc/Release/Shell-Builtin-Commands.html#index-emulate
2015-02-10 19:18:15 +01:00
Marc Cornellà e93fd939ad Run pushd command directly and trigger prompt redraw 2015-02-10 19:18:15 +01:00
Marc Cornellà 5fe22fcbc6 Clean up and fix +1/-0 syntax to work as expected
This change follows this proposed behaviour:

 Ctrl+Shift+Left:  move to last visited directory
 Ctrl+Shift+Right: move to next visited directory

an alternative behaviour would be:

 Ctrl+Shift+Left:  move directory to the left in `dirs` output
 Ctrl+Shift+Right: move directory to the right in `dirs` output

It also introduces `setopt nopushdminus` as a way to standardise
pushd syntax. It's value wasn't clear before, which has been the
cause of so many pull requests regarding this plugin not working
in some environments.
2015-02-10 19:18:14 +01:00
Marc Cornellà e60458793a Switch newer-than logic to get the desired behavior
In the old version, the function returned true (0) if the cache file
was newer than the Cakefile, which was *always* unless the Cakefile
had been updated. Therefore we generated the file every time unless
the Cakefile was updated, which was precisely when we needed to
regenerate the cache file.

Now it generates the cache file only when the Cakefile has been
updated.
2015-02-01 23:32:38 +01:00
Marc Cornellà 711843153d Tidy up the grep.zsh library 2014-12-13 19:52:49 +01:00
Marc Cornellà 0190eb084b Use unaliased grep in flag check 2014-12-13 19:45:04 +01:00
Marc Cornellà cf586b54b8 Ignore .bzr folders in grep too 2014-12-13 19:45:02 +01:00
Marc Cornellà 0bd3c9996f Extract VCS folders definition to avoid repetition 2014-12-13 19:44:38 +01:00
Marc Cornellà a301f567e3 Switch back to oh-my-zsh.hide-dirty setting again
Commit 81004dfaba reverted the change
in 9b811fb625 when editing the merge
conflict from #2928.

This commit fixes that so that we don't make the same mistake again.

First seen in http://git.io/Cdaj5Q
2014-11-19 18:40:18 +01:00
Marc Cornellà 95d795e8ca Change all hostname calls for $HOST or $SHORT_HOST 2014-11-06 18:33:56 +01:00
Marc Cornellà 4310a15de5 Change all pwd calls for $PWD variable
This avoids spawning additional processes as $PWD **always** contains
the current working directory.
2014-11-06 18:33:56 +01:00
Marc Cornellà 74177c5320 Change all whoami calls for $USER variable
This avoid spawning additional processes, as the $USER variable will
**always** contain the current logged-in user.
2014-11-06 18:33:56 +01:00
Marc Cornellà b452cafb16 Follow-redirect and silent mode curl throughout gitignore
This commit completes previous efforts and standardizes both curl commands
into using silent mode and following redirects in case the URL changes
again in the future.
2014-10-22 18:13:15 +02:00
Marc Cornellà 36e05e95ad Don't set auto_name_dirs because it messes up prompts
From http://zsh.sourceforge.net/Doc/Release/Options.html#Completion-4

> AUTO_NAME_DIRS
> Any parameter that is set to the absolute name of a directory immediately
> becomes a name for that directory, that will be used by the ‘%~’ and
> related prompt sequences, and will be available when completion is performed
> on a word starting with ‘~’.
> (Otherwise, the parameter must be used in the form ‘~param’ first.)

Explained in more detail in
https://github.com/wayneeseguin/rvm/issues/3091#issuecomment-60083194

Related issues:
https://github.com/robbyrussell/oh-my-zsh/issues/2857
https://github.com/robbyrussell/oh-my-zsh/issues/3238
https://github.com/wayneeseguin/rvm/issues/3091
2014-10-22 15:39:27 +02:00
Marc Cornellà 142a6c7fd5 Fix pass zsh completion and autoloading
When autocompleting from `pass <TAB>', sometimes the following errors
appear:

  _values:compvalues:10: not enough arguments
  find: `/home/user/.password-store': No such file or directory
  _values:compvalues:10: not enough arguments
  find: `/home/user/.password-store': No such file or directory

The `_values' error happens when there is no password-store folder *or*
there are no passwords in pass; the `find' error only when there is no
password-store folder.

We can trace it back to line 108, which contains the only `_values'
statement that is executed when we autocomplete from pass. We confirm
this by following the trail of execution, which is

  _pass -> _pass_cmd_show -> _pass_complete_entries ->
        -> _pass_complete_entries_helper

If we try running the command inside `$()' on line 104, we see that it
returns nothing and the output is blank. This means that `_values' only
receives 1 of its 2 mandatory parameters, therefore the above error is
triggered (not enough arguments).

That is unless we don't have a password-store folder, in which case the
`find: [...] no such file or directory' error is *also* triggered.

We solve the first error by supplying a default value of "" if the
command outputs nothing, using the zsh construct ${var:-else}.

We solve the second error by redirecting the find command's stderr output
to /dev/null, so the error is effectively suppressed.

* * * *

This patch also fixes the first tab completion, which currently only
loads the completion function definition.

We do this by adding a `_pass' statement at the end of the file, which
runs the `_pass' completion function after loading its definition.
This is the standard way an autoloaded function works; for other examples
look at zsh's official completion files.
2014-08-29 00:39:33 +02:00
Marc Cornellà 17dd5792b4 Update pass completion to upstream
Conflicts:
	plugins/pass/_pass
2014-08-29 00:39:33 +02:00
Marc Cornellà 1e2abe5d4e Categories of issues in oh-my-zsh (work-in-progress) 2014-08-29 00:38:12 +02:00
Marc Cornellà 1aadd63cfc Add CONTRIBUTING.md file general structure 2014-08-29 00:38:12 +02:00
Marc Cornellàandncanceill 340da08b9a Add missing quotes to within-bundler-project function 2014-06-28 10:12:19 +02:00
Marc Cornellàandncanceill fbf4a78acf Show user prompt in gnzh theme regardless of UID
Fixes #2008.
2014-06-06 11:27:53 +02:00
Marc Cornellà fcfa323974 Use cache folder inside $ZSH, delete with unaliased rm 2014-04-18 17:07:23 +02:00
Marc Cornellà 5137e0e509 Escape % in $CMD variable
Fixes formatting on some rare cases when a percent ends up
in the $CMD variable, like these below:

- When assigning a variable, $CMD ends up with the second parameter;
in this case, $CMD will contain '+%s%N', messing with the syntax:

 $ a=`date +%s%N`

- A function (or command in general) that contains a percent symbol:

 $ to\%() { echo $(( $1 * 100 / $3))\% } # $CMD=to%()
 $ to% 2 of 10 # $CMD=to%
2014-03-25 21:14:20 +01:00
Marc CornellàandPhil Eichinger c0e3c553bc Fix export syntax of $GREP_OPTIONS
Fixes #2641, #2642
2014-03-25 16:47:58 +01:00
Marc Cornellà 12e30faaca Fix export syntax of $GREP_OPTIONS
Fixes #2641, #2642
2014-03-23 02:09:38 +01:00
Marc Cornellà a951600b4e Avoid 'title:parse error' with single quotes in $CMD
Fixes #2182
2014-02-21 22:16:12 +01:00
Marc Cornellà 3e5de21dc5 Revert previous commit, escape % 2014-02-21 22:16:12 +01:00
Marc Cornellà b73ced397f Use single quotes also in $LINE definiton 2014-02-21 22:16:12 +01:00
Marc Cornellà b0fbe0d11a Avoid evaluating special chars in $LINE on title command (fixes #2234) 2014-02-21 22:16:12 +01:00