1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-03-13 02:05:40 +08:00

Change: rename tags layer && improve cscope layer (#2509)

This commit is contained in:
Wang Shidong 2019-02-02 22:26:35 +08:00 committed by GitHub
parent 99212664c7
commit f507c2cf84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 68 additions and 49 deletions

View File

@ -84,6 +84,7 @@ function! s:get_list_of_PRs() abort
\ . s:last_release_number
\ . " && v:val['number'] < "
\ . s:current_release_number
\ . ' && !empty(get(v:val, "merged_at", ""))'
\ . " && index(s:unmerged_prs_since_current_release, v:val['number']) == -1 "
\ ))
endfor

View File

@ -229,6 +229,11 @@ endfunction
let s:file['unify_path'] = function('s:unify_path')
function! s:path_to_fname(path)
return substitute(s:unify_path(a:path), '[\\/:;.]', '_', 'g')
endfunction
let s:file['path_to_fname'] = function('s:path_to_fname')
function! SpaceVim#api#file#get() abort
return deepcopy(s:file)

View File

@ -16,6 +16,7 @@ endfunction
function! SpaceVim#layers#cscope#config() abort
let g:_spacevim_mappings_space.m.c = {'name' : '+cscope'}
if SpaceVim#layers#isLoaded('unite')
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'c'], 'Unite cscope/functions_called_by', 'find functions called by this function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'C'], 'Unite cscope/functions_calling', 'find functions calling this function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'd'], 'Unite cscope/global_definition', 'find global definition of a symbol', 1)
@ -25,5 +26,17 @@ function! SpaceVim#layers#cscope#config() abort
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'e'], 'Unite cscope/egrep_pattern', 'Find this egrep pattern', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 't'], 'Unite cscope/text_string', 'find this text string', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', '='], 'Unite cscope/assignments_to_symbol', 'find assignments to this symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'i'], 'call CscopeUpdateDB()', 'create cscope index', 1)
else
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'c'], 'call cscope#find("d", expand("<cword>"))', 'find functions called by this function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'C'], 'call cscope#find("c", expand("<cword>"))', 'find functions calling this function', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'C'], 'call cscope#find("g", expand("<cword>"))', 'find global definition of a symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'r'], 'call cscope#find("s", expand("<cword>"))', 'find references of a symbol', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'f'], 'call cscope#find("f", expand("<cword>"))', 'find files', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'F'], 'call cscope#find("i", expand("<cword>"))', 'find files including this file', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'e'], 'call cscope#find("e", expand("<cword>"))', 'Find this egrep pattern', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 't'], 'call cscope#find("t", expand("<cword>"))', 'find this text string', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', '='], 'call cscope#find("a", expand("<cword>"))', 'find assignments to this symbol', 1)
endif
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'u'], 'call cscope#updateDB()', 'create cscope index', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'c', 'i'], 'call cscope#createDB()', 'create cscope DB', 1)
endfunction

View File

@ -8,9 +8,7 @@
function! SpaceVim#layers#tags#plugins() abort
return [
\ ['ludovicchabant/vim-gutentags', {'merged' : 0, 'loadconf' : 1}],
\ ['SpaceVim/gtags.vim', {'merged' : 0}],
\ ['tsukkee/unite-tag', {'merged' : 0}],
\ ]
endfunction
@ -18,19 +16,19 @@ function! SpaceVim#layers#tags#config() abort
let g:_spacevim_mappings_space.m.g = {'name' : '+gtags'}
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'c'], 'GtagsGenerate!', 'create a gtags database', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'u'], 'GtagsGenerate', 'update tag database', 1)
if SpaceVim#layers#isLoaded('denite')
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'f'], 'Denite gtags_path', 'list all file in GTAGS', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'DeniteCursorWord gtags_def', 'find definitions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'DeniteCursorWord gtags_ref', 'find references', 1)
elseif SpaceVim#layers#isLoaded('unite')
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'f'], 'Unite gtags/path', 'list all file in GTAGS', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'Unite gtags/def', 'find definitions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'Unite gtags/ref', 'find references', 1)
else
" if SpaceVim#layers#isLoaded('denite')
" call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'f'], 'Denite gtags_path', 'list all file in GTAGS', 1)
" call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'DeniteCursorWord gtags_def', 'find definitions', 1)
" call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'DeniteCursorWord gtags_ref', 'find references', 1)
" elseif SpaceVim#layers#isLoaded('unite')
" call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'f'], 'Unite gtags/path', 'list all file in GTAGS', 1)
" call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'Unite gtags/def', 'find definitions', 1)
" call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'Unite gtags/ref', 'find references', 1)
" else
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'f'], 'Gtags -p', 'list all file in GTAGS', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'd'], 'exe "Gtags -d " . expand("<cword>")', 'find definitions', 1)
call SpaceVim#mapping#space#def('nnoremap', ['m', 'g', 'r'], 'exe "Gtags -r " . expand("<cword>")', 'find references', 1)
endif
" endif
augroup spacevim_layer_tags
autocmd!
autocmd BufEnter *

View File

@ -80,6 +80,7 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管
| [fzf](fzf/) | 这一模块为 SpaceVim 提供了以 fzf 为核心的异步模糊查找机制,支持模糊搜索文件、历史记录、函数列表等。 |
| [git](git/) | 这一模块为 SpaceVim 提供了 Git 支持,根据当前 Vim 版本特性,选择 gina 或者 gita 作为默认的后台 Git 插件。 |
| [github](github/) | 这一模块为 SpaceVim 提供了 Github 数据管理功能,包括问题列表、动态等管理。 |
| [gtags](gtags/) | 这一模块为 SpaceVim 提供了全局的 gtags 索引管理,提供快速检索定义和引用的功能。 |
| [japanese](japanese/) | 这一模块为 SpaceVim 的日文用户提供了日文的 Vim 帮助文档,同时提供部分插件的日文帮助文档。 |
| [lang#WebAssembly](lang/WebAssembly/) | 这一模块为 SpaceVim 提供了 WebAssembly 的开发支持。 |
| [lang#agda](lang/agda/) | 这一模块为 SpaceVim 提供了 Agda 的开发支持,主要包括语法高亮及一键运行。 |
@ -129,7 +130,6 @@ Vim 插件以及相关配置。而 SpaceVim 是以模块的方式来组织和管
| [leaderf](leaderf/) | 这一模块为 SpaceVim 提供了以 leaderf 为核心的异步模糊查找机制,支持模糊搜索文件、历史记录、函数列表等。 |
| [shell](shell/) | 这一模块为 SpaceVim 提供了终端集成特性,优化内置终端的使用体验。 |
| [sudo](sudo/) | 这一模块为 SpaceVim 提供了以管理员身份读写文件的功能。 |
| [tags](tags/) | 这一模块为 SpaceVim 提供了全局的 tags 索引管理,提供快速检索定义和引用的功能。 |
| [tmux](tmux/) | 这一模块为 SpaceVim 提供了一些在 Vim 内操作 tmux 的功能,使得在 tmux 窗口之间跳转更加便捷。 |
| [tools#dash](tools/dash/) | 这一模块为 SpaceVim 提供了 Dash 支持,可快速查找光标位置的单词。 |
| [tools](tools/) | 这一模块为 SpaceVim 提供了多种常用工具,包括日历、计算器等多种工具类插件,并针对 Vim8 以及 Neovim 提供了更好的插件选择。 |

View File

@ -52,7 +52,8 @@ sudo pacman -S cscope
| 按键 | 描述 |
| ----------- | ------------------------------- |
| `SPC m c =` | Find assignments to this symbol |
| `SPC m c i` | 建立 cscope 索引 |
| `SPC m c i` | 建立当前项目 cscope 索引 |
| `SPC m c u` | 更新所有项目 cscope 索引 |
| `SPC m c c` | 列出某个方法调用的所有函数 |
| `SPC m c C` | 列出某个方法被哪些函数调用 |
| `SPC m c d` | 查询 symbol 的定义处 |

View File

@ -1,10 +1,11 @@
---
title: "SpaceVim tags 模块"
description: "这一模块为 SpaceVim 提供了全局的 tags 索引管理,提供快速检索定义和引用的功能。"
title: "SpaceVim gtags 模块"
description: "这一模块为 SpaceVim 提供了全局的 gtags 索引管理,提供快速检索定义和引用的功能。"
redirect_from: "/cn/tags/"
lang: cn
---
# [可用模块](../) >> tags
# [可用模块](../) >> gtags
<!-- vim-markdown-toc GFM -->

View File

@ -86,6 +86,7 @@ Some layers are enabled by default. The following example shows how to disable `
| [fzf](fzf/) | This layers provide a heavily customized fzf centric work-flow |
| [git](git/) | This layers adds extensive support for git |
| [github](github/) | This layer provides GitHub integration for SpaceVim |
| [gtags](gtags/) | This layer provide gtags manager for project |
| [japanese](japanese/) | Layer for japanese users, include japanese docs and runtime messages |
| [lang#WebAssembly](lang/WebAssembly/) | This layer adds WebAssembly support to SpaceVim |
| [lang#agda](lang/agda/) | This layer adds agda language support to SpaceVim |
@ -137,7 +138,6 @@ Some layers are enabled by default. The following example shows how to disable `
| [leaderf](leaderf/) | This layers provide a heavily customized LeaderF centric work-flow |
| [shell](shell/) | This layer provide shell support in SpaceVim |
| [sudo](sudo/) | sudo layer provides ability to read and write file elevated privileges in SpaceVim |
| [tags](tags/) | This layer provide tags manager for project |
| [test](test/) | This layer allows to run tests directly on SpaceVim |
| [tmux](tmux/) | This layers adds extensive support for tmux |
| [tools#dash](tools/dash/) | This layer provides Dash integration for SpaceVim |

View File

@ -41,7 +41,7 @@ To use this configuration layer, add it to your configuration file.
```toml
[[layers]]
name = "cscope"
name = "cscope"
```
## Key bindings
@ -49,7 +49,8 @@ name = "cscope"
| Key Binding | Description |
| ----------- | -------------------------------------- |
| `SPC m c =` | Find assignments to this symbol |
| `SPC m c i` | Create cscope index |
| `SPC m c i` | Create cscope DB |
| `SPC m c u` | Update cscope DBs |
| `SPC m c c` | Find functions called by this function |
| `SPC m c C` | Find functions calling this function |
| `SPC m c d` | find global definition of a symbol |

View File

@ -1,6 +1,7 @@
---
title: "SpaceVim tags layer"
description: "This layer provide tags manager for project"
title: "SpaceVim gtags layer"
description: "This layer provide gtags manager for project"
redirect_from: "/tags/"
---
# [Available Layers](../) >> tags

View File

@ -2,24 +2,34 @@ This page documents changes in master branch since last release v1.0.0
## PreRelease
The next release is v1.1.0
The next release is v1.1.0:
### Pull Requests
<!-- call SpaceVim#dev#followHEAD#update('en') -->
<!-- SpaceVim follow HEAD en start -->
#### New Features
- Add key binding SPC e e [#2507](https://github.com/SpaceVim/SpaceVim/pull/2507)
- Add input method support on statusline [#2496](https://github.com/SpaceVim/SpaceVim/pull/2496)
- add lang#red layer [#2486](https://github.com/SpaceVim/SpaceVim/pull/2486)
- Add chinese linter to layer chinese [#2473](https://github.com/SpaceVim/SpaceVim/pull/2473)
- Add: zeal layer [#2469](https://github.com/SpaceVim/SpaceVim/pull/2469)
- Add: add a new feature 'format all tables' for markdown. [#2457](https://github.com/SpaceVim/SpaceVim/pull/2457)
- add ctrl - r [#2436](https://github.com/SpaceVim/SpaceVim/pull/2436)
- add mapping to clear quickfix [#2430](https://github.com/SpaceVim/SpaceVim/pull/2430)
- Add alt file plugin [#2416](https://github.com/SpaceVim/SpaceVim/pull/2416)
- Add: coc.nvim integration enhacements [#2415](https://github.com/SpaceVim/SpaceVim/pull/2415)
- Add plugin for git log [#1963](https://github.com/SpaceVim/SpaceVim/pull/1963)
#### Feature Changes
- Change: optimize some code. [#2498](https://github.com/SpaceVim/SpaceVim/pull/2498)
- Change: modify the function of SPC c L. [#2492](https://github.com/SpaceVim/SpaceVim/pull/2492)
#### Bug Fixs
- Fixed: extend the patterns. [#2500](https://github.com/SpaceVim/SpaceVim/pull/2500)
- Fix for code-running java [#2499](https://github.com/SpaceVim/SpaceVim/pull/2499)
- Fix: fix a bug for the function of SPC x i c . [#2491](https://github.com/SpaceVim/SpaceVim/pull/2491)
- Fix delete file [#2490](https://github.com/SpaceVim/SpaceVim/pull/2490)
- Fix typo [#2475](https://github.com/SpaceVim/SpaceVim/pull/2475)
- Fix: call fzf#wrap in fzf#run [#2472](https://github.com/SpaceVim/SpaceVim/pull/2472)
- Fix typo: statuline -> statusline [#2451](https://github.com/SpaceVim/SpaceVim/pull/2451)
@ -27,20 +37,17 @@ The next release is v1.1.0
- Fix runner close job [#2441](https://github.com/SpaceVim/SpaceVim/pull/2441)
- Fix rust runner in windows [#2438](https://github.com/SpaceVim/SpaceVim/pull/2438)
- Fixed: fix typos. [#2437](https://github.com/SpaceVim/SpaceVim/pull/2437)
- Fix lua runner in windows [#2427](https://github.com/SpaceVim/SpaceVim/pull/2427)
- Fix go run support [#2426](https://github.com/SpaceVim/SpaceVim/pull/2426)
- Fixed: fix a typo, there should be a \| between >> and \/\/. [#2423](https://github.com/SpaceVim/SpaceVim/pull/2423)
- Fixed: Fix an alignment error and fix the regular expression. [#2420](https://github.com/SpaceVim/SpaceVim/pull/2420)
- Fix api import [#2418](https://github.com/SpaceVim/SpaceVim/pull/2418)
- fix `docs/cn/layers/lang/vue.md` [#2417](https://github.com/SpaceVim/SpaceVim/pull/2417)
- Fixed: fix typos. [#2413](https://github.com/SpaceVim/SpaceVim/pull/2413)
- Fix docker support [#2406](https://github.com/SpaceVim/SpaceVim/pull/2406)
- Fix debug command [#2226](https://github.com/SpaceVim/SpaceVim/pull/2226)
- Fix perl support [#2230](https://github.com/SpaceVim/SpaceVim/pull/2230)
- Fix preview in flygrep [#2256](https://github.com/SpaceVim/SpaceVim/pull/2256)
#### Unmarked PRs
- Doc: fix typos. [#2502](https://github.com/SpaceVim/SpaceVim/pull/2502)
- Doc: update the documentation of the layer autocomplete. [#2501](https://github.com/SpaceVim/SpaceVim/pull/2501)
- Doc: add a new name rule: hints-like-this [#2493](https://github.com/SpaceVim/SpaceVim/pull/2493)
- Update init.vim [#2487](https://github.com/SpaceVim/SpaceVim/pull/2487)
- Improve lang#r layer and doc [#2485](https://github.com/SpaceVim/SpaceVim/pull/2485)
- Trying to get up to date with the origin [#2484](https://github.com/SpaceVim/SpaceVim/pull/2484)
- Doc: fix typos. [#2483](https://github.com/SpaceVim/SpaceVim/pull/2483)
- Doc: fix typos. [#2481](https://github.com/SpaceVim/SpaceVim/pull/2481)
- Typo dashboard [#2477](https://github.com/SpaceVim/SpaceVim/pull/2477)
- Doc: fix typos. [#2471](https://github.com/SpaceVim/SpaceVim/pull/2471)
- Improve lua support [#2470](https://github.com/SpaceVim/SpaceVim/pull/2470)
@ -60,17 +67,8 @@ The next release is v1.1.0
- Use a yellow ⚠ for warnings messages [#2435](https://github.com/SpaceVim/SpaceVim/pull/2435)
- Update statusline support for startify [#2434](https://github.com/SpaceVim/SpaceVim/pull/2434)
- Doc, cosmetics: remove trailing spaces [#2433](https://github.com/SpaceVim/SpaceVim/pull/2433)
- Improve statusline support for gina [#2432](https://github.com/SpaceVim/SpaceVim/pull/2432)
- Doc: fix typo for javascript [#2428](https://github.com/SpaceVim/SpaceVim/pull/2428)
- Jump to test of api [#2424](https://github.com/SpaceVim/SpaceVim/pull/2424)
- patch for #2114 [#2422](https://github.com/SpaceVim/SpaceVim/pull/2422)
- Doc: typo fixes [#2421](https://github.com/SpaceVim/SpaceVim/pull/2421)
- Doc: add description for SPC l k. [#2414](https://github.com/SpaceVim/SpaceVim/pull/2414)
- Website: add vim#command api doc [#2412](https://github.com/SpaceVim/SpaceVim/pull/2412)
- Improve shell layer key binding [#2409](https://github.com/SpaceVim/SpaceVim/pull/2409)
- Doc: add some tweaks on doc instructions [#2056](https://github.com/SpaceVim/SpaceVim/pull/2056)
- Improve startup experience [#1977](https://github.com/SpaceVim/SpaceVim/pull/1977)
- [issue#2367]: clear rootDir cache after rooter pattern changed [#2370](https://github.com/SpaceVim/SpaceVim/pull/2370)
<!-- SpaceVim follow HEAD en end -->