about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-22 10:19:35 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-22 10:19:35 -0700
commit999141f35af777591877890534be4fb9415a013f (patch)
treec2207478d7096333234e358e24e8228c6c0b9c86
parent7d13531e531541fd1593b1bf6e410a5589afb46d (diff)
downloadmu-999141f35af777591877890534be4fb9415a013f.tar.gz
1123
-rw-r--r--cpp/vimrc.vim9
1 files changed, 8 insertions, 1 deletions
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)