Commit Graph

120 Commits

Author SHA1 Message Date
Martin Chaine
7384288e07 transform mimetype to a fallback option
The option is now used as a fallback when detection by extension fails. Some
scripts like `base/mail.kak` and `base/html.kak` still rely heavily on it.
2016-12-06 17:48:46 +01:00
Maxime Coste
168abcdb48 Fix c-family.kak after the change to keep handling of eol 2016-11-29 00:01:37 +00:00
Maxime Coste
97a84a4765 c-family.kak: rename gcc_macros to builtin_macros 2016-11-27 23:38:47 +00:00
Frank LENORMAND
94971e0e8a Introduce the builtin face, modify scripts accordingly 2016-11-24 17:06:45 +03:00
Maxime Coste
90de54af2f Rework c-family /* */ comments auto insertion of prefix star
Fixes #918
2016-11-14 21:11:20 +00:00
Maxime Coste
dcd733e5fa Do a first phase of command renaming 2016-11-14 00:27:14 +00:00
Frank LENORMAND
85ce5db08a Merge the "error" duplicate face into "Error" 2016-11-09 17:51:42 +03:00
Maxime Coste
fff129f15b Merge remote-tracking branch 'lenormf/fix-sh-highlighting' 2016-11-08 20:20:45 +00:00
Frank LENORMAND
aca984f000 Highlight variable expansions as values in shell scripts 2016-11-08 19:03:41 +03:00
Frank LENORMAND
277117f64b Fix the doc command for users of BSD man
This commit uses options and flags that will work on both the BSD and
the `man-db` implementations, however those changes remain unportable as
the POSIX standard only defines a single `-k` flag for the utility,
which we don't need.

The call to the `col` utility has also been replaced by a call to `sed`,
as the former is only shipped on systems that have the `nroff` formatter
installed.
2016-11-03 14:57:55 +03:00
Maxime Coste
01dba547fb Tweak c-family indentation logic 2016-11-02 22:27:50 +00:00
Maxime Coste
cf5bcdf1bb Merge remote-tracking branch 'lenormf/fix-formatcmd' 2016-10-17 18:28:57 +01:00
Maxime Coste
1431dcff46 Fix bug in c-family indentation logic after visibility labels
Fixes #872
2016-10-16 19:27:53 +01:00
Frank LENORMAND
ac42ea414e Add commenting characters to all supported languages
The default commenting character is now '#', considering the superior
amount of files that use it for comments compared to the previous
C-style comment characters.

The logic now also prioritize the opening commenting characters if they
contain a colon, to be able to use selection commenting on markdown
files.
2016-10-15 11:07:21 +03:00
Frank LENORMAND
68d3eda270 Miscellaneous fixes to the commenting.kak script
This commit properly produces backslash characters within double quote
strings instead of hoping the shell will not recognize the escape
sequence that they form with the following character. Use the proper
POSIX function declaration form.

The uncommenting logic now also ignores trailing newline characters,
which shortens the amount of operations needed to uncomment a selection.
2016-10-14 22:15:35 +03:00
Frank LENORMAND
5db1d1beef Move the commenting variables back to commenting.kak
Initialising the `comment_line_chars` and `comment_selection_chars` variables
in language support scripts created a hard dependency of those scripts
to `commenting.kak`, which would create errors when this script was not
loaded, e.g. when running tests.
2016-10-14 22:12:01 +03:00
Frank LENORMAND
67a8e8ca3c Remove all references to formatcmd
Initializing the `formatcmd` variable in the default language support
scripts created a dependency to the `formatter.kak` script, which we do
not want. Examples of such cases are when users haven't loaded the
`formatter.kak` script, or when Kakoune runs its test suite and
selectively loads some language scripts for testing purposes.
2016-10-14 19:16:45 +03:00
Maxime Coste
5af29b0254 Fix python comment copy logic in python.kak
And introduce the first unit test that sources bundled support
scripts.

Fixes #860
2016-10-13 20:13:05 +01:00
Frank LENORMAND
f6a2925950 Fix, complete and add docstring documentation to builtin commands
Level out the builtin commands loaded at startup in terms of format and
expressiveness. The following convention was followed:
* commands that take more than one argument have to be described along
  with their parameters prior to the actual documentation, otherwise the
  docstring consists in a capitalized sentence
  e.g. `command <arg1>: do something`
* optional arguments are enclosed in square brackets, to comply with the
  format used for hardcoded commands
  e.g. `cd [<directory>]`
* describe the effects of the command in the documentation string and
  omit implementation details unless they are relevant. Usually command
  names include the name of the tool they use, so they don't need to be
  redundantly mentioned
  e.g. `tmux-new-pane <arguments>: open a new pane`
* document the format the parameters to the commands, or list them if
  they are to be chosen among a list of static values (c.f. `spell.kak`)
2016-10-11 10:26:17 +03:00
Maxime Coste
35a6d4916e Fix :doc completion candidates, they do not depend on the current word
Fixes #845
2016-10-06 13:38:49 +01:00
Maxime Coste
1b9c8b9cf2 Fix hool -> hook in rc files 2016-10-01 14:09:59 +01:00
greduan
a68f5f20a1 Add highlight group to highlighters rmhl hooks 2016-09-28 08:45:01 +02:00
greduan
6c6359de93 Add highlight group to highlighters addhl hooks 2016-09-28 08:25:02 +02:00
Maxime Coste
0d5a1ddf4c Merge remote-tracking branch 'lenormf/fix-makefile' 2016-09-25 15:17:03 +01:00
Frank LENORMAND
b26d083627 Place the Makefile highlighting script alongside the make support script 2016-09-25 09:19:56 +03:00
Kylie McClain
3ec0cbd07a formatter.kak: Use sed rather than ${variable//string/replacement}
Using ${variable//string/replacement} is a bash extension, it is not part
of POSIX shell scripting.

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
2016-09-21 19:54:17 -04:00
Maxime Coste
e9c63316f5 Tweak c-family indent logic 2016-09-05 23:33:34 +01:00
Frank LENORMAND
47d9f4a993 Allow instant completion of doc pages
Closes #750
2016-08-30 17:25:34 +03:00
Maxime Coste
3a24763d53 c-indent: only align to opening paren if it is on the immediate previous line 2016-08-09 18:45:13 +01:00
Maxime Coste
967a55d09f c-indent: Tweak implementation of c-family-insert-on-newline 2016-08-05 09:37:25 +01:00
Maxime Coste
19e36425f4 c-indent: Restore previous indent after a closing parenthesis 2016-08-05 09:05:47 +01:00
Maxime Coste
d836fe7d66 c-indent: fix align to opening paren touching too much text 2016-08-05 09:05:30 +01:00
Maxime Coste
b3f4840f45 Merge remote-tracking branch 'lenormf/fix-hooks-cfamily' 2016-08-05 08:07:41 +01:00
Maxime Coste
b80dbf9322 Move x11.kak and tmux.kak to rc/base from rc/core 2016-07-28 09:17:18 +01:00
Martin Chaine
82e28bce11 Move iterm.kak to rc/extra 2016-07-25 12:52:40 +02:00
Martin Chaine
fce5274f81 Introduce iTerm2 support (split, tab, window) 2016-07-25 12:23:56 +02:00
Frank LENORMAND
78c6b7c03d Don't completely remove empty lines when fixing indents 2016-07-15 10:29:19 +03:00
Frank LENORMAND
4204f6dae6 Create an insert group, fix and improve the existing hooks 2016-07-12 17:23:55 +03:00
Maxime Coste
bbceae97a2 Fix uses of <c-m> in rc files, <ret> should be used now 2016-07-11 19:47:56 +01:00
Frank LENORMAND
7419f8241a Fix operators highlighting in shell scripts 2016-07-08 13:13:08 +03:00
Frank LENORMAND
b8c83a914a Update the keywords highlighted in kak files 2016-06-26 16:59:48 +03:00
Maxime Coste
a2d76e27b0 Use a draft context for *.h c/cpp filetype decision 2016-06-22 20:49:58 +01:00
Frank LENORMAND
4747ba6be9 Allow man buffer to be redrawn automatically when the window is resized
Tweaked by Maxime Coste
Closes #671
2016-06-06 18:07:10 +01:00
Maxime Coste
9298efd19b Restore whitespace cleanup on InsertEnd in python.kak 2016-05-05 13:59:06 +01:00
Maxime Coste
8c5d3128ef static_words def style tweak in c-family.kak 2016-05-05 13:54:12 +01:00
Maxime Coste
13ab721f64 python.kak: restore cleaning up trailing whitespaces on newline 2016-05-05 13:50:49 +01:00
Maxime Coste
763bb5aed1 Use the current client tmux session when splitting a new client 2016-05-05 13:32:16 +01:00
Frank LENORMAND
a20f5fc6a2 Pass a generic pattern to printf calls, use echo when possible 2016-04-23 10:00:36 +03:00
Frank LENORMAND
664f382ab2 Convert a non-POSIX extended sed regex to a basic notation 2016-04-23 09:56:53 +03:00
Frank LENORMAND
bdb67d8227 Remove a non-POSIX and unneeded -r sed flag 2016-04-23 09:56:53 +03:00
Frank LENORMAND
3b2fd831f4 Replace non-POSIX -o test flag with a double pipe 2016-04-23 09:56:53 +03:00
Frank LENORMAND
84a21f8cfb Replace non POSIX calls to echo with printf %s 2016-04-23 09:56:53 +03:00
Maxime Coste
3f74dd2924 Remove uses of \< and \>, always use std regex compatible \b 2016-04-21 20:43:17 +01:00
Frank LENORMAND
82a3f10a82 Fix arbitrary keys execution in the doc command 2016-04-12 10:41:16 +03:00
Maxime Coste
a026ebf298 style tweak in the static words definitions 2016-04-09 10:20:13 +01:00
Maxime Coste
a49685d996 Merge remote-tracking branch 'lenormf/fix-static-completion' 2016-04-09 10:08:19 +01:00
Frank LENORMAND
65f160fae7 Fix the patterns that detect commented selections 2016-03-25 21:40:17 +02:00
Frank LENORMAND
464007e332 Fix hook declarations 2016-03-25 21:31:01 +02:00
Maxime Coste
c1c17db5e9 Collapse jumps in man .kak 2016-03-21 13:44:31 +00:00
Maxime Coste
01742d8161 Merge remote-tracking branch 'lenormf/rc/man.kak' 2016-03-20 18:14:42 +00:00
Maxime Coste
3499d440de Collapse jumps in grep.kak and make.kak 2016-03-20 16:37:58 +00:00
Frank LENORMAND
4bb5658206 Replace non-POSIX here-strings and calls to echo 2016-03-17 15:32:32 +02:00
Frank LENORMAND
a340eaf0ab Fix the page detection pattern 2016-03-16 14:10:47 +02:00
Maxime Coste
09baf73152 Fix various posix shell compliance issues in the rc/ files 2016-03-14 20:59:23 +00:00
Frank LENORMAND
3079d2a7e3 Replace non-POSIX inline character replacement in shell scripts 2016-03-14 18:29:11 +02:00
Frank LENORMAND
98594cf6df Add static completion suggestions to several languages, set autopep8 as default python formatter 2016-03-14 14:10:49 +02:00
Maxime Coste
00673eba36 Handle more gracefully switches between different c-family filetypes 2016-03-03 19:28:58 +00:00
Maxime Coste
8e3f403e13 doc.kak should be in rc/core, not rc/base 2016-02-05 13:42:02 +00:00
Maxime Coste
14256e4979 Merge remote-tracking branch 'lenormf/rc/man.kak' 2016-02-02 23:38:49 +00:00
Maxime Coste
fef0277998 Reorganise rc/ into subdirectories
* core: set of tools to work on kakoune source code
 * base: very common languages and tools
 * extra: less common languages and tools
2016-01-29 09:03:23 +00:00