美文网首页
2019-12-15 vim

2019-12-15 vim

作者: Ztry | 来源:发表于2019-12-26 16:47 被阅读0次

    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 # 检查是否有损坏的依赖
    

    相关文章

      网友评论

          本文标题:2019-12-15 vim

          本文链接:https://www.haomeiwen.com/subject/mzvknctx.html