sponsor Vim development Vim logo Vim Book Ad

caw.vim : Comment plugin: Operator mappings/Dot-repeatable/300+ filetypes

 script karma  Rating 0/0, Downloaded by 806  Comments, bugs, improvements  Vim wiki

created by
script type
Latest version: https://github.com/tyru/caw.vim


The below are the examples in "filetype=c".
caw.vim supports 300+ filetypes (see |caw-supported-filetypes|).

Type "gci" (toggle: "gcc", uncomment: "gcui")
    "   <- inserted here"
    "   # <- inserted here"

Type "gcI" (uncomment: "gcuI")
    "   inserted the first column"
    "#    inserted the first column"

Type "gca" (uncomment: "gcua")
    "inserted after this"
    "inserted after this    # "

Type "gcw" (uncomment: "gcuw")
    "  wrap!"
    "  /* wrap! */"

Type "gcb"
    "  box!"
    "  /********/"
    "  /* box! */"
    "  /********/"

Type "gco"
    "   func1();"
    "   func1()"
    "   // "  (now cursor is at the end and entered insert-mode)

Type "gcO"
    "   func1();"
    "   // "  (now cursor is at the end and entered insert-mode)
    "   func1();"


* Supports 300+ filetypes (see |caw-supported-filetypes|).
  * But caw.vim does not slow down your Vim startup because each comment
    string are defined at ftplugin files (after/ftplugin/<filetype>/caw.vim).
* Supports operator keymappings (|caw-keymappings-operator|).
  * If |g:caw_operator_keymappings| is non-zero, all default keymappings map
    to operator keymappings.
  * If you need operator-user.vim to use operator keymappings.
* Supports also non-operator keymappings (|caw-keymappings-non-operator|).
* Dot-repeatable if you installed repeat.vim
* The comment behavior only depends on 'filetype' by default.
  But if you have installed context_filetype.vim, caw.vim also depends on the
  filetype of the context of the current cursor location.
  So you can comment/uncomment JavaScript in HTML correctly.
* Well-tested powered by https://github.com/thinca/vim-themis
install details

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
caw-v1.0.zip 1.0 2016-05-03 7.3 tyru Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.