In my .vimrc file, I have a key binding for commenting out that inserts double slashes (//) at the start of a line:
" the mappi
The ftdetect folder is for scripts of filetype detection. Filetype plugins must be inside the ftplugin folder. The filetype must be included in the file name in one of the following three forms:
.../ftplugin/.vim .../ftplugin/_foo.vim .../ftplugin//foo.vim For instance, you can map comments for the cpp filetype putting the following inside the .../ftplugin/cpp_mine.vim:
:map :s/^/\/\//
:map :s/\/\///