设置Vmware自动调整窗口大小
安装Vmware Tools,重启无效,则:
手工安装Vmware tools:终端窗口命令如下:
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop如果上面的命令执行并重启之后仍然没有效果:关机–>设置–>硬件–>显示器:
指定监视器设置:数量设为1,分辨率为主机(我是win)的分辨率,关闭拉伸模式。开机,在“查看”中可以进行屏幕自适应设置。
Write a “Hello World” program, compile it, then run it under GNU/Linux.
输入 gcc hell.c
输入 ./a.out
Write a Makefile to compile the “Hello World” program
1 | CC = gcc |
GDB的基本使用
next和 step类似于vs中的f10和f11
基本命令:
1 | gdb <executable name> 开始调试 |
git log –name=1711436 过滤查看手动修改过的记录
how to use tmux
tmux一种需要学习成本的Linux终端的分屏方式。
All commands in Tmux start with a prefix, which by default is ctrl+b
.
离开tmux返回shell:Ctrl+b
d
get a list of the currently running sessions type:tmux ls
attach to session 0
: tmux attach-session -t 0
Ctrl+b
c
Create a new window (with shell)Ctrl+b
w
Choose window from a listCtrl+b
0
Switch to window 0 (by number )Ctrl+b
,
Rename the current windowCtrl+b
%
Split current pane horizontally into two panesCtrl+b
"
Split current pane vertically into two panesCtrl+b
o
Go to the next paneCtrl+b
;
Toggle between the current and previous paneCtrl+b
x
Close the current pane
git
When you want to commit the change, type
1 | git add . |
The --allow-empty
option is necessary, because usually the change is already committed by development tracing system. Without this option, git
will reject no-change commits.
ctags
vim提供了强有力的函数跳转的插件功能
首先要安装ctags, 在ubuntu下直接输入
1 | sudo apt-get install exuberant-ctags |
接着,在源文件目录树执行如下命令:
1 | ctags -R |
即可在目录下生成一个tags文件, 这个文件就是所有函数和变量的索引列表。(通过ls可以看见)
若E257:cstag:找不到tag,解决:在.vimrc中增加:
1 | set tags=tags; |
make的时候可以make -j4,4线程编译可以加快速度