aboutsummaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/notes/extending-dte-editor.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/content/notes/extending-dte-editor.md b/content/notes/extending-dte-editor.md
new file mode 100644
index 0000000..d23cbc7
--- /dev/null
+++ b/content/notes/extending-dte-editor.md
@@ -0,0 +1,51 @@
1---
2title: "Extending dte editor"
3url: extending-dte-editor.html
4date: 2023-05-31T08:12:45+02:00
5type: notes
6draft: false
7tags: [dte]
8---
9
10[`dte`](https://craigbarnes.gitlab.io/dte/) is an interesting editor I started using
11lately more and more. Since it is using [`execvp()`](https://linux.die.net/man/3/execvp)
12it can be easily extended. I needed comment/uncomment feature so I created a
13small utility that does this for me. Code lives on repository
14[dte extensions](https://git.mitjafelicijan.com/dte-extensions.git/about/)
15but this utilities can be used for whatever you want. Make sure you have
16version 1.11 or above.
17
18Next one will be invoking formatter based on the type of a file.
19
20My config that works for me.
21
22```sh
23set show-line-numbers true;
24set tab-width 4;
25set case-sensitive-search false;
26
27# Special aliases
28alias m_comment 'exec -s -i line -o buffer -e errmsg ~/.dte/bin/comment'
29alias m_format 'save; exec go fmt .; reload'
30alias m_duplicate 'copy;paste';
31
32# Useful aliases.
33alias m_force_close 'quit -f';
34alias m_reload 'close; open $FILE'
35
36# Key bindings.
37bind M-s save;
38bind M-q m_force_close;
39bind M-z refresh;
40bind C-down blkdown;
41bind C-up blkup;
42bind C-_ m_comment;
43bind M-. m_format;
44bind C-d m_duplicate;
45
46# Syntax highlighting.
47hi preproc magenta;
48hi keyword red;
49hi linenumber blue;
50hi comment cyan;
51```