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