Add ‘New Document’ Option in Right-Click Menu in Ubuntu

New versions of Ubuntu don’t include the option to create a new text document in right-click context menu anymore. Here is how to bring that useful option back.
Warp Terminal

The other day, I was trying to create a new text file in Ubuntu.

While in Nautilus, I right-clicked and to my surprise, I didn’t see the option to create a new document. This option in the right-click context menu allowed creating empty text files.

documents tab without empty documents menu
Documents Tab without empty documents Menu

It’s a small inconvenience because I can always use the terminal to create a new document or I could open the text editor and save an empty text file. But I don’t want to do that. I want that good old right-click new document option back.

In this quick tip, I’ll show you how to add the new document option in right-click context menu in Ubuntu.

Doing it in the terminal is a lot easier, but I’ll show you the graphical way of doing it as well.

Enable new document option in Nautilus File Manager in Ubuntu

If you prefer videos, you can see the tutorial steps in action in the video below:

If you go into your Home directory, you’ll see a folder called Templates. Chances are that you probably never used it. But today is your lucky day as you are finally going to utilize this Template directory.

templates folder 1
Templates Folder

This Template directory is used to create … templates. What I mean is that the documents saved in this special folder will be available in the right-click menu.

For example, if you write letters regularly, you can put a sample letter file in this folder. Now if you right-click in any other folder, you’ll see the option of creating ‘Letter’ in the menu. You select that and you’ll have that saved sample letter in the new location. You can edit it and save it with a new name. It’ll save you some of your precious time for sure.

📋
Some readers have noted that their Templates directory is hidden and named as .Templates. If you don’t see the Templates directory in your home directory, try to see the hidden files with Ctrl+H keyboard shortcut or ls -la command in the terminal and see if it is named .Templates.

Now, we are going to use this feature of Templates directory here. I’ll show the command line option first.

Method 1: Command line way

Open a terminal and use the following commands:

touch ~/Templates/Empty\ Document

This will create a new empty file named ‘Empty Document’ in your Templates directory. And now, when you right-click in the file manager, you’ll see the New Document option.

documents tab with empty document menu
New document option added to right-click context menu

Method 2: The GUI way

If you are not comfortable with the terminal and commands, no worries. I have got your back here.

Press Super/Windows key and search for the text editor. And open the editor.

text editor from search
Text editor from search

Now, all you have to do is to save this empty file in the Templates directory. You can give it any relevant name.

save empty document in template
Save empty document in Template Folder

You should see it in the Templates directory.

empty document in templates folder
Empty Document in Templates Folder

Now, when you right-click on any directory, you’ll see the option to create a new document in Nautilus.

documents tab with empty document menu 2
Nautilus with empty document menu

Bonus Tip: Add a variety of files for quick creation

Similarly, you can add more variety of files in the Templates directory to access them quickly from the right-click context menu.

more new items
More New Templates

Troubleshooting tips: Templates directory was deleted

If you deleted the Templates directory and want to use the right-click feature to create a new document, here's what you can do.

You should create a new Templates directory.

But it will not work just yet. In the ~/.config/user-dirs.dirs file, make sure you have a line like this:

XDG_TEMPLATES_DIR="$HOME/Templates"

Since you had deleted the Templates directory, XDG_TEMPLATES_DIR entry was probably removed from the file at some point. You have to put it back again.

Save the changes and reboot. Now you should be able to use the feature of Templates directory again.

If you are using Ubuntu in a language other than English, you should use the equivalent term in your locale.

Conclusion

I wonder why Nautilus removed the option to create new documents from the right-click context menu. It’s a useful feature and should be present by default. What do you think?

Since we are discussing templates, maybe you would want to use templates in LibreOffice to reuse certain types of documents.

How to Create Templates in LibreOffice
Creating a template in LibreOffice can save you some time for the documents that you use often. Learn how to create new templates in LibreOffice.
About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.