Skip to content

Commit

Permalink
publish 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
calon committed Aug 6, 2023
1 parent 85b3d67 commit 4051371
Show file tree
Hide file tree
Showing 15 changed files with 591 additions and 487 deletions.
26 changes: 13 additions & 13 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
<title>写给非程序员的 Vim 新手教程</title>
<link rel="stylesheet" href="/css/theme.css" />
<link rel="stylesheet" href="/css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />

<script src="/js/jquery-3.6.0.min.js" defer></script>
<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body class="wy-body-for-nav" role="document">
Expand All @@ -27,7 +26,7 @@
<a href="/." class="icon icon-home"> 写给非程序员的 Vim 新手教程
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="//search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>
Expand All @@ -50,7 +49,7 @@
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li><a href="/." class="icon icon-home" aria-label="Docs"></a> &raquo;</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
Expand Down Expand Up @@ -91,14 +90,15 @@ <h1 id="404-page-not-found">404</h1>

</span>
</div>
<script>var base_url = '/';</script>
<script src="/js/theme_extra.js" defer></script>
<script src="/js/theme.js" defer></script>
<script src="/search/main.js" defer></script>
<script defer>
window.onload = function () {
<script src="/js/jquery-3.6.0.min.js"></script>
<script>var base_url = "/";</script>
<script src="/js/theme_extra.js"></script>
<script src="/js/theme.js"></script>
<script src="/search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
};
});
</script>

</body>
Expand Down
6 changes: 3 additions & 3 deletions css/theme.css

Large diffs are not rendered by default.

438 changes: 248 additions & 190 deletions index.html

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions search.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
<title>写给非程序员的 Vim 新手教程</title>
<link rel="stylesheet" href="./css/theme.css" />
<link rel="stylesheet" href="./css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />

<script src="./js/jquery-3.6.0.min.js" defer></script>
<!--[if lt IE 9]>
<script src="./js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body class="wy-body-for-nav" role="document">
Expand All @@ -27,7 +26,7 @@
<a href="./." class="icon icon-home"> 写给非程序员的 Vim 新手教程
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="./search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>
Expand All @@ -50,7 +49,7 @@
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="./." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li><a href="./." class="icon icon-home" aria-label="Docs"></a> &raquo;</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
Expand All @@ -64,7 +63,7 @@ <h1 id="search">Search Results</h1>

<form id="content_search" action="search.html">
<span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span>
<input name="q" id="mkdocs-search-query" type="text" class="search_input search-query ui-autocomplete-input" placeholder="Search the Docs" autocomplete="off" autofocus title="Type search term here">
<input name="q" id="mkdocs-search-query" type="text" class="search_input search-query ui-autocomplete-input" placeholder="Search the Docs" aria-label="Search the Docs" autocomplete="off" autofocus title="Type search term here">
</form>

<div id="mkdocs-search-results" class="search-results" data-no-results-text="No results found">
Expand Down Expand Up @@ -98,14 +97,15 @@ <h1 id="search">Search Results</h1>

</span>
</div>
<script>var base_url = '.';</script>
<script src="./js/theme_extra.js" defer></script>
<script src="./js/theme.js" defer></script>
<script src="./search/main.js" defer></script>
<script defer>
window.onload = function () {
<script src="./js/jquery-3.6.0.min.js"></script>
<script>var base_url = ".";</script>
<script src="./js/theme_extra.js"></script>
<script src="./js/theme.js"></script>
<script src="./search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
};
});
</script>

</body>
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2022-10-08</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
68 changes: 33 additions & 35 deletions vim/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ Vim 本身不提供版本控制功能,需要借助 git 等版本控制工具

插件 [fugitive](https://github.com/tpope/vim-fugitive)[vim-gitgutter](https://github.com/airblade/vim-gitgutter) 专精于 git,[vim-signify](https://github.com/mhinz/vim-signify) 则可以配合所有常见的版本控制工具使用。

## 配置文件详解
### 配置文件详解

之前我们有介绍过 Vim 配置文件的基本用法,为了更加顺手地使用 Vim,还需要更进一步的优化配置文件。
以下配置的条目可以直接复制到 vimrc 文件中保存。
Expand All @@ -1123,7 +1123,7 @@ Vim 本身不提供版本控制功能,需要借助 git 等版本控制工具

另外,强烈建议入门者不要在配置上花费太多时间,你会发现这是个时间的无底洞,严重影响你的生产力——除非你知道自己在干什么,而且现有的配置实在难用。

#### 使用鼠标
### 使用鼠标

如果一时无法适应纯键盘操作,可以允许所有模式下使用鼠标:

Expand Down Expand Up @@ -1261,6 +1261,33 @@ endif
也就是说,切换到其他缓冲区时,并不会将当前缓冲区中的内容从内存中移除,而是相当于在后台保留,还可以在缓冲区列表中看到,并且切换过去继续编辑。
但要注意,如果当前缓冲区修改后再隐藏,可能会因此忘记保存。虽然退出 Vim 时会提示保存。

### 寄存器与宏

Vim 使用寄存器(*registers*)来保存一些特殊的内容,比如复制、剪切、删除的文本,曾经输入过的命令和查找过的内容,等等。使用 `"`+`寄存器名`+`指令动作` 来操作寄存器。

比如 `+` 寄存器是与系统剪贴板相通的,`"+y``"+p` 指令就是分别将内容复制到系统剪贴板和粘贴过来。`":p` 可以粘贴上一次执行的命令,`"/p` 可以粘贴上一次搜索内容。
`0` 寄存器保留了最近一次复制的内容,不会被删除的内容覆盖掉。
输入 `:registers` 命令可以查看各个寄存器中的内容。

`a-z` 26个寄存器分配给用户自己使用,比如 `"ay``"ap` 就是用寄存器 `a` 代替了默认的剪贴板寄存器,自然也可以用来记录宏命令。

宏(*macro*)在文本编辑器中是一连串操作的记录,用于将重复的人工操作变为可以重复执行的自动操作。

使用 `q`+`寄存器名字` 指令来开始录制宏,比如 `qa` 表示接下来的操作指令都会记录到寄存器 `a` 中。
再按一次 `q` 来结束录制,真正写入寄存器中。

使用 `@`+`寄存器名字` 来执行保存的宏,比如 `@a`

只要你知道某个操作对应的指令是什么和如何写入指定的寄存器,就能自己编写包含该指令的宏,简单的宏命令非常容易搞定。

比如输入 `ggVGd`,其指令含义是全选并删除——`gg` 跳到首行,`V` 选中整行,`G` 跳到尾行,`d` 删除。
选中这些内容后,执行 `"ay` 指令,表示复制到 `a` 寄存器中。
再使用 `@a` 执行 `a` 寄存器的内容,于是就删除了整个文件的内容。

也可以使用 `:let @a=ggVGd` 直接写入寄存器 `a`

宏还有多种高级用法,比如多次执行、对选中的行全部执行等等,在用的到的时候再去查找教程

## 插件系统

### 安装插件
Expand Down Expand Up @@ -1291,7 +1318,7 @@ Pathogen 插件本身(pathogen.vim)放置在 `vimfiles\autoload` 目录中

类似的插件还有 Vundle、Neo Bundle、Vim Addon Manager、Packer、Lazy(只能用于 Neovim) 等等,用户可以根据使用习惯和插件兼容情况挑选一款最适合自己的。

## 其他技巧和常见问题
## 技巧和常见问题

### 转换为 HTML

Expand Down Expand Up @@ -1328,36 +1355,7 @@ Vim 没有提供现成的编码转换菜单,可以用命令搞定:
vnoremap < <gv
vnoremap > >gv

### 寄存器

Vim 使用寄存器(*registers*)来保存一些特殊的内容,比如复制、剪切、删除的文本,曾经输入过的命令和查找过的内容,等等。使用 `"`+`寄存器名`+`指令动作` 来操作寄存器。

比如 `+` 寄存器是与系统剪贴板相通的,`"+y``"+p` 指令就是分别将内容复制到系统剪贴板和粘贴过来。`":p` 可以粘贴上一次执行的命令,`"/p` 可以粘贴上一次搜索内容。
`0` 寄存器保留了最近一次复制的内容,不会被删除的内容覆盖掉。
输入 `:registers` 命令可以查看各个寄存器中的内容。

`a-z` 26个寄存器分配给用户自己使用,比如 `"ay``"ap` 就是用寄存器 `a` 代替了默认的剪贴板寄存器,自然也可以用来记录宏命令。

###

宏(*macro*)在文本编辑器中是一连串操作的记录,用于将重复的人工操作变为可以重复执行的自动操作。

使用 `q`+`寄存器名字` 指令来开始录制宏,比如 `qa` 表示接下来的操作指令都会记录到寄存器 `a` 中。
再按一次 `q` 来结束录制,真正写入寄存器中。

使用 `@`+`寄存器名字` 来执行保存的宏,比如 `@a`

只要你知道某个操作对应的指令是什么和如何写入指定的寄存器,就能自己编写包含该指令的宏,简单的宏命令非常容易搞定。

比如输入 `ggVGd`,其指令含义是全选并删除——`gg` 跳到首行,`V` 选中整行,`G` 跳到尾行,`d` 删除。
选中这些内容后,执行 `"ay` 指令,表示复制到 `a` 寄存器中。
再使用 `@a` 执行 `a` 寄存器的内容,于是就删除了整个文件的内容。

也可以使用 `:let @a=ggVGd` 直接写入寄存器 `a`

宏还有多种高级用法,比如多次执行、对选中的行全部执行等等,在用的到的时候再去查找教程

# 常用指令、命令总结
## 常用指令、命令总结

以下是最常用的指令和命令的清单,方便记忆:

Expand Down Expand Up @@ -1391,7 +1389,7 @@ Vim 使用寄存器(*registers*)来保存一些特殊的内容,比如复
| Ctrl-R | redo | 普通 | 重做 | 编辑 |


# 技巧
### 其他技巧

重复上一个命令 .
% 在对应括号跳转
Expand All @@ -1416,7 +1414,7 @@ K keyword 查看关键字释义
普通模式下 `q:` 查看命令历史清单
如果想要对可视化选中文本执行宏的话,可以执行 `:normal @a`(或者其他你所定义的宏的名字),这条命令会临时将你切换到普通模式,针对选中的每一行执行宏命令。

# Vim 社区和其他资源
## Vim 社区和其他资源

[Vim 官方网站](https://www.vim.org/)
[Vim Awesome](https://vimawesome.com/)
Expand Down
26 changes: 13 additions & 13 deletions vim/site/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
<title>写给非程序员的 Vim 新手教程</title>
<link rel="stylesheet" href="/css/theme.css" />
<link rel="stylesheet" href="/css/theme_extra.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/github.min.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css" />

<script src="/js/jquery-3.6.0.min.js" defer></script>
<!--[if lt IE 9]>
<script src="/js/html5shiv.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/highlight.min.js"></script>
<script>hljs.highlightAll();</script>
</head>

<body class="wy-body-for-nav" role="document">
Expand All @@ -27,7 +26,7 @@
<a href="/." class="icon icon-home"> 写给非程序员的 Vim 新手教程
</a><div role="search">
<form id ="rtd-search-form" class="wy-form" action="//search.html" method="get">
<input type="text" name="q" placeholder="Search docs" title="Type search term here" />
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" title="Type search term here" />
</form>
</div>
</div>
Expand All @@ -50,7 +49,7 @@
<div class="wy-nav-content">
<div class="rst-content"><div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="/." class="icon icon-home" alt="Docs"></a> &raquo;</li>
<li><a href="/." class="icon icon-home" aria-label="Docs"></a> &raquo;</li>
<li class="wy-breadcrumbs-aside">
</li>
</ul>
Expand Down Expand Up @@ -91,14 +90,15 @@ <h1 id="404-page-not-found">404</h1>

</span>
</div>
<script>var base_url = '/';</script>
<script src="/js/theme_extra.js" defer></script>
<script src="/js/theme.js" defer></script>
<script src="/search/main.js" defer></script>
<script defer>
window.onload = function () {
<script src="/js/jquery-3.6.0.min.js"></script>
<script>var base_url = "/";</script>
<script src="/js/theme_extra.js"></script>
<script src="/js/theme.js"></script>
<script src="/search/main.js"></script>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
};
});
</script>

</body>
Expand Down
Loading

0 comments on commit 4051371

Please sign in to comment.