Files
neovim/runtime/doc
Evgeni Chasnovski 73de98256c feat(comment): add built-in commenting
Design

- Enable commenting support only through `gc` mappings for simplicity.
  No ability to configure, no Lua module, no user commands. Yet.

- Overall implementation is a simplified version of 'mini.comment'
  module of 'echasnovski/mini.nvim' adapted to be a better suit for
  core. It basically means reducing code paths which use only specific
  fixed set of plugin config.

  All used options are default except `pad_comment_parts = false`. This
  means that 'commentstring' option is used as is without forcing single
  space inner padding.

As 'tpope/vim-commentary' was considered for inclusion earlier, here is
a quick summary of how this commit differs from it:

- **User-facing features**. Both implement similar user-facing mappings.
  This commit does not include `gcu` which is essentially a `gcgc`.
  There are no commands, events, or configuration in this commit.

- **Size**. Both have reasonably comparable number of lines of code,
  while this commit has more comments in tricky areas.

- **Maintainability**. This commit has (purely subjectively) better
  readability, tests, and Lua types.

- **Configurability**. This commit has no user configuration, while
  'vim-commentary' has some (partially as a counter-measure to possibly
  modifying 'commentstring' option).

- **Extra features**:
    - This commit supports tree-sitter by computing `'commentstring'`
      option under cursor, which can matter in presence of tree-sitter
      injected languages.

    - This commit comments blank lines while 'tpope/vim-commentary' does
      not. At the same time, blank lines are not taken into account when
      deciding the toggle action.

    - This commit has much better speed on larger chunks of lines (like
      above 1000). This is thanks to using `nvim_buf_set_lines()` to set
      all new lines at once, and not with `vim.fn.setline()`.
2024-04-05 18:07:43 +02:00
..
2024-03-28 09:32:32 +08:00
2023-07-25 05:07:13 -07:00
2023-12-20 07:02:48 +08:00
2023-10-29 16:02:32 +08:00
2024-01-17 14:01:39 +08:00
2023-12-13 20:31:16 +01:00
2024-03-09 11:21:55 +00:00
2023-04-17 15:46:24 +08:00
2024-01-15 11:40:44 +01:00
2024-02-08 19:07:31 +08:00
2023-12-13 20:31:16 +01:00
2024-04-04 06:19:13 +08:00
2021-09-10 08:48:27 +02:00
2023-06-25 17:14:28 +02:00
2023-10-29 16:02:32 +08:00
2024-02-29 22:54:57 +01:00
2023-05-13 21:33:22 +02:00
2023-12-06 08:04:21 +08:00
2024-03-12 13:51:53 +08:00
2024-02-22 10:07:04 +01:00
2024-03-12 13:51:53 +08:00
2022-10-14 08:01:13 -07:00
2024-01-18 00:14:48 -08:00
2022-12-11 18:41:26 -08:00
2023-10-21 18:04:08 +08:00
2023-11-14 23:29:09 +01:00
2018-10-29 09:55:07 +01:00
2023-06-25 17:14:28 +02:00
2015-08-15 15:25:30 -03:00
2023-11-06 19:03:08 +08:00
2024-01-18 00:14:48 -08:00
2023-10-10 19:20:32 +02:00
2023-01-01 15:05:13 +01:00
2023-06-19 08:40:33 -07:00
2023-09-28 05:22:09 +08:00
2023-11-27 17:43:13 +08:00
2023-06-11 12:40:22 +01:00
2023-04-04 19:07:33 +02:00
2024-03-16 16:38:40 +08:00
2023-08-10 17:28:02 +08:00
2023-08-13 13:25:10 +01:00
2023-05-15 09:38:32 +02:00
2023-04-23 15:22:55 +02:00
2023-08-10 17:28:04 +08:00
2023-01-03 10:07:43 +00:00
2023-06-25 17:14:28 +02:00
2023-06-19 08:40:33 -07:00
2023-06-25 17:14:28 +02:00
2023-07-25 05:07:13 -07:00
2023-06-25 17:14:28 +02:00
2021-05-01 22:29:03 -04:00
2023-06-25 17:14:28 +02:00
2018-10-29 10:01:44 +01:00
2021-04-29 09:27:19 -04:00
2023-06-25 17:14:28 +02:00
2023-06-26 11:29:12 +02:00
2023-06-25 17:14:28 +02:00
2021-04-29 20:42:16 -04:00
2023-06-26 11:29:12 +02:00
2024-04-05 15:45:13 +02:00
2023-07-25 05:07:13 -07:00
2021-04-27 09:21:34 -04:00
2023-06-19 08:40:33 -07:00
2023-01-03 10:07:43 +00:00
2023-06-25 17:14:28 +02:00