`
san_yun
  • 浏览: 2663387 次
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

Be more efficient

阅读更多

svndiff

快捷键

Gnome快捷键:

通用快捷键

Alt + F1 类似Windows下的Win键,在GNOME中打开"应用程序"菜单(Applications)
Alt + F2 类似Windows下的Win + R组合键,在GNOME中运行应用程序
Ctrl + Alt + D 类似Windows下的Win + D组合键,显示桌面
Ctrl + Alt + L 锁定桌面并启动屏幕保护程序
Ctrl + Alt + → / ← 在不同工作台间切换
Ctrl + Alt + Shift + → / ← 移动当前窗口到不同工作台

Ubuntu通用快捷键

PrintScreen 全屏抓图
Alt + PrintScreen 当前窗口抓图
Ctrl+ Alt+ F1-F4 进入全屏终端
Ctrl+ Alt+ F7 返回桌面
<--Ctrl+Alt+Shift+F8 未知(终端或模拟终端)
Ctrl+Alt+Shift+Fn 终端N或模拟终端N(n和N为数字1-6) -->

窗口操作(鼠标)

Shift + 中键 拖拽文件图标,移动菜单
Alt + 左键 拖拽移动窗口
Alt + Shift + 左键 拖拽移动窗口并且可以使窗口停留在边缘位置
Alt + 右键 弹出窗口管理器菜单
Alt + 中键 拖拽改变窗口大小

窗口操作(纯键盘)

Alt + ESC 在不同程序窗口间切换
Alt + Tab 为了兼容Windows下的Alt + Tab组合键习惯,提供的第二个"在不同程序窗口间切换"
Alt + F4 关闭窗口
Alt + F5 取消最大化窗口 (恢复窗口原来的大小)
Alt + F7 移动窗口 (注: 在窗口最大化的状态下无效)
Alt + F8 改变窗口大小 (注: 在窗口最大化的状态下无效)
Alt + F9 最小化窗口
Alt + F10 最大化窗口
Alt + Space 打开窗口的控制菜单 (点击窗口左上角图标出现的菜单)

文件浏览器

Ctrl+H 显示隐藏文件(切换键)
Ctrl+T 新建标签
Ctrl+W 关闭标签
Ctrl+Page Up 上一个标签
Ctrl+Page Down 下一个标签
Alt+N 切换到第N个标签(N为数字)

命令简化

用alias简化命令

你是否在为每次antx reactor goals=xxx,xxx而感到这个命令实在是太繁琐,我们可以在主目录下的.bashrc里面添加alias以简化命令

alias antxc='antx reactor goals=clean'
alias antxd='antx reactor goals=default
'
alias antxe='antx reactor goals=eclipse'
alias antxcd='antx reactor goals=clean,default
'
alias antxcde='antx reactor goals=clean,default
,eclipse'
alias antxp='antx -p RELEASE'

编写shell脚本简化命令

用alias简化命令可以应对简单的情况,但是对于一些复杂的逻辑,编写shell脚本配合alias来简化命令则更加方便,比如:
我们在每次修改完成代码重新部署应用的时候每次都要敲3个命令,关闭服务器,重新编译,开启服务器,而且不同的应用关闭和开启服务器的脚本位于不同的文件 夹下,甚为繁琐,每次用起来特别繁琐。这里我写了一个脚本,用于简化部署命令,只要用一个deploy命令就可以直接部署。
使用方法:将commandTemplate functions 放到~/scripts目录下,然后给这两个文件执行权限,最后在~/.bashrc下添加下列alias

alias deploy='sh ~/scripts/commandTemplate deploy'
alias startws='sh ~/scripts/commandTemplate startws'
alias killws='sh ~/scripts/commandTemplate killws'

这样以后就可以直接在应用目录下打deploy来执行关闭服务器,重新编译,开启服务器,执行startws命令来开启服务器,执行killws命令来关闭服务器了。

简化svn命令

用于简化svn co命令,自动检出到一个以$appName$branchCreateDate命名的文件夹,不过这个脚本的作用似乎不是很大:简化svn命令

配置VIM

syntax on #语法高亮
set nu
set fileencoding=gb18030 #自动编码转换
set fileencodings=utf-8,gb18030,utf-16,big5 #自动编码转换
set autoindent #自动缩进
set ts=4  #tabs键的空格数设置
autocmd BufRead *.as set filetype=actionscript #as文件语法高亮
autocmd BufRead *.mxml set filetype=mxml #mxml文件语法高亮
autocmd BufRead *.vm set filetype=velocity #vm文件语法高亮

vim自定义语法高亮

到网上随便Google一下下载相应的语法高亮文件并复制到~/.vimrc/syntax文件夹下
在.vimrc添加响应的语法高亮配置.如上面的vm高亮

使用VI模式来对命令历史进行搜索

在使用命令行中,我们知道可以通过向上方向键和向下方向键来查看命令历史,这么介绍一个方法来通过VI的搜索模式来搜索命令历史,要知道搜索有时候要比浏览快很多哦。首先介绍如何开启这个功能,Linux用户可以在.bash_rc中加入

set -o vi

来启用这个功能,要搜索命令的时候只需要和在VI编辑器中一样按/进入搜索,最后按下Enter键就可以把结果给搜索出来了,和VI中一模一样。

Ubuntu Gnome剪切版的诡异问题:

gnome下的剪切板行为比较怪异,比如你复制了firefox的地址,然后关闭firefox,再按ctrl+v却粘贴不了,可以pastie使用这个软件解决这个问题:http://www.omgubuntu.co.uk/2010/10/pastie-handy-clipboard-manager-indicator-applet/

复制内容到剪切版

在Mac有一个很方便的命令pbcopy,在linux可以用xclip -selection clipboard来代替,这个命令可以将管道的内容复制到剪切板

使用vimdiff来代替svndiff

鉴于在linux下没有像乌龟那样强大的图形化svn工具,而svn本身提供的svn diff命令太过简陋,所以可以考虑用更加直观的vimdiff来代替svn diff命令,具体的做法如下:
在.vim/scripts路径下新建一个文件svndiff:

#!/bin/bash
shift 5;/usr/bin/vimdiff -f "$@"

给这个文件执行权限:

chmod +x svndiff

在.bashrc里面加一个alias:

alias svndiff="svn diff --diff-cmd ~/.vim/scripts/svndiff"

下面你就可以svndiff filename来代替svn diff命令了,效果如下:

点图片查看大图

分享到:
评论

相关推荐

    RTCM32标准文档格式定义

    This standard has been developed by RTCM Special Committee 104 as a more efficient alternative to Version 2 in various documents entitled "RTCM Recommended Standards for Differential Navstar GPS ...

    Beginning Xcode: Swift 3 Edition [Apress, 2016]

    This book is for those with some Objective-C/Cocoa and/or iOS SDK app development experience, but want to be more efficient in writing and testing their code, and people who want to know in-depth ...

    【高考专题辅导】安徽省2014版高考英语 专题检测卷(三十二)书面表达

    Donating books to libraries, schools in rural areas, or organizing book swaps can be more efficient ways to ensure the books serve their purpose. Personally, donating books is the best approach, as ...

    Color active shape models

    The hierarchical implementation of CASM is found to be more efficient and accurate compared to the non-hierarchical approach. Additionally, the choice of color space plays a crucial role in the ...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Inlining a function can generate more efficient object code, as long as the inlined function is small. Feel free to inline accessors and mutators, and other short, performance-critical functions. ...

    微软内部资料-SQL性能优化5

    If you create an index using a large key, fewer entries will fit on a page, so more pages (and possibly more levels) will be needed for the index. On a qualified select, update, or delete, the ...

    AZ-900.136Q.Pdf

    Box 3: NoWhile cloud computing generally improves resource utilization by enabling dynamic scaling, it's not always guaranteed to be more efficient than on-premises solutions. Efficiency depends on ...

    表层进firstly to begin with

    "equally", "however", "likewise", "in the same way", "on the other hand", "otherwise" 用于对比或转折论点:"While both methods have their merits, in comparison, method A proves to be more efficient." ...

    JavaScript APIs HTML5

    This is an alternative to the traditional DOM traversal methods and can be more efficient in certain scenarios. Key functions include: - `document.querySelector(selector)` - `document....

    一个跨平台的CString源码

    // The latest version of this code should always be available at the // following link: // // http://www.joeo.net/code/StdString.zip (Dec 6, 2003) // // // REMARKS: // This header file declares the ...

    Postman-REST-Client_v0.8.1.crx 绿色版

    Postman helps you be more efficient while working with APIs. Postman is a scratch-your-own-itch project. The need for it arose while one of the developers was creating an API for his project. After ...

    jpeg.rar_IDCT_Work It_jpeg_jpeg compression

    the attached utility is a work I ve submitted to the university It shows what a jpeg compression is all about. the function implements the DCT transform, using a matrix ...that might be more efficient.

    Postman-REST-Client_v0.8.1

    Postman helps you be more efficient while working with APIs. Postman is a scratch-your-own-itch project. The need for it arose while one of the developers was creating an API for his project. After ...

    Android代码-android-gif-drawable

    This way should be more efficient than WebView or Movie classes. Javadoc Setup Gradle (Android Studio) Insert the following dependency to build.gradle file of your project. dependencies { compile '...

    Python中pow()和math.pow()函数用法示例

    本文实例讲述了Python中pow()和math.pow()函数用法。分享给大家供大家参考,具体如下: 1. 内置函数pow() &gt;&gt;&gt; help(pow) ... equivalent to (x**y) % z, but may be more efficient (e.g. for lon

    erlang on many core

    The number of processing units integrated into a single die or ...more efficient techniques than traditional processors. For example, an on-chip network may be used to interconnect all cores on a chip

    Efficient MIDP Programming

    Some protocols can be inefficient due to their design or overhead. Opt for protocols that are optimized for mobile networks, such as: - **Binary Protocols**: Binary protocols like MQTT or Protocol ...

    TrussTLBO.zip_Modified_TLBO basic_evolutionary_teaching learning

    Teaching Learning Based Optimization (TLBO) ...A more efficient TLBO algorithm is also introduced in the following reference: Design of space trusses using modified teaching–learning based optimization

Global site tag (gtag.js) - Google Analytics