# rosed command saving

I have given the command seeing below $rosed beginner_tutorials CMakeLists.txt I want to add these 2 lines rosbuild_add_executable(talker src/talker.cpp) rosbuild_add_executable(listener src/listener.cpp) I just simply add the line now i don't know how to save the file edit retag close merge delete ## 2 Answers Sort by » oldest newest most voted rosed starts the default editor for your system. You can find out what editor that is by invoking: $ echo \$EDITOR


That is probably vim for you, but maybe it could be emacs or something else. If the result of that call is empty, then on Ubuntu that means vim will be used.

You can google online for how to use that editor, or change the variable in your .bashrc to point to an editor that you prefer (e.g. nano is more self-explaining to novice linux users).

EDIT, with vim, press the Escape button, then write

:wq


The editor should (w)rite and (q)uit then.

more

If you want to change your editor to something (I prefer nano), try:

echo "export EDITOR=nano" >> ~/.bashrc && source ~/.bashrc


When editing with nano, the command to save is control + o. Then exit with control + x. Simple enough!

more