CentOS Stream 9: Vim Text Editor

step-1

Initial Settings

There are many cases to use text editor on CUI terminal, so it's more convenient to install editors with advanced features like Vim.

Step [1] Install Vim on this example.


[root@bizantum ~]# dnf -y install vim-enhanced

Step [2] Set command alias for your own environment.


[root@bizantum ~]# vi ~/.bashrc
# add alias to the end
alias vi='vim'
# apply changes
[root@bizantum ~]# source ~/.bashrc

Step [3] Configure Vim for each user environment. You may want to select and apply each parameter according to your own preferences. If you like to applly settings to all users as the system wide, add the settings in [/etc/vimrc].


[root@bizantum ~]# vi ~/.vimrc
" use extended function of vim
" it is no compatible with vi
set nocompatible

" specify character encoding
set encoding=utf-8

" specify file encoding
set fileencodings=utf-8

" specify file formats
set fileformats=unix,dos

" take backup
" opposite is [ set nobackup ]
set backup

" specify backup directory
set backupdir=~/backup

" take 50 search histories
set history=50

" ignore Case
set ignorecase

" distinct Capital if you mix it in search words
set smartcase

" highlights matched words
" opposite is [ set nohlsearch ]
set hlsearch

" use incremental search
" opposite is [ set noincsearch ]
set incsearch

" show line number
" opposite is [ set nonumber ]
set number

" visualize break ( $ ) or tab ( ^I )
set list

" highlights parentheses
set showmatch

" not insert LF at the end of file
set binary noeol

" set auto indent
" opposite is [ noautoindent ]
set autoindent

" show color display
" opposite is [ syntax off ]
syntax on

" change colors for comments if [ syntax on ] is set
highlight Comment ctermfg=LightCyan

" wrap lines
" opposite is [ set nowrap ]
set wrap

Comments

Popular posts from this blog

Debian 12 Bookworm: Install Kubeadm
Introduction In this article, we will explore the what, who, where, when, why, and how of Kubeadm functionality on the Debian 12 Bookworm platform, so let's get started.
Fedora 40 : Mail Server
Introduction This guide covers the installation and configuration of a mail server on Fedora 40. It will help you understand the what, who, where, when, why, and how of setting up a mail server.
Cyber Security: NIST Overview
Overview The National Institute of Standards and Technology (NIST) is a pivotal entity in the United States that plays a crucial role in advancing measurement science, standards, and technology. Understanding NIST’s functions, importance, and impact is vital for various industries and sectors.
Cyber Security: ISO 27001 Overview
Introduction ISO 27001 is an international standard for information security management systems (ISMS). It provides a framework for managing sensitive company information to ensure it remains secure. Understanding ISO 27001 is crucial for organizations aiming to protect their information assets.
AlmaLinux 9: How to Install
Introduction AlmaLinux 9 Server is a free and open-source Linux distribution that provides a stable and secure platform for server environments. It's a popular choice for both enterprise and personal use due to its reliability and robust features. This guide will walk you through the steps to install AlmaLinux 9 Server on your system.
AlmaLinux 9: Overview
Introduction AlmaLinux 9 is a robust, open-source enterprise operating system that serves as a community-driven alternative to CentOS. Designed to deliver stability, performance, and long-term support, AlmaLinux is an excellent choice for servers in diverse environments, from small businesses to large enterprises.