Skip to content

Commit 26bf394

Browse files
committedMar 24, 2020
chore(vimrc): update vimrc readme
1 parent d56f666 commit 26bf394

File tree

2 files changed

+97
-3
lines changed

2 files changed

+97
-3
lines changed
 

‎README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# dotfiles
2-
个人配置文件
1+
# 我的配置文件
32

4-
自己使用的一些工具的配置文件
3+
我自己的Mac上使用的一些配置文件。
4+
5+
1. [MacVim配置](https://github.com/razeencheng/dotfiles/tree/master/macvim) -> [相关博客](https://razeencheng.com/post/my-macvim-vimrc.html)

‎macvim/README.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[# 我的MacVim配置](https://razeencheng.com/post/my-macvim-vimrc.html)
2+
3+
### 快速使用该配置
4+
5+
```bash
6+
curl -kSL https://raw.githubusercontent.com/razeencheng/dotfiles/master/macvim/install.sh | sh
7+
```
8+
9+
然后打开MacVim执行 ":PluginInstall"。
10+
11+
12+
### QA
13+
14+
**Q1**. 插件安装后,关于`YouCompleteMe`报错。
15+
16+
**A1**. `YouCompleteMe`插件需要单独配置, 你可以配置你需要的语言,如golang:
17+
18+
```bash
19+
cd ~/.vim/bundle/YouCompleteMe
20+
git clean -f
21+
git pull
22+
git submodule update --recursive --init
23+
/.vim/bundle/YouCompleteMe$ ../install.sh --clang-completer --go-completer
24+
```
25+
26+
27+
28+
**Q2**. Cmd f 与MacVim系统按键冲突。
29+
30+
**A2**. 要么修改系统按键,要么修改配置。由于使用频率较高,我把系统的改了,如下。
31+
32+
![](http://st.razeen.cn/image/blog/modify_sys_keyboard.jpg)
33+
34+
大概4步:
35+
36+
1. 找到是什么菜单占用了你的按键, 这里是 “Find...‘;
37+
2. 在“系统设置” > "键盘" > '快捷键' 中添加你的MacVim;
38+
3. 修改占用菜单 “Find...” 为其他快捷键;
39+
4. 回来再看看,原来的快捷键已经该了,Cmd f 就不冲突了。
40+
41+
42+
43+
**Q3**: 搜索报错 `Option '*g*:*ctrlsf_ackprg*' is not defined or empty.`
44+
45+
**A3**: 要安装依赖 `brew install the_silver_searcher`
46+
47+
48+
### 快捷键
49+
50+
vim一些基础操作可以看下图。
51+
52+
![](http://st.razeen.cn/image/blog/vim-keyboard.jpg)
53+
54+
55+
56+
我这里主要整理一些组合操作(这里主要以上面的配置为准)
57+
58+
| 快捷键 | 操作 | 备注 |
59+
| -------------------- | -------------------------- | ---- |
60+
| Cmd e | 开启/关闭 侧边栏(目录树) | |
61+
| Cmd y | 开启大纲 | |
62+
| Cmd+/ | 代码注释 | |
63+
| Ctrl j/k/h/l | 多窗口切换 | |
64+
| Shift h/l | 切换缓冲区 | |
65+
| Cmd f | 快速搜索 | |
66+
| :CO | 打开上次搜索的结果 | |
67+
| :w!! | 用sudo权限保存文件 | |
68+
| ,1/2/3/4/5/6/7/8/9/0 | 切换tab | |
69+
| ,zz | 折叠行 | |
70+
| ,/ | 移除搜索高亮 | |
71+
| ,sa | 选择全部 | |
72+
| ,w | 保存当前文件 | |
73+
| ,bd | 关闭但前缓冲区, 不关闭窗口 | |
74+
| ,goc | GoErrCheck | |
75+
| ,gob | GoBuild | |
76+
| ,gor | GoRename | |
77+
| ,gol | GoLint | |
78+
| ,us | 修改当前文件类型的代码片段 | |
79+
| ,,h | 显示往前可快速移动的点 | |
80+
| ,,j | 显示往下可快速移动的点 | |
81+
| ,,k | 显示往上可快速移动的点 | |
82+
| ,,l | 显示往后可快速移动的点 | |
83+
| ,,. | 显示上一次可快速移动的点 | |
84+
| ,gaa | Git add | |
85+
| ,gc | git commit | |
86+
| ,gl | git pull | |
87+
88+
89+
90+
91+
92+
93+

0 commit comments

Comments
 (0)
Please sign in to comment.