Commit Graph

1937 Commits

Author SHA1 Message Date
Maxime Coste
321facb594 Merge remote-tracking branch 'Anfid/lua-fixes' 2020-05-30 09:29:48 +10:00
Maxime Coste
1a185f5d6f Merge remote-tracking branch 'Phlogistique/eex' 2020-05-30 09:25:19 +10:00
Maxime Coste
3589791670 Merge remote-tracking branch 'Guest0x0/master' 2020-05-30 09:24:25 +10:00
Maxime Coste
d1f4b44655 Merge remote-tracking branch 'lenormf/fix-ini' 2020-05-30 09:22:37 +10:00
Maxime Coste
0b56c777c0 Merge remote-tracking branch 'lenormf/fix-spell-next' 2020-05-30 09:22:06 +10:00
Maxime Coste
f939055e22 Merge remote-tracking branch 'lenormf/remove-bold-italic-faces' 2020-05-30 09:21:08 +10:00
Maxime Coste
65921d0515 Merge branch 'fix-perl-regex' of https://github.com/buffet/kakoune 2020-05-30 09:20:00 +10:00
Maxime Coste
2a28779998 Merge branch 'latex' of http://github.com/mreppen/kakoune 2020-05-30 09:14:39 +10:00
Maxime Coste
3f787acb4f Merge remote-tracking branch 'greenfork/add-underscores-to-zig-integers-highlighting' 2020-05-30 09:13:17 +10:00
Maxime Coste
0315b2e3f5 Merge remote-tracking branch 'greenfork/add-default-comments-for-zig' 2020-05-30 09:12:51 +10:00
Maxime Coste
a28deb0aaf Merge branch 'highlight-markdown' of https://github.com/pickfire/kakoune 2020-05-30 09:11:45 +10:00
Maxime Coste
c716f5d4e4 Merge remote-tracking branch 'krobelus/02-sh-space-before-heredoc-keyword' 2020-05-30 09:07:20 +10:00
Maxime Coste
c8fde1bf33 Merge remote-tracking branch 'krobelus/01-fish-single-quote-highlighting' 2020-05-30 09:07:01 +10:00
Maxime Coste
d90f8d4324 Merge remote-tracking branch 'lenormf/remove-lint-enable' 2020-05-30 09:05:53 +10:00
Max Reppen
6f5bc42b87 LaTeX highlighter improvements
Added \(\) highlighter
2020-05-29 17:46:06 -04:00
Frank LENORMAND
b4f2c3fe91 rc lint: Remove the concept of "enabling" linting
This commit renames `lint-enable` into `lint-show-diagnostics`,
makes it hidden, and calls it automatically after diagnostics have
been recovered by `:lint-cleaned-selections`.

The `lint-disable` command becomes `lint-hide-diagnostics`.

The concept of "enabling" diagnostics was inherited from the Clang
support script, but in that case it's not clear why calling `:lint`
should do the work but not render it (similarly to `:spell`).

The `lint-show` command was also renamed into a more descriptive
`lint-show-current-line`.
2020-05-29 14:39:39 +03:00
Maxime Coste
08e0b663f7 Fix unintended interpretation of ranges length syntax
Ranges specified with a +<length> were inconsistent, with +0 meaning
an empty range, while +1 meant a two character long range (first character
+ the following one). Change that to mean a single character.

Fixes #3479
2020-05-29 12:25:57 +10:00
Johannes Altmanninger
62f61df08f fish.kak: add new fish builtins
eval is a proper builtin as well now
2020-05-28 21:49:47 +02:00
Johannes Altmanninger
bb865a18c1 fish.kak: fix highlighting for single quoted strings
fish allows to escape single quotes within single quoted strings,
just like double quotes in double quoted strings.

https://fishshell.com/docs/current/index.html#quotes
2020-05-28 21:49:47 +02:00
Ivan Tham
752ccc0946 Fix regression on setext-style markdown header
Reproduce:

header1
header2
-------
2020-05-28 14:33:00 +08:00
Ivan Tham
09a45a2e96 Fix setext-style markdown header highlight
Reproduce:

    - item

    header
    ------
2020-05-27 18:23:53 +08:00
Dmitry Matveyev
31d41c526e Add underscore highlighting as visual separator inside Zig integers 2020-05-22 16:47:05 +03:00
Johannes Altmanninger
53309c3534 sh.kak: allow space before heredoc string 2020-05-21 08:34:58 +02:00
Dmitry Matveyev
ccfd5ea5c6 Add default comments for Zig language 2020-05-19 22:05:10 +03:00
Maxime Coste
5933ab1e78 Split python auto-insert hooks from auto-indent 2020-05-19 17:16:05 +10:00
Frank LENORMAND
05db1e8697 rc spell: Make :spell-next wrap around the buffer 2020-05-15 18:37:03 +03:00
Frank LENORMAND
4eac927a01 rc spell: Rewrite :spell-next in Awk 2020-05-15 12:59:30 +03:00
Frank LENORMAND
e9e15e6a44 rc spell: Simplify selection-descriptions parsing
Remove everything after the first pipe sign. Pop the timestamp.
2020-05-15 12:21:02 +03:00
Frank LENORMAND
7db9062122 rc spell: Don't use expr to format-check
The regular pattern based on `printf`/`grep` is cleaner and less
error prone.
2020-05-15 12:19:29 +03:00
Frank LENORMAND
37706d7a95 colors: Retire the bold and italic faces
This commit removes declarations and mentions to the built-in `bold`
and `italic` faces.

While they could be a user-friendly way of customising how tokens
are emphasised in Markdown documents (similarly to the
`$LESS_TERMCAP_*` environment variables for `man` pagers), most other
markup languages do not have the concept of "strong" and "emphasis"
but refer directly to the font style/weight.

The faces were also not even set by default to highlight as their
names implied, so having markup language support scripts directly
use the +b and +i face attributes is more consistent.
2020-05-15 11:56:38 +03:00
Frank LENORMAND
c7043e06ee rc ini: More leniently highlight section names
Highlight every character between brackets, including more
brackets. This allows alternative constructs in INI files such as:

```
[section]
    [[subsection]]
```

This commit also only applies the appropriate face on the section
name itself, not the entire line (including hypothetical surrounding
whitespace characters).
2020-05-14 10:25:38 +03:00
Frank LENORMAND
9bc6bddcac
rc spell: Fix off-by-one highlighting glitch 2020-05-07 10:40:25 +00:00
buffet
7870685248 Fix perl regex for operator // 2020-05-05 16:22:30 +00:00
Noé Rubinstein
c5bd4a37ee Elixir: add support for Eex comments and quotation 2020-05-03 13:54:51 +02:00
Noé Rubinstein
da45172256 Elixir: add support for <% in addition to <%= 2020-05-03 13:54:50 +02:00
Noé Rubinstein
f272768544 Elixir: Fix triple-string, add support for Eex
This adds support for the Eex templating that is used in the Phoenix
web framework. Eex files include HTML and Elixir code, and Elixir files
can include Eex in string literals marked with the `~L` prefix.

Additionally this unbreaks `"""` string literals, which did not work because
`"` was matched before `"""`
2020-05-03 13:54:48 +02:00
Guest0x0
36d4cf4f5b fix indent behavior for lines without indent 2020-05-03 17:48:44 +08:00
Frank LENORMAND
c6906be475 rc man: Make the use of $MANPATH portable 2020-05-02 11:59:06 +10:00
Maxime Coste
83cdaee002 Merge remote-tracking branch 'JJK96/spell' 2020-04-30 19:23:27 +10:00
Maxime Coste
db8f19c51f Merge remote-tracking branch 'eraserhd/fix-kitty' 2020-04-30 19:22:07 +10:00
Jason Felice
d287251326 Split modules and allow kitty-send-text to take a parameter 2020-04-27 11:58:39 -04:00
Jan-Jaap Korpershoek
063a702bf4 Add error handling
Rewrite line by line to make escaping easier
2020-04-27 12:28:29 +02:00
Jan-Jaap Korpershoek
246735520f Add spell-add command 2020-04-27 11:57:14 +02:00
Maxime Coste
e69b369e6f Merge remote-tracking branch 'ifreund/meson-syntax' 2020-04-27 17:40:45 +10:00
Guest0x0
69e45dce38 basic syntax highlighting & indentation for the Coq language 2020-04-23 21:07:37 +08:00
Maxime Coste
f7ad8bd70e Highlight mail References headers 2020-04-21 13:21:35 +10:00
Maxime Coste
6dc17cb3b3 Complete man pages from MANPATH as well 2020-04-21 13:21:35 +10:00
Isaac Freund
b0fb7fce63
Highlight meson_options.txt as well 2020-04-15 02:49:21 +02:00
Isaac Freund
8ad6746cc8
Add basic highlighting for meson 2020-04-15 01:04:44 +02:00
Maxime Coste
fd454f90f9 Merge remote-tracking branch 'ifreund/zig-syntax' 2020-04-13 11:08:32 +10:00
Maxime Coste
52a80defd6 Merge remote-tracking branch 'Laaas/patch-1' 2020-04-13 11:07:09 +10:00
Maxime Coste
54e0396c84 Merge remote-tracking branch 'codesoap/awkcomment' 2020-04-09 07:50:11 +10:00
Maxime Coste
b3983dd523 Merge remote-tracking branch 'eraserhd/diff-objects' 2020-04-09 07:42:01 +10:00
Maxime Coste
63df04b6e0 Merge remote-tracking branch 'lenormf/fix-lint' 2020-04-09 07:41:54 +10:00
Aaron Bull Schaefer
de2b3f9b9a Add filetype support for CUE language
This follows the upstream spec as closely as possible.

See:
- https://cuelang.org
- https://cuelang.org/docs/references/spec/
2020-04-06 12:03:54 -07:00
Jason Felice
7e5936ba23 diff.kak: add diff file and diff hunk text objects 2020-04-03 15:48:54 -04:00
Frank LENORMAND
7d987c013e rc lint: Check the lintcmd option is set in :lint-buffer
Calling `:lint-buffer` when `lintcmd` is empty results in a temporary
directory being created, but never removed when the underlying linting
code errors out.
2020-03-27 10:20:40 +03:00
Las
e142a37f21 rc ruby: Don't recognize "keyword"-like identifiers
In Ruby, identifiers can end with a `!` or `?` too, which means that `class!` or `end?`are not actually keywords, but regular identifiers. This fixes that by not using `\b` but `[^0-9A-Za-z_!?]` instead in some places.
2020-03-25 21:18:21 +09:00
Isaac Freund
9396f508c2
Fix indentation of auto-extended comments 2020-03-22 20:19:43 +01:00
Isaac Freund
6198cc5e47
Encapsulate zig highlighting and commands in a module 2020-03-22 19:24:39 +01:00
Isaac Freund
3098557e25
Add indent rules 2020-03-22 19:18:15 +01:00
Isaac Freund
23b28df1b8
Use attribute face where appropriate 2020-03-22 10:50:29 +01:00
codesoap
94cdd3f9e3 rc spell: Avoid C-style comments in awk 2020-03-22 08:13:30 +01:00
Isaac Freund
6190f8ce70
Add syntax highlighting for zig 2020-03-21 22:46:19 +01:00
Mikhail Pogretskiy
57c62b2a10 rc lua: Improve indent hooks behavior, add '...' highlighting 2020-03-20 23:12:46 +07:00
Maxime Coste
329f291ae0 Merge remote-tracking branch 'Anfid/hunk-seek-wrap' 2020-03-15 12:35:50 +11:00
Mikhail Pogretskiy
8c7bb10e56 rc git: Make git next/prev-hunk behavior consistent with search command 2020-03-11 13:56:28 +07:00
Frank LENORMAND
e83ad2a2a4 rc spell: Re-implement message processing in Awk
Plain shell takes too long on large files.

Fixes #3399
2020-03-09 14:22:34 +03:00
Maxime Coste
f682d8c01f Merge remote-tracking branch 'chambln/git' 2020-03-03 07:55:12 +11:00
Jason Felice
1ed8b84762 Fix unnecessary refreshes
Incrementally setting the lint variables triggers multiple refreshes,
including the text jumping as the guttter column is removed and re-
added.  This causes the info message to disappear when linting is done
on NormalIdle.
2020-02-28 21:44:10 -05:00
Gregory Chamberlain
13d042cf8f rc git: Fix highlighting of ‘:git log --graph’
Looks like hyphens and periods are sometimes printed as part of
git-log(1)’s graphing feature; for example, in this repository:

    git log --graph 55e7f857
2020-02-27 05:11:11 +00:00
Maxime Coste
f6b6b94ba6 Merge branch 'rust-indent' of http://github.com/jneem/kakoune 2020-02-25 20:13:30 +11:00
Maxime Coste
a2506f3b22 Merge remote-tracking branch 'matthias-margush/file-type-detection-fix' 2020-02-25 20:12:22 +11:00
Joe Neeman
5024fe17f6 Make rust auto-indenter ignore most things inside comments.
Fixes #3352.
2020-02-24 12:51:03 -06:00
Matthias Margush
99c09daec3 Fix filetype detection
The -i flag on Mac OS means:
    ჻ man file | grep -i -- -i
    -i      If the file is a regular file, do not classify its contents.

The --mime-type option is (mostly) portable:
- Linux uses --mime-type
- macOS uses --mime-type
- FreeBSD uses --mime-type
- NetBSD uses --mime-type
- OpenBSD uses --mime-type and does not use the same implementation as everybody else
- Solaris does not support MIME types at all
2020-02-21 21:25:57 -08:00
Gregory Chamberlain
7babfe2508 Use filetype ini for XDG desktop entry files
See <https://freedesktop.org/wiki/Specifications/desktop-entry-spec/>
2020-02-20 18:25:01 +00:00
Maxime Coste
ce93a7b032 Fix doc paragraph rewrapping 2020-02-18 19:25:12 +11:00
Maxime Coste
61cae51605 Merge remote-tracking branch 'Guest0x0/master' 2020-02-16 10:48:04 +11:00
Maxime Coste
08d6268ae7 Merge remote-tracking branch 'lenormf/documentation-face' 2020-02-16 10:46:35 +11:00
Tim Allen
9277121695 rc lint: Change flag symbols for lint errors and warnings.
As suggested in code review.
2020-02-14 17:27:36 +11:00
Guest0x0
ab091bcf69 improve syntax highlighting 2020-02-14 07:33:47 +08:00
Tim Allen
59e273c316 rc lint: Teach lint-{next,previous}-message to wrap around the buffer.
This matches the behaviour of make-{next,previous}-error.
2020-02-13 20:27:28 +11:00
Tim Allen
48bd7387bb rc lint: When parsing lint messages, use "remove shortest prefix" pattern.
There might legitimately be "|" characters in the message, so
we want to stop at the first one, the one that delimits the message location
from the message text.
2020-02-13 20:27:24 +11:00
Tim Allen
cad0572ca5 rc lint: Re-add missing kakquote functions. 2020-02-13 20:27:19 +11:00
Tim Allen
c1e9f46301 rc lint: Don't start a comment with "shellcheck".
That confuses shellcheck into expecting a warning pragma.
2020-02-13 20:27:12 +11:00
Tim Allen
09f067d585 rc lint: More code-review comments.
Don't ask Kakoune to quote values we know can never contain shell-sensitive
characters, and flatten the kakquote() function to a single line for ease
of copy/pasting.
2020-02-09 14:01:35 +11:00
Tim Allen
673d081823 rc lint: Address code-review comments. 2020-02-09 13:23:58 +11:00
Tim Allen
51fcea7ce0 rc lint: Add a lint-selections command to lint part of a buffer.
Fixes #2302, #3336.

Addresses parts of #3155.

Changes include:

- New `lint-selections` command that only lints the current selections,
  and allows a custom lint command.
- New `lint-buffer` command that always lints the whole buffer with
  the linter specified in the lintcmd option.
- `lint` alias for `lint-buffer`, for backwards compatibility.
- Errors and warnings are now shown in the Error and Information faces,
  not hard-coded red and yellow.
- Error and warning flags now use "!" and "?" symbols respectively,
  instead of a unicode block, so they can still be distinguished
  in a monochrome colour-scheme or by colour-blind users.
- An error flag on a given line always takes precedence over a warning.
- All messages for the same line are collected into a multi-line message.
- We no longer escape tildes in messages, since that change was added
  in commit ae339dc (2016) when we started using `%~~` to quote messages.
  We stopped using `%~~` in commit 1a2eecd (2018).
- Anything the linter writes to stderr is logged to the *debug* buffer,
  not lost.
- If the linter writes to stderr, an error is shown to the user instead
  of the usual error/warning count.
- The `lint_errors` hidden option is replaced by `lint_messages`,
  because it contains warnings as well as errors.
- `lint-next-error` renamed to `lint-next-message`,
  and `lint-previous-error` renamed to `lint-previous-message`
  for the same reason.
    - New `lint-next-error` and `lint-previous-error` aliases,
      for backwards compatibility.
- `lint-next-message` and `lint-previous-message` show the message
  they jump to.
- Where `lint_errors` was a range-specs option, `lint_messages` is a
  line-specs option to keep things simpler. This means lint-next-message
  and lint-previous-message no longer jump to a specific column.
2020-02-07 19:22:47 +11:00
Maxime Coste
8eb84c6f5d Merge branch 'master' of http://github.com/velrest/kakoune 2020-02-07 07:03:33 +11:00
Dan Rosén
8dd2373db1 Remove duplicated scopes highlight in kakrc.kak 2020-02-06 17:33:16 +01:00
Maxime Coste
bb28477c48 Merge remote-tracking branch 'chambln/master' 2020-02-05 20:54:49 +11:00
Maxime Coste
1a2bf7b105 Merge branch 'patch-2' of http://github.com/Ordoviz/kakoune 2020-02-05 20:47:25 +11:00
Maxime Coste
9cc22f2596 Merge remote-tracking branch 'lenormf/fix-3330' 2020-02-05 20:42:33 +11:00
Maxime Coste
a3749d6c20 Merge remote-tracking branch 'lenormf/patch-3' 2020-02-05 20:41:40 +11:00
Maxime Coste
7d4ae422d2 Merge remote-tracking branch 'lenormf/docstring-pretty' 2020-02-05 20:40:10 +11:00
Lennard Hofmann
8dbc86c54a [sh] Do not highlight keywords if preceded/succeeded by a hyphen 2020-02-03 21:34:36 +01:00
Frank LENORMAND
275abb227e rc: Make docstrings more readable
This cosmetics commit makes use of the auto-deindentation syntax,
available to docstrings.
2020-02-03 20:53:28 +01:00
Lennard Hofmann
75bb796b2b
[sh] Allow more characters in aliases and function names
Which characters are allowed?
- Aliases: https://www.gnu.org/software/bash/manual/html_node/Aliases.html
- Functions: https://unix.stackexchange.com/questions/245331/shell-valid-function-name-characters

For aliases I chose [\w-.] instead of blacklisting many forbidden characters. For functions I chose \S.
2020-02-03 18:59:46 +00:00
Lennard Hofmann
c6eb9bd8f0
Fix #2832 2020-02-03 18:33:27 +00:00
Gregory Chamberlain
548c6b0b7e rc git: Use git-log filetype for ‘:git show’
The git-log filetype is more appropriate for ‘git show’ output
because it highlights both diffs and commit data.
2020-02-02 00:26:46 +00:00
Frank LENORMAND
90ba4d0903 rc spell: Handle errors returned on the first line
The first line returned by `aspell` isn't always an identification
string, it can also be an error.

This commit prevents the first line from being ignored in any case,
and allows errors to be reported consistently.

Related to #3330
2020-02-01 16:04:58 +01:00
Frank LENORMAND
0c4c744362 rc: Highlight embedded documentation
This commit adds a `documentation` face to the builtin themes, used
to highlight common documentation syntaxes:

	/**
	 * JavaDoc
	 */

	/*!
	 * QtDoc
	 */

	/// Inline documentation

	## Inline documentation

The face is only an alias to the `comment` one for now.

Closes #1944
2020-01-29 20:03:21 +01:00
Gregory Chamberlain
f4e8585981 rc git: Expand highlighting of git status
Adds support for highlighting git-status(1) output in short format
(--short) and with branch name (--branch), including file renames and
commits ahead/behind information.
2020-01-29 17:19:23 +00:00
Gregory Chamberlain
eb1b629829 rc git: Improve git-log highlighters
Adds support for highlighting git-log(1) output with the ‘--graph’
and ‘--pretty=oneline’ options.
2020-01-29 12:48:08 +00:00
Frank LENORMAND
5ea2f26efa
rc ctags: Escape backslash in {\} faces
Using `{\}` in an Awk script results in the following error being printed:

```
awk: cmd. line:18: warning: escape sequence `\}' treated as plain `}'
```
2020-01-28 10:05:10 +00:00
Maxime Coste
9842e24fc4 Merge remote-tracking branch 'alexherbo2/crystal' 2020-01-27 16:27:06 +11:00
Alex Leferry 2
2f05aebfff Use POSIX -E of sed for extended regular expressions 2020-01-21 14:45:33 +01:00
Alex Leferry 2
d7e2094f1c Crystal: Slight style change 2020-01-21 11:31:43 +01:00
Maxime Coste
da1320eda2 Merge remote-tracking branch 'alexherbo2/crystal' 2020-01-20 07:09:14 +11:00
Maxime Coste
fcf682e74f Merge branch 'patch-1' of http://github.com/Ordoviz/kakoune 2020-01-20 07:08:29 +11:00
Alex Leferry 2
c13e123096 Give an explicit name to the Crystal highlighter 2020-01-17 23:37:17 +01:00
Jonas Cosandey
b084e66897 Add html module to hbs filetype to correctly highlight hbs files 2020-01-16 10:20:35 +01:00
Maxime Coste
5f126ee267 Merge branch 'master' of https://github.com/aecepoglu/kakoune 2020-01-16 20:01:14 +11:00
Maxime Coste
60f9a474ab Merge remote-tracking branch 'lenormf/jinja-templates' 2020-01-16 19:59:51 +11:00
Maxime Coste
20b0ad8b84 Merge branch 'latex-headings' of http://github.com/Ordoviz/kakoune 2020-01-16 19:57:30 +11:00
Lennard Hofmann
71e4ac4574
[sh] Allow hyphens in variables but not every character
Co-Authored-By: Frank LENORMAND <lenormf@gmail.com>
2020-01-15 13:56:25 +00:00
Lennard Hofmann
1e9353a24b [latex] Highlight section headings 2020-01-14 17:31:35 +01:00
Lennard Hofmann
b84d852723 [sh] Merge two %sh blocks into one
It simply needed a newline
2020-01-13 17:51:18 +01:00
Maxime Coste
dabe4c3d92 Merge branch 'master' of http://github.com/nunzioc/kakoune 2020-01-13 20:33:10 +11:00
Alex Leferry 2
fed8f01e47 x11-terminal: Leverage the shell quoting of lists for perfect forwarding
Fixes x11-terminal forwarding
2020-01-13 05:26:08 +01:00
Lennard
a8bbdc71d9 [sh] Separate keywords and builtins; fix variables
Previously, the keywords were a mess. They contained the shell’s
reserved words and some arbitrarily selected builtins. I generated
the word list using bash because it contains all POSIX builtins and
is common for scripting.

In variable assignments some characters that are allowed to be in
variables used to not be highlighted, e.g. hyphens. With this commit
all characters except whitespace are considered to be part of the
variable.
2020-01-12 11:41:12 +01:00
NunzioCicone
dfbc69abeb Allow empty elements in jsx 2020-01-11 06:40:21 -05:00
aecepoglu
8b00458330
better scheme highlighter for char,string,comment 2020-01-09 17:07:23 +03:00
YohananDiamond
99ea0c2169 julia.kak: added keywords "mutable" and "struct" 2020-01-08 15:21:08 -03:00
Frank LENORMAND
5dc4ce5281 rc jinja: Highlight Jinja statements/expressions
This commit implements a standalone shared highlighter group that
highlights Jinja statements and expressions.

The traditional way of highlighting file contents is to hook on the
file extension, and assign a custom filetype/highlighter group to
the current buffer. However, since Jinja templates can be based on
any text file format in existence, we do not have a specific file
extension to hook, and consequently, no custom "jinja" filetype.

The user is expected to add the `jinja` highlighter whenever required:

```
require-module jinja
add-highlighter window/ ref jinja
```

Alternatively, file extensions that are known to occasionally pair
with Jinja can be hooked from the user configuration:

```
hook global WinCreate .+\.html %[
    try %[
        execute-keys -draft \%s \{%|\{\{ <ret>
        require-module jinja
        add-highlighter window/ ref jinja
    ]
]
```

The above hook auto-detects statements/expressions (respectively
{%…%} and {{…}} expansions), but will cause false positives
(in terms of highlighting), and therefore isn't part of `jinja.kak`
by default.
2020-01-08 12:22:34 +01:00
Jason Felice
0ed3bd662c {clojure,lisp}.kak: handle doubled brackets 2020-01-03 15:14:56 -05:00
Maxime Coste
f2159750d2 Slight code cleanup in grep.kak 2019-12-31 12:50:19 +11:00
Maxime Coste
90ec9434b7 Fix clang completion output parsing 2019-12-15 10:32:14 +11:00
Evan Relf
77ec8b70a8
Fix Haskell multi-line quasiquoter highlighting 2019-12-12 16:00:50 -08:00
Evan Relf
991ed97f4c
Fix incomplete highlighting of Haskell via keyword 2019-12-12 15:45:43 -08:00
Evan Relf
9eb9747396 Improve highlighting of Haskell function names 2019-12-12 15:27:48 -08:00
Evan Relf
024a3afff0 Highlight Haskell type and data family keyword 2019-12-12 15:27:48 -08:00
Evan Relf
63bbfc253b Relocate Haskell quasiquote region highlighter 2019-12-12 15:27:48 -08:00
Frank LENORMAND
7b9ae595c0 rc repl tmux: Do not check for the Tmux version
This commit removes attempts to auto-detect the version of the local
Tmux binary.

The Tmux package that ships with OpenBSD doesn't have a version
number[1], and therefore doesn't provide any way to check if it's
compatible with the REPL module, making the feature disabled by
default in that distribution.

Fixes #3237.

[1] https://github.com/tmux/tmux/issues/1141#issuecomment-340244302
2019-12-10 12:15:08 +01:00
Frank LENORMAND
fde2550478 rc git: Highlight commands differently from pick
The `pick` command in a rebase commit is virtually a no-op, but other
commands actually do things. This commit visually communicates
that fact.

Fixes #3208.
2019-12-08 13:49:53 +01:00
Maxime Coste
ee2985739b Merge remote-tracking branch 'lenormf/window-range' 2019-12-04 21:16:11 +11:00
Las
df9995b216
Recognize .mjs files as javascript files
.mjs is the extension for javascript modules
2019-12-03 15:05:40 +09:00
Maxime Coste
805675b731 Merge remote-tracking branch 'jcpetruzza/syntax-terraform' 2019-11-28 20:35:16 +11:00
Maxime Coste
b19dae13fc Merge remote-tracking branch 'lenormf/fix-clang-autocomplete' 2019-11-28 20:34:17 +11:00
Maxime Coste
2904d13420 Add a {\} marker to disable markup processing 2019-11-28 20:23:52 +11:00
Maxime Coste
8691ee8d4a Modularize r file support 2019-11-26 21:32:52 +11:00
Maxime Coste
2209b5d415 Improve perl regex and qq string highlighting 2019-11-26 21:32:52 +11:00
Frank LENORMAND
657eeb02d2 rc clang: Factorize multiple calls to gsub 2019-11-22 09:43:39 +01:00
Frank LENORMAND
3161a6255c rc clang: Handle nested tags in completion
Some completion candidates have e.g. `{#…#}` tags in their
name/description. They can be nested, which the cleanup regex doesn't
take into account.
2019-11-22 09:30:30 +01:00
Maxime Coste
82e5346904 Add a -atomic switch to write and change clang.kak to take advantage 2019-11-21 23:38:32 +11:00
Daniel Gorin
2666d69e6d Add filetype for terraform files with syntax hl 2019-11-18 20:41:42 +00:00
Maxime Coste
0dd6ea83d8 Merge remote-tracking branch 'evanrelf/haskell' 2019-11-18 20:03:14 +11:00
Maxime Coste
2804479b27 Merge remote-tracking branch 'JJK96/comment' 2019-11-18 20:01:37 +11:00
Evan Relf
199b4e2f66
Highlight Haskell deriving strategies keywords 2019-11-18 00:15:33 -08:00
Evan Relf
237acbcfeb
Improve Haskell quasiquote highlighting
Now only the inside of the quasiquote gets the string coloring applied.
2019-11-18 00:14:41 -08:00
Evan Relf
f40064b8d6
Add forall unicode character as Haskell keyword 2019-11-18 00:14:22 -08:00
Maxime Coste
7368678e26 Merge remote-tracking branch 'lenormf/fix-rust-formatcmd' 2019-11-17 10:41:47 +11:00
Maxime Coste
49f3a72bdc Merge remote-tracking branch 'Anfid/update-lua-highlight' 2019-11-17 10:39:00 +11:00
Maxime Coste
d220ac049e Merge remote-tracking branch 'Anfid/hunk-next-prev' 2019-11-17 10:38:52 +11:00
Maxime Coste
7582c5d5e7 Merge remote-tracking branch 'lenormf/fix-fail-errors' 2019-11-17 09:59:28 +11:00
Maxime Coste
090efcb1b1 Merge remote-tracking branch 'lePerdu/elm-lang-fixes' 2019-11-17 09:50:33 +11:00
Mikhail Pogretskiy
304f10bea2 rc lua: Improve syntax highlighting 2019-11-15 23:05:54 +07:00
Frank LENORMAND
5b1f9255a1 rc: Use the standard fail command to report errors
Merely using `echo` with markup doesn't log errors in the debug
buffers, and is also less readable.
2019-11-14 08:32:55 +01:00
Mikhail Pogretskiy
e159acaa19 Add git next-hunk and prev-hunk commands
Fixes #2423
2019-11-13 22:55:03 +07:00
Jan-Jaap Korpershoek
d655af04cd Change markdown block comment 2019-11-12 13:21:54 +01:00
Frank LENORMAND
fa6396405e rc rust: Don't set an arbitrary formatter
Users who want to use a formatter are free to pick a tool of their
choosing and set `formatcmd` in their user configuration.
2019-11-11 14:20:26 +01:00
lePerdu
c5fad3cab6 Don't set formatcmd in the syntax file 2019-11-11 08:14:18 -05:00
Maxime Coste
b464822f1b Merge branch 'fsharp-filetype-bugfix' of http://github.com/pema99/kakoune 2019-11-11 21:57:01 +11:00
Maxime Coste
d2d0e629fa Merge remote-tracking branch 'lenormf/spell-lang' 2019-11-11 21:51:57 +11:00
pema99
43b8f1338b Fix literal '"' in fsharp highlighting. 2019-11-11 06:25:37 +01:00
lePerdu
a805844e20 Fix type, variable, and function patterns
The old ones are functionally correct (I think), but are un-necessarily
complex and not don't semantically fit what they are trying to match.
2019-11-10 19:35:11 -05:00
lePerdu
a0d6d8a03f Remove where keyword and add port keyword 2019-11-10 19:24:12 -05:00
lePerdu
44bc51a90a Put - first in character class patterns
If `-` is not first or last in a character classes, it matches a range based on
the character code. This applies to special characters as well as to
alphanumeric characters.
2019-11-10 18:29:07 -05:00
lePerdu
7c455db52e Properly highlight Elm operators
- Highlight `=` and `|` as keywords (like `->` and `:`)
- Highlight custom operators (I guess they aren't really custom as of Elm 0.19
  but there are still a bunch "built in").
2019-11-10 18:12:45 -05:00
lePerdu
166049f128 Highlight multiline strings in Elm 2019-11-10 18:12:17 -05:00
lePerdu
3232ba8a4c Use elm-format for formatcmd in Elm 2019-11-10 18:11:36 -05:00
lePerdu
6aab2f54dd Copy doc comment (///) prefix to new lines 2019-11-09 09:41:11 -05:00
lePerdu
2167374496 Add Gluon highlighting/indent 2019-11-09 09:22:19 -05:00
Maxime Coste
11975b7f31 Merge remote-tracking branch 'AJChapman/dhall' 2019-11-09 09:09:14 +11:00
Maxime Coste
88944c7b6a Merge remote-tracking branch 'nhey/fsharp-filetype' 2019-11-09 09:06:44 +11:00
Frank LENORMAND
a7bf625236 rc modeline: Support spelling language options 2019-11-08 17:56:36 +01:00
Nikolaj Hey Hinnerskov
1f19b44b88 Add syntax highlighting for F#
Co-authored-by: pema99 <pemamalling@gmail.com>
2019-11-08 13:01:36 +01:00
Frank LENORMAND
be8d0e6726 rc spell: Allow storing a language in an option
This commit adds a `spell_lang` option that will be used by the
`spell` command when no language is passed to it directly.

Setting a buffer/window local option allows using `:spell` seamlessly
across several buffers, written in different languages.
2019-11-08 12:44:55 +01:00
Maxime Coste
d5f2744e59 Merge remote-tracking branch 'JJK96/xml' 2019-11-07 20:16:58 +11:00
Maxime Coste
f13239764b Merge branch 'patch/fix-python-operator-highlighter' of http://github.com/cipharius/kakoune 2019-11-07 20:08:59 +11:00
Maxime Coste
50a4964910 Merge remote-tracking branch 'Delapouite/patch-3' 2019-11-07 20:06:02 +11:00
Maxime Coste
44047a69c5 Fix c-family include highlighting 2019-11-05 17:35:44 +11:00
Jan-Jaap Korpershoek
fcc8ed5df3 [html] Fix indentation when entering a newline while in the middle of a tag
Example:

```
        <tag>|</tag>
```
Then press enter

Old behaviour:
```
        <tag>
            </tag>
```
New behaviour:
```
        <tag>
        </tag>
```

I also added a test for it
2019-11-03 12:25:02 +01:00
Alex Chapman
6a3421d285 Add support for quoted labels, empty record values and their type 2019-10-30 10:22:31 +11:00
Alex Chapman
9381277274 Add Dhall multi-line string literals 2019-10-30 10:22:23 +11:00
Alex Chapman
80a4e66622 Add syntax support for the Dhall configuration language. 2019-10-30 10:22:12 +11:00
cipharius
988b92d948 Fix python operator highlighter 2019-10-27 15:49:04 +02:00
Bruno Heridet
3726fd000c
filetype: add support for .make extension
While building fish-shell which uses `cmake`, a lot of regular Makefiles are generated with this extension.
2019-10-25 14:14:30 +02:00
Maxime Coste
5b34a6ed81 Merge remote-tracking branch 'eraserhd/tmux-version-check' 2019-10-23 22:36:11 +11:00
Maxime Coste
74275b82e1 Merge remote-tracking branch 'lenormf/python-highlight-module' 2019-10-23 22:32:10 +11:00
Maxime Coste
a49ae162f4 Add a -verbatim switch to evaluate-commands for perfect forwarding
-verbatim will disable argument parsing in evaluate-commands, making
it possible to forward a single command to a different context without
triggering a reparsing of the arguments.

Fixes -try-client support in grep.kak

Closes #3153
2019-10-23 22:30:23 +11:00
Maxime Coste
362021c1d3 Merge remote-tracking branch 'lenormf/key-semicolon' 2019-10-23 22:10:06 +11:00
Jason Felice
6f443537e4 Accept tmux pre-release and rc versions 2019-10-22 10:25:41 -04:00
Frank LENORMAND
e3ba7f7d56 rc swift: Remove highlighting of non-standard comments
Highlighting arbitrary words in Swift comments should be done from the
user configuration, plus hardcoding the `red` color doesn't play well
with all colorschemes.
2019-10-22 11:12:10 +02:00
Frank LENORMAND
21614cb06e src: Create a <semicolon> named key
This commit allows using the <semicolon> expansion in commands, instead
of `\;`.

It makes commands look more elegant, and prevents new-comers from
falling into the trap of using <a-;> without escaping the semicolon.
2019-10-22 11:02:06 +02:00
Frank LENORMAND
2ed70ad5cc rc man: Expose the actual buffer-space's width
Fixes #675
2019-10-20 21:38:58 +02:00
Frank LENORMAND
38746b169e rc python: Highlight modules in import statements 2019-10-20 20:21:08 +02:00
Maxime Coste
a5d662f7fe Fix d.kak invonluntary modification 2019-10-17 22:39:07 +11:00
Maxime Coste
e4fb70ebec Replace ModeChange hooks by ModePush and ModePop
Remove deprecated InsertBegin, InsertEnd, NormalBegin, NormalEnd
hooks.

Closes #2545
2019-10-16 20:45:53 +11:00
Maxime Coste
a1a63901c1 Merge branch 'patch-1' of https://github.com/chaoky/kakoune 2019-10-15 20:46:40 +11:00
Maxime Coste
e4f815e350 Merge remote-tracking branch 'occivink/alt-fail' 2019-10-09 19:18:45 +11:00
Maxime Coste
5430f6ccad Simplify argument pass through in git wrapper script
Fixes #2869
2019-10-09 17:40:57 +11:00
Olivier Perret
fac05f3ea0 [rc] Use 'fail' when the alternative file cannot be found
This makes it possible to implement a fallback strategy using 'try .. catch',
for cases where the alternative file is not stored in a subdirectory
2019-10-08 18:06:54 +02:00
Leonardo Dias ~Lordie
220d5b6e72
fixed regex for matching words
the regex for matching words was matching some characters that elm does not parse
added <_> and <->> as keywords
2019-10-02 03:46:23 -03:00
Leonardo Dias ~Lordie
32648d6cf4
Better elm syntax lighting
this will only highlight elm 0.19 (latest) properly
very close to how https://ellie-app.com/ highlights
- anything that starts with an upper case letter is a type
- anything that starts with a lower case letter is a function
- function declaration is just a function at the start of a line

note: the default color scheme looks too colorful
2019-10-01 23:44:54 -03:00
Maxime Coste
d793ca76b6 Merge branch 'haskell' of http://github.com/evanrelf/kakoune 2019-10-01 20:07:29 +10:00
Maxime Coste
f2e5582f34 Merge remote-tracking branch 'eraserhd/pr/master/extra_word_chars-on-window' 2019-10-01 20:06:03 +10:00
Maxime Coste
9421e28eb5 Merge remote-tracking branch 'occivink/grep-space' 2019-10-01 18:35:26 +10:00
Olivier Perret
b376e3b662 grep: fix for filenames containg spaces 2019-09-30 23:54:31 +02:00
Evan Relf
c544e01b7d
Add additional syntax highlighting for Haskell
- Function names in type signatures are now highlighted
- Quasiquotes are now highlighted
2019-09-28 15:38:43 -07:00
Jason Felice
f88cf7ffb4 rc, doc: set extra_word_chars on buffer, not window
For clojure.kak and haskell.kak, set extra_word_chars on the buffer
and not the window, so that the buffer's word db is updated correctly
for word completion.

Document this.

Also, minor refactor of clojure.kak.

Closes #3108
2019-09-26 09:55:02 -04:00
Maxime Coste
370693afd8 Do not autoscroll on grep results
Closes #3100
2019-09-26 20:30:38 +10:00
Maxime Coste
891a9f5fe6 Merge remote-tracking branch 'lenormf/fix-git-tools' 2019-09-22 09:29:19 +10:00
Maxime Coste
271b1d4f2f Add a clang_directory option to set PWD when completing
This matches the directory entry in compilation databases
format.
2019-09-17 21:50:21 +10:00
Maxime Coste
8cca77c949 Accept docstrings with last line not fully indented
When trimming indent, the last line, if only containing
whitespaces does not need to match the indent, so that
this indentation style works:

    -docstring %{
        indented string
    }
2019-09-17 21:48:00 +10:00
Maxime Coste
6d085f995e Merge remote-tracking branch 'andreyorst/universal-git-path' 2019-09-16 07:06:50 +10:00
Andrey Orst
cab4908f1d cd to file's dir 2019-09-15 22:29:33 +03:00
Maxime Coste
33a00c7031 Fix clang completion support with modern clang 2019-09-15 11:48:25 +10:00
Maxime Coste
90f83780a5 Rename formatter.kak to format.kak and alias format to format-buffer 2019-09-15 10:52:06 +10:00
Maxime Coste
6ee71191af Merge remote-tracking branch 'codesoap/background_blocks' 2019-09-15 09:29:26 +10:00
Maxime Coste
7aec8b2231 Merge remote-tracking branch 'stevenyvr987/add-hyperlink-support-to-man-plugin' 2019-09-15 09:05:12 +10:00
Maxime Coste
54ba6a44c8 Merge remote-tracking branch 'occivink/refactor-format' 2019-09-15 09:01:19 +10:00
Maxime Coste
fb60eea66d Merge remote-tracking branch 'lenormf/fix-latex' 2019-09-15 09:00:25 +10:00
Olivier Perret
82d99aa12b Refactor formatter.kak
The 'format' command is split into two, 'format-selections' and
'format-buffer' which relies on the former.
2019-09-12 18:53:06 +02:00
Maxime Coste
64511baceb Merge remote-tracking branch 'mogenson/editorconfig' 2019-09-08 22:57:14 +10:00
Frank LENORMAND
1aea592b76 rc latex: Highlight DTX and STY files 2019-09-05 10:19:39 +02:00
Frank LENORMAND
b3287a74cb rc latex: Highlight .cls files as LaTeX
When .cls files are opened, the local `filetype` option is automatically
set to `tex`, which isn't supported.
2019-08-24 20:36:34 +02:00
Michael Mogenson
37ded5e400 Check if buffile is path before loading editorconfig settings
Check if buffile is a full path by checking for the beginning
'/' character in editorconfig-load command. This avoids a parsing
error from feeding a *scratch*/*debug*/*grep*/etc. buffer name to the
editorcofig command. Don't clear editorconfig hooks until after checking
for a valid bufffile path. This way, opening the *debug* buffer will
not clear the hooks from a previously parsed .editorconfig file. If
trim_trailing_whitespace is true, print the hook directly from awk. This
removes the need to save a editorcofig_trim_trailing_whitespace option.

Note: Setting the max_line_length requires a window to be created.
Therefore, a global hook to load .editorconfig settings should be:

    hook global WinCreate .* %{editorconfig-load}
2019-08-20 14:55:17 -04:00
Maxime Coste
292efe1b37 Merge remote-tracking branch 'andreyorst/patch-2' 2019-08-19 22:30:16 +10:00
Maxime Coste
7d8fb135a9 Merge remote-tracking branch 'codesoap/makefile' 2019-08-19 22:25:18 +10:00
Maxime Coste
5e2f123baf Merge branch 'master' of https://github.com/aecepoglu/kakoune 2019-08-19 22:24:14 +10:00
Maxime Coste
349586b464 Merge remote-tracking branch 'andreyorst/fix-rust-meta-attributes' 2019-08-19 22:20:13 +10:00
Maxime Coste
0f5389700e Merge remote-tracking branch 'nhey/master' 2019-08-19 22:19:29 +10:00
Andrey Orst
427153b8e9
remove wrong '+' from awk regex 2019-08-12 22:18:26 +03:00
nhey
4722db7103 Highlight parenthesized paths. Also change '()' to '§' for module quoting. 2019-08-12 18:07:32 +02:00
tawsi-melek
3f405b00f1 Revert back to previous char literal highlighter as it's more precise 2019-08-12 17:17:20 +02:00
tawsi-melek
228a8dd9ae Fix some more edge cases
* Adapt the char literal highlighter from c-family.kak
* Fix line comment adjacent to char literal not being highlighted
* Fix single quote terminating a double quote string
2019-08-12 16:40:35 +02:00
tawsi-melek
1c58e5aa90 Improve single line comments
* '#' now gets highlighted as a char literal
* Remove highlighting for comment tags and escape sequences
2019-08-08 22:47:22 +02:00
tawsi-melek
93e64b4541 Some more improvements
* Fix keywords in comments being highlighted
* Highlight Nim's escape sequences for strings
* Highlight common comment tags
* Add on/off to the highlighted boolean values
* Remove redundant regex highlighter for comments
* Fix autoindent indenting lines more than it should
2019-08-08 21:17:55 +02:00
Andrey Orst
396236f728 support raw strings withing the meta attributes 2019-08-07 11:37:02 +03:00
Andrey Orst
3156ecacc3 fix #3043 2019-08-06 17:02:51 +03:00
tawsi-melek
5ca0b9baa3 Enum too 2019-08-06 00:00:38 +02:00
tawsi-melek
ff7397b593 nim.kak: Add auto-indent after tuple and object
Before:
```nim
type
  MyType = tuple
  myint: int     # This line needs to be indented manually
```

After:
```nim
type
  MyType = tuple
    myint: int     # Lines after 'tuple' are now indented automatically
```
2019-08-05 22:02:56 +02:00
Maxime Coste
6eec6e656d Merge remote-tracking branch 'lenormf/fix-python-decorators' 2019-08-04 20:21:20 +10:00
Jason Felice
ba672623bc Insert Clojure ns directive for new files 2019-07-31 09:38:09 -04:00
codesoap
e502097d01 makefile.kak: require whitespace after target 2019-07-30 14:43:11 +02:00
codesoap
6e86766966 makefile.kak: remove reqex mismatch between highlight and indent 2019-07-30 10:00:04 +02:00
codesoap
4c3795faa2 makefile.kak: Refine regex for target
Multiple targets and the target separators ':', '::' and '!' are now
supported.
2019-07-30 09:55:25 +02:00
Frank LENORMAND
ff52bd7027 rc python: Highlight indented decorators with .
Make sure decorators are on their own line, and don't stop highlighting at
the first dot when they are imported, e.g.

```
import enum

@enum.unique
class A(enum.Enum):
    …
```

Ideally highlighting shouldn't stop at the first parenthesis either
(e.g. `@foo(['1'])`), but the current code somewhat highlights the contents
of the parens already, which is good enough in most cases.
2019-07-26 13:01:58 +03:00
Maxime Coste
550feb1706 Merge remote-tracking branch 'andreyorst/rust-highlighting' 2019-07-25 17:48:04 +10:00