2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

最低限vimを使えるようにする

Posted at

コマンド

今回使用するコマンドの概要です

コマンド できること
mkdir ディレクトリを作成
cd ディレクトリを移動
touch 新規ファイルを作成
vim ファイルの編集
cat ファイルの中身を確認
mkdir docker
cd docker
touch dockerfile

vim dockerfile

上記でvimが起動したら、iキーを押下。
ファイルがINSERT状態になるので、何かしらコードやコメントなどを入力

今回はサンプルとして以下のコードをコピペしています。

FROM python:3.9

WORKDIR /app

RUN apt-get update && \
    apt-get upgrade -y
RUN pip install --upgrade pip
RUN pip install --upgrade setuptools
RUN pip install --upgrade wheel
RUN pip install gradio

編集が終わったら、escキーを押下。
ファイルを保存したい場合は「:wq」を入力する。(普通に終わりたい場合は「:q」)

cat dockerfile

無事に保存できているかは、catコマンドで確認できます。

まとめ

  1. 覚えておきたいLinuxコマンド

    コマンド できること
    mkdir ディレクトリを作成
    cd ディレクトリを移動
    touch 新規ファイルを作成
    vim ファイルの編集
    cat ファイルの中身を確認
  2. vimが起動した後の手順

    1. [i]キーでinsertモードに移る
    2. 好きなテキストをうったら、[esc]キーでinsertモードを終了
    3. [:wp]で保存してvimを終了
2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?