How to enable syntax highlighting and auto-completion for NS-3 in Doom Emacs?

gcgbarbosa

George C. G. Barbosa

Posted on August 22, 2022

How to enable syntax highlighting and auto-completion for NS-3 in Doom Emacs?

If doom is your favorite editor and you want to work on ns-3 with doom then follow these steps:

  • Have doom emacs and ns-3 installed.

  • Make sure your init.el file has cc with lsp enabled:

(cc +lsp)

Enter fullscreen mode Exit fullscreen mode
  • You will need to generate a file called compile_commands.json.

  • Depending on your version of ns-3 you might use waf or cmake for that.

  • on cmake, add the following to your cmake compilation command:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ...

Enter fullscreen mode Exit fullscreen mode
  • on waf, the document is automatically generated inside the build folder.

  • Move the compile_commands.json file to the root of your ns3 folder.

  • Enjoy your autocompletion:

2022-08-14-18:33:27.png

  • You can use g d to jump to the definition of an identifier.
💖 💪 🙅 🚩
gcgbarbosa
George C. G. Barbosa

Posted on August 22, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related