HEX
Server: Apache/2.4.46 (Win64) OpenSSL/1.1.1j PHP/8.4.25
System: Windows NT DESKTOP-4TAV2RJ 10.0 build 19045 (Windows 10) AMD64
User: fred (0)
PHP: 8.4.25
Disabled: NONE
Upload Files
File: C:/Program Files/Git/usr/share/vim/vim91/pack/dist/opt/comment/plugin/comment.vim
vim9script

# Maintainer: Maxim Kim <[email protected]>
# Last Update: 2025 Mar 21
# 2025 Jun 22 by Vim Project: add <Plug> mappings #17563

import autoload 'comment.vim'

nnoremap <silent> <expr> <Plug>(comment-toggle) comment.Toggle()
xnoremap <silent> <expr> <Plug>(comment-toggle) comment.Toggle()
nnoremap <silent> <expr> <Plug>(comment-toggle-line) comment.Toggle() .. '_'
nnoremap <silent> <expr> <Plug>(comment-toggle-end) comment.Toggle() .. '$'

onoremap <silent> <Plug>(comment-text-object-inner) <scriptcmd>comment.ObjComment(v:true)<CR>
onoremap <silent> <Plug>(comment-text-object-outer) <scriptcmd>comment.ObjComment(v:false)<CR>
xnoremap <silent> <Plug>(comment-text-object-inner) <esc><scriptcmd>comment.ObjComment(v:true)<CR>
xnoremap <silent> <Plug>(comment-text-object-outer) <esc><scriptcmd>comment.ObjComment(v:false)<CR>

if get(g:, 'comment_mappings', true)
  nmap gc <Plug>(comment-toggle)
  xmap gc <Plug>(comment-toggle)
  nmap gcc <Plug>(comment-toggle-line)
  nmap gC <Plug>(comment-toggle-end)

  omap ic <Plug>(comment-text-object-inner)
  omap ac <Plug>(comment-text-object-outer)
  xmap ic <Plug>(comment-text-object-inner)
  xmap ac <Plug>(comment-text-object-outer)
endif