腾讯云VPS(CVM)重装Debian系统后的基础配置工作

前言

由于 CentOS 即将停止维护, 所以打算将手头的机器从 CentOS 重装到其他 Linux 发行版, 在 Ubuntu 和 Debian 之间纠结了一下, 最后还是决定选择 Debian.

本文记录一下 Debian 重装后的基础配置工作.

换源

因为我用的是腾讯云的 VPS, 所以换成腾讯云得源.

vim /etc/apt/sources.list

写入以下内容

deb https://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb https://mirrors.tencent.com/debian-security/ bullseye-security main
deb-src https://mirrors.tencent.com/debian-security/ bullseye-security main
deb https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib

保存后apt update更新一下即可.

配置 vim

如果系统内没有 vim, 可以apt install vim安装.

进入或创建 vim 配置文件

vim ~/.vimrc

将以下配置写入, 可以根据自己喜好更改.

set nocompatible
set number
syntax on
set cursorline
set ruler
set fileformat=unix
set autoindent
set cindent
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab "缩进用空格来表示
set showmatch "高亮显示匹配的括号
set matchtime=5 "匹配括号高亮的时间(单位是十分之一秒)
set scrolloff=3 "光标移动到buffer的顶部和底部时保持3行距离
set laststatus=2 "启动显示状态行(1), 总是显示状态行(2)
set backspace=2 "使backspace键正常处理indent, eol, start等
set langmenu=zh_CN.UTF-8
set helplang=cn
set ignorecase "搜索忽略大小写
set hlsearch "高亮显示匹配字符(回车后)
set incsearch "搜索实时高亮显示所有匹配的字符
"set autoread "设置当文件被改动时自动载入

"可以在buffer使用鼠标
set mouse=a
set selection=exclusive
set selectmode=mouse,key

由于其他配置腾讯云已经预先解决好了, 无需多费心, 至此已经基本配置完毕, 可以开始正常使用了.

posted @ 2022-03-09 11:12  方清欢  阅读(141)  评论(0编辑  收藏  举报