moe is vim written in nim.
Code analysis
Functions in procedure startUi
(in file src/moepkg/ui.nim), such as initscr
,
cbreak
, etc are mainly defined in
ncurses.nim
from library nim-ncurses.
This dependency is defined in file moe.nimble.
Goto Definition
Install neovim plugin "alaviss/nim.nvim",
then use gd
to go to definition of a function.
Rune
Rune is a Type that can hold a single Unicode code point.
Debugging
# in terminal #1:
sudo apt install gdbserver
nim c --debugger:native src/moe.nim # compile binary in folder 'src'
gdbserver :12345 src/moe
# in terminal #2:
gdb src/moe
(gdb) target remote localhost:12345
Now you can use (interact with application) moe in terminal #1, debug (set breakpoint, step, print variable ...) moe in #2.
Or in terminal #2:
cat << EOF > debug.gdb
target remote localhost:12345
b src/moe.nim:35
b src/moepkg/editorstatus.nim:49
b src/moepkg/normalmode.nim:205
b src/moepkg/normalmode.nim:427
EOF
gdb -x debug.gdb
(gdb) c