고급 개발자로 가는 길

OS/Linux

[Linux] vim 에디터 설치

다크엔지니어 2022. 1. 20. 00:56
반응형

보드 초기 셋팅 시 에디터로 쉘 Script 등 여러 Script 를 수정 할 일이 생긴다.

이럴때 vim apt-get 에디터 설치가 안되어있으면, vi, nano 에디터를 사용해야 하며,

키가 basic 상태로 일반 키와 많이 다르다.

물론 basic 상태 hjkl 등을 사용하여 익히는 것도 좋지만, 편리한 방법도 고려해볼 수 있다.

 

아래 명령어를 진행한다.

sudo apt-get update
sudo apt-get install vim

 

아래와 같은 진행이 이루어진다.

Get:1 http://archive.raspberrypi.org/debian buster InRelease [32.6 kB]
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Reading package lists... Done
E: Repository 'http://archive.raspberrypi.org/debian buster InRelease' changed its 'Suite' value from 'testing' to 'oldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
pi@raspberrypi:~ $ sudo apt-get install vim
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  vim-runtime
Suggested packages:
  ctags vim-doc vim-scripts
The following NEW packages will be installed:
  vim vim-runtime
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6780 kB of archives.
After this operation, 32.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf vim-runtime all 2:8.1.0875-5 [5775 kB]
Get:2 http://ftp.kaist.ac.kr/raspbian/raspbian buster/main armhf vim armhf 2:8.1.0875-5 [1005 kB]
Fetched 6780 kB in 14s (468 kB/s)
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "ko_KR.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
Selecting previously unselected package vim-runtime.
(Reading database ... 91789 files and directories currently installed.)
Preparing to unpack .../vim-runtime_2%3a8.1.0875-5_all.deb ...
Adding 'diversion of /usr/share/vim/vim81/doc/help.txt to /usr/share/vim/vim81/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim81/doc/tags to /usr/share/vim/vim81/doc/tags.vim-tiny by vim-runtime'
Unpacking vim-runtime (2:8.1.0875-5) ...
Selecting previously unselected package vim.
Preparing to unpack .../vim_2%3a8.1.0875-5_armhf.deb ...
Unpacking vim (2:8.1.0875-5) ...
Setting up vim-runtime (2:8.1.0875-5) ...
Setting up vim (2:8.1.0875-5) ...
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
Processing triggers for man-db (2.8.5-2) ...

 

아래와 같이 진입해보면 i 후 일반 타이핑으로 입력이 되는것을 확인 할 수 있다.

vi .bashrc

 

반응형