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