I map <S-CR> to this little script in my various ftplugin files to
make adding line endings easier. ":" for Python, ";" for C-style
languages, etc. Now I want to use it for Erlang, for which "." seems
reasonable.

" Insert a line ending if necessary
fun! AddLineEnder(char)
    let line = getline(".")
    if match(line, a:char . "\s*$") == -1
        exec "normal A" . a:char
    endif
endfunction


Why does this work for all characters except the following?

:call AddLineEnder(".")

I've also tried

:call AddLineEnder("\.") but no luck.

Thomas
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to