From 999141f35af777591877890534be4fb9415a013f Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 22 Apr 2015 10:19:35 -0700 Subject: 1123 --- cpp/vimrc.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cpp/vimrc.vim b/cpp/vimrc.vim index c666d258..2b79fbec 100644 --- a/cpp/vimrc.vim +++ b/cpp/vimrc.vim @@ -1,6 +1,6 @@ " Highlighting literate directives in C++ sources. function! HighlightTangledFile() - if &ft == "" + if &ft == "" || &ft == "cpp" set ft=cpp endif set comments-=:// @@ -28,3 +28,10 @@ endfunction call HighlightTangledFile() autocmd BufRead,BufNewFile *.mu set ft=mu autocmd BufRead,BufNewFile 0* call HighlightTangledFile() + +" Scenarios considered: +" opening or starting vim with a new or existing file without an extension (should interpret as C++) +" opening or starting vim with a new or existing file with a .mu extension +" starting vim or opening a buffer without a file name (ok to do nothing) +" opening a second file in a new or existing window (shouldn't mess up existing highlighting) +" reloading an existing file (shouldn't mess up existing highlighting) -- cgit 1.4.1-2-gfad0