forked from Binocular222/Sublime-Text-3-Full-Documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.SublimeTableEditor.txt
184 lines (157 loc) · 15 KB
/
Package.SublimeTableEditor.txt
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
For first time you should enable table editor with command palette:
click ctrl+shift+p
select Table Editor: Enable for current syntax or Table Editor: Enable for current view or "Table Editor: Set table syntax ... for current view"
Then when Table Editor is enabled, type
| Name | Phone |
|-
Then press Tab key, you will get pretty printed table
For make table a bit faster faster type only
|Name|Phone
And then click ctrl+k,enter.
Table Editor support double hline with character '='. Type bellow
| Name | Phone |
|=
Then press Tab key
Then fill rows and click ctrl+k,enter each time when cursor in Phone position
Convert CSV into table
Select some text with CSV data
Name,Age
Anna,20
Alexander,27
and then click ctrl+k, | to convert CSV data into table, you will get
| Name | Age |
| Anna | 20 |
| Alexander | 27 |
This command automatically recognize CSV dialect, for example you can enter data separated by tab
Settings
http://docs.sublimetext.info/en/latest/customization/settings.html
{
"enable_table_editor": true //By default Table Editor is disabled. For enable Table Editor you have to set
"table_editor_syntax": "Auto" // Set table syntax for Table Editor. Valid options are: "Auto", "Simple", "EmacsOrgMode", "Pandoc", "MultiMarkdown", "reStructuredText", "Textile"
"table_editor_border_style": "simple" // Override border style for Table Editor Valid options are: "simple", "grid", "emacs"
"table_editor_custom_column_alignment": false // If true, supports '<', '>', '#' column alignment (Left-Right-Center)
"table_editor_align_number_right": false //By default a number column aligns to right, if you do not like this you can disable it
"table_editor_detect_header": false //By default a header column aligns to center, if you do not like this you can disable it
"table_editor_keep_space_left": true
"table_editor_intelligent_formatting":false //only for textiles and multimarkdown tables. It is true by default for textile syntax
}
Keybinding
ctrl+shift+a ≡ Re-align the table without change the current table field. Move cursor to begin of the current table field.
tab ≡ Re-align the table, move to the next field. Creates a new row if necessary.
shift+tab ≡ Re-align, move to previous field.
enter ≡ Re-align the table and move down to next row. Creates a new row if necessary. At the beginning or end of a line, enter still does new line.
alt+left ≡ Move the current column left.
alt+right ≡ Move the current column right.
alt+shift+left ≡ Kill the current column.
alt+shift+right ≡ Insert a new column to the left of the cursor position.
alt+shift+up ≡ Kill the current row or horizontal line.
alt+shift+down ≡ Insert a new row above the current row.
alt+up ≡ Move current row up
alt+down ≡ Move current row down
ctrl+k, - ≡ Insert single horizontal line below current row. Doesn't make sense and doesn't supported for Textile syntax
ctrl+k, = ≡ Insert double horizontal line below current row. Doesn't make sense and doesn't supported for Textile syntaxes
ctrl+k, enter ≡ Insert a horizontal line below current row, and move the cursor into the row below that line. Doesn't make sense and doesn't supported for Textile syntaxes
ctrl+k, | ≡ Convert selected CSV region into table
alt+enter ≡ Split rest of cell down from current cursor position, insert new line bellow if current row is last row in the table or if next line is hline
ctrl+j ≡ Join current row and next row into one if next row is not hline
Supported Syntaxes
Simple
EmacsOrgMode
Pandoc
Multi Markdown
reStructuredText
Textile
* "table_editor_style" : "simple"
* "table_editor_style" : "emacs"
* "table_editor_style" : "grid"
Simple Style
|-----------|-----|-----------|
| Name | Age | Phone |
|===========|=====|===========|
| Anna | 32 | 123456789 |
|-----------|-----|-----------|
| Alexander | 28 | 987654321 |
|-----------|-----|-----------|
EmacsOrgMode
| Name | Age |
|-----------+-----|
| Anna | 20 |
| Alexander | 27 |
Pandoc Grid Tables
+-----------+-----+
| Name | Age |
+===========+=====+
| Anna | 20 |
+-----------+-----+
| Alexander | 27 |
+-----------+-----+
Multi Markdown/Pandoc Pipe tables
Alignment:
| Name | Phone | Age Column |
| :-------- | :---: | ---------: |
| Anna | 12 | 20 |
| Alexander | 13 | 27 |
| Right | Left | Default | Center |
| ----: | :--- | ------- | :----: |
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
Colspan(alpha status):
| | Grouping ||
| First Header | Second Header | Third Header |
| ------------ | :-----------: | -----------: |
| Content | *Long Cell* ||
| Content | **Cell** | Cell |
| New section | More | Data |
| And more | And more | |
| :---------------------------------------: |||
RestructuredText
| Name | Age |
+-----------+-----+
| Anna | 20 |
| Alexander | 27 |
Textile
Alignment:
|_. Name |_. Age |_. Custom Alignment Demo |
| Anna | 20 |<. left |
| Alexander | 27 |>. right |
| Misha | 42 |=. center |
| | | |
Colspan(alpha status):
|\2. spans two cols |
| col 1 | col 2 |
Rowspan(alpha status):
|/3. spans 3 rows | a |
| b |
| c |
Compound Textile table cell specifiers:
|_\2. spans two cols |
|_<. col 1 |_>. col 2 |
Note: Formatting and work with textile tables with colspan and rowspan has alpha status.
Emacs Style
|-----------+-----+-----------|
| Name | Age | Phone |
|===========+=====+===========|
| Anna | 32 | 123456789 |
|-----------+-----+-----------|
| Alexander | 28 | 987654321 |
|-----------+-----+-----------|
Grid Style
+-----------+-----+-----------+
| Name | Age | Phone |
+===========+=====+===========+
| Anna | 32 | 123456789 |
+-----------+-----+-----------+
| Alexander | 28 | 987654321 |
+-----------+-----+-----------+
| Name | Phone | Age | Position |
|-----------|------------------------|-----|----------------------------------|
| Anna | 123456789 | 32 | Senior Software Engineer_ |
| Alexander | 987654321 | 28 | Senior Software Testing Engineer |
| Max | 1242345345433242321321 | | |
|-----------|------------------------|-----|----------------------------------|
| Right | Left | Default | Center |
| ----: | :--- | ------- | :----: |
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |