转向vscode的声明

工欲善其事必先利其器。

发现了linux命令行在编写代码时候的不方便了。具体不方便之处在于:

  • 列出包含关键词的文件操作:快捷操作,用于在当前目录及其子目录下递归搜索指定的关键词,并仅在 .c.h 文件中查找

    alias g='grep -nr --include="*.c" --include="*.h" '
    
  • vim打开文件的特定行

    vim +N file
    
  • tree命令选项

    #只看目录,不看文件
    -d     List directories only.
    -x     Stay on the current file-system only.
    -L level Max display depth of the directory tree.
    # 例如只看nemu/src目录下的文件
    tree -x nemu/src/
    
    
  • vim的操作

最终,直接舍弃vim操作。转向用vscode连接虚拟机开发。配置ssh密钥:

  1. 在本地计算机上生成SSH密钥对

    ssh-keygen -t rsa -b 4096
    
  2. 将公钥复制到 Ubuntu 虚拟机

    echo "your_public_key" >> ~/.ssh/authorized_keys
    
  3. 验证SSH密钥登陆

    ssh user@<Ubuntu_IP_address>
    

vscode确实用着更顺手一点。

posted @ 2024-11-12 11:07  上山砍大树  阅读(58)  评论(0)    收藏  举报