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