Linux screen和cscope工具使用总结

1 minicom使用
1.1 minicom配置
第一次启动时:
如果输入sudo minicom提示错误,则需: sudo minicom -s
启动
出现配置菜单:选serial port setup
进入串口配置
输入A配置串口驱动为/dev/ttyUSB0
输入E配置速率为115200 8N1
输入F将 Hardware Flow Control 设为 NO
回车退出。

1.2 退出minicom
先按Ctrl+A 键,再按Z键;注意不是连续按,Ctrl+A 松开后才按Z。

2 screen使用步骤
1)
screen
执行shell命令
将screen放到后台 ctrl + a + d

2) 查看有哪些后台screen
screen -ls

3) 将某个后台screen调到前台
screen -r <ID>

4) kill某个screen
screen -X -S <ID> quit

3 tmux
3.1 安装工具
Ubuntu系统中使用sudo apt-get install tmux安装tmux工具。

3.2 使用工具
输入命令tmux使用工具
-上下分屏:ctrl + b  再按 "
-左右分屏:ctrl + b  再按 %
-切换屏幕:ctrl + b  再按 o
-关闭一个终端:ctrl + b  再按 x
-上下分屏与左右分屏切换: ctrl +b  再按空格键

4 cscope
4.1 软件安装
apt-get install cscope

4.2 ~/.vimrc Settings
4.2.1 Cscope Settings
Copy the following comment to ~/.vimrc
以下的"(左双引号)后面的表示注释
例如:" add any database in current directory

if has("cscope")
set csprg=/usr/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif

4.2.2 Remember Last Location
Copy the following comment to ~/.vimrc

if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif

4.2.3 Syntax Color off
Copy the following comment to ~/.vimrc
以下的"(左双引号)后面的表示注释
例如:"4 space, not Tab

hi comment ctermfg=6
syntax off
"4 space, not Tab
set tabstop=4
autocmd FileType c,cpp,h,java set shiftwidth=4 | set expandtab

4.2.4 Show the Whitespace
Copy the following comment to ~/.vimrc
以下的"(左双引号)后面的表示注释
例如:" whitespace

" whitespace
highlight whitespaceEOF ctermbg=red guibg=red
match whitespaceEOF /\s\+$/

4.3 不显示shell提示符前面过长的文件路径
@ ~/.bashrc Setting
Copy the following comment to ~/.bashrc

4.4 Support CPP and Java
# find ./ -name *.cpp > cscope.files
# find ./ -name *.hpp >> cscope.files
# find ./ -name *.c >> cscope.files
# find ./ -name *.h >> cscope.files
# find ./ -name *.java >> cscope.files
# cscope –kbRq

4.5 Vim快捷键
选中多行,复制:Shift + v,y;粘贴:p
选中多列,复制:Ctrl + v,y;粘贴:p
函数跳转:Ctrl + ]
函数跳转返回:Ctrl + o
跳到第一行: :0
跳到最后一行: :$
比较:vimdiff  file1 file2
vimdiff 2个窗口互相跳转:ctrl + 按2次w键
vim以16进制查看文件:”: %!xxd”
字符串替换::%s/oldstring/newstring/g
查找谁调用symbol::cs find c <symbol>
查找symbol出现的地方::cs find s <symbol>
查找指定的文件::cs find f <文件名>
VI行超过80字符长度提示:set colorcolumn=81

5 taglist
5.1 Download taglist.vim from Internet
需要注册账号

5.2 Install
5.2.1 ~/.vimrc Setting
Copy the following comment to ~/.vimrc
以下的"(左双引号)后面的表示注释
例如:" show Tlist always

" show Tlist always
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Auto_Open=1
let Tlist_WinWidth=30

5.2.2 taglist.vim
mkdir ~/.vim/plugin
cp taglist.vim ~/.vim/plugin

5.2.3 taglist快捷键
跳到左边函数list窗口:ctrl + 按2次w键
跳到右边源码窗口:选择函数,按回车键
当左边函数list窗口被关闭时,可以在vim中用如下命令打开:“:TlistOpen”
需要关闭左边函数list窗口时,可以在vim中用如下命令关闭:“:TlistClose”
或者使用 ” ctrl + 按2次w键“ 跳转到左边窗口,然后输入如下命令:“:q”

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值