diff options
-rw-r--r-- | cpp/vimrc.vim | 9 |
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) |