-[submodule "tpope/start/vim-vinegar"]\r
- path = pack/tpope/opt/vim-vinegar
- url = https://github.com/tpope/vim-vinegar.git\r
-[submodule "tpope/start/vim-commentary"]\r
- path = pack/tpope/start/vim-commentary\r
- url = https://github.com/tpope/vim-commentary.git\r
-[submodule "tpope/start/vim-repeat"]\r
- path = pack/tpope/start/vim-repeat\r
- url = https://github.com/tpope/vim-repeat.git\r
-[submodule "tpope/start/vim-surround"]\r
- path = pack/tpope/start/vim-surround\r
- url = https://github.com/tpope/vim-surround.git\r
-[submodule "tpope/start/vim-unimpaired"]\r
- path = pack/tpope/start/vim-unimpaired\r
- url = https://github.com/tpope/vim-unimpaired.git\r
-[submodule "tpope/start/vim-fugitive"]\r
- path = pack/tpope/start/vim-fugitive\r
- url = https://github.com/tpope/vim-fugitive.git\r
-[submodule "pack/snipmate/opt/vim-snipmate"]\r
- path = pack/snippets/opt/vim-snipmate\r
- url = https://github.com/garbas/vim-snipmate.git\r
-[submodule "pack/snipmate/opt/vim-addon-mw-utils"]\r
- path = pack/snippets/opt/vim-addon-mw-utils\r
- url = https://github.com/MarcWeber/vim-addon-mw-utils.git\r
-[submodule "pack/snipmate/opt/tlib_vim"]\r
- path = pack/snippets/opt/tlib_vim\r
- url = https://github.com/tomtom/tlib_vim.git\r
-[submodule "pack/snipmate/opt/vim-snippets"]\r
- path = pack/snippets/opt/vim-snippets\r
- url = https://github.com/honza/vim-snippets.git\r
-[submodule "pack/github/opt/vim-airline"]\r
- path = pack/github/opt/vim-airline\r
- url = https://github.com/vim-airline/vim-airline.git\r
-[submodule "pack/github/opt/tagbar"]\r
- path = pack/github/opt/tagbar\r
- url = https://github.com/majutsushi/tagbar.git\r
-[submodule "pack/github/opt/errormarker.vim"]\r
- path = pack/async/opt/errormarker.vim\r
- url = https://github.com/mh21/errormarker.vim.git\r
-[submodule "pack/github/opt/asyncrun.vim"]\r
- path = pack/async/opt/asyncrun.vim\r
- url = https://github.com/skywind3000/asyncrun.vim.git\r
-[submodule "pack/github/opt/incsearch.vim"]\r
- path = pack/github/opt/incsearch.vim\r
- url = https://github.com/haya14busa/incsearch.vim.git\r
-[submodule "pack/github/opt/ale"]\r
- path = pack/async/opt/ale\r
- url = https://github.com/w0rp/ale.git\r
-[submodule "pack/markdown/opt/vim-javascript"]\r
+[submodule "pack/tpope/start/vim-vinegar"]
+ path = pack/tpope/start/vim-vinegar
+ url = https://github.com/manasthakur/vim-vinegar.git
+[submodule "tpope/start/vim-commentary"]
+ path = pack/tpope/start/vim-commentary
+ url = https://github.com/tpope/vim-commentary.git
+[submodule "tpope/start/vim-repeat"]
+ path = pack/tpope/start/vim-repeat
+ url = https://github.com/tpope/vim-repeat.git
+[submodule "tpope/start/vim-surround"]
+ path = pack/tpope/start/vim-surround
+ url = https://github.com/tpope/vim-surround.git
+[submodule "tpope/start/vim-unimpaired"]
+ path = pack/tpope/start/vim-unimpaired
+ url = https://github.com/tpope/vim-unimpaired.git
+[submodule "tpope/start/vim-fugitive"]
+ path = pack/tpope/start/vim-fugitive
+ url = https://github.com/tpope/vim-fugitive.git
+[submodule "pack/snipmate/opt/vim-snipmate"]
+ path = pack/snippets/opt/vim-snipmate
+ url = https://github.com/garbas/vim-snipmate.git
+[submodule "pack/snipmate/opt/vim-addon-mw-utils"]
+ path = pack/snippets/opt/vim-addon-mw-utils
+ url = https://github.com/MarcWeber/vim-addon-mw-utils.git
+[submodule "pack/snipmate/opt/tlib_vim"]
+ path = pack/snippets/opt/tlib_vim
+ url = https://github.com/tomtom/tlib_vim.git
+[submodule "pack/snipmate/opt/vim-snippets"]
+ path = pack/snippets/opt/vim-snippets
+ url = https://github.com/honza/vim-snippets.git
+[submodule "pack/github/opt/vim-airline"]
+ path = pack/github/opt/vim-airline
+ url = https://github.com/vim-airline/vim-airline.git
+[submodule "pack/github/opt/tagbar"]
+ path = pack/github/opt/tagbar
+ url = https://github.com/majutsushi/tagbar.git
+[submodule "pack/github/opt/errormarker.vim"]
+ path = pack/async/opt/errormarker.vim
+ url = https://github.com/mh21/errormarker.vim.git
+[submodule "pack/github/opt/asyncrun.vim"]
+ path = pack/async/opt/asyncrun.vim
+ url = https://github.com/skywind3000/asyncrun.vim.git
+[submodule "pack/github/opt/incsearch.vim"]
+ path = pack/github/opt/incsearch.vim
+ url = https://github.com/haya14busa/incsearch.vim.git
+[submodule "pack/github/opt/ale"]
+ path = pack/async/opt/ale
+ url = https://github.com/w0rp/ale.git
+[submodule "pack/markdown/opt/vim-javascript"]
path = pack/markdown/opt/vim-javascript
- url = https://github.com/pangloss/vim-javascript\r
-[submodule "pack/markdown/opt/vim-pandoc"]\r
+ url = https://github.com/pangloss/vim-javascript
+[submodule "pack/markdown/opt/vim-pandoc"]
path = pack/markdown/opt/vim-pandoc
- url = https://github.com/vim-pandoc/vim-pandoc.git\r
-[submodule "pack/markdown/opt/vim-pandoc-syntax"]\r
+ url = https://github.com/vim-pandoc/vim-pandoc.git
+[submodule "pack/markdown/opt/vim-pandoc-syntax"]
path = pack/markdown/opt/vim-pandoc-syntax
- url = https://github.com/vim-pandoc/vim-pandoc-syntax.git\r
-[submodule "pack/async/opt/completor.vim"]\r
- path = pack/async/opt/completor.vim\r
- url = https://github.com/maralla/completor.vim.git\r
-[submodule "pack/async/opt/validator.vim"]\r
- path = pack/async/opt/validator.vim\r
- url = https://github.com/maralla/validator.vim.git\r
-[submodule "pack/syntax/opt/vim-syntax-extra"]\r
+ url = https://github.com/vim-pandoc/vim-pandoc-syntax.git
+[submodule "pack/async/opt/completor.vim"]
+ path = pack/async/opt/completor.vim
+ url = https://github.com/maralla/completor.vim.git
+[submodule "pack/async/opt/validator.vim"]
+ path = pack/async/opt/validator.vim
+ url = https://github.com/maralla/validator.vim.git
+[submodule "pack/syntax/opt/vim-syntax-extra"]
path = pack/markdown/opt/vim-syntax-extra
- url = https://github.com/justinmk/vim-syntax-extra.git\r
-[submodule "pack/github/opt/supertab"]\r
- path = pack/github/opt/supertab\r
- url = https://github.com/ervandew/supertab.git\r
-[submodule "pack/github/opt/pick.vim"]\r
- path = pack/github/opt/pick.vim\r
- url = https://github.com/calleerlandsson/pick.vim.git\r
-[submodule "pack/github/opt/Tortoise-Typing"]\r
- path = pack/github/opt/Tortoise-Typing\r
- url = https://github.com/thanthese/Tortoise-Typing.git\r
-[submodule "pack/async/opt/mesonic"]\r
- path = pack/async/opt/mesonic\r
- url = https://github.com/igankevich/mesonic.git\r
-[submodule "pack/shougo/nvim-yarp"]\r
+ url = https://github.com/justinmk/vim-syntax-extra.git
+[submodule "pack/github/opt/supertab"]
+ path = pack/github/opt/supertab
+ url = https://github.com/ervandew/supertab.git
+[submodule "pack/github/opt/pick.vim"]
+ path = pack/github/opt/pick.vim
+ url = https://github.com/calleerlandsson/pick.vim.git
+[submodule "pack/github/opt/Tortoise-Typing"]
+ path = pack/github/opt/Tortoise-Typing
+ url = https://github.com/thanthese/Tortoise-Typing.git
+[submodule "pack/async/opt/mesonic"]
+ path = pack/async/opt/mesonic
+ url = https://github.com/igankevich/mesonic.git
+[submodule "pack/shougo/nvim-yarp"]
path = pack/shougo/opt/nvim-yarp
- url = https://github.com/roxma/nvim-yarp.git\r
-[submodule "pack/shougo/start/deoplete.nvim"]\r
+ url = https://github.com/roxma/nvim-yarp.git
+[submodule "pack/shougo/start/deoplete.nvim"]
path = pack/shougo/opt/deoplete.nvim
- url = https://github.com/Shougo/deoplete.nvim.git\r
-[submodule "pack/shougo/start/vim-hug-neovim-rpc"]\r
+ url = https://github.com/Shougo/deoplete.nvim.git
+[submodule "pack/shougo/start/vim-hug-neovim-rpc"]
path = pack/shougo/opt/vim-hug-neovim-rpc
- url = https://github.com/roxma/vim-hug-neovim-rpc.git\r
+ url = https://github.com/roxma/vim-hug-neovim-rpc.git
[submodule "pack/async/start/gen_tags.vim"]
path = pack/async/opt/gen_tags.vim
url = https://github.com/jsfaint/gen_tags.vim.git
-[submodule "pack/tpope/start/vim-vinegar"]
- path = pack/tpope/start/vim-vinegar
- url = https://github.com/manasthakur/vim-vinegar.git
[submodule "pack/markdown/opt/previm"]
path = pack/markdown/start/previm
url = https://github.com/previm/previm.git
-" File: gtags-cscope.vim\r
-" Author: Tama Communications Corporation\r
-" Version: 0.4.1\r
-" Last Modified: September 10, 2014\r
-"\r
-" Copyright and license\r
-" ---------------------\r
-" Copyright (c) 2010, 2011 Tama Communications Corporation\r
-"\r
-" This file is part of GNU GLOBAL.\r
-"\r
-" This program is free software: you can redistribute it and/or modify\r
-" it under the terms of the GNU General Public License as published by\r
-" the Free Software Foundation, either version 3 of the License, or\r
-" (at your option) any later version.\r
-" \r
-" This program is distributed in the hope that it will be useful,\r
-" but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
-" GNU General Public License for more details.\r
-" \r
-" You should have received a copy of the GNU General Public License\r
-" along with this program. If not, see <http://www.gnu.org/licenses/>.\r
-"\r
-" Overview\r
-" --------\r
-" The gtags-cscope.vim plugin script integrates the GNU GLOBAL source code tagging system\r
-" with Vim using cscope interface.\r
-"\r
-" Installation\r
-" ------------\r
-" Drop the file in your plugin directory or source it from your vimrc.\r
-" To use this script, you need the GNU GLOBAL-5.8 or later installed\r
-" in your machine.\r
-"\r
-" Usage\r
-" -----\r
-" First of all, you must execute gtags(1) at the root of source directory\r
-" to make tag files. Assuming that your source directory is '/var/src',\r
-" it is neccessary to execute the following commands.\r
-"\r
-" [Load vim]\r
-" $ cd /var/src\r
-" $ gtags\r
-" $ vim\r
-" [Load gtags-cscope]\r
-" :GtagsCscope <ENTER> (in vim command line)\r
-"\r
-" Basic command\r
-" -------------\r
-" Then you can use cs commands except for the 'd'(2) command.\r
-" Profitable commands are assigned to keys like follows:\r
-"\r
-" explanation command \r
-" ----------------------------------------------------------\r
-" Find symbol :cs find 0 or s\r
-" Find definition :cs find 1 or g\r
-" Find functions called by this function (not implemented)\r
-" Find reference :cs find 3 or c\r
-" Find text string :cs find 4 or t\r
-" Find egrep pattern :cs find 6 or e\r
-" Find path :cs find 7 or f\r
-" Find include file :cs find 8 or i\r
-"\r
-" You can move tag list using:\r
-" Go to the next tag :tn\r
-" Go to the previous tag :tp\r
-" Pop tag stack :pop\r
-"\r
-" About the other tag command, you can see the help like this:\r
-"\r
-" :h tagsrch\r
-"\r
-" Enhancing command\r
-" -----------------\r
-" You can use the context jump function. To use this function, put the cursor\r
-" on a word and type <C-\><C-\><C-]>.\r
-" If you can use mouse then please double click on the left button.\r
-" To pop tag, please type 'g' and click on the right button.\r
-"\r
-" Configure\r
-" ---------\r
-" You can use the following variables in $HOME/.vimrc.\r
-"\r
-" To use the default key/mouse mapping:\r
-" let GtagsCscope_Auto_Map = 1\r
-" To ignore letter case when searching:\r
-" let GtagsCscope_Ignore_Case = 1\r
-" To use absolute path name:\r
-" let GtagsCscope_Absolute_Path = 1\r
-" To deterring interruption:\r
-" let GtagsCscope_Keep_Alive = 1\r
-" If you hope auto loading:\r
-" let GtagsCscope_Auto_Load = 1\r
-" To use 'vim -t ', ':tag' and '<C-]>'\r
-" set cscopetag\r
-"\r
-if exists("loaded_gtags_cscope")\r
- finish\r
-endif\r
-if !has("cscope")\r
- echohl WarningMsg |\r
- \ echomsg 'Gtags-cscope: ' . 'This vim does not include cscope support.' |\r
- \ echohl None\r
- finish\r
-endif\r
-"\r
-" global command name\r
-"\r
-let s:global_command = $GTAGSGLOBAL\r
-if s:global_command == ''\r
- let s:global_command = "global"\r
-endif\r
-if !exists("GtagsCscope_Auto_Load")\r
- let GtagsCscope_Auto_Load = 0\r
-endif\r
-if !exists("GtagsCscope_Auto_Map")\r
- let GtagsCscope_Auto_Map = 0\r
-endif\r
-if !exists("GtagsCscope_Use_Old_Key_Map")\r
- let GtagsCscope_Use_Old_Key_Map = 0\r
-endif\r
-if !exists("GtagsCscope_Quiet")\r
- let GtagsCscope_Quiet = 0\r
-endif\r
-if !exists("GtagsCscope_Ignore_Case")\r
- let GtagsCscope_Ignore_Case = 0\r
-endif\r
-if !exists("GtagsCscope_Absolute_Path")\r
- let GtagsCscope_Absolute_Path = 0\r
-endif\r
-if !exists("GtagsCscope_Keep_Alive")\r
- let GtagsCscope_Keep_Alive = 0\r
-endif\r
-\r
-"\r
-" Display error message.\r
-"\r
-function! s:Error(msg)\r
- if (g:GtagsCscope_Quiet == 0)\r
- echohl WarningMsg |\r
- \ echomsg 'Gtags-cscope: ' . a:msg |\r
- \ echohl None\r
- endif\r
-endfunction\r
-\r
-function! s:GtagsCscope_GtagsRoot()\r
- let cmd = s:global_command . " -pq"\r
- let cmd_output = system(cmd)\r
- if v:shell_error != 0\r
- if v:shell_error == 3\r
- call s:Error('GTAGS not found.')\r
- else\r
- call s:Error('global command failed. command line: ' . cmd)\r
- endif\r
- return ''\r
- endif\r
- return strpart(cmd_output, 0, strlen(cmd_output) - 1)\r
-endfunction\r
-\r
-function! s:GtagsCscope()\r
- "\r
- " Get gtagsroot directory.\r
- "\r
- let gtagsroot = s:GtagsCscope_GtagsRoot()\r
- if gtagsroot == ''\r
- return\r
- endif\r
- "\r
- " Load gtags-cscope.\r
- "\r
- set csprg=gtags-cscope\r
- let s:command = "cs add " . gtagsroot . "/GTAGS"\r
- let s:option = ''\r
- if g:GtagsCscope_Ignore_Case == 1\r
- let s:option = s:option . 'C'\r
- endif\r
- if g:GtagsCscope_Absolute_Path == 1\r
- let s:option = s:option . 'a'\r
- endif\r
- if g:GtagsCscope_Keep_Alive == 1\r
- let s:option = s:option . 'i'\r
- endif\r
- if s:option != ''\r
- let s:command = s:command . ' . -' . s:option\r
- endif\r
- set nocscopeverbose\r
- exe s:command\r
- set cscopeverbose\r
- "\r
- " Key mapping\r
- "\r
- if g:GtagsCscope_Auto_Map == 1\r
- if g:GtagsCscope_Use_Old_Key_Map == 1\r
- " normal command\r
- :nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR>\r
- :nmap <C-\>t :cs find g <C-R>=expand("<cword>")<CR>\r
- :nmap <C-\>r :cs find c <C-R>=expand("<cword>")<CR>\r
- :nmap <C-\>g :cs find e <C-R>=expand("<cword>")<CR>\r
- :nmap <C-\>P :cs find f \r
- " Using 'CTRL-spacebar', the result is displayed in new horizontal window.\r
- :nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@>t :scs find g <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@>r :scs find c <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@>g :scs find e <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@>P :scs find f \r
- " Hitting CTRL-space *twice*, the result is displayed in new vertical window.\r
- :nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@><C-@>t :vert scs find g <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@><C-@>r :vert scs find c <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@><C-@>g :vert scs find e <C-R>=expand("<cword>")<CR>\r
- :nmap <C-@><C-@>P :vert scs find f \r
- else\r
- "\r
- " The following key mappings are derived from 'cscope_maps.vim'.\r
- " (The 'd' command is not implemented in gtags-cscope.)\r
- "\r
- " normal command\r
- :nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>\r
- :nmap <C-\>i :cs find i <C-R>=expand("<cfile>")<CR><CR>\r
- ":nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>\r
- " Using 'CTRL-spacebar', the result is displayed in new horizontal window.\r
- :nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>\r
- :nmap <C-@>i :scs find i <C-R>=expand("<cfile>")<CR><CR>\r
- ":nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>\r
- " Hitting CTRL-space *twice*, the result is displayed in new vertical window.\r
- :nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>\r
- :nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>\r
- :nmap <C-@><C-@>i :vert scs find i <C-R>=expand("<cfile>")<CR><CR>\r
- ":nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>\r
- endif\r
- " tag command\r
- :nmap <C-\><C-n> :tn<CR>\r
- :nmap <C-\><C-p> :tp<CR>\r
- :nmap <C-n> :cn<CR>\r
- :nmap <C-p> :cp<CR>\r
- " Context search. See the --from-here option of global(1).\r
- :nmap <C-\><C-\><C-]> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>\r
- :nmap <2-LeftMouse> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>\r
- :nmap g<LeftMouse> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>\r
- :nmap <C-LeftMouse> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>\r
- " The following mappings are unnecessary, because you can use the default mapping.\r
- ":nmap g<RightMouse> <C-t>\r
- ":nmap <C-RightMouse> <C-t>\r
- " Short cut key\r
- :nmap <C-\><SPACE> :cs find<SPACE>\r
- :nmap <C-@><SPACE> :scs find<SPACE>\r
- :nmap <C-@><C-@><SPACE> :vert scs find<SPACE>\r
- :nmap <F2> :copen<CR>\r
- :nmap <F3> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>\r
- :nmap <F4> :cclose<CR>\r
- endif\r
-endfunction\r
-\r
-if g:GtagsCscope_Auto_Load == 1\r
- call s:GtagsCscope()\r
-endif\r
-command! -nargs=0 GtagsCscope call s:GtagsCscope()\r
-let loaded_gtags_cscope = 1\r
+" File: gtags-cscope.vim
+" Author: Tama Communications Corporation
+" Version: 0.4.1
+" Last Modified: September 10, 2014
+"
+" Copyright and license
+" ---------------------
+" Copyright (c) 2010, 2011 Tama Communications Corporation
+"
+" This file is part of GNU GLOBAL.
+"
+" This program is free software: you can redistribute it and/or modify
+" it under the terms of the GNU General Public License as published by
+" the Free Software Foundation, either version 3 of the License, or
+" (at your option) any later version.
+"
+" This program is distributed in the hope that it will be useful,
+" but WITHOUT ANY WARRANTY; without even the implied warranty of
+" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+" GNU General Public License for more details.
+"
+" You should have received a copy of the GNU General Public License
+" along with this program. If not, see <http://www.gnu.org/licenses/>.
+"
+" Overview
+" --------
+" The gtags-cscope.vim plugin script integrates the GNU GLOBAL source code tagging system
+" with Vim using cscope interface.
+"
+" Installation
+" ------------
+" Drop the file in your plugin directory or source it from your vimrc.
+" To use this script, you need the GNU GLOBAL-5.8 or later installed
+" in your machine.
+"
+" Usage
+" -----
+" First of all, you must execute gtags(1) at the root of source directory
+" to make tag files. Assuming that your source directory is '/var/src',
+" it is neccessary to execute the following commands.
+"
+" [Load vim]
+" $ cd /var/src
+" $ gtags
+" $ vim
+" [Load gtags-cscope]
+" :GtagsCscope <ENTER> (in vim command line)
+"
+" Basic command
+" -------------
+" Then you can use cs commands except for the 'd'(2) command.
+" Profitable commands are assigned to keys like follows:
+"
+" explanation command
+" ----------------------------------------------------------
+" Find symbol :cs find 0 or s
+" Find definition :cs find 1 or g
+" Find functions called by this function (not implemented)
+" Find reference :cs find 3 or c
+" Find text string :cs find 4 or t
+" Find egrep pattern :cs find 6 or e
+" Find path :cs find 7 or f
+" Find include file :cs find 8 or i
+"
+" You can move tag list using:
+" Go to the next tag :tn
+" Go to the previous tag :tp
+" Pop tag stack :pop
+"
+" About the other tag command, you can see the help like this:
+"
+" :h tagsrch
+"
+" Enhancing command
+" -----------------
+" You can use the context jump function. To use this function, put the cursor
+" on a word and type <C-\><C-\><C-]>.
+" If you can use mouse then please double click on the left button.
+" To pop tag, please type 'g' and click on the right button.
+"
+" Configure
+" ---------
+" You can use the following variables in $HOME/.vimrc.
+"
+" To use the default key/mouse mapping:
+" let GtagsCscope_Auto_Map = 1
+" To ignore letter case when searching:
+" let GtagsCscope_Ignore_Case = 1
+" To use absolute path name:
+" let GtagsCscope_Absolute_Path = 1
+" To deterring interruption:
+" let GtagsCscope_Keep_Alive = 1
+" If you hope auto loading:
+" let GtagsCscope_Auto_Load = 1
+" To use 'vim -t ', ':tag' and '<C-]>'
+" set cscopetag
+"
+if exists("loaded_gtags_cscope")
+ finish
+endif
+if !has("cscope")
+ echohl WarningMsg |
+ \ echomsg 'Gtags-cscope: ' . 'This vim does not include cscope support.' |
+ \ echohl None
+ finish
+endif
+"
+" global command name
+"
+let s:global_command = $GTAGSGLOBAL
+if s:global_command == ''
+ let s:global_command = "global"
+endif
+if !exists("GtagsCscope_Auto_Load")
+ let GtagsCscope_Auto_Load = 0
+endif
+if !exists("GtagsCscope_Auto_Map")
+ let GtagsCscope_Auto_Map = 0
+endif
+if !exists("GtagsCscope_Use_Old_Key_Map")
+ let GtagsCscope_Use_Old_Key_Map = 0
+endif
+if !exists("GtagsCscope_Quiet")
+ let GtagsCscope_Quiet = 0
+endif
+if !exists("GtagsCscope_Ignore_Case")
+ let GtagsCscope_Ignore_Case = 0
+endif
+if !exists("GtagsCscope_Absolute_Path")
+ let GtagsCscope_Absolute_Path = 0
+endif
+if !exists("GtagsCscope_Keep_Alive")
+ let GtagsCscope_Keep_Alive = 0
+endif
+
+"
+" Display error message.
+"
+function! s:Error(msg)
+ if (g:GtagsCscope_Quiet == 0)
+ echohl WarningMsg |
+ \ echomsg 'Gtags-cscope: ' . a:msg |
+ \ echohl None
+ endif
+endfunction
+
+function! s:GtagsCscope_GtagsRoot()
+ let cmd = s:global_command . " -pq"
+ let cmd_output = system(cmd)
+ if v:shell_error != 0
+ if v:shell_error == 3
+ call s:Error('GTAGS not found.')
+ else
+ call s:Error('global command failed. command line: ' . cmd)
+ endif
+ return ''
+ endif
+ return strpart(cmd_output, 0, strlen(cmd_output) - 1)
+endfunction
+
+function! s:GtagsCscope()
+ "
+ " Get gtagsroot directory.
+ "
+ let gtagsroot = s:GtagsCscope_GtagsRoot()
+ if gtagsroot == ''
+ return
+ endif
+ "
+ " Load gtags-cscope.
+ "
+ set csprg=gtags-cscope
+ let s:command = "cs add " . gtagsroot . "/GTAGS"
+ let s:option = ''
+ if g:GtagsCscope_Ignore_Case == 1
+ let s:option = s:option . 'C'
+ endif
+ if g:GtagsCscope_Absolute_Path == 1
+ let s:option = s:option . 'a'
+ endif
+ if g:GtagsCscope_Keep_Alive == 1
+ let s:option = s:option . 'i'
+ endif
+ if s:option != ''
+ let s:command = s:command . ' . -' . s:option
+ endif
+ set nocscopeverbose
+ exe s:command
+ set cscopeverbose
+ "
+ " Key mapping
+ "
+ if g:GtagsCscope_Auto_Map == 1
+ if g:GtagsCscope_Use_Old_Key_Map == 1
+ " normal command
+ :nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR>
+ :nmap <C-\>t :cs find g <C-R>=expand("<cword>")<CR>
+ :nmap <C-\>r :cs find c <C-R>=expand("<cword>")<CR>
+ :nmap <C-\>g :cs find e <C-R>=expand("<cword>")<CR>
+ :nmap <C-\>P :cs find f
+ " Using 'CTRL-spacebar', the result is displayed in new horizontal window.
+ :nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR>
+ :nmap <C-@>t :scs find g <C-R>=expand("<cword>")<CR>
+ :nmap <C-@>r :scs find c <C-R>=expand("<cword>")<CR>
+ :nmap <C-@>g :scs find e <C-R>=expand("<cword>")<CR>
+ :nmap <C-@>P :scs find f
+ " Hitting CTRL-space *twice*, the result is displayed in new vertical window.
+ :nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR>
+ :nmap <C-@><C-@>t :vert scs find g <C-R>=expand("<cword>")<CR>
+ :nmap <C-@><C-@>r :vert scs find c <C-R>=expand("<cword>")<CR>
+ :nmap <C-@><C-@>g :vert scs find e <C-R>=expand("<cword>")<CR>
+ :nmap <C-@><C-@>P :vert scs find f
+ else
+ "
+ " The following key mappings are derived from 'cscope_maps.vim'.
+ " (The 'd' command is not implemented in gtags-cscope.)
+ "
+ " normal command
+ :nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
+ :nmap <C-\>i :cs find i <C-R>=expand("<cfile>")<CR><CR>
+ ":nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
+ " Using 'CTRL-spacebar', the result is displayed in new horizontal window.
+ :nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
+ :nmap <C-@>i :scs find i <C-R>=expand("<cfile>")<CR><CR>
+ ":nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>
+ " Hitting CTRL-space *twice*, the result is displayed in new vertical window.
+ :nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
+ :nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
+ :nmap <C-@><C-@>i :vert scs find i <C-R>=expand("<cfile>")<CR><CR>
+ ":nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
+ endif
+ " tag command
+ :nmap <C-\><C-n> :tn<CR>
+ :nmap <C-\><C-p> :tp<CR>
+ :nmap <C-n> :cn<CR>
+ :nmap <C-p> :cp<CR>
+ " Context search. See the --from-here option of global(1).
+ :nmap <C-\><C-\><C-]> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>
+ :nmap <2-LeftMouse> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>
+ :nmap g<LeftMouse> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>
+ :nmap <C-LeftMouse> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>
+ " The following mappings are unnecessary, because you can use the default mapping.
+ ":nmap g<RightMouse> <C-t>
+ ":nmap <C-RightMouse> <C-t>
+ " Short cut key
+ :nmap <C-\><SPACE> :cs find<SPACE>
+ :nmap <C-@><SPACE> :scs find<SPACE>
+ :nmap <C-@><C-@><SPACE> :vert scs find<SPACE>
+ :nmap <F2> :copen<CR>
+ :nmap <F3> :cs find d <C-R>=expand("<cword>")<CR>:<C-R>=line('.')<CR>:%<CR>
+ :nmap <F4> :cclose<CR>
+ endif
+endfunction
+
+if g:GtagsCscope_Auto_Load == 1
+ call s:GtagsCscope()
+endif
+command! -nargs=0 GtagsCscope call s:GtagsCscope()
+let loaded_gtags_cscope = 1