# Setting Up Midnight Commander Double-Click to Open Files


`Midnight Commander` (`mc`) is a terminal dual-pane file manager. By default, double-clicking or pressing Enter on a file may not open it the way you expect, especially for text files. Here we change it to open files with your preferred editor.

## 1. Copy Configuration File

First, we need to copy the system default `mc` extension configuration file (`mc.ext.ini`) to the user's personal configuration directory. This ensures our modifications only affect the current user and won't be overwritten during system updates.

Open terminal and execute the following commands:

```bash
mkdir -p ~/.config/mc
cp /etc/mc/mc.ext.ini ~/.config/mc/mc.ext.ini
```

## 2. Modify Configuration File

Next, we need to edit the configuration file we just copied: `~/.config/mc/mc.ext.ini`. You can use any text editor you prefer, such as `vim` or `nano`.

```bash
vim ~/.config/mc/mc.ext.ini
```

In this file, you need to find the `[Default]` configuration section. This section defines default operations for file types that don't match specific rules. Find the `Open=` line and modify it to:

```ini
# ... file header content ...

[Default]
# ... other default settings ...
Open=%var{EDITOR:vi} %f
# ... rest of file content ...
```


---

> Author: Nite  
> URL: https://www.nite07.com/en/posts/mc-double-click/  

