aboutsummaryrefslogtreecommitdiffstats
path: root/autoload
diff options
context:
space:
mode:
authorPeter Odding <peter@peterodding.com>2014-10-20 21:48:14 +0200
committerPeter Odding <peter@peterodding.com>2014-10-20 21:48:14 +0200
commit9b6e7d125c660f31091f59b52de9b1e425cbcb64 (patch)
tree2a6fe4b70c451ee7a15420890dc7df7074824e3a /autoload
parentd251fdb37c9cf71d569073621e277ddf6c392f02 (diff)
downloadvim-easytags-9b6e7d125c660f31091f59b52de9b1e425cbcb64.tar.gz
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.
Diffstat (limited to 'autoload')
-rw-r--r--autoload/xolox/easytags.vim4
-rw-r--r--autoload/xolox/easytags/filetypes.vim20
2 files changed, 19 insertions, 5 deletions
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 <peter@peterodding.com>
-" 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 <peter@peterodding.com>
-" 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.