なぜ Android Studio のコピーは使いづらいのか? - 「常にプレーンテキストでコピーする」設定方法

Android Studio でテキストをコピーすると、コードの色やフォントなどの装飾(リッチテキスト)が一緒についてきます。

一見便利に見えますが、Slack やドキュメントに貼り付けたとき、意図せずスタイルが保持されてしまい、かえって見づらくなります。

特に、コードをブログやチャットに共有する場合、「ただのテキストとして貼りたいだけなのに……」という不満が出やすいです。

この問題は、標準のコピー操作(Cmd+C / Ctrl+C)がリッチテキスト形式を優先していることに起因しています。

 

🤔「常にプレーンテキストでコピーする」設定方法

この挙動は設定から変更可能です。Android Studio の Preferences(または Settings)を開いて、次の手順で設定を変えましょう:

1. メニューから Editor → General → Smart Keys に移動

2.「Copy as rich text」のチェックを外す

これで、今後 Cmd+C / Ctrl+C を押した際にも、余計な装飾を含まないプレーンテキストとしてコピーされるようになります。

特別なショートカットを使わなくても、普段通りの操作でコードだけをきれいにコピーできるので、ストレスが激減します。

 

🤔 コード共有の効率を上げるために

この設定変更は、日常的にコードを共有する開発者にとって大きなメリットになります。

Markdown に貼るとき、Google ドキュメントや Notion に記録するとき、いちいち「Copy as Plain Text」を選ぶ必要がなくなるため、作業効率が向上します。

また、受け取った側も余計なスタイルに惑わされず、コードそのものを読みやすくなります。

Android Studio はデフォルトで「見た目のきれいさ」を重視しますが、実際の開発現場では「シンプルで確実な共有」が求められる場面も多いです。

このような小さな設定変更が、日々の開発体験を大きく快適にしてくれます。

 

🤔 まとめ:小さな設定で大きな快適さを

Android Studio のコピー動作は、初期設定のままだと意図しないリッチテキスト形式でのコピーとなり、共有時に不便を感じがちです。

しかし、「Copy as rich text」のチェックを外すだけで、常にプレーンテキストとしてコピーできるようになり、

コード共有が格段にスムーズになります。

日々のちょっとしたストレスを減らし、開発に集中するためにも、ぜひ一度この設定を見直してみてください。


【Fixed】Android Studio startup crashes on macOS 15.4 Sequoia

一時的な対応してたので気になっていました。

👉 Mac OS Sequoia 15.4 で Android Studio を含む IDEA系 IDE が起動できないとかクラッシュの件

今の最新版で修正されてるって。

it still crashes on startup on my device. It happened after I modified the macOS keyboard shortcuts.

it most likely happening after modifying macOS shortcuts

Apr 17, 2025 12:41PM

Marked as fixed.

The fix going to be included into next Android Studio releases
- Meerkat.1 Patch 2
- Meerkat.2 RC3
- Narwahl.1 Canary7

Startup crashes on macOS 15.4 [408836786] - Issue Tracker
https://issuetracker.google.com/issues/408836786?pli=1

cannot open Android ,it Boom [411163934] - Issue Tracker
https://issuetracker.google.com/issues/411163934


【curl】 Note: Unnecessary use of -X or --request, POST is already inferred.


❯ curl -X POST "https://httpbin.org/post" -H "accept: application/json"


Note: Unnecessary use of -X or --request, POST is already inferred.

-d や --data があると自動で POST と判断するので -X POST などは不要だって。


❯ echo '{
  "user_id" : 123,
  "name" : "ワロ田",
  "age" : 14
}' | curl -vs -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json' -d @- https://httpbin.org/post
* Host httpbin.org:443 was resolved.
* IPv6: (none)
* IPv4: 54.152.142.77, 3.224.7.64, 35.172.19.140, 34.238.6.191
*   Trying 54.152.142.77:443...
* Connected to httpbin.org (54.152.142.77) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256 / [blank] / UNDEF
* ALPN: server accepted h2
* Server certificate:
*  subject: CN=httpbin.org
*  start date: Aug 20 00:00:00 2024 GMT
*  expire date: Sep 17 23:59:59 2025 GMT
*  subjectAltName: host "httpbin.org" matched cert's "httpbin.org"
*  issuer: C=US; O=Amazon; CN=Amazon RSA 2048 M02
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://httpbin.org/post
* [HTTP/2] [1] [:method: POST]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: httpbin.org]
* [HTTP/2] [1] [:path: /post]
* [HTTP/2] [1] [user-agent: curl/8.7.1]
* [HTTP/2] [1] [content-type: application/json; charset=UTF-8]
* [HTTP/2] [1] [accept: application/json]
* [HTTP/2] [1] [content-length: 55]
> POST /post HTTP/2
> Host: httpbin.org
> User-Agent: curl/8.7.1
> Content-Type: application/json; charset=UTF-8
> Accept: application/json
> Content-Length: 55
>
* upload completely sent off: 55 bytes
< HTTP/2 200
< date: Sun, 13 Apr 2025 03:08:32 GMT
< content-type: application/json
< content-length: 557
< server: gunicorn/19.9.0
< access-control-allow-origin: *
< access-control-allow-credentials: true
<
{
  "args": {},
  "data": "{  \"user_id\" : 123,  \"name\" : \"\u30ef\u30ed\u7530\",  \"age\" : 14}",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "application/json",
    "Content-Length": "55",
    "Content-Type": "application/json; charset=UTF-8",
    "Host": "httpbin.org",
    "User-Agent": "curl/8.7.1",
    "X-Amzn-Trace-Id": "Root=1-67fb2ab0-3685bdfa4519f20b0d94c818"
  },
  "json": {
    "age": 14,
    "name": "\u30ef\u30ed\u7530",
    "user_id": 123
  },
  "origin": "114.123.123.8",
  "url": "https://httpbin.org/post"
}
* Connection #0 to host httpbin.org left intact


❯ echo '{
  "user_id" : 123,
  "name" : "ワロ田",
  "age" : 14
}' | curl -s -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json' -d @- https://httpbin.org/post | jq
{
  "args": {},
  "data": "{  \"user_id\" : 123,  \"name\" : \"ワロ田\",  \"age\" : 14}",
  "files": {},
  "form": {},
  "headers": {
    "Accept": "application/json",
    "Content-Length": "55",
    "Content-Type": "application/json; charset=UTF-8",
    "Host": "httpbin.org",
    "User-Agent": "curl/8.7.1",
    "X-Amzn-Trace-Id": "Root=1-67fb2b2f-6faa217ece89a13acc5315"
  },
  "json": {
    "age": 14,
    "name": "ワロ田",
    "user_id": 123
  },
  "origin": "114.123.123.81",
  "url": "https://httpbin.org/post"
}

Form からの POST があるので

リクエストヘッダは2つつけたほうが

「JSON の POST ですよ」

とはっきり明示できそうです。

 

🧑🏻‍💻 参考