iterm2
bash添加颜色(utunbu配色方案)
->
Git show branch name ->
ps1 语法
#enables colorin the terminal bash shell export
export CLICOLOR=1
#sets up thecolor scheme for list export
export LSCOLORS=gxfxcxdxbxegedabagacad
#sets up theprompt color (currently a green similar to linux terminal)
export PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\W\[\033[01;33m\]\$(parse_git_branch)\[\033[00m\]\$ "
#enables colorfor iTerm
export TERM=xterm-color
alias
alias
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
Bash git 自动补全
brew install bash-completion
cd /usr/local/opt/bash-completion/etc/bash_completion.d
curl -L -O https://raw.github.com/git/git/master/contrib/completion/git-completion.bash
brew unlink bash-completion
brew link bash-completion
常用命令
tail -f -n 5 xxx.log #显示最后5行
tailf -n xxx.log
快捷键
ctrl+u 剪切文本直到行的起始(可以用于清空行)
ctrl+k 剪切文本直到行的末尾
ctrl+y 粘贴最近剪切的文本
ctrl+e 跳到行首
ctrl+a 调到行尾 (cmd + -> 也行,开启了profile-keys-key mappings-natrual text editing)
ctrl+L 清空屏幕(功能相当于命令clear)
Vscode
快捷键
shift+opt+鼠标:选择列并同时编辑
shift+cmd+p :显示所有命令
直接把文件夹拖到目录栏,可以加入工作区
Goland
- git展示local changes
Preference --> version control --> commit --> 取消勾选第一个 --> 展示git log - opt+cmd+L :format 当前文件
Vim
配置
修改~/.vimrc
#set encoding=utf-8 " The encoding displayed.
#set fileencoding=utf-8 " The encoding written to file.
set nu
syntax on #语法高亮
set mouse=a #用来开启鼠标功能的。a表示所有模式
set ts=4 #tab 4个字符
set expandtab
搜索
/ 搜索
插入
I 行首插入
A 行尾插入
o 上面插入一行
O 下面插入一行
移动
h j k l 左下上右
w b 向前向后一个单词
ctrl+e ctrl+y 向下向上滚动一行
ctrl+f ctrl+b 向下向上滚动一屏
0 $ 行首行尾
:30 到第30行
撤销
u 撤销上一步