Commit graph

810 commits

Author SHA1 Message Date
Julien Nicoulaud
55e6a85fbb Merge branch 'master' of github.com:nicoulaj/zsh-syntax-highlighting
Conflicts:
	zsh-syntax-highlighting.zsh
2011-06-12 23:04:33 +02:00
Julien Nicoulaud
0772ddd346 Big refactoring.
* Don't override user defined styles
* Better modularisation of highlighters
* Allow to define which highlighters are activated
* Allow to define the order in which they are defined
* Minor performance optimizations
* Fixed some variables leak
* Improve documentation
* Brackets highlighter: use ZSH_HIGHLIGHT_STYLES instead of a specific array
2011-06-12 22:57:14 +02:00
NAKAMURA Yoshitaka
0999ab05ba do nothing if PENDING inputs are exist
Originally, zsh-syntax-highlighting called highlight functions at every inputs.
It's OK for user's keyboard inputs. But when long inputs come from clipboard,
it cause noticeable slowdown.
2011-03-12 16:31:18 +09:00
Julien Nicoulaud
19f16752bb Issue 49: Don't use readlink, options differ between systems
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-03-02 00:34:12 +01:00
Julien Nicoulaud
bc788f3f19 Start splitting highlighters to separate files.
The script still works on its own, highlighters in highlighters/ are
loaded as addons if present.

Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-17 23:41:01 +01:00
Julien Nicoulaud
2f0fb81af4 More efficient way to look for elements in arrays
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-17 22:27:31 +01:00
Julien Nicoulaud
3abf463753 More code style fixes
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-17 21:02:23 +01:00
Julien Nicoulaud
2670c93e05 Make sure functions names match _zsh_highlight_*
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-17 20:58:22 +01:00
Julien Nicoulaud
dd84bff854 Code style
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-17 19:51:07 +01:00
Julien Nicoulaud
6879d3c29f Issue 47: Removing styling of 'isearch' and 'special', as it has no effect
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-17 19:31:20 +01:00
Julien Nicoulaud
e1479022a0 Merge branch 'hchbaw-for-nicoulaj' 2011-02-17 19:20:32 +01:00
Julien Nicoulaud
69e7442e4d Add nakamuray to the list of contributors
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-16 22:42:18 +01:00
Julien Nicoulaud
fdc113996e Merge branch 'highlight-assignment' of https://github.com/nakamuray/zsh-syntax-highlighting into nakamuray-highlight-assignment 2011-02-16 22:39:45 +01:00
NAKAMURA Yoshitaka
390ab0fc32 Highlight variable assignment 2011-02-14 19:26:24 +09:00
Julien Nicoulaud
d66b15aeb0 Fix contributor URL
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-13 09:57:36 +01:00
Julien Nicoulaud
93c9e6a753 Split off contributors list to a separate file
Markdown for everyone

Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-01 21:07:00 +01:00
Julien Nicoulaud
ca79a5f65a Fix fish shell URL
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-01 21:02:45 +01:00
Julien Nicoulaud
78ff61eddc Fix typo
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-02-01 21:01:37 +01:00
Takeshi Banse
bb5f41ef6d Add contrib/keyword.zsh
Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-16 22:45:17 +09:00
Takeshi Banse
0948c3d676 Introduce _zsh_add-highlighter.
For easily extending the highlighting behavior, split the
actual highlighting function into some pieces.

For example "_zsh_main-highlight" transformed into,

1) An actual highlighting function which updates the
`region_highlight` on its own. (_zsh_main-highlight)
2) A predicate which determines whether its highlighting function
(in this case `_zsh_main-highlight`) should be called or not.
(_zsh_buffer-modified-p)

Likewise, `_zsh_highlight-bracket-match` and
`_zsh_highlight-bracket-match-p` are born.

Eventually, `_zsh_highlight-zle-buffer` coordinates above these
functions and maintain some internal state variables.

Finally, added `_zsh_add-highlighter` a little syntactic-sugar-ish
function to register the highlighting functions in an appropriate manner.

Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-16 20:32:53 +09:00
Takeshi Banse
6663c5647d Make bracket match a function.
Append it to ZSH_HIGHLIGHT_FUNCTIONS.

Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-16 20:32:20 +09:00
Takeshi Banse
07588d2165 Make core syntax highlighting a function.
Make `_zsh_highlight-zle-buffer` just a hands-off.
Now, `_zsh_highlight-zle-buffer` calls each ZSH_HIGHLIGHT_FUNCTIONS
in turn.  The former `_zsh_highlight-zle-buffer` is renamed to
`_zsh_main-highlight.`

Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-16 20:26:50 +09:00
Julien Nicoulaud
ea792cbf87 Add a mechanism for testing the correctness of the highlighting.
Feel free to add more test data !

Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-01-10 23:46:27 +01:00
Julien Nicoulaud
e162de6f51 Add BSD license
(http://www.zsh.org/mla/users//2011/msg00030.html)

Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-01-10 10:11:35 +01:00
Julien Nicoulaud
0392fdc46a Issue 34: Do not highlight non commands as commands.
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-01-08 18:03:52 +01:00
Julien Nicoulaud
50b612cec4 Merge branch 'celtic-master' 2011-01-08 13:09:56 +01:00
Julien Nicoulaud
678245bd63 Add stillmaintained badge
Signed-off-by: Julien Nicoulaud <julien.nicoulaud@gmail.com>
2011-01-08 13:08:02 +01:00
Arlen Cuss
a40d777860 Use ${(Q)arg} to expand a level of quotes, such that files/directories with spaces in their name (escaped with backslash) are noticed correctly. 2011-01-08 15:51:26 +11:00
Takeshi Banse
d2f641ca50 Carefully rebind the $clean_event.
% bindkey "^I" complete-word
  % bi<TAB>

If we had not source the zsh-syntax-highlighting.zsh, it could
complete something. This is due to that `complete-word` will be
rebinded with 'zle -N $clean_event'.

Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-07 21:51:39 +09:00
Takeshi Banse
2fd0845b77 Recreate the completion widget with its own function.
Currently, each completion widgets will be re-installed, but its
function will be statically associated with `_main_complete`.

We can get this function name via $widget[$event] which is the
zsh's zsh/zleparameter module's feature. We can use this information
for `zle -C`ing.

Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-07 21:46:17 +09:00
Takeshi Banse
802583ea94 Make this clause function and call it afterward.
Signed-off-by: Takeshi Banse <takebi@laafc.net>
2011-01-07 21:35:43 +09:00
Julien Nicoulaud
f962bdf1e7 Fix regression 2011-01-06 23:28:41 +01:00
Julien Nicoulaud
0b0b09de64 Fix absolute path in symlink 2011-01-06 23:26:24 +01:00
Julien Nicoulaud
9d63573e4e Issue 30: Add a test script to watch performance 2011-01-06 23:23:29 +01:00
Julien Nicoulaud
83372a5cee Issue 38: Conflict with command-not-found 2011-01-06 22:25:16 +01:00
Julien Nicoulaud
4d0e833079 Merge branch 'master' of github.com:nicoulaj/zsh-syntax-highlighting 2011-01-06 14:59:59 +01:00
Julien Nicoulaud
fc5caa4e2d Fix error when sourcing twice the script 2011-01-06 14:59:23 +01:00
Julien Nicoulaud
43e31cdc58 Fix error when source twice the script 2011-01-06 14:57:51 +01:00
Mounier Florian
7e963c6c7e Fix issue 31 2011-01-06 09:16:15 +01:00
Julien Nicoulaud
262755f1e7 Fix link in README 2011-01-05 23:46:08 -08:00
Julien Nicoulaud
0a50e2a830 Issue 32: 'xargs' and 'zargs' are followed by commands (thanks to claytron) 2011-01-06 08:41:52 +01:00
Julien Nicoulaud
ca4d7fbd06 Emphasize installations instructions ;) 2011-01-05 23:11:24 +01:00
Julien Nicoulaud
a9da4e6c76 Harmonize exported variables names 2011-01-05 23:07:56 +01:00
Julien Nicoulaud
8188920d00 Update README 2011-01-05 23:07:22 +01:00
Julien Nicoulaud
60842aa75b Define a style for hashed commands 2011-01-05 22:51:00 +01:00
Sorin Ionescu
a7746077bf Added hashed commands highlighting to zsh-syntax-highlighting oh-my-zsh plugin. 2011-01-06 05:47:42 +08:00
Sorin Ionescu
06d67990d9 Added oh-my-zsh zsh-syntax-highlighting plugin. 2011-01-06 05:47:42 +08:00
Julien Nicoulaud
b45891cdf4 Fix variable scope and make variable names even more obvious 2011-01-05 22:16:17 +01:00
Julien Nicoulaud
0e55450a0b Issue 26: The script unplugs user defined events 2011-01-05 22:11:00 +01:00
Mounier Florian
701cc303fe Highlighting bracket pair, when one is under the cursor (Issue 24) 2011-01-05 17:08:34 +01:00