-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathcontext.vim
More file actions
121 lines (107 loc) · 3.41 KB
/
Copy pathcontext.vim
File metadata and controls
121 lines (107 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
let s:pluginBuffer = -1
let s:configuration = {
\ "defaultSymbols": {
\ "unicode": {
\ "CS": "⌗",
\ "Sin": "•",
\ "All": "፨",
\ "Vis": "★",
\ "File": "⊚",
\ "Tabs": "○",
\ "CTab": "●",
\ "NTM": "⁺",
\ "WLoad": "⬆",
\ "WSave": "⬇",
\ "Zoom": "⌕",
\ "SLeft": "›",
\ "SRight": "‹",
\ "BM": "♥",
\ "Help": "?",
\ "IV": "☆",
\ "IA": "★",
\ "IM": "+",
\ "Dots": "…"
\ },
\ "ascii": {
\ "CS": "#",
\ "Sin": "BUF",
\ "All": "ALL",
\ "Vis": "VIS",
\ "File": "FILE",
\ "Tabs": "-",
\ "CTab": "+",
\ "NTM": "+",
\ "WLoad": "|::|",
\ "WSave": "[::]",
\ "Zoom": "*",
\ "SLeft": "[",
\ "SRight": "]",
\ "BM": "BM",
\ "Help": "?",
\ "IV": "-",
\ "IA": "*",
\ "IM": "+",
\ "Dots": "..."
\ }
\ },
\ "Height": 1,
\ "MaxHeight": 0,
\ "SetDefaultMapping": 1,
\ "DefaultMappingKey": "<C-Space>",
\ "KeyMap": {},
\ "FunctionHelp": {},
\ "GlobCommand": "",
\ "UseTabline": 1,
\ "UseMouseAndArrowsInTerm": 0,
\ "StatuslineFunction": "ctrlspace#api#Statusline()",
\ "SaveWorkspaceOnExit": 0,
\ "SaveWorkspaceOnSwitch": 0,
\ "LoadLastWorkspaceOnStart": 0,
\ "CacheDir": expand($HOME),
\ "ProjectRootMarkers": [".git", ".hg", ".svn", ".bzr", "_darcs", "CVS"],
\ "UnicodeFont": 1,
\ "IgnoredFiles": '\v(tmp|temp)[\/]',
\ "SearchTiming": [50, 500],
\ "SearchResonators": ['.', '/', '\', '_', '-'],
\ "Engine": "",
\ }
function! s:init()
let s:conf = copy(s:configuration)
for name in keys(s:conf)
if exists("g:CtrlSpace" . name)
let s:conf[name] = g:{"CtrlSpace" . name}
endif
endfor
let s:conf.Symbols = copy(s:conf.UnicodeFont ? s:conf.defaultSymbols.unicode : s:conf.defaultSymbols.ascii)
if exists("g:CtrlSpaceSymbols")
call extend(s:conf.Symbols, g:CtrlSpaceSymbols)
endif
let s:symbolSizes = {
\ "IAV": max([strwidth(s:conf.Symbols.IV), strwidth(s:conf.Symbols.IA)]),
\ "IM": strwidth(s:conf.Symbols.IM),
\ "Dots": strwidth(s:conf.Symbols.Dots)
\ }
endfunction
call s:init()
function! ctrlspace#context#PluginFolder()
if !exists("s:pluginFolder")
let s:pluginFolder = fnamemodify(resolve(expand('<sfile>:p')), ':h:h')
endif
return s:pluginFolder
endfunction
function! ctrlspace#context#Separator()
return "|CS_###_CS|"
endfunction
function! ctrlspace#context#PluginBuffer()
return s:pluginBuffer
endfunction
function! ctrlspace#context#SetPluginBuffer(value)
let s:pluginBuffer = a:value
return s:pluginBuffer
endfunction
function! ctrlspace#context#SymbolSizes()
return s:symbolSizes
endfunction
function! ctrlspace#context#Configuration()
return s:conf
endfunction