From 9b6e7d125c660f31091f59b52de9b1e425cbcb64 Mon Sep 17 00:00:00 2001 From: Peter Odding Date: Mon, 20 Oct 2014 21:48:14 +0200 Subject: Change file type canonicalization to treat C as C++ Please refer to the inline comments for more details. This will hopefully fix issue #91 on GitHub: https://github.com/xolox/vim-easytags/issues/91 PS. I've completely removed the objc/objcpp grouping because I don't know these languages so I don't know what grouping would be correct anyway. Until a user with an informed opinion chimes in it's better to just remove this grouping. --- autoload/xolox/easytags.vim | 4 ++-- autoload/xolox/easytags/filetypes.vim | 20 +++++++++++++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'autoload/xolox') diff --git a/autoload/xolox/easytags.vim b/autoload/xolox/easytags.vim index 7a40980..9441671 100644 --- a/autoload/xolox/easytags.vim +++ b/autoload/xolox/easytags.vim @@ -1,9 +1,9 @@ " Vim script " Author: Peter Odding -" Last Change: September 17, 2014 +" Last Change: October 20, 2014 " URL: http://peterodding.com/code/vim/easytags/ -let g:xolox#easytags#version = '3.7' +let g:xolox#easytags#version = '3.8' let g:xolox#easytags#default_pattern_prefix = '\C\<' let g:xolox#easytags#default_pattern_suffix = '\>' diff --git a/autoload/xolox/easytags/filetypes.vim b/autoload/xolox/easytags/filetypes.vim index d655ef7..24652ab 100644 --- a/autoload/xolox/easytags/filetypes.vim +++ b/autoload/xolox/easytags/filetypes.vim @@ -1,6 +1,6 @@ " Vim script " Author: Peter Odding -" Last Change: June 20, 2014 +" Last Change: October 20, 2014 " URL: http://peterodding.com/code/vim/easytags/ " This submodule of the vim-easytags plug-in translates between back and forth @@ -110,8 +110,22 @@ endfunction " }}}1 -" Define the default file type groups. -call xolox#easytags#filetypes#add_group('c', 'cpp', 'objc', 'objcpp') +" Define the default file type groups. It's important that C normalizes to C++ +" because of the following points: +" +" - Vim and Exuberant Ctags consistently treat *.h files as C++. I guess this +" is because A) the filename extension is ambiguous and B) C++ is a +" superset of C so the mapping makes sense. +" +" - Because of the above point, when you use file type specific tags files +" and you're editing C source code you'll be missing everything defined in +" your *.h files. Depending on your programming style those tags might be +" redundant or they might not be. +" +" To solve this dilemma the vim-easytags plug-in groups the C and C++ file +" types together and tells Exuberant Ctags to treat it all as C++ because C++ +" is a superset of C. +call xolox#easytags#filetypes#add_group('cpp', 'c') call xolox#easytags#filetypes#add_group('html', 'htmldjango') " Define the default file type mappings. -- cgit v1.2.3