Vim 版本升级(Vim8)

安装步骤 第一步,下载源码 到Vim官方Github仓库下载目前最新的Vim Release版本 wget https://codeload.github.com/vim/vim/tar.gz/v8.2.1258 第二步,解压 $ mv v8.2.1258 vim-v8.2.1258.tar.gz $ tar -xvzf vim-v8.2.1258.tar.gz 第三步,编译安装 $ cd vim-8.2.1258/ $ ./configure --prefix=$HOME/.local --enable-python3interp=yes && make && make install 这里注意一下我们需要用configure配置一下安装的路径,将Vim8安装到自己账户的目录下,避免干扰到系统上的其他用户 --enable-python3interp=yes 添加 python3 支持 在这里可能会遇到 no terminal library found 错误: ...

July 26, 2020 | 1 分钟 | 350 字 | Tianlun Song

Windows 开机自启VMware虚拟机

由于进行Linux下软件开发,需要频繁使用 VMware 虚拟机,为提高效率找到一种开机启动启动 VMware 虚拟机的方法,可以大大提升效率。 第一步,编写脚本 首先编写 自启 脚本 vm_start.bat ,内容如下: ...

July 22, 2020 | 2 分钟 | 507 字 | Tianlun Song

VIM 创建程序文件自动添加头部注释

修改 /etc/vimrc ,在文件最后添加以下内容: " 当新建 .h .c .hpp .cpp .mk .sh等文件时自动调用SetTitle 函数 autocmd BufNewFile *.[ch],*.hpp,*.cpp,Makefile,*.mk,*.sh exec ":call SetTitle()" " 加入注释 func SetComment() call setline(1,"/*================================================================") call append(line("."), "* Copyright (C) ".strftime("%Y")." IEucd Inc. All rights reserved.") call append(line(".")+1, "* ") call append(line(".")+2, "* 文件名称:".expand("%:t")) call append(line(".")+3, "* 创 建 者:SongTL, songtianlun@comleader.com.cn") call append(line(".")+4, "* 创建日期:".strftime("%Y年%m月%d日")) call append(line(".")+5, "* 描 述:") call append(line(".")+6, "*") call append(line(".")+7, "================================================================*/") call append(line(".")+8, "") call append(line(".")+9, "") endfunc " 加入shell,Makefile注释 func SetComment_sh() call setline(3, "#================================================================") call setline(4, "# Copyright (C) ".strftime("%Y")." IEucd Inc. All rights reserved.") call setline(5, "# ") call setline(6, "# 文件名称:".expand("%:t")) call setline(7, "# 创 建 者:SongTL, songtianlun@comleader.com.cn") call setline(8, "# 创建日期:".strftime("%Y年%m月%d日")) call setline(9, "# 描 述:") call setline(10, "#") call setline(11, "#================================================================") call setline(12, "") call setline(13, "") endfunc " 定义函数SetTitle,自动插入文件头 func SetTitle() if &filetype == 'make' call setline(1,"") call setline(2,"") call SetComment_sh() elseif &filetype == 'sh' call setline(1,"#!/system/bin/sh") call setline(2,"") call SetComment_sh() else call SetComment() if expand("%:e") == 'hpp' call append(line(".")+10, "#ifndef _".toupper(expand("%:t:r"))."_H") call append(line(".")+11, "#define _".toupper(expand("%:t:r"))."_H") call append(line(".")+12, "#ifdef __cplusplus") call append(line(".")+13, "extern \"C\"") call append(line(".")+14, "{") call append(line(".")+15, "#endif") call append(line(".")+16, "") call append(line(".")+17, "#ifdef __cplusplus") call append(line(".")+18, "}") call append(line(".")+19, "#endif") call append(line(".")+20, "#endif //".toupper(expand("%:t:r"))."_H") elseif expand("%:e") == 'h' call append(line(".")+10, "#pragma once") elseif &filetype == 'c' call append(line(".")+10,"#include \"".expand("%:t:r").".h\"") elseif &filetype == 'cpp' call append(line(".")+10, "#include \"".expand("%:t:r").".h\"") endif endif endfun 使用效果: ...

July 20, 2020 | 2 分钟 | 555 字 | Tianlun Song

【简记】Linux 计划任务 Crontab

cron 简介 cron 是 UNIX, SOLARIS,LINUX 下的一个十分有用的工具。通过 cron 脚本能使计划任务定期地在系统后台自动运行。 cron 命令 crontab -e – 编辑该用户的 crontab,当指定 crontab 不存在时新建。 crontab -l – 列出该用户的 crontab。 crontab -r – 删除该用户的 crontab。 crontab -u<用户名称> – 指定要设定 crontab 的用户名称。 ...

July 20, 2020 | 4 分钟 | 1515 字 | Tianlun Song

VS Code 免密登录Linux服务器

使用 VS Code 中提供的 Remote Development 可以实现连接远程服务器,管理文件、远程调试、远程管理等功能,实现远程开发。今天主要介绍如何通过配置SSH公钥实现 VC Code 免密登录 Linux 服务器。 ...

July 20, 2020 | 1 分钟 | 336 字 | Tianlun Song

Linux部署私钥实现免密登录

第一步,生成密钥对(windows或linux均可): ssh-keygen 之后一路回车,默认不设密码,默认目录为 ~/.ssh 第二步,部署公钥至服务器端(Linux),并赋权限 cat id_rsa.pub >> authorized_keys sudo chmod 600 authorized_keys sudo chmod 700 ~/.ssh 将 id_rsa.pub 替换为你的公钥路径即可,如果是在本地生成需上传至服务器端。 这项操作可以部署多个公钥,命令会在 authorized_keys 后面追加,而 Linux 公钥验证检测 authorized_keys 文件中的公钥 一个萝卜一个坑,一个公钥只运行一个用户使用登录 第三步,检查密钥登陆功能是否开启 1、打开SSH配置文件 ...

July 20, 2020 | 1 分钟 | 486 字 | Tianlun Song

《断舍离》

作者: 山下英子 出版社: 广西科学技术出版社 原作名: 新・片づけ術「断捨離」 译者: 吴倩 出版 ...

July 19, 2020 | 6 分钟 | 2643 字 | Tianlun Song

《断舍离》十句感触

作者: 山下英子 出版社: 广西科学技术出版社 原作名: 新・片づけ術「断捨離」 译者: 吴倩 出版年: 2013-7-30 页数: 192 定价: CNY 32.00 装帧: 平装 丛书: 山下英子 断舍离 ISBN: 9787807639817 ...

July 19, 2020 | 6 分钟 | 2573 字 | Tianlun Song

在终端打印地图

无意间突发奇想,能否在终端中打印地图,然后找到了一篇文章介绍,只需运行这行代码: $ telnet mapscii.me # 若未安装telnet需安装一下 $ yum install telnet -y $ sudo apt-get install telnet 就可以看到这幅令人惊艳的地图了: ...

July 18, 2020 | 1 分钟 | 122 字 | Tianlun Song

解决git不小心提交大文件导致无法提交问题

在一次不小心向GitHub提交了一个1GB文件后,出现一个令人崩溃的错误: remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. remote: error: Trace: a22b6b202ddb6da3e2795ca71663de19 remote: error: See http://git.io/iEPt8g for more information. remote: error: File system_status/test_26457 is 1024.00 MB; this exceeds GitHub's file size limit of 100.00 MB 更崩溃的是,在此之后又进行了几次提交,可不能因为这次手误丢掉几次提交成果呀。 在网上浏览一圈后找到解决方法: ...

July 17, 2020 | 2 分钟 | 901 字 | Tianlun Song