Commit Graph

471 Commits

Author SHA1 Message Date
Eduardo Cuomo
40544a1d5d Fix invalid "ls -G" alias. 2016-11-02 15:42:38 +01:00
Marc Cornellà
1b799e9762 Check dircolors settings before using gls on darwin (#5570)
`gls` seems to be installed by default or on most macOS systems, but its
default color scheme sucks. This fix will make sure to only use it if it
has been customised prior to running OMZ.

Related: #5516, #5520.
2016-11-02 15:39:28 +01:00
Marc Cornellà
c24dfa1ab4 Fix ls coloring in MacOS if gls is not installed
Fixes #5520.
2016-10-11 09:24:43 +02:00
rossmcf
628d0bb106 Fix ls colouring for Darwin. (#5516) 2016-10-10 23:08:54 +02:00
Hong
f7d4f985ac Use $+commands to check the existence of a command in clipboard.zsh. (#5519) 2016-10-10 23:01:37 +02:00
Hong
a56eac7a71 Use OSTYPE instead of uname whenever possible for better speed. (#5496) 2016-10-10 22:24:30 +02:00
Hong
98cd3973d2 Take advantage of LS_COLORS for the color of completion if GNU ls is used. (#5510) 2016-10-10 20:40:17 +02:00
Marc Cornellà
c2e3a410ea Fix style of theme-and-appearance.zsh 2016-10-04 01:30:01 +02:00
Marc Cornellà
6304a789ab Only set default LS_COLORS if not set before
Also, force the use of Bourne-style shell syntax with `dircolors -b`.
2016-10-04 01:29:47 +02:00
Marc Cornellà
6c08286c8e Use $commands[] to check for command existence 2016-10-04 01:27:19 +02:00
Hong Xu
efa7c7b7ff set better default colors for GNU ls instead of none.
GNU coreutils ship a color setup command by default which can be used to
set a good default color theme for ls:

  https://www.gnu.org/software/coreutils/manual/html_node/dircolors-invocation.html
2016-10-04 01:06:36 +02:00
Marc Cornellà
4e12024b0b Fix styling of lib/completion.zsh 2016-09-22 00:44:25 +02:00
Gravemind
0d897cca74 Fix hyphen and underscore filename completion
This deletes the previous hack that allowed completing files with
the extension: e.g. `abcd.z` to `abcdefg.z`.

It is still possible to use `abcd[TAB].z`, and hyphens or underscores
are very much more important than this other trick.

Source:
https://github.com/robbyrussell/oh-my-zsh/issues/1398#issuecomment-169163149

Signed-off-by: Marc Cornellà <marc.cornella@live.com>
2016-09-22 00:43:30 +02:00
Yuichi Tanikawa
27fff27253 Fix git_prompt_status() not showing ahead/behind/diverged status correctly (#5388) 2016-09-08 00:23:04 +02:00
Marc Cornellà
71201ffd67 git: output nothing when no commits ahead or behind
This fixes old git_commits_ahead behavior and changes git_commits_behind
to have the same behavior.

Fixes #5355
2016-09-05 11:22:48 +02:00
Fredrik Fornwall
9772f8e10d Replace /bin/sh with sh for portability (#5291)
This makes things work even on system lacking /bin/sh, such as on
non-rooted Android systems.
2016-08-09 02:39:11 +02:00
Luke Childs
a7de0fabd7 nvm plugin improvements (#5265)
* Export $NVM_DIR if it doesn't exist and use it when looking for nvm
* Use $NVM_DIR when looking for nvm for completion
* Use $NVM_DIR when looking for nvm in nvm_prompt_info
2016-08-07 19:36:44 +02:00
Steven
61981951b1 Updated git_commits_ahead function (#5247)
* Function wasn't returning correct value
* Updated underlying git command
* Kept echo command from previous function for backwards compatibility
* Kept function consistent with git_commits_behind
2016-08-01 17:48:46 +02:00
Steven
96a2092e37 lib/git.zsh: Added git_commits_behind function (#4450)
* Added git_commits_behind function
* Added 'command' to git_commits_behind function
* git_commits_behind code review changes
2016-07-15 11:05:39 +02:00
Marc Cornellà
cc36063cfd Cleanup theme-and-appearance.zsh 2016-05-12 13:23:46 +02:00
Marc Cornellà
ed484dfaf6 Delete cdablevars option by default
Fixes weird autocompletion of directories and named users.
Fix #4864
2016-05-12 13:22:27 +02:00
Aesop Wolf
69e1506ad9 Add git user profile functions for prompt display 2016-03-31 14:16:46 -07:00
Michele Bologna
87f8251388 Re-added $ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE
Re-added $ZSH_THEME_GIT_PROMPT_EQUAL_REMOTE variable which was removed in 9f55213
2016-01-13 15:36:59 +01:00
Marc Cornellà
0842384987 Put local var declaration in its own line in lib/git.zsh
In places, the local statement will override the exit code and the written
command won't have the effect intended when it was written.

For example, when it's not inside a git repo the exit code won't be true,
but the local statement will make it true regardless. See #4708.
2015-12-17 18:37:49 +01:00
Andrew Janke
9f552130bd Move current_branch() from git plugin to core lib/git.zsh
Fixes #4085: core -> plugin dependency issue.
Rename it to git_current_branch for clarity that it's git-specific.
Update all plugins that were calling it to use new name.
Fix variable leaks by making more variables in lib/git.zsh local.
Have lib/git.zsh use [[ ]] instead of [ ] everywhere.
2015-12-14 20:28:37 -05:00
moyamo
71deb74552 Fix indentation 2015-12-14 13:05:51 +02:00
moyamo
d779750341 Default to using terminfo to set the terminal title
Currently, the title is only set on supported terminals (i.e. xterm,
urxvt, screen etc.). Using terminfo entries to set the terminal title
adds support for many more terminals.
2015-12-14 12:59:04 +02:00
desrum_m
95aa9bd97b Better research history with arrow keys
This change enables UP-arrow and DOWN-arrow full-line history completion.
For example, if you write `git clone` and press UP:

- Before this change,
  it will use the last command that starts with `git`.

- After this change,
  it will use the last command that starts with `git clone`.
2015-12-14 01:08:55 +01:00
Marc Cornellà
d54d896346 Merge pull request #3966 from apjanke/fix-spectrum-ls
Make spectrum_ls implementation consistent with $FG and spectrum_bls
2015-12-13 21:39:13 +01:00
Marc Cornellà
11de60fde9 Merge pull request #3965 from apjanke/spectrum-hide-codes
Hide spectrum.zsh var values to avoid junky output to terminal
2015-12-13 21:28:44 +01:00
Marc Cornellà
4fbfb149d3 Add back the - alias to go to the previous directory
The alias was removed in #3564. A couple of users were using
it, so I'm adding it back.
2015-12-13 20:36:31 +01:00
Marc Cornellà
4e306887c2 Cleanup update_terminalapp_cwd function 2015-12-01 14:05:38 +01:00
Marc Cornellà
eca912e51a Quote all variables in if statements 2015-12-01 14:05:18 +01:00
Marc Cornellà
103eb32721 Use a case structure to id terminal types 2015-12-01 14:04:12 +01:00
Dawid Ferenczy
63d7500cf1 Added setting of the window title in Cygwin 2015-12-01 13:52:52 +01:00
Marc Cornellà
b457ae2501 Merge pull request #4651 from ionelmc/patch-1
Add support for "putty" $TERM in termsupport.zsh
2015-12-01 00:05:17 +01:00
Ionel Cristian Mărieș
d55111f200 Support all kinds of putty-like terminal strings. 2015-12-01 00:59:35 +02:00
Marc Cornellà
584e0a6ef9 Use shwordsplit in open_command() 2015-11-30 21:27:58 +01:00
Marc Cornellà
afdfe2391e Add empty string parameter to start command
Otherwise `start` will confuse the first parameter as the title of
a new command prompt if the parameter contains whitespace. That is
because the command to be run will be:

    start "abc def"

which opens a new command prompt window with the title "abc def".
With the added empty string we force the start command to interpret
the passed parameter as the file / command:

    start "" "abc def"

which will be interpreted like `""` is the title and the rest is
the file or command to start.

-------

**NOTE:** this wouldn't be necessary if the start script in msys
was defined differently; that is, if it had the empty string
already incorporated in the script (/usr/bin/start), like so:

```diff
-cmd //c start "${@//&/^&}"
+cmd //c start "" "${@//&/^&}"
```

Notice however that this would make it impossible to use start
setting a different title, so it's probably best to leave it as is.

More info: http://sourceforge.net/p/msys2/tickets/14/

-------

The change `${(z)open_cmd}` is necessary to force zsh to split the
variable by the spaces and interpret it as separate words.

More info: http://zsh.sourceforge.net/FAQ/zshfaq03.html#l17
2015-11-30 21:21:28 +01:00
Mark Ingalls
0a79f1e836 make this work in the git-for-windows SDK
Added an option for the msys value of $OSTYPE
2015-11-30 21:01:15 +01:00
Ionel Cristian Mărieș
711c1bcb40 Add support for "putty" $TERM in termsupport.zsh 2015-11-30 15:16:47 +02:00
Marc Cornellà
fea74b4b34 Fix open_command nohup call
There a syntax error if $cmd_var contains more than one word,
so we drop the current way to prepend nohup and use a simpler
if-else form.
2015-11-29 19:34:10 +01:00
Andrew Janke
f0981d564a termsupport: protect subshell with quotes 2015-11-27 15:58:06 +01:00
Marc Cornellà
ebfba0e539 Drop the use of nohup on OSX for tmux compatibility
Apparently `nohup` is not needed in OSX, and using it has the side
that it may break under tmux with the error

  nohup: can't detach from console: No such file or directory

For now, this commit only drops the use of `nohup` in OSX. But it
*may* not be necessary under other similar platforms.
2015-11-27 15:40:31 +01:00
Marc Cornellà
56345c26fb Merge pull request #4473 from apjanke/5_1_1-bracketed-paste-hack
Disable bracketed-paste-magic in zsh 5.1.1, where it is buggy
2015-10-20 08:26:15 +02:00
Robby Russell
b28db6b475 Merge pull request #4475 from apjanke/diagdump-5.1-fix
diagnostics: fix for reserved-word changes in zsh 5.1
2015-10-13 18:01:52 -07:00
Robby Russell
dc06e96e9c Merge pull request #4254 from apjanke/copyfile-portability
Cross-platform clipboard clipcopy() and clippaste()
2015-10-09 07:15:53 -07:00
Andrew Janke
d15521d09d diagnostics: fix for reserved-word changes in zsh 5.1
Reference:
https://github.com/zsh-users/zsh/blob/zsh-5.1.1/NEWS#L20-L32
2015-10-08 22:31:39 -04:00
Andrew Janke
3551745792 Disable bracketed-paste-magic in zsh 5.1.1, where it is buggy
A bracketed-paste-magic bug breaks pasting of CJK and some other characters in zsh 5.1.1.
http://www.zsh.org/mla/workers/2015/msg02680.html
See #4434
2015-10-08 22:13:42 -04:00
Andrew Janke
b6d78df62c clip*: add xsel support 2015-10-05 05:13:11 -04:00