2019-12-15 vim

vim常用命令

  1. 全選(高亮顯示):按esc后,然后ggvG或者ggVG
  2. 全部復制:按esc后,然后ggyG
  3. 全部刪除:按esc后,然后dG
  4. 粘貼:插入模式下,ctrl+shift+v(wsl開啟ctrl+shift+c/v復制粘貼模式)
    # /etc/apt/sources.list
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup # 復制一份備份
    sudo vim /etc/apt/sources.list
    # 在第一行的第一個位置,按esc,輸入dG,全選刪除
    # 因為在wsl中開啟了ctrl+shift+c/v復制粘貼模式,所以可以直接ctrl+c復制下邊的字符,在終端vim中按i進入插入模式,再按ctrl+shift+v粘貼
    #阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

    # 按esc,:wq,寫入保存
    sudo apt-get update # 更新源
    sudo apt-get install package # 安裝包
    sudo apt-get remove package # 刪除包
    sudo apt-cache search package # 搜索軟件包
    sudo apt-cache show package  # 獲取包的相關信息,如說明、大小、版本等
    sudo apt-get install package --reinstall  # 重新安裝包
    sudo apt-get -f install  # 修復安裝
    sudo apt-get remove package --purge # 刪除包,包括配置文件等
    sudo apt-get build-dep package # 安裝相關的編譯環境
    sudo apt-get upgrade # 更新已安裝的包
    sudo apt-get dist-upgrade # 升級系統
    sudo apt-cache depends package # 了解使用該包依賴那些包
    sudo apt-cache rdepends package # 查看該包被哪些包依賴
    sudo apt-get source package  # 下載該包的源代碼
    sudo apt-get clean && sudo apt-get autoclean # 清理無用的包
    sudo apt-get check # 檢查是否有損壞的依賴
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。