summaryrefslogtreecommitdiff
path: root/ted.cfg
blob: 3b6909b9d86ac973dc28f2374820f5f858e075ea (plain)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
%include themes/classic.ted.cfg

[core]
tab-width = 4
indent-with-spaces = off
# cursor width in pixels
cursor-width = 1
# time to blink cursor for (i.e. it will be on for cursor-blink-time-on seconds, then off for cursor-blink-time-off seconds)
# set -off to 0 to disable blinking
cursor-blink-time-on = 0.5
cursor-blink-time-off = 0.3
# amount of scroll "padding" (minimum number of lines below the cursor will the bottom of the screen be)
scrolloff = 5
# if you do a bunch of typing, then undo, it will generally
# undo the past this many seconds of editing.
undo-save-time = 6
text-size = 18
border-thickness = 1
max-menu-width = 600
padding = 6
error-display-time = 10
auto-indent = on
# automatically add a newline at the end of the file on save
auto-add-newline = on
syntax-highlighting = on
line-numbers = on
# if set to "on", when a file is changed by another program, it will be reloaded by ted without asking you.
auto-reload = on
# automatically reload config when saved
auto-reload-config = on
# default build command to use if Cargo.toml/Makefile/etc. is not found
build-default-command = make
# if this is non-empty, it will be used as the build command, even if Cargo.toml/Makefile/etc. exists.
# very useful with path-specific settings, e.g. use
#  [/my/fav/project//core]
#  build-command = "supermake --treble-clef -rxvt"
build-command = ""
# whether or not to jump to the first build error when the build completes.
jump-to-build-error = yes
# restore previously opened files when ted is launched?
restore-session = on
# show autocomplete menu when a trigger character (e.g. '.') is typed (LSP only)
trigger-characters = on
# should all identifier characters (e.g. a-z) be treated as trigger characters?
identifier-trigger-characters = off
# display "phantom completions"? (if there is only one completion, display it next to the cursor)
phantom-completions = on
# enable LSP support (for autocompletion, etc.)
# you can also set `lsp = ""` but this is a quick way to disable LSP servers for all langauges
lsp-enabled = yes
# enable this to log all messages between ted and the LSP server
# (may require restarting ted to update)
# the log file is in the same folder as ted.cfg.
lsp-log = off
# display function signature help? (only with LSP running)
# this is the thing at the bottom of ted which shows the parameters to the function you're calling
signature-help-enabled = yes
# display hover info when the F1 key is pressed? (only with LSP running)
hover-enabled = yes
# key used to show hover info
hover-key = F1
# if this is set to x, then hover info will be displayed without F1 key after x seconds (with LSP running)
hover-time = 1e10
# highlight instances of the variable under the cursor when the F2 key is pressed? (only with LSP running)
highlight-enabled = yes
# key used to highlight variable under cursor
highlight-key = F2
# don't require F2 key for highlighting
highlight-auto = no
# maximum editable file size.
# ted will set the buffer to view-only if a file larger than this is loaded.
# NOTE: ted is not really meant for absolutely massive files.
#       it should handle anything up to 100,000 lines just fine (maybe small hiccups in some cases for >20,000)
#       files up to 1,000,000 lines should be just fine in view-only mode (although they might take a bit of time to load)
max-file-size = 20000000
# absolute maximum file size.
# ted will produce an error if a file larger than this is loaded.
max-file-size-view-only = 100000000
# how much ctrl+scroll wheel changes the text size (0 for no change, negative to invert change)
ctrl-scroll-adjust-text-size = 1.0

# whether to use vsync or not. you probably want this on.
vsync = on
# max framerate. vsync overrides this.
# you might want to increase this if you have a >60Hz monitor and you don't care about CPU usage.
framerate-cap = 60

# search depth for files to generate tags for.
# if set to 0, tag generation/regeneration will do nothing
tags-max-depth = 2
# regenerate tags if an identifier is not found (with Ctrl+click)?
regenerate-tags-if-not-found = yes
# this variable determines how ted finds the "root directory" of a project for
# running build commands and because LSP servers need to know
# FOR EXAMPLE:  If you have the file /a/b/c/d.txt open,
#               ted will check each of the directories /, /a, /a/b, /a/b/c
#               and set the root to whichever one has one of these files,
#               breaking ties by order of appearance in the list below.
#               So if /a/b/.git and /a/Makefile and /a/b/c/Cargo.toml exist,
#               ted will select /a/b as the root.
# if no identifying files are found, the directory containing the current file is used.
root-identifiers = .ted-root, .ted-root.out, Cargo.toml, make.bat, CMakeLists.txt, Makefile, go.mod, .git

# whether or not to save a backup copy of files before
# writing to the file (prevents loss of data if power goes out mid-write or something).
# the backups are deleted immediately after writing.
save-backup = yes
# whether to default to \r\n line endings.
# this setting is ignored on non-Windows operating system.
crlf-windows = no

# you can make your own custom background for ted using a shader.
# an example is provided here. you will have access to the following variables:
#     t_pos - screen position of fragment (0,0) to (1,1)
#     t_aspect - (window_width / window_height, 1)
#     t_time - current time in seconds, modulo 3600
#     t_save_time - time since last save, in seconds.
#     t_texture - a texture, made with your choice of image
# if you want your shader supported no matter what, only use stuff from GLSL version 110.
#  on non-ancient computers, you should be able to use GLSL version 130.
# bg-shader = "void main() {
# 	vec2 p = t_pos * t_aspect;
# 	float r = pow(sin(p.x * 100.0 + t_time * 3.0), 60.0);
# 	float g = pow(sin(p.y * 100.0 + t_time * 6.0), 60.0);
# 	vec4 color = vec4(r, g, 1.0 - t_save_time, 0.2);
# 	gl_FragColor = clamp(color, 0.0, 1.0);
# }"
# here's an example using a texture:
# bg-texture = "/path/to/my/cool/picture.jpg" (or .png, .gif, .bmp)
# bg-shader = "void main() { gl_FragColor = texture2D(t_texture, t_pos) * vec4(1.0,1.0,1.0,0.2); }"

[C.core]
lsp = "clangd --log=error"
comment-start = "// "

[C++.core]
lsp = "clangd --log=error"
comment-start = "// "

[Go.core]
lsp = "gopls"
comment-start = "// "

[Java.core]
lsp = "jdtls"
# by default, jdtls doesn't give signature help
lsp-configuration = `{
	"java": {
		"signatureHelp": {
			"enabled": true
		}
	}
}`
comment-start = "// "

[JavaScript.core]
lsp = "typescript-language-server --stdio"
comment-start = "// "

[TypeScript.core]
lsp = "typescript-language-server --stdio"
comment-start = "// "

[JSON.core]
comment-start = "// "

[GLSL.core]
comment-start = "// "

[Python.core]
lsp = "pylsp"
comment-start = "# "

[Rust.core]
lsp = "rust-analyzer"
comment-start = "// "

[Tex.core]
lsp = "texlab"
comment-start = "% "

[HTML.core]
comment-start = "<!-- "
comment-end = " -->"

[XML.core]
comment-start = "<!-- "
comment-end = " -->"

[CSS.core]
comment-start = "/* "
comment-end = " */"

# phantom completions are just annoying if you're not actually programming
[Markdown.core]
phantom-completions = off
[TedCfg.core]
phantom-completions = off
comment-start = "# "
[Config.core]
phantom-completions = off
comment-start = "# "
[Text.core]
phantom-completions = off

[keyboard]
# motion and selection
Left = :left
Shift+Left = :select-left
Ctrl+Left = :left-word
Ctrl+Shift+Left = :select-left-word
Right = :right
Shift+Right = :select-right
Ctrl+Right = :right-word
Ctrl+Shift+Right = :select-right-word
Up = :up
Shift+Up = :select-up
Down = :down
Shift+Down = :select-down
Ctrl+Up = :up-blank-line
Ctrl+Shift+Up = :select-up-blank-line
Ctrl+Down = :down-blank-line
Ctrl+Shift+Down = :select-down-blank-line
Home = :start-of-line
Shift+Home = :select-start-of-line
Ctrl+Home = :start-of-file
Ctrl+Shift+Home = :select-start-of-file
End = :end-of-line
Shift+End = :select-end-of-line
Ctrl+End = :end-of-file
Ctrl+Shift+End = :select-end-of-file
Ctrl+a = :select-all
# go to previous cursor position
Ctrl+p = :previous-position
# move cursor to matching bracket
Ctrl+Shift+5 = :matching-bracket
# Ctrl+Shift+d = :clear-selection

# insertion
Tab = :tab
Shift+Tab = :backtab
Enter = :newline
# same as :newline for normal text insertion, but goes to the previous search result instead of the next one for find+replace
Shift+Enter = :newline-back
Keypad Enter = :newline
Shift+Keypad Enter = :newline-back
# toggle selection between commented/uncommented
Ctrl+/ = :comment-selection

# deletion
Delete = :delete
Shift+Delete = :delete
Ctrl+Delete = :delete-word
Ctrl+Shift+Delete = :delete-word
Backspace = :backspace
Shift+Backspace = :backspace
Ctrl+Backspace = :backspace-word
Ctrl+Shift+Backspace = :backspace-word

# scrolling
PageUp = :page-up
PageDown = :page-down
Shift+PageUp = :select-page-up
Shift+PageDown = :select-page-down

Ctrl+o = :open
Ctrl+n = :new
Ctrl+s = :save
Ctrl+Alt+Shift+s = :save-all
Ctrl+Shift+s = :save-as
Ctrl+q = :quit
# reload all buffers from their files.
# this doesn't affect buffers with unsaved changes.
Ctrl+Shift+r = :reload-all

# You can do something like this:
# Ctrl+Alt+t = 3 :set-language
# to set the language of the current buffer to Rust, for example. This might be useful if
# one file extension could be multiple different languages.
# Here are the numbers corresponding to each language we have syntax highlighting for:
#  0 Plain text (no syntax highlighting)
#  1 C
#  2 C++
#  3 Rust
#  4 Python
#  5 TeX
#  6 Markdown
#  7 HTML
#  8 Config
#  9 JavaScript
# 10 Java
# 11 Go
# 12 ted.cfg
# 13 TypeScript
# 14 JSON
# 15 XML
# 16 GLSL
# -1 Guess from the file extension (default)

# IDE features
Ctrl+Space = :autocomplete
# go to previous completion
Ctrl+Shift+Space = :autocomplete-back
Ctrl+u = :find-usages

Ctrl+z = :undo
Ctrl+Shift+z = :redo
Ctrl+f = :find
Ctrl+Shift+f = :find-replace
Ctrl+c = :copy
Ctrl+x = :cut
Ctrl+v = :paste
Ctrl+Shift+p = :command-selector

Ctrl+9 = :decrement-number
Ctrl+0 = :increment-number

# tabs
Ctrl+w = :tab-close
Ctrl+PageUp = :tab-prev
Ctrl+PageDown = :tab-next
Ctrl+Shift+PageUp = :tab-move-left
Ctrl+Shift+PageDown = :tab-move-right
Alt+1 = 0 :tab-switch
Alt+2 = 1 :tab-switch
Alt+3 = 2 :tab-switch
Alt+4 = 3 :tab-switch
Alt+5 = 4 :tab-switch
Alt+6 = 5 :tab-switch
Alt+7 = 6 :tab-switch
Alt+8 = 7 :tab-switch
Alt+9 = 8 :tab-switch
Alt+0 = 9 :tab-switch
# (for if you have those fancy extra buttons on your mouse)
X1 = :tab-prev
X2 = :tab-next

Ctrl+Equals = 3 :increase-text-size
Ctrl+- = 3 :decrease-text-size

Ctrl+Alt+Shift+v = :view-only

F4 = :build
Ctrl+[ = :build-prev-error
Ctrl+] = :build-next-error
# Ctrl+Shift+1 applies to QWERTY keyboards (and others), Ctrl+! for AZERTY (and others)
Ctrl+Shift+1 = :shell
Ctrl+! = :shell

Ctrl+t = :generate-tags

Ctrl+d = :goto-definition
# alternative to ctrl+click
Ctrl+' = :goto-definition-at-cursor
# alternative to ctrl+shift+click
Ctrl+Shift+' = :goto-declaration-at-cursor
# alternative to ctrl+alt+click
Ctrl+Alt+' = :goto-type-definition-at-cursor
Ctrl+g = :goto-line

Ctrl+\ = :split-horizontal
Ctrl+Shift+\ = :split-vertical
# unsplit
Ctrl+j = :split-join
# switch to the other side of a split
Ctrl+tab = :split-switch
# swap sides of a split
Ctrl+Shift+tab = :split-swap

Escape = :escape

# keyboard macros
Ctrl+F1 = 1 :macro-record
Ctrl+F2 = 2 :macro-record
Ctrl+F3 = 3 :macro-record
Ctrl+F4 = 4 :macro-record
Ctrl+F5 = 5 :macro-record
Ctrl+F6 = 6 :macro-record
Ctrl+F7 = 7 :macro-record
Ctrl+F8 = 8 :macro-record
Ctrl+F9 = 9 :macro-record
Ctrl+F10 = 10 :macro-record
Ctrl+F11 = 11 :macro-record
Ctrl+F12 = 12 :macro-record

Shift+F1 = 1 :macro-execute
Shift+F2 = 2 :macro-execute
Shift+F3 = 3 :macro-execute
Shift+F4 = 4 :macro-execute
Shift+F5 = 5 :macro-execute
Shift+F6 = 6 :macro-execute
Shift+F7 = 7 :macro-execute
Shift+F8 = 8 :macro-execute
Shift+F9 = 9 :macro-execute
Shift+F10 = 10 :macro-execute
Shift+F11 = 11 :macro-execute
Shift+F12 = 12 :macro-execute

[extensions]
# text is the default if the extension doesn't match any of the ones below
Text = .txt
C = .c, .h
C++ = .cpp, .hpp, .C, .H, .cxx, .hxx, .cc, .hh
Rust = .rs
Python = .py
Tex = .tex
Markdown = .md
GLSL = .glsl, .tesc, .tese, .vert, .frag, .geom, .comp
HTML = .html, .php, .xhtml
XML = .xml, .iml
Config = .cfg, .toml
# ted.cfg has its own syntax highlighting
TedCfg = ted.cfg
JavaScript = .js
TypeScript = .ts
JSON = .json
Java = .java
Go = .go
CSS = .css

# You can add language-specific settings like this:
# [HTML.core]
# tab-width = 2

# Or path-specific settings like this:
# [/path/to/special/project//colors]
# keyword = #f0f

# Or both!
# [/path/to/special/project//Javascript.keyboard]
# Ctrl+J = "function() {" :insert-text