Commit graph

863 commits

Author SHA1 Message Date
Andrew
f20179519f
Detect more file types for git syntax highlighting (#2330)
* Update git-commit.yaml

This will enable syntax highlighting for merge commit messages

* Update git-commit.yaml
2022-01-08 19:51:15 -08:00
Juan Francisco Cantero Hurtado
3a1ec088e2
Raku syntax: fix comments (#2318)
Code:
 # sub xyz(Str is encoded("utf8")) returns int32 is native("asdf") { * }
2021-12-31 18:51:53 -05:00
Juan Francisco Cantero Hurtado
a2d83132ca
Raku syntax: Fix strings and comments (#2311)
* Raku syntax: Fix strings and comments

Problematic code:
my @array1 = [
   "'", "a", "b"
];
my @array2 = [
   '"', 'a', 'b'
];
my @array3 = [
   "#", "a", "b"
];

I deleted "default" because it was breaking comments with urls after
of my changes.

Some parts were taken from:
https://github.com/hankache/raku.nanorc/blob/master/raku.nanorc

* Raku syntax: fix strings

Code:
sub xyz(Str is encoded('utf8')) returns int32 is native('asdf') { * }
sub xyz(Str is encoded("utf8")) returns int32 is native("asdf") { * }

From python3.yaml
2021-12-31 17:42:21 -05:00
Reilly Wood
580c32bcef
Fix repo.json info in plugin docs (#2313) 2021-12-31 02:06:53 -05:00
Owen Valentine
cc0af275c1
Adjust default keybinding text (#2293)
Fixes #2287
2021-12-24 22:32:15 -05:00
Juan Francisco Cantero Hurtado
fd20fc8837
Fix the syntax for Raku variables. (#2309)
The current version has problems with the last argument and the
brackets in this code:

sub myfunction(Int $x1, Int $x2){

}

Taken from:
https://github.com/hankache/raku.nanorc/blob/master/raku.nanorc
2021-12-21 23:47:31 -05:00
Jake Leahy
c442d7030d
Fix edge case when comment is at start of line (#2237) 2021-12-05 17:45:10 -08:00
antonl05
6998cb5602
add more types for nim (#2284) 2021-11-22 22:41:04 -08:00
Matthias Thym
dd8e341de2
Fix linter help formatting (#2280) 2021-11-17 12:59:16 -08:00
abaldota
d023aef6b5
Python syntax: multiline string should be constant.string, not comment (#2268)
* Python syntax: multiline string should be comment.string, not comment 

''' delimits multiline strings, not comments

* Python syntax: multiline string should be comment.string, not comment 

''' delimits multiline strings, not comments

* Update python3.yaml for python3.10 keywords
2021-11-14 21:54:56 -08:00
Evan Shimoniak
58e3cc1be0
Clarified some documentation (#2259)
* Clarified meaning of indentchar setting

The description "sets the indentation character" combined with the default value of a space led me to believe that this was a way to set a preference for tabs/spaces and choose a number of spaces per indentation all at once. I've updated the description to try to make its true function clearer.

* Added note on rmtrailingws

This behavior was unexpected for me, so it's probably good to let other users know which option has precedence.

* Added details to help command

Initially I kept trying to use `help <command-name>` rather than `help commands`
2021-11-02 13:26:14 -07:00
Dmitry Maluka
ffbb257434
Support for highlighting all search matches (hlsearch) (#1762)
* Support for highlighting all search matches (hlsearch)

hlsearch is implemented efficiently using the buffer's line array,
somewhat similarly to the syntax highlighting.
Unlike the syntax highlighter which highlights the entire file,
hlsearch searches for matches for the displayed lines only.
Matches are searched when the given line is displayed first time
or after it was modified. Otherwise the previously found matches
are used.

* Add UnhighlightSearch action

and add it to the list of actions triggered by Esc key by default.

* Add comment explaining the purpose of search map

* Add hlsearch colors to colorschemes

Mostly just copied from the corresponding original (mostly vim) colorschemes.

* Highlight matches during/after replace as well

As a side effect it also changes the last search value, i.e. affects FindNext
and FindPrevious, but it's probably fine. In vim it works the same way.

* Improve hlsearch option description
2021-09-28 13:39:03 -07:00
Ryan Westlund
c2d7b62e8f
Fix #2190: Document goto command in commands.md (#2218) 2021-09-24 14:40:11 -07:00
TogoorooDev
395bfc2307
Syntax Highlighting Support for FreeBSD Kernel Configuration Files (#2220)
* added FreeBSD kernel configuration file format

* updated format, notably to highlight the word 'include'
2021-09-24 14:39:46 -07:00
Ali Kefia
a417ec4dcb
normalize path - force slash separator to access embed FS (#2197) 2021-08-25 16:26:54 -04:00
Ali Kefia
ec3292e8c4
Build : using go:generate and go:embed (#2195)
* using go:generate and go:embed

* fix import
2021-08-24 22:02:29 -04:00
Zachary Yedidia
fe3186ba9d Ignore tool files 2021-08-21 18:07:43 -04:00
Zachary Yedidia
bb609467dd Update comment filetype when commenting 2021-08-20 14:42:38 -04:00
Dmitry Maluka
87ad6fc0bb
plugins.md: update link to the internal documentation (#2191)
godoc.org now redirects to pkg.go.dev and it's not obvious how to locate
the internal packages documentation at https://pkg.go.dev/github.com/zyedidia/micro
2021-08-18 15:35:49 -04:00
Zachary Yedidia
403a9eb11d Add rust clippy linter and go vet linter 2021-08-18 01:08:54 -04:00
Zachary Yedidia
7a1ba01621 Merge branch 'patch-3' of https://github.com/pyfisch/micro into pyfisch-patch-3 2021-08-06 20:44:57 -04:00
riley
2b8cd6b758
Highlight racket files as lisp (#1931)
Add syntax highlighting for [racket](racket-lang.org), a (variant of scheme which is a) variant of lisp which uses the .rkt extension.
2021-08-06 20:38:22 -04:00
AAAA
cbe339da07
Update v.yaml (#1925)
Improvements:
 - Use proper scope names for better colorization
 - Better regex to detect binary, octal, decimal and hexadecimal numbers
 - Extend some definitions based on the Vlang docs

Co-authored-by: AAAA <dev@onerbs.com>
2021-08-06 20:37:42 -04:00
Zachary Yedidia
e290ce2de5 Fixes for syntax and docs
Fixes #2163
Ref #2173
2021-08-03 00:07:14 -04:00
Andrey Nering
c7fd4ba5f1
Document that "bubblegum" is a light theme (#2153) 2021-08-02 21:13:05 -04:00
pyfisch
6e1fe5b301 More precise filename detection for shell scripts
Make the regular expression much more precise:

* match literal dots instead of any char (match rc.conf but not rcXconf)
* match special filenames exactly (match PKGBUILD but not myPKGBUILD.something)

Run build-all to update internal/config/runtime.go

closes #2163
2021-07-21 22:09:46 +02:00
pyfisch
84a490f14c
Update rust syntax: don't highlight lifetimes (#2164)
Work-around rust lifetimes and character literals both using single quotes.
2021-07-21 15:02:28 -04:00
pyfisch
42a9302636
Update rust syntax: char literal (#2162)
Highlight character literals started with a single quote (').
Importantly this ensures correct highlighting for the character literal '"'.
Limitation: rust char literals contain exactly one character, however this isn't checked by the highlighter.

Closes #2160
2021-07-21 12:37:41 -04:00
Ali Kefia
ae0c28a03d
Fix name collision on linter name (swiftc) (#2158) 2021-07-18 18:30:52 -04:00
Ali Kefia
1a5518ebbb
Shellcheck as a new shell linter + runtime.go out of git control (#2157)
* shellcheck as a new shell linter + runtime.go out of git control

* keep runtime.go and keep both shfmt and shellcheck since we can remove from custom conf
2021-07-16 15:01:50 -04:00
Rylee
160a81c572
Add alcritty and foot to the list of OSC 52 supporting terminals (#2154) 2021-07-13 23:37:48 -04:00
vandervoortj
9ceb69921a
Add nix language syntax (#2024)
* Create nix.yaml

Add nix language syntax

* Add nix-linter
2021-06-15 17:56:31 -04:00
Kethan
4b0db74770
Fix typo in tutorial.md (#2130) 2021-06-12 23:52:08 -04:00
Jeff Zhao
ee9c78dc86
Improve linter performance (#2083)
Only compute args if we are actually going to use it
2021-06-01 19:34:10 -04:00
Rosetta H&S
b66ec2bf7a
Add highlighting for user-defined types (#2107)
* Added highlighting for user-defined types

Provides automatic highlighting of user-defined types ending with either "_t" or "_T", as is seen in editors such as Nano, or within GitHub itself.

* Update cpp.yaml
2021-06-01 19:33:40 -04:00
Héctor M. Monacci
2dc2cabe0e
Dont take # as comment when preceded by backslash (#2112)
When escaped with a backslash (e.g., inside a regex) the numeral char, ```#```, shouldn't be interpreted as a beginning of comment.
2021-06-01 19:33:06 -04:00
Zachary Yedidia
56c7744e23 Fix erlang comment syntax 2021-05-31 20:26:32 -04:00
Dmitry Maluka
965e43ebf1 Implement word wrapping
Fixes #264
Fixes #1644
2021-04-08 23:54:10 +02:00
Alex Tsantilis
f1aaa30743
Update and rename perl6.yaml to raku.yaml (#1927)
The language has been renamed but still aims to support the old file extensions for a time.
2021-04-07 16:21:19 -04:00
Laszlo Gombos
9ed3525076
Improve patch file detection by adding a header rule. (#1942) 2021-04-07 16:20:57 -04:00
Dmitry Maluka
c5798b5b8c
Fix softwrap scrolling issues (#1981)
Softwrap implementation enhanced to fix various issues with scrolling,
centering, relocating etc.

The main idea is simple: work not with simple line numbers but
with (Line, Row) pairs, where Line is a line number in the buffer
and Row is a visual line (a row) number within this line.
The logic remains mostly the same, but simple arithmetic operations
on line numbers are replaced with corresponding operations on
(Line, Row) pairs.

Fixes #632, #1657
2021-04-07 16:18:51 -04:00
Zachary Yedidia
975e78d9c0 Remove conf highlighting (too many conflicts)
Fixes #2031

The conf highlighter interferes with many more specific highlighters and
doesn't provide much value on its own.
2021-02-20 14:27:58 -05:00
relrelb
6c694a1db4
Improve C syntax highlighting (#2015) 2021-02-17 22:28:19 -05:00
Nikolay Korotkiy
261eb41912
Add Gemini syntax file (#2016) 2021-02-17 22:27:56 -05:00
Sebastian Kolind Sørensen
d7abc8f100
Add .tsx support for Typescript syntax (#2021)
* Update to look for tsx files also

* Shorten filename detection
2021-02-17 22:27:45 -05:00
Zachary Yedidia
c3a17a71be Rename to incsearch 2021-01-27 13:49:38 -05:00
Zachary Yedidia
120cd02b30 Merge branch 'PR-find-on-type' of https://github.com/ilius/micro into ilius-PR-find-on-type 2021-01-27 13:48:01 -05:00
Peter Kramarik
fcc2fea684
fix vue syntax highlight (#1982) 2021-01-08 17:06:49 -05:00
Marduk Bolaños
84f7248943
Added multiline strings to the Scala syntax highlighter (#1969)
In Scala multiline strings are constructed just like in Python

```
val message = """
This
is
a
message
"""
2021-01-05 19:59:28 -05:00
Saeed Rasooli
dd37ad5ce4
add settings option "findontype" to allow disabling search-on-type 2021-01-04 10:30:47 +03:30
Zachary Yedidia
54c23cae72 Merge branch 'python-highlight-zero' of https://github.com/a11ce/micro into a11ce-python-highlight-zero 2020-12-27 18:42:53 -05:00
Zachary Yedidia
2fbeb40bf0 Update hlint format 2020-12-20 16:53:18 -05:00
Zachary Yedidia
6b7c04b421 Add Dracula colorscheme to defaults
See https://draculatheme.com/micro.
2020-12-20 01:08:41 -05:00
Dmitry Maluka
83b3efc9de
Document undocumented colorscheme groups (#1939) 2020-12-20 00:35:57 -05:00
a11ce
1e5f8c020e Highlight 0 as a constant number in python3 2020-12-15 18:57:28 -05:00
Alekhine51
3fb5a7053f
Added a sentence to colors.md clarifying that the truecolor environment variable has to be created by the user. (#1928) 2020-12-08 22:43:37 -05:00
Carlos Henrique Guardão Gandarez
7a5f7e443a
Make more libraries available (#1917)
* Make more libraries available to plugin dvelopment

* Add Unzip function to util
2020-11-21 01:46:17 -05:00
Marduk Bolaños
3d683b27f7
.sbt files also contain Scala code
The Scala Build Tool sbt uses Scala as configuration language.
2020-11-11 09:58:10 +01:00
Zachary Yedidia
5d230754a8 Merge 2020-11-05 15:39:29 -05:00
Zachary Yedidia
19067a9bf0 Enable ignorecase by default
Closes #1908
2020-11-05 15:39:05 -05:00
XeroOl
b2620eb68c
update lua.yaml (#1892)
added `break` as a keyword
2020-10-16 01:44:48 -04:00
Zachary Yedidia
cfcb2e4577 Update runtime 2020-10-06 17:39:20 -04:00
ThatXliner
c0907bb58e
✏️ : Added more Code tags (#1875)
I added more syntax highlighting for python comment code tags. Though this should be implemented for all languages...
2020-10-06 16:56:08 -04:00
Marduk Bolaños
225b24f356
Fixed help topic name (#1876)
The help topic is called `commands` not `command`
2020-10-06 16:55:47 -04:00
Zachary Yedidia
530041ac70 Fix typo
Closes #1869
2020-09-23 21:54:25 -04:00
Ryan Westlund
e8ba143144
Fix Crystal syntax highlighting (#1844)
Don't highlight things that don't exist, add some missing keywords,
highlight true/false/nil as constants instead of keywords, and
highlight types as types instead of constants.
2020-09-17 23:20:28 -04:00
MasFlam
e0dc018f66
Fix some left-over details in C++ syntax highlighting (#1865)
- move type cast keywords into operators, since that's their syntactic function
- fix a single dot being matched as a constant.number
- add the missing caret operator
2020-09-17 23:19:41 -04:00
MasFlam
cf63a68c8b
groovy highlight (#1866) 2020-09-17 23:19:32 -04:00
Ertu (Er2, Err)
6dd92faf1a
coffeescript syntax fix (#1861) 2020-09-16 00:06:40 -04:00
MasFlam
8df921cf96
Overall syntax highlighting improvements for C++ (#1858)
* Overall syntax highlighting improvements for C++
Most of these changes are based on the information on cppreference.com;
specifically from here: https://en.cppreference.com/w/cpp/keyword
- made `identifier` actually match any identifier
- add ~ as an operator
- add `static_assert` as a keyword (statement)
- add keywords that are interchangeable with operators as operators
- add keywords `sizeof`, `alignof` and `typeid` as operators
- add the quasi-keywords `asm`, `fortran` and `final`, `override`
- add the keyword `nullptr`
- add `_Pragma` as a preprocessor keyword
- add C++20 (concepts and modules) -related keywords
- add casting keywords
- add the keyword (specifier) `noexcept`
- remove `nothrow` (because it's not any more special than `vector` is)
- add `wchar_t` and `charXX_t` types
- add cv type keywords as `type.keyword`s
- move some fitting keywords into `type.keywords`
(mostly because they appear in/near type signatures etc.)
I didn't include coroutine-related language features,
primarily because there is no good source of information
about them other than the ISO C++ standard.

* Further changes to C++ syntax highlighting
- reverted the changes to the `identifier` regex, since most
colorschemes color it the same as `type`s and/or `statement`s
- fix the 2nd `type` regex (the word boundaries were in only two pipe-options)
- move `nullptr` back into `constant.bool`,
since it looks better in-editor this way (imo)
- add `?` as an operator
- add regexes that match all the correct number literals, and nothing else
(see https://en.cppreference.com/w/cpp/language/floating_literal)
(that is, if I haven't made a mistake)
2020-09-14 00:06:47 -04:00
Zachary Yedidia
067f08c56e Merge 2020-09-14 00:05:55 -04:00
Zachary Yedidia
ad16f1756b Remove test option
Fix #1857
2020-09-14 00:05:35 -04:00
Zachary Yedidia
fcfec28d79 Don't highlight parens in default theme 2020-09-13 20:25:02 -04:00
Zachary Yedidia
5044ccf6bb Update keybinding docs
Also updates the pane type of `info` to `command` which is a more
descriptive name.
2020-09-06 17:38:23 -04:00
Peder B. Sundt
5bee7272e9
Add improvements to the python3 syntax definitions (#1833)
* Python3: Add built-in object 'cls'

* Python3: Add the bitwise negation operator ~

* Python3: Add support for hexadeximal and binary numerical literals

* Python3: Rewrite '(__foo__|__bar__)' as '__(foo|bar)__', add known '__i.*__' methods

* Python3: Add __iter__ as a magic method, sort the list of magic methods

* Python3: Numerical literals: Add support for '_', disallow leading 0 for decimals

* fixup! Python3: Numerical literals: Add support for '_', disallow leading 0 for decimals

hex oct and bin have different sets of allowed digits

* Python3: Add support for floating point numbers with optional scientific notation

* Python3: stop single-line strings at EOL

* Python3: Add support for TODO and FIXME in comments

* Python3: Add support for the ^ bitwise xor operator
2020-08-23 15:46:27 -04:00
Peder B. Sundt
11291e1406
Minor tweak to the railscast color scheme (#1834)
* Railscast: Change the color of operators to match keywords instead of identifiers

* Railscast: Add a color for `constant.specialChar`
2020-08-23 15:46:05 -04:00
Bartek Pacia
3ba03cca15
fix spelling (#1828) 2020-08-17 13:04:44 -04:00
Ryan Westlund
c6d04220be
Highlight static as keyword in Javascript files (#1824) 2020-08-14 16:56:55 -04:00
Ryan Westlund
a87370b111
Improve Rust syntax highlighting (#1820) 2020-08-11 21:39:57 -04:00
Zachary Yedidia
c837a7d0b7 Ref #1819 2020-08-10 20:34:10 -04:00
Robin Voetter
626b08e991
Improve Zig syntax definitions (#1814)
* Improve Zig syntax definitions

* Remove duplicate definition of constant.number

* Make undefined a constant
2020-08-05 19:39:03 -04:00
Jakob Nybo Nissen
697751d5f6
Allow Julia multiline strings and comments (#1813) 2020-08-05 19:38:29 -04:00
Ryan Westlund
1f27f51f9a
Add syntax support for Renpy (#1789) 2020-07-22 15:26:37 -04:00
Ryan Westlund
1343955b05
Add comment support for OCaml (#1776) 2020-07-15 14:13:44 -04:00
Zachary Yedidia
781a2dd826 Add flake8 linter, postinit and preinit
Closes #1768
2020-07-13 13:28:26 -04:00
Zachary Yedidia
a52dbb2142 Fix swift linting problem 2020-07-09 18:08:14 -04:00
Zachary Yedidia
41a27cc58a Update linter to include eslint
Ref #1766
2020-07-09 18:04:40 -04:00
Zachary Yedidia
3d387732c4 Update linter documentation
Ref #1766
2020-07-09 17:58:42 -04:00
Ján Priner
ddc887f6e4
Highlight multicharacter escape sequences in C and C++ string literals (#1761) 2020-07-08 00:17:48 -04:00
Zachary Yedidia
621e4e9e4d Slight performance improvement 2020-07-05 15:54:00 -04:00
Zachary Yedidia
806525c3da Improve comment plugin
When commenting a selection, the plugin won't just toggle each
line individually but will only uncomment the block if it is all
comments.

The comment plugin also now takes into account any number of spaces
between the comment character and the text. For example '//comment' will
be uncommented properly, as well as '//      comment'.

Fixes #1758
2020-07-05 15:48:49 -04:00
Zachary Yedidia
aeb5563df0 Update runtime 2020-07-04 20:06:37 -04:00
Zachary Yedidia
f143418267 Add support for copy-paste via OSC 52
Ref #1754
2020-07-04 20:00:39 -04:00
Zachary Yedidia
977290d77b Improve php string highlighting
Fixes #1753
2020-07-01 23:38:47 -04:00
Utkarsh Gupta
b748d0c383
Drop unnecessary Ftoa and FtoaWithDigits function (#1751)
Fixes: #1749

Signed-off-by: Utkarsh Gupta <utkarsh@debian.org>
2020-06-30 13:19:27 -04:00
Ryan Westlund
e946d9eddf
Improve Haskell syntax highlighting (#1745) 2020-06-26 17:53:43 -04:00
Zachary Yedidia
60846f549c Update plugin documentation 2020-06-24 17:24:45 -04:00
Zachary Yedidia
5f62f550f3 Add more functions to customize status bar
Adds `status.lines`, `status.vcol`, `status.bytes`, `status.size`,
and exposes some functions from go-humanize to plugins.

Ref #1727
2020-06-24 17:19:42 -04:00
Zachary Yedidia
db1df05017 Support month and day names in crontab syntax
Ref #1739
2020-06-24 16:33:22 -04:00
Zachary Yedidia
05cbc310f3 Use boundaries in cron syntax rules
Fixes #1739
2020-06-24 16:00:56 -04:00