Install Vim on Linux

vim001

Summary

Install Vim on Rocky Linux.Make simple settings.

Vim installation

Why Vim?

An indispensable text editor for backend engineers.

A text editor with extensions derived from vi.

Eclipse and VSC (Visual Studio Code) are also very nice editors.

However, it depends on the GUI environment.It is better to be able to perform simple operations.

Besides, it may look a little cool …

vim

Advanced text editor

An excellent product that allows you to quickly respond to cursor movements by switching modes with key operations.

The difficulty is that training is required until you get used to it.

事前準備
https://www.codese.net/en/git001/

install

vim install command.If you are an administrator, you don’t need “sudo”.

sudo dnf -y install vim-enhanced

start vim

Type “vim” to start vim.To finish, enter “: q” to finish.

vim

Plugin manager

vim can have more useful features by installing useful plugins.

Install the plugin manager “dein”.

Create a directory and move it.

mkdir -p ~/.cache/dein 
cd ~/.cache/dein

dein installation shell script creation

curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh > installer.sh

Run shell

sh ./installer.sh ~/.cache/dein
Advance preparation
Cloning into '/home/codese/.cache/dein/repos/github.com/Shougo/dein.vim'...
remote: Enumerating objects: 60, done.
remote: Counting objects: 100% (60/60), done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 60 (delta 1), reused 22 (delta 0), pack-reused 0
Receiving objects: 100% (60/60), 73.81 KiB | 260.00 KiB/s, done.
Resolving deltas: 100% (1/1), done.
Done.

Please add the following settings for dein to the top of your vimrc (Vim) or init.vim (NeoVim) file:


"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=/home/codese/.cache/dein/repos/github.com/Shougo/dein.vim

" Required:
call dein#begin('/home/codese/.cache/dein')

" Let dein manage dein
" Required:
call dein#add('/home/codese/.cache/dein/repos/github.com/Shougo/dein.vim')

" Add or remove your plugins here like this:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')

" Required:
call dein#end()

" Required:
filetype plugin indent on
syntax enable

" If you want to install not installed plugins on startup.
"if dein#check_install()
"  call dein#install()
"endif

"End dein Scripts-------------------------


nnoremap <silent><C-n> :NERDTreeToggle<CR>

let g:syntastic_python_checkers = ["flake8"]

:set fileencoding=utf-8
:set enc=utf-8
:set tabstop=4

vim settings

Edit the “.vimrc” file to configure Vim.

vim file creation
vim ~/.vimrc

Replace the “codese” below with your username.

vim file edit
"dein Scripts-----------------------------
if &compatible
  set nocompatible               " Be iMproved
endif

" Required:
set runtimepath+=/home/codese/.cache/dein/repos/github.com/Shougo/dein.vim

" Required:
if dein#load_state('/home/codese/.cache/dein')
  call dein#begin('/home/codese/.cache/dein')

  " Let dein manage dein
  " Required:
  call dein#add('/home/codese/.cache/dein/repos/github.com/Shougo/dein.vim')

  " Add or remove your plugins here like this:
  call dein#add('Shougo/neosnippet.vim')
  call dein#add('Shougo/neosnippet-snippets')

  " nerdtree"
  call dein#add('scrooloose/nerdtree')

  " Required:
  call dein#end()
  call dein#save_state()
endif

" Required:
filetype plugin indent on
syntax enable
endif

"End dein Scripts-------------------------

nnoremap <silent><C-n> :NERDTreeToggle<CR>

let g:syntastic_python_checkers = ["flake8"]

:set fileencoding=utf-8
:set enc=utf-8
:set tabstop=4

Please change the editing to your liking.

colorscheme settings

Finally, set the color scheme.

We recommend “molokai”.

Create and move directories

mkdir ~/.vim
cd ~/.vim
mkdir colors

I will clone it from git.

git clone https://github.com/tomasr/molokai

Move the clone file to the clolors directory

mv molokai/colors/molokai.vim ~/.vim/colors/

Edit vim settings

vi ~/.vimrc
Add to “.vimrc”
"colorscheme
colorscheme molokai
syntax on
let g:molokai_original = 1
let g:rehash256 = 1
set background=dark

Reopen the configuration file.

vi ~/.vimrc

good job for today. This completes the Vim installation and configuration.

タイトルとURLをコピーしました