" Vim Setting 2019/09/03
"
" 半角文字の設定 Windows オンリー
set guifont=MS_Gothic:h14
"全角文字の設定
set guifontwide=MS_Gothic:h14
" クリップボートとvimレジスタを同期する
" http://cohama.hateblo.jp/entry/20130108/1357664352
set clipboard=unnamed
" netrw 環境のプロトコルの設定 Windows オンリー
if (has('win32') || has('win64'))
"use scp
let g:netrw_scp_cmd = "D:\\windows_openssh\\OpenSSH-Win64\\ssh.exe "
let g:netrw_sftp_cmd = "D:\\windows_openssh\\OpenSSH-Win64\\sftp.exe"
let g:netrw_ssh_cmd = "D:\\windows_openssh\\OpenSSH-Win64\\ssh.exe"
hi String ctermfg=brown guifg=Orange cterm=none gui=none
hi MatchParen guifg=Yellow guibg=DarkCyan
hi SignColumn guibg=#101020
hi CursorIM guifg=NONE guibg=Red
hi CursorLine guifg=NONE guibg=#505050
"colorscheme midnight
"set background=dark
" Error Strange Charactor set termencoding=ja_JP.UTF-8
" Error Strange Charactor set fileencodings=guess,ja_JP.UTF-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom
" vi 起動時の上部にメニューやオプションを表示する設定 okosi
set completeopt=menuone,preview
set showmode
set number
"set list
set title
set ambiwidth=double
set tabstop=2
"set expandtab
set shiftwidth=2
set smartindent
"set listchars=tab:損-,trail:-,eol:??extends:損,precedes:束,nbsp:%
set nrformats-=octal
set hidden
set history=50
set virtualedit=block
set whichwrap=b,s,,,<,>
"set backspace=indent,eol,start
" 端末の表示文字コードを指定する
"set termencoding=ja_JP.UTF-8
"set termencoding=utf-8
set fileencodings=guess,ja_JP.UTF-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom
" 以下ファイルセーブ時にエンコードすろ文字コードを指定している okosi
"wrong set fileencodings=guess,ja_JP.UTF-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom
set fileencodings=guess,utf-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom,euc-jp,utf-8
set fileencoding=utf-8
set fileformats=unix,dos,mac
"set fileencodings=ja_JP.UTF-8
set encoding=utf-8
set ruler
set showmatch
set statusline=%F%m%r%h%w\ FMT=%{&ff}\ TP=%Y\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ POS=%04l,%04v%p%%\ LEN=%L
"カーソル位置(水平・垂直)を特定するのに有効
"set cursorline " カーソルラインの強調表示を有効化
set cursorline
set cursorcolumn
" File: gtags.vim
" Author: Tama Communications Corporation
" Version: 0.6.8
" Last Modified: Nov 9, 2015
"
" Copyright and license
" ---------------------
" Copyright (c) 2004, 2008, 2010, 2011, 2012, 2014, 2015
" 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.vim plug-in script integrates the GNU GLOBAL source code tag system
" with Vim. About the details, see http://www.gnu.org/software/global/.
"
" Installation
" ------------
" Drop the file in your plug-in directory or source it from your vimrc.
" To use this script, you need GLOBAL-6.0 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 necessary to execute the following commands.
"
" $ cd /var/src
" $ gtags
"
" And you will find three tag files in the directory.
"
" $ ls G*
" GPATH GRTAGS GTAGS
"
" General form of Gtags command is as follows:
"
" :Gtags option pattern
"
" You can use all options of global(1) except for the -c, -p, -u and
" all long name options. They are sent to global(1) as is.
"
" To go to 'func', you can say
"
" :Gtags func
"
" Input completion is available. If you forgot the name of a function
" but recall only some characters of the head, please input them and
" press <TAB> key.
"
" :Gtags fu<TAB>
" :Gtags func <- Vim will append 'nc'.
"
" If you omitted an argument, vim ask it as follow:
"
" Gtags for pattern: <current token>
"
" Inputting 'main' to the prompt, vim executes global -x main',
" parse the output, list located objects in the quickfix window
" and load the first entry. The quickfix window shows like this:
"
" gozilla/gozilla.c|200| main(int argc, char **argv)
" gtags-cscope/gtags-cscope.c|124| main(int argc, char **argv)
" gtags-parser/asm_scan.c|2056| int main()
" gtags-parser/gctags.c|157| main(int argc, char **argv)
" gtags-parser/php.c|2116| int main()
" gtags/gtags.c|152| main(int argc, char **argv)
" List
"
" You can go to any entry using quickfix command.
"
" :cn'
" go to the next line.
"
" :cp'
" go to the previous line.
"
" :ccN'
" go to the Nth line.
"
" :cl'
" list all lines.
"
" You can see a help for quickfix like this:
"
" :h quickfix
"
" You can use POSIX regular expression too. It requires more execution time though.
"
" :Gtags sget_
"
" It will match to both of 'set_value' and 'get_value'.
"
" To go to the referenced point of 'func', add -r option.
"
" :Gtags -r func
"
" To go to any symbols which are not defined in GTAGS, try this.
"
" :Gtags -s func
"
" To go to any string other than symbol, try this.
"
" :Gtags -g sget_
"
" This command accomplishes the same function as grep(1) but is more convenient
" because it retrieves an entire directory structure.
"
" To get list of objects in a file 'main.c', use -f command.
"
" :Gtags -f main.c
"
" If you are editing main.c' itself, you can use '%' instead.
"
" :Gtags -f %
"
" You can get a list of files whose path include specified pattern.
" For example:
"
" :Gtags -P /vm/ <- all files under 'vm' directory.
" :Gtags -P \.h$ <- all include files.
" :Gtags -P init <- all paths includes 'init'
"
" If you omitted an argument and input only <ENTER> key to the prompt,
" vim shows list of all files in the project.
"
" Since all short options are sent to global(1) as is, you can
" use the -i, -o, -O, and so on.
"
" For example, if you want to ignore case distinctions in pattern.
"
" :Gtags -gi paTtern
"
" It will match to both of 'PATTERN' and 'pattern'.
"
" If you want to search a pattern which starts with a hyphen like '-C'
" then you can use the -e option like grep(1).
"
" :Gtags -ge -C
"
" By default, Gtags command search only in source files. If you want to
" search in both source files and text files, or only in text files then
"
" :Gtags -go pattern # both source and text
" :Gtags -gO pattern # only text file
"
" See global(1) for other options.
"
" The Gtagsa (Gtags + append) command is almost the same as Gtags command.
" But it differs from Gtags in that it adds the results to the present list.
" If you want to get the union of ':Gtags -d foo' and ':Gtags -r foo' then
" you can invoke the following commands:
"
" :Gtags -d foo
" :Gtagsa -r foo
"
" The GtagsCursor command brings you to the definition or reference of
" the current token. If it is a definition, you are taken to the references.
" If it is a reference, you are taken to the definitions.
"
" :GtagsCursor
"
" If you have the hypertext generated by htags(1) then you can display
" the same place on mozilla browser. Let's load mozilla and try this:
"
" :Gozilla
"
" If you want to load vim with all main()s then following command line is useful.
"
" % vim '+Gtags main'
"
" Also see the chapter of 'vim editor' of the on-line manual of GLOBAL.
"
" % info global
"
" The following custom variables are available.
"
" Gtags_VerticalWindow open windows vitically
" Gtags_Auto_Map use a suggested key-mapping
" Gtags_Auto_Update keep tag files up-to-date automatically
" Gtags_No_Auto_Jump don't jump to the first tag at the time of search
" Gtags_Close_When_Single close quickfix windows in case of single tag
"
" You can use the variables like follows:
"
" $HOME/.vimrc
" let Gtags_Auto_Map = 1
"
" If you want to use the tag stack, please use gtags-cscope.vim.
" You can use the plug-in together with this script.
"
if exists("loaded_gtags")
finish
endif
"
" global command name
"
let s:global_command = $GTAGSGLOBAL
if s:global_command ==
let s:global_command = "global"
endif
" Open the Gtags output window. Set this variable to zero, to not open
" the Gtags output window by default. You can open it manually by using
" the :cwindow command.
" (This code was derived from 'grep.vim'.)
if !exists("g:Gtags_OpenQuickfixWindow")
let g:Gtags_OpenQuickfixWindow = 1
endif
if !exists("g:Gtags_VerticalWindow")
let g:Gtags_VerticalWindow = 0
endif
if !exists("g:Gtags_Auto_Map")
let g:Gtags_Auto_Map = 0
endif
if !exists("g:Gtags_Auto_Update")
let g:Gtags_Auto_Update = 0
endif
" 'Dont_Jump_Automatically' is deprecated.
if !exists("g:Gtags_No_Auto_Jump")
if !exists("g:Dont_Jump_Automatically")
let g:Gtags_No_Auto_Jump = 0
else
let g:Gtags_No_Auto_Jump = g:Dont_Jump_Automatically
endif
endif
if !exists("g:Gtags_Close_When_Single")
let g:Gtags_Close_When_Single = 0
endif
" -- ctags-x format
" let Gtags_Result = "ctags-x"
" let Gtags_Efm = "%*\\S%*\\s%l%\\s%f%\\s%m"
"
" -- ctags format
" let Gtags_Result = "ctags"
" let Gtags_Efm = "%m\t%f\t%l"
"
" Gtags_Use_Tags_Format is obsoleted.
if exists("g:Gtags_Use_Tags_Format")
let g:Gtags_Result = "ctags"
let g:Gtags_Efm = "%m\t%f\t%l"
endif
if !exists("g:Gtags_Result")
let g:Gtags_Result = "ctags-mod"
endif
if !exists("g:Gtags_Efm")
let g:Gtags_Efm = "%f\t%l\t%m"
endif
" Character to use to quote patterns and file names before passing to global.
" (This code was drived from 'grep.vim'.)
if !exists("g:Gtags_Shell_Quote_Char")
if has("win32") || has("win16") || has("win95")
let g:Gtags_Shell_Quote_Char = '"'
else
let g:Gtags_Shell_Quote_Char = "'"
endif
endif
if !exists("g:Gtags_Single_Quote_Char")
if has("win32") || has("win16") || has("win95")
let g:Gtags_Single_Quote_Char = "'"
let g:Gtags_Double_Quote_Char = '\"'
else
let s:sq = "'"
let s:dq = '"'
let g:Gtags_Single_Quote_Char = s:sq . s:dq . s:sq . s:dq . s:sq
let g:Gtags_Double_Quote_Char = '"'
" Vim Japanese Document : https://vim-jp.org/vimdoc-ja/
" Office transrate Text Apache Tika 2019/09/17 augroup office_format
augroup END
" Vim Setting 2014/09/23 set nocompatible filetype off " for vundle
" Vim Setting 2019/09/21 " *.swp *~, .viminfo *.un~ ファイルを作成しない設定 set nobackup set noswapfile set viminfo= set noundofile
" Vim Setting 2019/09/09 " ftp://host/ でディレクトリ表示などを変更した時の以下エラー対処 " E21: 'modifiable'がオフなので、変更できません "変更しようとすると、次のエラーメッセージが表示されます。 " E21: 'modifiable'がオフなので、変更できません " -M 引数を使えば Vim を閲覧モードに設定できますが、これは自主規制みたいなもの " で、次のコマンドを使えば制限はなくなってしまいます。 " " :set modifiable " :set write
"すべてのバッファをタブで開く コマンドモードに入って ":tab ba と入力してEnter。 "現在のタブ以外の全てのタブを閉じる ":tabo と入力してEnter。 "タブ自体を移動する "nnoremap <silent> <Tab>l :+tabmove<CR> "nnoremap <silent> <Tab>h :-tabmove<CR> nnoremap <silent> <Tab>l :tabNext<CR> nnoremap <silent> <Tab>h :tabprevious<CR> "nnoremap gr :tabprevious<CR>
" TAB 操作マクロ設定例 " 一例 "nnoremap <silent> <leader>tf :<c-u>tabfirst<cr> "nnoremap <silent> <leader>tl :<c-u>tablast<cr> "nnoremap <silent> <leader>tn :<c-u>tabnext<cr> "nnoremap <silent> <leader>tN :<c-u>tabNext<cr> "nnoremap <silent> <leader>tp :<c-u>tabprevious<cr> "nnoremap <silent> <leader>te :<c-u>tabedit<cr> "nnoremap <silent> <leader>tc :<c-u>tabclose<cr> "nnoremap <silent> <leader>to :<c-u>tabonly<cr> "nnoremap <silent> <leader>ts :<c-u>tabs<cr> " "nnoremap TABCMD <nop> "nmap <leader>t TABCMD " "nnoremap <silent> TABCMDf :<c-u>tabfirst<cr> "nnoremap <silent> TABCMDl :<c-u>tablast<cr> "nnoremap <silent> TABCMDn :<c-u>tabnext<cr> "nnoremap <silent> TABCMDN :<c-u>tabNext<cr> "nnoremap <silent> TABCMDp :<c-u>tabprevious<cr> "nnoremap <silent> TABCMDe :<c-u>tabedit<cr> "nnoremap <silent> TABCMDc :<c-u>tabclose<cr> "nnoremap <silent> TABCMDo :<c-u>tabonly<cr> "nnoremap <silent> TABCMDs :<c-u>tabs<cr>
" Vim Setting 2019/09/03 " " 半角文字の設定 Windows オンリー set guifont=MS_Gothic:h14 "全角文字の設定 set guifontwide=MS_Gothic:h14 " クリップボートとvimレジスタを同期する " http://cohama.hateblo.jp/entry/20130108/1357664352 set clipboard=unnamed
" grep sygwin 設定 set grepprg=grep\ -nr " 各タブページのカレントバッファ名+αを表示 function! s:tabpage_label(n)
endfunction
" netrw 環境のプロトコルの設定 Windows オンリー if (has('win32') || has('win64'))
endif
" session path "let s:session_path = expand('~/_vim/sessions') " "if !isdirectory(s:session_path) " call mkdir(s:session_path, "p") "endif
"if has("vim_starting") "set rtp+=$HOME/_vim/bundle/neobundle.vim/ "call neobundle#rc(expand('~/_vim/bundle')) "endif
" NeoBundle "NeoBundle 'git://github.com/Shougo/neocomplcache.git' "NeoBundle 'git://github.com/Shougo/unite.vim.git'
"カラースキーマの設定 " orignal "darkblue" end
let colors_name = "mycolor"
hi String ctermfg=brown guifg=Orange cterm=none gui=none hi MatchParen guifg=Yellow guibg=DarkCyan hi SignColumn guibg=#101020 hi CursorIM guifg=NONE guibg=Red hi CursorLine guifg=NONE guibg=#505050 "colorscheme midnight "set background=dark
exec "set runtimepath+=".escape(globpath(&runtimepath, 'D:\Download\global656\bin\gtags.exe'), ' ') "nmap <C-]> :call Gtag(expand('<cword>'))<CR>
" "let $LC_ALL="C" "let $LANG="C" " 制御文字の表示化 "set list set nolist
"set nu "set showmode set ts=2 " map <C-h> :call Gtag(expand('<cword>'))<CR> "map <C-h> :Gtags -f %<CR> map <C-j> :GtagsCursor<CR> map <C-n> :cn<CR> map <C-p> :cp<CR> nmap <C-g> :Gtags -g nmap <C-l> :Gtags -f %<CR> nmap <C-j> :Gtags <C-r><C-w><CR> nmap <C-k> :Gtags -r <C-r><C-w><CR> "nmap <C-n> :cn<CR> "nmap <C-p> :cp<CR>
" Error Strange Charactor set termencoding=ja_JP.UTF-8 " Error Strange Charactor set fileencodings=guess,ja_JP.UTF-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom " vi 起動時の上部にメニューやオプションを表示する設定 okosi set completeopt=menuone,preview set showmode set number "set list set title set ambiwidth=double set tabstop=2 "set expandtab set shiftwidth=2 set smartindent "set listchars=tab:損-,trail:-,eol:??extends:損,precedes:束,nbsp:% set nrformats-=octal set hidden set history=50 set virtualedit=block set whichwrap=b,s,,,<,> "set backspace=indent,eol,start
inoremap { {}<Left> inoremap {<Enter> {}<Left><CR><ESC><S-o> inoremap ( ()<ESC>i inoremap (<Enter> ()<Left><CR><ESC><S-o> inoremap #inc #include <><ESC>i
"set incsearch "syntax on "set nohlsearch "set cursorline
" "highlight Normal ctermbg=black ctermfg=grey "highlight StatusLine term=none cterm=none ctermfg=black ctermbg=grey "highlight CursorLine term=none cterm=none ctermfg=none ctermbg=darkgray highlight Normal ctermbg=black ctermfg=grey highlight StatusLine term=none cterm=none ctermfg=black ctermbg=grey highlight CursorLine term=none cterm=none ctermfg=none ctermbg=darkgray " "highlight Normal ctermbg=grey ctermfg=black "highlight StatusLine term=none cterm=none ctermfg=grey ctermbg=black "highlight CursorLine term=none cterm=none ctermfg=darkgray ctermbg=none
"Example " Backspace で既存の文字を削除できるように設定 " start - 既存の文字を削除できるように設定 " eol - 行頭でBackspaceを使用した場合上の行と連結 " indent - オートインデントモードでインデントを削除できるように設定 set backspace=start,eol,indent " 特定のキーに行頭および行末の回りこみ移動を許可する設定 " b - Backspace ノーマルモード ビジュアルモード " s - Space ノーマルモード ビジュアルモード " - → ノーマルモード ビジュアルモード " [ - ← 挿入モード 置換モード " ] - → 挿入モード 置換モード " ~ - ~ ノーマルモード set whichwrap=b,s,,~ " マウス機能有効化 "Linux NO!! set mouse=a " シンタックスハイライト有効化 (背景黒向け。白はコメントアウト " されている設定を使用) "Linux NO!!syntax on "highlight Normal ctermbg=black ctermfg=grey highlight Normal ctermbg=none ctermfg=none highlight StatusLine term=none cterm=none ctermfg=black ctermbg=grey "highlight CursorLine term=none cterm=none ctermfg=none ctermbg=darkgray "highlight Normal ctermbg=grey ctermfg=black "highlight StatusLine term=none cterm=none ctermfg=grey ctermbg=black "highlight CursorLine term=none cterm=none ctermfg=darkgray ctermbg=none set nohlsearch " 検索キーワードをハイライトしないように設定 set cursorline " カーソルラインの強調表示を有効化 " 行番号を表示 "set number " ステータスラインを表示 set laststatus=2 " ステータスラインを常に表示 set statusline=%F%r%h%= " ステータスラインの内容 " インクリメンタル検索を有効化 set incsearch " 補完時の一覧表示機能有効化 set wildmenu wildmode=list:full " 自動的にファイルを読み込むパスを設定 ~/.vim/userautoload/*vim set runtimepath+=~/.vim/ runtime! userautoload/*.vim
"Windows Vim " Backspace で既存の文字を削除できるように設定 " start - 既存の文字を削除できるように設定 " eol - 行頭でBackspaceを使用した場合上の行と連結 " indent - オートインデントモードでインデントを削除できるように設定 "set backspace=start,eol,indent " 特定のキーに行頭および行末の回りこみ移動を許可する設定 " b - Backspace ノーマルモード ビジュアルモード " s - Space ノーマルモード ビジュアルモード " - → ノーマルモード ビジュアルモード " [ - ← 挿入モード 置換モード " ] - → 挿入モード 置換モード " ~ - ~ ノーマルモード "set whichwrap=b,s,,~
" シンタックスハイライト有効化 (背景黒向け。白はコメントアウト " されている設定を使用) "syntax on "highlight Normal ctermbg=black ctermfg=grey "highlight StatusLine term=none cterm=none ctermfg=black ctermbg=grey "highlight CursorLine term=none cterm=none ctermfg=none ctermbg=darkgray "highlight Normal ctermbg=grey ctermfg=black "highlight StatusLine term=none cterm=none ctermfg=grey ctermbg=black "highlight CursorLine term=none cterm=none ctermfg=darkgray ctermbg=none "set nohlsearch " 検索キーワードをハイライトしないように設定 " 行番号を表示 set number " インクリメンタル検索を有効化 "set incsearch " 補完時の一覧表示機能有効化 "set wildmenu wildmode=list:full " 自動的にファイルを読み込むパスを設定 ~/_vimfiles/userautoload/*vim "set runtimepath+=~/_vimfiles/ "runtime! userautoload/*.vim
" 端末の表示文字コードを指定する "set termencoding=ja_JP.UTF-8 "set termencoding=utf-8 set fileencodings=guess,ja_JP.UTF-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom
" 以下ファイルセーブ時にエンコードすろ文字コードを指定している okosi "wrong set fileencodings=guess,ja_JP.UTF-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom set fileencodings=guess,utf-8,iso-2022-jp-3,cp932,euc-jisx0213,ucs-bom,euc-jp,utf-8 set fileencoding=utf-8 set fileformats=unix,dos,mac "set fileencodings=ja_JP.UTF-8 set encoding=utf-8 set ruler set showmatch set statusline=%F%m%r%h%w\ FMT=%{&ff}\ TP=%Y\ [ASCII=\%03.3b]\ [HEX=\%02.2B]\ POS=%04l,%04v%p%%\ LEN=%L
"カーソル位置(水平・垂直)を特定するのに有効 "set cursorline " カーソルラインの強調表示を有効化 set cursorline set cursorcolumn
" File: gtags.vim " Author: Tama Communications Corporation " Version: 0.6.8 " Last Modified: Nov 9, 2015 " " Copyright and license " --------------------- " Copyright (c) 2004, 2008, 2010, 2011, 2012, 2014, 2015 " 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.vim plug-in script integrates the GNU GLOBAL source code tag system " with Vim. About the details, see http://www.gnu.org/software/global/. " " Installation " ------------ " Drop the file in your plug-in directory or source it from your vimrc. " To use this script, you need GLOBAL-6.0 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 necessary to execute the following commands. " " $ cd /var/src " $ gtags " " And you will find three tag files in the directory. " " $ ls G* " GPATH GRTAGS GTAGS " " General form of Gtags command is as follows: " " :Gtags option pattern " " You can use all options of global(1) except for the -c, -p, -u and " all long name options. They are sent to global(1) as is. " " To go to 'func', you can say " " :Gtags func " " Input completion is available. If you forgot the name of a function " but recall only some characters of the head, please input them and " press <TAB> key. " " :Gtags fu<TAB> " :Gtags func <- Vim will append 'nc'. " " If you omitted an argument, vim ask it as follow: " " Gtags for pattern: <current token> " " Inputting 'main' to the prompt, vim executes global -x main', " parse the output, list located objects in the quickfix window " and load the first entry. The quickfix window shows like this: " " gozilla/gozilla.c|200| main(int argc, char **argv) " gtags-cscope/gtags-cscope.c|124| main(int argc, char **argv) " gtags-parser/asm_scan.c|2056| int main() " gtags-parser/gctags.c|157| main(int argc, char **argv) " gtags-parser/php.c|2116| int main() " gtags/gtags.c|152| main(int argc, char **argv) " List " " You can go to any entry using quickfix command. " " :cn' " go to the next line. " " :cp' " go to the previous line. " " :ccN' " go to the Nth line. " " :cl' " list all lines. " " You can see a help for quickfix like this: " " :h quickfix " " You can use POSIX regular expression too. It requires more execution time though. " " :Gtags sget_ " " It will match to both of 'set_value' and 'get_value'. " " To go to the referenced point of 'func', add -r option. " " :Gtags -r func " " To go to any symbols which are not defined in GTAGS, try this. " " :Gtags -s func " " To go to any string other than symbol, try this. " " :Gtags -g sget_ " " This command accomplishes the same function as grep(1) but is more convenient " because it retrieves an entire directory structure. " " To get list of objects in a file 'main.c', use -f command. " " :Gtags -f main.c " " If you are editing main.c' itself, you can use '%' instead. " " :Gtags -f % " " You can get a list of files whose path include specified pattern. " For example: " " :Gtags -P /vm/ <- all files under 'vm' directory. " :Gtags -P \.h$ <- all include files. " :Gtags -P init <- all paths includes 'init' " " If you omitted an argument and input only <ENTER> key to the prompt, " vim shows list of all files in the project. " " Since all short options are sent to global(1) as is, you can " use the -i, -o, -O, and so on. " " For example, if you want to ignore case distinctions in pattern. " " :Gtags -gi paTtern " " It will match to both of 'PATTERN' and 'pattern'. " " If you want to search a pattern which starts with a hyphen like '-C' " then you can use the -e option like grep(1). " " :Gtags -ge -C " " By default, Gtags command search only in source files. If you want to " search in both source files and text files, or only in text files then " " :Gtags -go pattern # both source and text " :Gtags -gO pattern # only text file " " See global(1) for other options. " " The Gtagsa (Gtags + append) command is almost the same as Gtags command. " But it differs from Gtags in that it adds the results to the present list. " If you want to get the union of ':Gtags -d foo' and ':Gtags -r foo' then " you can invoke the following commands: " " :Gtags -d foo " :Gtagsa -r foo " " The GtagsCursor command brings you to the definition or reference of " the current token. If it is a definition, you are taken to the references. " If it is a reference, you are taken to the definitions. " " :GtagsCursor " " If you have the hypertext generated by htags(1) then you can display " the same place on mozilla browser. Let's load mozilla and try this: " " :Gozilla " " If you want to load vim with all main()s then following command line is useful. " " % vim '+Gtags main' " " Also see the chapter of 'vim editor' of the on-line manual of GLOBAL. " " % info global " " The following custom variables are available. " " Gtags_VerticalWindow open windows vitically " Gtags_Auto_Map use a suggested key-mapping " Gtags_Auto_Update keep tag files up-to-date automatically " Gtags_No_Auto_Jump don't jump to the first tag at the time of search " Gtags_Close_When_Single close quickfix windows in case of single tag " " You can use the variables like follows: " " $HOME/.vimrc " let Gtags_Auto_Map = 1 " " If you want to use the tag stack, please use gtags-cscope.vim. " You can use the plug-in together with this script. " if exists("loaded_gtags")
endif
" " global command name " let s:global_command = $GTAGSGLOBAL if s:global_command ==
endif " Open the Gtags output window. Set this variable to zero, to not open " the Gtags output window by default. You can open it manually by using " the :cwindow command. " (This code was derived from 'grep.vim'.) if !exists("g:Gtags_OpenQuickfixWindow")
endif
if !exists("g:Gtags_VerticalWindow")
endif
if !exists("g:Gtags_Auto_Map")
endif
if !exists("g:Gtags_Auto_Update")
endif
" 'Dont_Jump_Automatically' is deprecated. if !exists("g:Gtags_No_Auto_Jump")
let g:Gtags_No_Auto_Jump = 0
let g:Gtags_No_Auto_Jump = g:Dont_Jump_Automatically
endif
if !exists("g:Gtags_Close_When_Single")
endif
" -- ctags-x format " let Gtags_Result = "ctags-x" " let Gtags_Efm = "%*\\S%*\\s%l%\\s%f%\\s%m" " " -- ctags format " let Gtags_Result = "ctags" " let Gtags_Efm = "%m\t%f\t%l" " " Gtags_Use_Tags_Format is obsoleted. if exists("g:Gtags_Use_Tags_Format")
endif if !exists("g:Gtags_Result")
endif if !exists("g:Gtags_Efm")
endif " Character to use to quote patterns and file names before passing to global. " (This code was drived from 'grep.vim'.) if !exists("g:Gtags_Shell_Quote_Char")
endif if !exists("g:Gtags_Single_Quote_Char")
endif
" " Display error message. " function! s:Error(msg)
endfunction " " Extract pattern or option string. " function! s:Extract(line, target)
endfunction
" " Trim options to avoid errors. " function! s:TrimOption(option)
endfunction
" " Execute global and load the result into quickfix window. " function! s:ExecLoad(option, long_option, pattern, flags)
let l:open = 1
let l:open = 0 let l:idx = stridx(l:result, "\n") if l:idx > 0 && stridx(l:result, "\n", l:idx + 1) > 0 let l:open = 1 endif endif if l:open == 0 cclose
endfunction
" " RunGlobal() " function! s:RunGlobal(line, flags)
endfunction
" " Execute RunGlobal() depending on the current position. " function! s:GtagsCursor()
endfunction
" " Show the current position on mozilla. " (You need to execute htags(1) in your source directory.) " function! s:Gozilla()
endfunction " " Auto update of tag files using incremental update facility. " function! s:GtagsAutoUpdate()
endfunction
" " Custom completion. " function! GtagsCandidate(lead, line, pos)
endfunction
function! GtagsCandidateCore(lead, line, pos)
endfunction
" Define the set of Gtags commands command! -nargs=* -complete=custom,GtagsCandidate Gtags call s:RunGlobal(<q-args>, ) command! -nargs=* -complete=custom,GtagsCandidate Gtagsa call s:RunGlobal(<q-args>, 'a') command! -nargs=0 GtagsCursor call s:GtagsCursor() command! -nargs=0 Gozilla call s:Gozilla() command! -nargs=0 GtagsUpdate call s:GtagsAutoUpdate() if g:Gtags_Auto_Update == 1 :autocmd! BufWritePost * call s:GtagsAutoUpdate() endif " Suggested map: if g:Gtags_Auto_Map == 1 :nmap <F2> :copen<CR> :nmap <F4> :cclose<CR> :nmap <F5> :Gtags<SPACE> :nmap <F6> :Gtags -f %<CR> :nmap <F7> :GtagsCursor<CR> :nmap <F8> :Gozilla<CR> :nmap <C-n> :cn<CR> :nmap <C-p> :cp<CR> :nmap <C-\><C-]> :GtagsCursor<CR> endif let loaded_gtags = 1