跳至内容

Bitcron Pro Plus主题修改(自用)

修改的主题为gridea-theme-bitcron-pro-plus

post.ejs 修改

找到——

<% if(typeof site.customConfig['valine']!=='undefined' && site.customConfig['valine']) { %>

在上一行添加<% } else { %>

<div class="doc_comments">
<% if (typeof commentSetting !== 'undefined' && commentSetting.showComment) { %>
      <% if (commentSetting.commentPlatform === 'gitalk') { %>
        <div id="gitalk-container"></div>
        <%- include('./_blocks/gitalk') %>
      <% } %>

      <% if (commentSetting.commentPlatform === 'disqus') { %>
        <%- include('./_blocks/disqus') %>
      <% } %>
<% } else { %>
            <% if(typeof site.customConfig['valine']!=='undefined' && site.customConfig['valine']) { %>
                <%- include('./_blocks/valine') %>
            <% } %>

<% } %>

Valine.ejs 修改

1、替换Valine核心代码库

<!--Valine 的核心代码库-->
<script src="//cdn.jsdelivr.net/npm/valine@1.4.4/dist/Valine.min.js"></script>

核心代码库默认网址打不开,换一个,你也可以保留原代码,注释掉即可。

<!--Valine 的核心代码库-->
<script src="//cdnjs.cloudflare.com/ajax/libs/valine/1.5.1/Valine.min.js"></script>

2、添加回复评论设置

<script>
    // 点击回复直接评论,官方版本点击回复时都是跳回到页面上方的评论框进行回复,评论框是固定不动的
    // 参考https://immmmm.com/valine-diy,用到jQuery
    $(document).ready(function(){
        //$('.vemoji-btn').text('😀');
        $("#vcomments").on('click', 'span.vat',function(){
            $(this).parent('div.vmeta').next("div.vcontent").after($("div.vwrap"));
            $('textarea#veditor').focus();
        })
    })
</script>

3、自动获取QQ昵称和QQ头像

new Valine下添加

enableQQ: 'true',

4、评论列表分页

pageSize: '10',

5、记录评论者IP

recordIP: 'true',

6、必填字段

默认提示“昵称不能少于3个字符”、“请填写正确的邮件地址”

requiredFields: ['nick','mail'],

7、自定义表情

添加CDN和Maps,来源BiliEmoji

记得在avatar:''后加逗号“,”。

        emojiCDN: '//i0.hdslb.com/bfs/emote/',
        emojiMaps: {
        "tv-doge": "6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png",
        "tv-坏笑": "1f0b87f731a671079842116e0991c91c2c88645a.png",
        "tv-难过": "87f46748d3f142ebc6586ff58860d0e2fc8263ba.png",
        "tv-生气": "26702dcafdab5e8225b43ffd23c94ac1ff932654.png",
        "tv-委屈": "d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png",
        "tv-斜眼笑": "911f987aa8bc1bee12d52aafe62bc41ef4474e6c.png",
        "tv-呆": "fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png",
        "tv-发怒": "34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png",
        "tv-惊吓": "0d15c7e2ee58e935adc6a7193ee042388adc22af.png",
        "tv-呕吐": "9f996894a39e282ccf5e66856af49483f81870f3.png",
        "tv-思考": "90cf159733e558137ed20aa04d09964436f618a1.png",
        "tv-微笑": "70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png",
        "tv-疑问": "0793d949b18d7be716078349c202c15ff166f314.png",
        "tv-大哭": "23269aeb35f99daee28dda129676f6e9ea87934f.png",
        "tv-鼓掌": "1d21793f96ef4e6f48b23e53e3b9e42da833a0f6.png",
        "tv-抠鼻": "c666f55e88d471e51bbd9fab9bb308110824a6eb.png",
        "tv-亲亲": "a8111ad55953ef5e3be3327ef94eb4a39d535d06.png",
        "tv-调皮": "b9c41de8e82dd7a8515ae5e3cb63e898bf245186.png",
        "tv-笑哭": "1abc628f6d4f4caf9d0e7800878f4697abbc8273.png",
        "tv-晕": "5443c22b4d07fb1907ccc610c8e6db254f2461b7.png",
        "tv-点赞": "f85c354995bd99e28fc76c869bfe42ba6438eff4.png",
        "tv-害羞": "a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png",
        "tv-睡着": "8b196675b53af58264f383c50ad0945048290b33.png",
        "tv-色": "61822c7e9aae5da76475e7892534545336b23a6f.png",
        "tv-吐血": "09dd16a7aa59b77baa1155d47484409624470c77.png",
        "tv-无奈": "ea8ed89ee9878f2fece2dda0ea8a5dbfe21b5751.png",
        "tv-再见": "180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png",
        "tv-流汗": "cead1c351ab8d79e9f369605beb90148db0fbed3.png",
        "tv-偷笑": "bb690d4107620f1c15cff29509db529a73aee261.png",
        "tv-抓狂": "fe31c08edad661d63762b04e17b8d5ae3c71a757.png",
        "tv-黑人问号": "45821a01f51bc867da9edbaa2e070410819a95b2.png",
        "tv-困": "241ee304e44c0af029adceb294399391e4737ef2.png",
        "tv-打脸": "56ab10b624063e966bfcb76ea5dc4794d87dfd47.png",
        "tv-闭嘴": "c9e990da7f6e93975e25fd8b70e2e290aa4086ef.png",
        "tv-鄙视": "6e72339f346a692a495b123174b49e4e8e781303.png",
        "tv-腼腆": "89712c0d4af73e67f89e35cbc518420380a7f6f4.png",
        "tv-馋": "fc7e829b845c43c623c8b490ee3602b7f0e76a31.png",
        "tv-可爱": "9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png",
        "tv-发财": "34db290afd2963723c6eb3c4560667db7253a21a.png",
        "tv-生病": "8b0ec90e6b86771092a498c54f09fc94621c1900.png",
        "tv-流鼻血": "c32d39db2737f89b904ca32700d140a9241b0767.png",
        "tv-尴尬": "7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png",
        "tv-大佬": "093c1e2c490161aca397afc45573c877cdead616.png",
        "tv-流泪": "7e71cde7858f0cd50d74b0264aa26db612a8a167.png",
        "tv-冷漠": "b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png",
        "tv-皱眉": "72ccad6679fea0d14cce648b4d818e09b8ffea2d.png",
        "tv-鬼脸": "0ffbbddf8a94d124ca2f54b360bbc04feb6bbfea.png",
        "tv-调侃": "4bc022533ef31544ca0d72c12c808cf4a1cce3e3.png",
        "tv-目瞪口呆": "0b8cb81a68de5d5365212c99375e7ace3e7891b7.png",
        // ... 更多表情
    }

可选贴吧表情包,复制以下替换。

        emojiCDN: '//tb2.bdstatic.com/tb/editor/images/face/',
        emojiMaps: {
        "呵呵": "i_f01.png",
        "哈哈": "i_f02.png",
        "吐舌": "i_f03.png",
        "啊": "i_f04.png",
        "酷": "i_f05.png",
        "怒": "i_f06.png",
        "开心": "i_f07.png",
        "汗": "i_f08.png",
        "泪": "i_f09.png",
        "黑线": "i_f10.png",
        "鄙视": "i_f11.png",
        "不高兴": "i_f12.png",
        "真棒": "i_f13.png",
        "钱": "i_f14.png",
        "疑问": "i_f15.png",
        "阴险": "i_f16.png",
        "吐": "i_f17.png",
        "咦": "i_f18.png",
        "委屈": "i_f19.png",
        "花心": "i_f20.png",
        "呼~": "i_f21.png",
        "笑眼": "i_f22.png",
        "冷": "i_f23.png",
        "太开心": "i_f24.png",
        "滑稽": "i_f25.png",
        "勉强": "i_f26.png",
        "狂汗": "i_f27.png",
        "乖": "i_f28.png",
        "睡觉": "i_f29.png",
        "惊哭": "i_f30.png",
        "升起": "i_f31.png",
        "惊讶": "i_f32.png",
        "喷": "i_f33.png",
        "爱心": "i_f34.png",
        "心碎": "i_f35.png",
        "玫瑰": "i_f36.png",
        "礼物": "i_f37.png",
        "彩虹": "i_f38.png",
        "星星月亮": "i_f39.png",
        "太阳": "i_f40.png",
        "钱币": "i_f41.png",
        "灯泡": "i_f42.png",
        "茶杯": "i_f43.png",
        "蛋糕": "i_f44.png",
        "音乐": "i_f45.png",
        "haha": "i_f46.png",
        "胜利": "i_f47.png",
        "大拇指": "i_f48.png",
        "弱": "i_f49.png",
        "OK": "i_f50.png",
        "伤心": "i_f51.gif",
        "加油": "i_f52.gif",
        "必胜": "i_f53.gif",
        "期待": "i_f54.gif",
        "牛逼": "i_f55.gif",
        "胜利": "i_f56.gif",
        "跟丫死磕": "i_f57.gif",
        "踢球": "i_f58.gif",
        "面壁": "i_f59.gif",
        "顶": "i_f60.gif",
        "巴西怒": "i_f61.gif",
        "伴舞": "i_f62.gif",
        "奔跑": "i_f63.gif",
        "点赞手": "i_f64.gif",
        "加油": "i_f65.gif",
        "哭泣": "i_f66.gif",
        "亮红牌": "i_f67.gif",
        "球迷": "i_f68.gif",
        "耶": "i_f69.gif",
        "转屁股": "i_f70.gif",
        // ... 更多表情
    }

bilibili的emojiCDNemote/可以塞到emojiMaps的文件名前,这样可以容纳//i0.hdslb.com/bfs/emote/链接下更多表情包,像【贴吧 | 哔哩哔哩动画 | Acfun | …】评论系统的多套表情切换功能需要魔改Valine代码,就不介绍了。

8、Valine添加一言

修改config.json"type": "input",改为"type": false,

或者将"value": "Just Go Go",中的 Just Go Go 删去,再删掉Gridea软件主题设置中填写的 Just Go Go,这样看上去加载占位提示符会有点延迟。

    {
      "name": "placeholder",
      "label": "占位提示符",
      "group": "Valine评论系统",
      "type": "input",
      "value": "Just Go Go",
      "note": "评论区占位提示符"
    },

valine.ejs中添加,

<script type="text/javascript">
    //添加一言
   fetch('https://v1.hitokoto.cn/?c=a')
    .then(response => response.json())
    .then(data => {
      document.getElementById("veditor").setAttribute("placeholder",data.hitokoto+"__"+data.from);
    })
    .catch(console.error)
</script>

9、Valine添加每日诗句(可选)

添加方法同上,加进去就行了。

<script src="https://sdk.jinrishici.com/v2/browser/jinrishici.js" charset="utf-8"></script>
<script type="text/javascript">
 jinrishici.load(function(result) {
     var jrsc_plac =  result.data.content + "\n「" + result.data.origin.title + "」" + result.data.origin.dynasty + " · " + result.data.origin.author;
     document.getElementById("veditor").setAttribute("placeholder",jrsc_plac);
 })
</script>

我的valine.ejs代码

<!--评论显示区,请插入合适的位置-->
<div id="comment"></div>
<!--Leancloud 操作库:-->
<script src="//cdn1.lncld.net/static/js/3.6.1/av-min.js"></script>
<!--Valine 的核心代码库-->
<script src="//cdnjs.cloudflare.com/ajax/libs/valine/1.5.1/Valine.min.js"></script>
<!--<script src="//cdn.jsdelivr.net/npm/valine@1.4.4/dist/Valine.min.js"></script>-->
<script>
    new Valine({
        el:'#comment',
        appId: '<%=site.customConfig['appId']%>',
        appKey: '<%=site.customConfig['appKey']%>',
        placeholder: '<%=site.customConfig['placeholder']%>',
        avatar:'',
        pageSize: '10',
        recordIP: 'true',
        requiredFields: ['nick','mail'],
        enableQQ: 'true',
        emojiCDN: '//i0.hdslb.com/bfs/',
        emojiMaps: {
        "tv-doge": "emote/6ea59c827c414b4a2955fe79e0f6fd3dcd515e24.png",
        "tv-坏笑": "emote/1f0b87f731a671079842116e0991c91c2c88645a.png",
        "tv-难过": "emote/87f46748d3f142ebc6586ff58860d0e2fc8263ba.png",
        "tv-生气": "emote/26702dcafdab5e8225b43ffd23c94ac1ff932654.png",
        "tv-委屈": "emote/d04dba7b5465779e9755d2ab6f0a897b9b33bb77.png",
        "tv-斜眼笑": "emote/911f987aa8bc1bee12d52aafe62bc41ef4474e6c.png",
        "tv-呆": "emote/fe1179ebaa191569b0d31cecafe7a2cd1c951c9d.png",
        "tv-发怒": "emote/34ba3cd204d5b05fec70ce08fa9fa0dd612409ff.png",
        "tv-惊吓": "emote/0d15c7e2ee58e935adc6a7193ee042388adc22af.png",
        "tv-呕吐": "emote/9f996894a39e282ccf5e66856af49483f81870f3.png",
        "tv-思考": "emote/90cf159733e558137ed20aa04d09964436f618a1.png",
        "tv-微笑": "emote/70dc5c7b56f93eb61bddba11e28fb1d18fddcd4c.png",
        "tv-疑问": "emote/0793d949b18d7be716078349c202c15ff166f314.png",
        "tv-大哭": "emote/23269aeb35f99daee28dda129676f6e9ea87934f.png",
        "tv-鼓掌": "emote/1d21793f96ef4e6f48b23e53e3b9e42da833a0f6.png",
        "tv-抠鼻": "emote/c666f55e88d471e51bbd9fab9bb308110824a6eb.png",
        "tv-亲亲": "emote/a8111ad55953ef5e3be3327ef94eb4a39d535d06.png",
        "tv-调皮": "emote/b9c41de8e82dd7a8515ae5e3cb63e898bf245186.png",
        "tv-笑哭": "emote/1abc628f6d4f4caf9d0e7800878f4697abbc8273.png",
        "tv-晕": "emote/5443c22b4d07fb1907ccc610c8e6db254f2461b7.png",
        "tv-点赞": "emote/f85c354995bd99e28fc76c869bfe42ba6438eff4.png",
        "tv-害羞": "emote/a37683fb5642fa3ddfc7f4e5525fd13e42a2bdb1.png",
        "tv-睡着": "emote/8b196675b53af58264f383c50ad0945048290b33.png",
        "tv-色": "emote/61822c7e9aae5da76475e7892534545336b23a6f.png",
        "tv-吐血": "emote/09dd16a7aa59b77baa1155d47484409624470c77.png",
        "tv-无奈": "emote/ea8ed89ee9878f2fece2dda0ea8a5dbfe21b5751.png",
        "tv-再见": "emote/180129b8ea851044ce71caf55cc8ce44bd4a4fc8.png",
        "tv-流汗": "emote/cead1c351ab8d79e9f369605beb90148db0fbed3.png",
        "tv-偷笑": "emote/bb690d4107620f1c15cff29509db529a73aee261.png",
        "tv-抓狂": "emote/fe31c08edad661d63762b04e17b8d5ae3c71a757.png",
        "tv-黑人问号": "emote/45821a01f51bc867da9edbaa2e070410819a95b2.png",
        "tv-困": "emote/241ee304e44c0af029adceb294399391e4737ef2.png",
        "tv-打脸": "emote/56ab10b624063e966bfcb76ea5dc4794d87dfd47.png",
        "tv-闭嘴": "emote/c9e990da7f6e93975e25fd8b70e2e290aa4086ef.png",
        "tv-鄙视": "emote/6e72339f346a692a495b123174b49e4e8e781303.png",
        "tv-腼腆": "emote/89712c0d4af73e67f89e35cbc518420380a7f6f4.png",
        "tv-馋": "emote/fc7e829b845c43c623c8b490ee3602b7f0e76a31.png",
        "tv-可爱": "emote/9e55fd9b500ac4b96613539f1ce2f9499e314ed9.png",
        "tv-发财": "emote/34db290afd2963723c6eb3c4560667db7253a21a.png",
        "tv-生病": "emote/8b0ec90e6b86771092a498c54f09fc94621c1900.png",
        "tv-流鼻血": "emote/c32d39db2737f89b904ca32700d140a9241b0767.png",
        "tv-尴尬": "emote/7cfa62dafc59798a3d3fb262d421eeeff166cfa4.png",
        "tv-大佬": "emote/093c1e2c490161aca397afc45573c877cdead616.png",
        "tv-流泪": "emote/7e71cde7858f0cd50d74b0264aa26db612a8a167.png",
        "tv-冷漠": "emote/b9cbc755c2b3ee43be07ca13de84e5b699a3f101.png",
        "tv-皱眉": "emote/72ccad6679fea0d14cce648b4d818e09b8ffea2d.png",
        "tv-鬼脸": "emote/0ffbbddf8a94d124ca2f54b360bbc04feb6bbfea.png",
        "tv-调侃": "emote/4bc022533ef31544ca0d72c12c808cf4a1cce3e3.png",
        "tv-目瞪口呆": "emote/0b8cb81a68de5d5365212c99375e7ace3e7891b7.png",
        "珑歌Taki_问号": "garb/15856c32cb30a08f361259a59c71b0edee4427dc.png@65w.webp",
        "珑歌Taki_打Call": "garb/67544581bd5f1390e6d95ac34c47867a9e9ebbbb.png@65w.webp",
        "珑歌Taki_好耶": "garb/0176869034a23b2523b552687ec851f4567bb452.png@65w.webp",
        "珑歌Taki_点赞": "garb/243dcd30319137f2715adbea4a4b106835e5c772.png@65w.webp",
        "珑歌Taki_啊对对": "garb/b2576d904e7fa6cada13a35236611f0128fe7a3a.png@65w.webp",
        "珑歌Taki_达咩": "garb/e39b5d13f7276c08caef3ea7b9585ab94de423da.png@65w.webp",
        "珑歌Taki_辣眼睛": "garb/7db3c777e5f618f4458fd379db9b6cfcc5f96a59.png@65w.webp",
        "珑歌Taki_晚安": "garb/cf46da11526aae66fa9b29532a32f262feaf806b.png@65w.webp",
        "珑歌Taki_羞羞": "garb/05ae694d1ef5335673825357ec3bcaee81ca2fd2.png@65w.webp",
        "珑歌Taki_叉你": "garb/7b6c47c462770fd91ca78982cf43a2025564fead.png@65w.webp",
        "珑歌Taki_给你一拳": "garb/1e46191feebe3412e07919dd33f2daef01884c0d.png@65w.webp",
        "珑歌Taki_委屈": "live/e4ce02a977edbd40a6df488f8ce317f1efb77e01.png@65w.webp",
        "珑歌Taki_呃呃": "live/e5c634f3c00b440af5e0269d6cd23a54dcd78a83.png@65w.webp",
        "珑歌Taki_爱你": "live/27e8e2c6679a2e268a2dc0032adec7e0f68abd89.png@65w.webp",
        "珑歌Taki_惊": "live/30fedf447cef730d5acb87c945bf964d4e43b8be.png@65w.webp",
        "珑歌Taki_干杯": "live/68db36d0645df15f4bb8e678d7d9f3a13840eaec.png@65w.webp",
        "樱吹雪_Yuki_啵啵": "garb/a963d838a5f6197defbb6e0591377d4bfd37707a.png@65w.webp",
        "樱吹雪_Yuki_打call": "garb/18f1f1c34738ebb3e2fc6a99bb2afe24192906ab.png@65w.webp",
        "樱吹雪_Yuki_晚安": "garb/c2651d764536e9de174dfc3ab6c0b74ba38d637e.png@65w.webp",
        "樱吹雪_Yuki_贴贴": "garb/dd5d3510ff3169348cfbd0308432cbf4d86f95da.png@65w.webp",
        "樱吹雪_Yuki_好耶": "garb/8a65b68d1c318f5878f610f0e6be5ab55cfad755.png@65w.webp",
        "樱吹雪_Yuki_嗷呜": "garb/fbb35575d9eeb199895056f6f2e678ea1568034f.png@65w.webp",
        "樱吹雪_Yuki_问号": "garb/31b0cd34cdf7d76c9167c319c4a3aa8c084bfd56.png@65w.webp",
        "樱吹雪_Yuki_哈哈": "garb/b64bccc47c050c201dd1a046c03ebff6bc73f94c.png@65w.webp",
        "樱吹雪_Yuki_妈": "garb/be0e78b625d6b76300b917445c65998c052cb3ce.png@65w.webp",
        "樱吹雪_Yuki_比心": "garb/c6acc382cf720529338d9426e1e7a45bd00ac6db.png@65w.webp",
        "樱吹雪_Yuki_wink": "garb/c2500df5817faf7ca63af1cefe62c2526d7693aa.png@65w.webp",
        "樱吹雪_Yuki_狐狸": "garb/26ae388cad7fb59d8797e7e0d77f198cdab46928.png@65w.webp",
        "花丸晴琉_mua": "emote/25be806bfbbb5300afdbeeb64977c90cd1254bf1.png",
        "花丸晴琉_wink": "emote/343d2d4bbf5919f25e37f971cf114d07232c5e73.png",
        "花丸晴琉_啊咧": "emote/b34c5a1827762b981d689bbc51f134469ef06f23.png",
        "花丸晴琉_大笑": "emote/1e28846f5cbd897dd2653142b8be9db42dfbdcb3.png",
        "花丸晴琉_呆住": "emote/2b31495e0c538e095d44ff1a17834abe317a05d2.png",
        "花丸晴琉_对不起": "emote/02d1e8ddfac938b20956f3d83350f442d398286a.png",
        "花丸晴琉_好耶": "emote/29724d41c08ec63962e0974aa653ea8be0cf3947.png",
        "花丸晴琉_挥手": "emote/2c0753c98d4e098a3c5f27ab658b1046b4032572.png",
        "花丸晴琉_惊慌": "emote/e8307d3bd2ad84434e2f6de1eea727aaa138d987.png",
        "花丸晴琉_泪目": "emote/02a805b640a1bd824d21c5e21cf2dbb19f03b6a1.png",
        "花丸晴琉_丧": "emote/e45bd7cf880f36a439ef47c355c73065911992ac.png",
        "花丸晴琉_生气": "emote/dfbfccd43db22e547f62563b73ae7a474b1163a2.png",
        "花丸晴琉_晚安": "emote/40b60d5c04c8e7037089c408e68a73d51fd3dee7.png",
        "花丸晴琉_无语": "emote/ac4cf2356a708eb11199f266160cb76be129ead9.png",
        "花丸晴琉_喜欢": "emote/71a508d3183fb59f1ddf3a42af59fa7495f2c18c.png",
        "花丸晴琉_邪恶": "emote/0a8175363b7c8270836323a627b1fe437938399c.png",
        "花丸晴琉_疑惑": "emote/4aef9a2a5c9800faf2501014e1fba1fbf180b8f0.png",
        "花丸晴琉_嘤嘤": "emote/b5584ef24436d42364e7234a9cd8734e00f872f6.png",
        "花丸晴琉_赞": "emote/adf49b5e19731a8176b774f55b5472b9234ee555.png",
        "花丸晴琉_早安": "emote/c5e20c947c10bb931413b8e4bc80b2bd3b09971e.png",
        "-菫時-打Call": "live/e8073adeb52036d0d563c848c4b55b8449bc4b85.png@65w.webp",
        "-菫時-分号分号": "live/f2a7a0916015a741a192ae85ee593a39c6dd04a7.png@65w.webp",
        "-菫時-哎呀": "live/0a691aec40c738918014b27acfefa3b295b8a458.png@65w.webp",
        "-菫時-地蕾": "live/cdb1f3adeee987c1fe5303ca90443932edb23d30.png@65w.webp",
        "-菫時-困困": "live/c9450e570d7abcf5a920b65e18b9624b75c9d4fb.png@65w.webp",
        "-菫時-生气": "live/021761abdfe8dc417e5267b74877bebd43dcfd58.png@65w.webp",
        "-菫時-亲亲": "live/e0ae55eb80c6b7c01eeb042a26a3bd2938ed679a.png@65w.webp",
        "-菫時-急了": "live/bea985bcf662dc4d85c9f78633c57398b7c3d223.png@65w.webp",
        "-菫時-问号": "live/5b29c4c15e6b97da2df564899f84906fc800590b.png@65w.webp",
        "-菫時-拜比": "live/a9fa62db7b7233dac30d3abd851b992710bc1649.png@65w.webp",
        "纱依shayi_打call": "garb/4d97de8b2d6bb9cb19621af93550b3560e85277f.png@65w.webp",
        "纱依shayi_喜欢": "garb/d345b8ff2f2dcd5a4833aa613fc7849bfb25f5e2.png@65w.webp",
        "纱依shayi_晚安": "garb/f34ec93c5aa7fdb7cc919544df401474bed1a3c1.png@65w.webp",
        "纱依shayi_kira": "garb/f784e4dc7d40f3d3a7ddb6977c241ff6d6a5db26.png@65w.webp",
        "纱依shayi_贴贴": "garb/003679cdb44d37576b700f8ed0f4e85bc6ffc8a7.png@65w.webp",
        "纱依shayi_结婚": "garb/b1a9e35f04b81476d1d93fdc3979fe194e873915.png@65w.webp",
        "纱依shayi_甜蜜的": "garb/415a5fec5062816d6c316a718cf7f739dc12dcef.png@65w.webp",
        "纱依shayi_摸鱼": "garb/b7f7d09fec93dd889b9e12286989dbfa41770689.png@65w.webp",
        "纱依shayi_好厉害": "garb/7dceff9c32cb6a7a617c910cc840eaeaa89f1e60.png@65w.webp",
        "纱依shayi_开心": "garb/360612ea05619a9517f9735e10f6a8e592eb6b35.png@65w.webp",
        "纱依shayi_疑问": "garb/f591282a33cb0eb16e6ac679792ea90ce42e6d67.png@65w.webp",
        "纱依shayi_哼": "garb/538c428f2d5bcaeefa60c81bb96e9a82475a59d2.png@65w.webp",
        "纱依shayi_心碎": "garb/59697798dd454428c773ae989745af62042025ee.png@65w.webp",
        "纱依shayi_趴": "garb/5261ebff0fce07a4bde695f56b1e90e03b2a22b9.png@65w.webp",
        "纱依shayi_蹭蹭": "garb/8feb22fa3a58e7a26c31792be79fab8c015fa7f6.png@65w.webp",
        "纱依shayi_喵": "garb/9a05fc8a87b3f5f05a3c01eec984aaec0f6727e1.png@65w.webp",
        "冥冥meichan_太爱钱了": "garb/item/e3d018abc7dfcaba7a95b512d313591ec015e984.png",
        "冥冥meichan_不可以": "garb/item/5cfc0218594fbe8b2946e67e03fc4ea5c4a19d36.png",
        "冥冥meichan_优雅红茶": "garb/item/8698f417982fd8d5abadf5207407532bb1b5b44f.png",
        "冥冥meichan_哭哭": "garb/item/32817fbdd4226afe71e1aa3d8f0a91c62729567d.png",
        "冥冥meichan_不想输": "garb/item/04fdc12859be022fba9992c76f89b0956d19262d.png",
        "冥冥meichan_开车": "garb/item/3414c37849153f2ebd0fe6c8d7298bbc711c4ed9.png",
        "冥冥meichan_大钻戒": "garb/item/fa42d4a68660e6c3d6447cdf0fe7d95cc4c7cdae.png",
        "冥冥meichan_带走": "garb/item/9862fdd11fb28e2456a5cd3f864f87a46f20604f.png",
        "冥冥meichan_我好了": "garb/item/8855c3fcfc538ee1d96e9ec25f758a0b5602cf66.png",
        "冥冥meichan_嗨呀": "garb/item/caebcb782f3a8742548786cd52cb4d80d8353e03.png",
        "冥冥meichan_好喜欢哦": "garb/item/3cc66caaf1a62e1778b18a458e58b38df99cfa0f.png",
        "冥冥meichan_给你一拳": "garb/item/9b9e4aa83cedd7016bf2f2a83bbe838b648f01ff.png",
        "冥冥meichan_理发店": "garb/item/6026b23be561844d08c5bc4b2d66316c3eeebb15.png",
        "冥冥meichan_典": "garb/item/172ea06085c8d242f3105d0d04826217bbe4fbeb.png",
        "冥冥meichan_信积拉奶": "garb/item/57902ef1f2392e1b8ca4a92ee9c844c18b633009.png",
        "冥冥meichan_饭饭": "garb/item/79a5c3bda7449e06f032c095144d8218b9acb335.png",
        "冥冥meichan_盯": "garb/item/9c9419db0b80a40ab36eed395251e7efe6421b69.png",
        "冥冥meichan_流汗": "garb/item/014bd9e4519567f7f711c0ef8138ffcd022750cd.png",
        "冥冥meichan_晚安": "garb/item/4ed6aba3c606484511e550e9d8070a74c004ba8e.png",
        "冥冥meichan_mua": "garb/item/21b927b32c186a8c4dd12ff48fcb19461d8dcd0e.png",
        "冥冥meichan_关注冥冥": "garb/item/55cfde3719b757aa211e5f1d136cd8c8a1e0dc2f.png",
        "冥冥meichan_你是懂的": "garb/item/724e8fe83e63a0814995dc8fd7a5d874c0568028.png",
        "冥冥meichan_你懂个P": "garb/item/ffa551eaec65b9b3e33eb388fb91f9c02e4ff67a.png",
        "冥冥meichan_钱不够啊": "garb/item/d153516692abb248a2429319ff7eb8cff4b2d463.png",
        "冥冥meichan_寄": "garb/item/4de329afec2e0ebe3c4d0db0da710721bed35ff3.png",
        // ... 更多表情
    }
    });
</script>
<script>
    // 点击回复直接评论,官方版本点击回复时都是跳回到页面上方的评论框进行回复,评论框是固定不动的
    // 参考https://immmmm.com/valine-diy,用到jQuery
    $(document).ready(function(){
        //$('.vemoji-btn').text('😀');
        $("#vcomments").on('click', 'span.vat',function(){
            $(this).parent('div.vmeta').next("div.vcontent").after($("div.vwrap"));
            $('textarea#veditor').focus();
        })
    })
</script>
<script type="text/javascript">
    //添加一言
   fetch('https://v1.hitokoto.cn/?c=a')
    .then(response => response.json())
    .then(data => {
      document.getElementById("veditor").setAttribute("placeholder",data.hitokoto+"__"+data.from);
    })
    .catch(console.error)
</script>

main.less 修改

1、在 veditor 输入界面增加背景图

将 CSS 加到你的博客样式文件中,图片改成你喜欢的。

#veditor {
    background-image: url(https://cdn.jsdelivr.net/gh/drew233/cdn/20200409110727.webp);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right;
    background-color: rgba(255, 255, 255, 0);
    resize: vertical
}

如果使用主题文件夹中的文件,url改为本地路径即可,如../media/images/veditor-bg.gif

2、隐藏评论系统 Valine Powered By信息

main.less 中添加

.vpower.txt-right {
  display: none;
}

3、评论头像旋转

main.less 中添加

img.vimg:hover {
  transform: rotateZ(360deg);/*图像旋转360度*/
  transition: all 1.5s ease-in-out;/*给所有规定以慢速开始和结束的过渡效果1.5s*/
}

friends.ejs 修改

Gridea软件菜单添加“友情链接 Internal /friends”,启用主题内置的友情链接,自定义配置编辑友链。

LOGO采用api.iowen.cn,根据URL地址获取网站 Favicon。

需要获取图标的URL地址,如:www.iowen.cn,确保URL能够正常打开。

不需要 http(s):// ,且结尾必须填 .png

请求示例:

https://api.iowen.cn/favicon/www.iowen.cn.png

1、移除友链以外内容(可选)

<!-- -->注释掉以下区域。

<div class="main"><div class="main-inner"><div class="content">
…
</div></section>
            </div></div></div>

2、打开评论系统

同上,添加<% } else { %>

3、屏蔽friends-desc

注释掉friends-desc。

<!-- <div class="friends-desc"> -->
<!-- </div> -->

friends.less 修改

友链部分居中

找到friend-container区域,添加post-content代码如下,

.friend-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  flex: auto;

  .friend-detail {
    flex: auto;
    padding: 24px 32px;
    width: 1000px;
    border-radius: 4px;
    }

    .post-content {
      display: flex;flex-wrap: wrap; justify-content: center;
    }
}

post-content部分可改为(不建议):

    .post-content {
      display: grid;grid-template-columns: repeat(2, 1fr);justify-items: center;
    }

darkmode.less 修改

添加暗黑模式背景图片,代码如下:

//设置背景图片
.darkmode {
  background: url(../media/images/682df424b899a901fff1b8541c950a7b0308f5ae.jpg) fixed;
  background-repeat: no-repeat;
  background-size: 100%;
  opacity: 70%;
}

本来想改成这样的,需要改header.ejs

footer.ejs 修改

<span style="display: inline;margin-right:15px;">👁<strong><span id="busuanzi_value_site_pv"></span></strong></span>

前面添加——

<div><div class="github-badge"><a href="https://open.gridea.dev" target="_blank" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">Gridea</span></a></div>
<div style="display: inline-block">&nbsp;</div>
<div class="github-badge"><a href="https://github.com/Wu-jiyan/gridea-theme-bitcron-pro-plus" target="_blank" rel="nofollow"><span class="badge-subject">Theme</span><span class="badge-value bg-green">Bitcron Pro Plus</span></a></div></div>

Gridea-个性化-自定义CSS添加如下CSS代码——

.github-badge {
    display: inline-block;
    border-radius: 4px;
    text-shadow: none;
    font-size: 12px;
    color: #fff;
    line-height: 1.25;
    margin-bottom: 5px
}

.github-badge a {
    color: #fff
}

.github-badge .badge-subject {
    display: inline-block;
    background-color: #555;
    padding: 4px 4px 4px 6px;
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px
}

.github-badge .badge-value {
    display: inline-block;
    padding: 4px 6px 4px 4px;
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px
}

.github-badge .bg-blue {
    background-color: #007ec6 !important
}

.github-badge .bg-green {
    background-color: #97ca00 !important
}

#footer span {
    font-size: .9em
}

根据xiaxi626/gridea-theme-bitcron-pro-plus微调

想加载本地评论框背景图片,原../media/images/veditor-bg.gif前要加/

持续更新中

参考

Hexo NexT 评论系统 Valine 的使用_valine.min.js_WuGenQiang的博客
Valine自定义表情与QQ邮箱头像支持 | Wittoy’s Blog @ 篱落闲栈
为你的Gridea博客加上Valine评论系统 | kveln’s blog
博客Valine评论样式美化 - 简书
【个人网站搭建】GitHub pages+hexo 框架下隐藏next主题的评论系统 Valine Powered By信息_隐藏power by valine_wangqingchuan92的博客
HTML 如何将 float:left 的 div 居中对齐|极客教程
Hexo博客 | 如何让你的valine更好看_JUST LOVE SMILE的博客
【博客美化】评论带头像,且支持旋转_weixin_34040079的博客
css 动画中 ease,seae-in,ease-in-out,ease-out,效果区别_css ease_小赞赞No1的博客
效果过度transition:all_transition: all_靓仔微笑的博客

Debian系统安装使用教程

Debian系统安装使用教程

Debian设置教程

debian 切换桌面类型 - 搜索

Debian 安装并切换配置使用 Xfce 4 桌面环境_debian切换桌面环境_ieeso的博客

linux中flac安装 - CodeAntenna

FLAC-1.3.2

Debian – 套件下載地址選擇 – flac_1.3.2-3+deb10u2_amd64.deb

Debian更换软件源_debian换源_金士顿的博客

Debian11 更换软件源_debian11换源_天下亦有不散之筵席的博客

FFmpeg设置教程

LINUX FFMPEG编译详细过程记录(最全)_ffmpeg 编译_柳鲲鹏的博客

在Ubuntu, Debian, 或Mint系统中编译FFmpeg_hebbely的博客

完美解决Linux环境编译ffmpeg库_linux ffmpeg 开发环境_Zhou_Xintong的博客

libogg-1.3.5

FLAC在Linux中安装-Please install ‘flac’ on ALL worker nodes_please install ‘flac’ on all worker nodes!_谁谁的博客的博客

如何在Debian 9上安装FFmpeg | linux资讯

Debian设置及FFmpeg安装流程

修复sudo apt-get update:

修改/etc/apt source.list

cdrom前添加#

安装需要的组件

【Linux】无法获得dpkg前端锁的解决方法_无法获取dpkg前端锁怎么解决_Frank学习路上的博客

如何清除 APT 缓存来回收宝贵的磁盘空间 | Linux 中国 - 知乎

Git同时配置Gitee和GitHub_MsLeesSun的博客

完美解决Linux环境编译ffmpeg库

在Ubuntu, Debian, 或Mint系统中编译FFmpeg

编译包下载完成

./configure --prefix="$HOME/ffmpeg_build" --disable-static --docdir="$HOME/ffmpeg_build/share/doc/libogg-1.3.5"

./configure --prefix="$HOME/ffmpeg_build"

Linux:设备上没有空间的问题解决 - 挑战者V - 博客园

https://www.cnblogs.com/youcong/p/14196813.html

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libass \
  --enable-libfdk-aac \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libopus \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree

在FFmpeg里添加自研编码器方法

【FFmpeg】在FFmpeg里添加自研编码器方法_ffmpeg 添加自定义编码器_bearhang的博客

ffmpeg安装第三方编码器_ffmpeg vc-1_Mr_weng_的博客

8个高质量的日语字幕资源(以及如何用它们学习日语)

Original title: 8 High-quality Resources for Japanese Subtitles (and How to Learn Japanese with Them)

Author: By AlanAlan and MikeMike

Last updated: June 24, 2023

Topic: Japanese Learning Resources

Reprinted from fluentu.com

Subtitles—a Japanese media lover’s best friend.

They can give your Japanese the boost it needs to eventually survive without them.

Whether you’re watching Japanese dramas, binging anime, enjoying a Japanese movie or anything in between, taking advantage of subtitles is the key to turning your favorite entertainment into quality learning material.

So let’s go through four techniques and eight resources you can use to learn more effectively using Japanese subtitles.

Why Learn Japanese Through Entertainment and Subtitles?

But before getting into the nitty-gritty, let’s talk about the benefits of learning Japanese with entertainment and subtitles—and why it’s worth your time.

  • It’s fun! Some of the best dramas, TV shows, movies, etc. in the world are made in Japan. Dramas in particular tend to be short, around eleven episodes and emotionally intense. Not to mention extremely addictive!

  • Another great thing about Japanese dramas is that the actors speak very clearly, and usually, only one person speaks at a time.

    ,Dramas feature useful, conversational language. This is the best way to learn things like aizuchi.

  • Japanese media is a gateway to Japan’s culture. There are constantly new works that frequently tackle current cultural concerns or problems.

Learners of All Levels Can Learn with Japanese Subtitles

Many students at a beginner level feel intimidated by the thought of watching an episode and trying to understand the language.

But even if you understand very little, your ears will begin to pick out individual sounds, and you’ll start to hear a word now and then that you do know.

When you’re reading subtitles, you’re still listening at some level. Your mind will start to make connections between words that you see repeatedly and the sound of that particular word.

At an intermediate level, you’ll find that at times you don’t read the subtitles. But when you do, they’ll help your comprehension when you most need them to.

At this kind of proficiency, it can be hard to wean yourself off subtitles, and they really need to be turned off when possible. However, they’re still an essential tool for those times when a Japanese dialogue has become impenetrable.

Even an advanced speaker of Japanese will still use subtitles to catch the nuances of dialogue or just for the odd occasion when they hear something they don’t quite understand.

A Potential Pitfall of Learning with Japanese Subtitles

There’s one thing you should watch out for when learning with subtitles.

It can be extremely tiring to listen and try to understand a foreign language over a protracted amount of time. Gradually, you might stop actually hearing what the characters say and just read the subtitles.

When this happens, it’s easy to convince yourself that you’re still learning something, but you’re actually gaining nothing.

You might find yourself reading with your eyes rather than listening with your ears. If this happens,** it’s best to stop watching and take a break.**

To a certain extent, subtitles can become a crutch. If you find you can listen and follow what the different characters are saying, then turn off the subtitles. Don’t use them if you really don’t need them.

So, now that we’ve gotten that out of the way, how should we find these subtitles?

How to Find Dramas, Anime, Movies and More with Japanese Subtitles

There are many streaming sites where you can find the latest drama series with subtitles, such as Viki and Dailymotion.

And of course, there’s tons of subtitled content on YouTube. One great technique to search specifically for subtitled content is to add the phrases **字幕 (じまく)**and **セリフ集(せりふあつ)**to the end of your search.

If you know the name of the drama, anime, movie, etc. you want to watch in English or Japanese, then you can usually find it on one of the above streaming sites.

And let’s not forget Netflix and the variety of anime sources!

If you want to learn with the subtitles themselves, then there are many “fansubbing” communities online where fans create and share the subtitles for popular shows. D-addicts is a popular one.

Where Can I Get Japanese Subtitles? 8 Resources You’ve Gotta Try

While Japanese subtitles can be tricky to find, a bit of sleuthing is all you need to dig them up.

That’s why I’m here to give you eight resources for Japanese subtitles to get you on your way to studying Japanese with the movies and shows you love!

Netflix

To the surprise of probably no one, Netflix is one of the premier resources for Japanese subtitles out there.

Many of Netflix’s Japanese programs offer subtitles in Japanese, with changing languages being as simple as tapping the subtitle icon in the bottom right-hand corner of the video.

Plus, you can lower the playback speed so you can catch every word that the actors are saying to match them to the subtitles.

Some Netflix titles with Japanese subs include: “Million Yen Women,” “Midnight Diner,” “Dad of Light” and “Scams.”

FluentU

FluentU is a language learning program that teaches Japanese through authentic videos. By “authentic videos,” I mean those that are made by and for native Japanese speakers, like anime clips, movie trailers, funny commercials, music videos and more.

These videos are subtitled in Japanese, with the option to turn romaji and English translations on, as well. All the subtitles are interactive: Hover over any word to see a definition. You can also click on words for a more detailed explanation and example sentences (vetted by professional translators) as well as other video clips where the word appears.

From here, you can add these words to custom flashcard decks and review them whenever you’re ready with FluentU’s personalized quizzes.

How does it work in practice? Well, for instance, you can watch a commercial for the anime “Princess Precure” and learn 20 new words and a few grammar points (like the te form).

You can use FluentU on the website, or download the iOS or Android app and keep learning from where you left off.

Viki

Want to watch the latest Japanese dramas with subtitles? You’ve come to the right place!

This service offers contemporary Japanese TV shows and movies, with a respectable library largely consisting of romantic comedies.

Viki is also aware that viewers may be trying to use their shows to acquire Japanese, so they’ve created a feature specifically for those studying Japanese: Learn Mode!

With Learn Mode, you get dual subtitles in Japanese and English. The video can be navigated in segments based on subtitle tracks, and you can even replay segments to ensure you’re understanding the line properly.

Why not try it out with shows like “Life: Love on the Line” or “When One Day I Will Sleep”?

NYU Subtitles

YouTube is another fantastic resource for Japanese subtitles.

This YouTube group has added subtitles to nearly 150 videos by Japanese comedian Atsuhiko Nakata from his channel Nakata University, where he teaches a variety of topics using comedy. Personally, I’m a fan of his videos on Japanese history!

Of course, there are a large number of YouTube channels that offer Japanese subtitles on their videos.

There are web series like “全力回避フラグちゃん”(ぜんりょくかいひふらぐちゃん, Utmost Evasion Flag-chan), about a shinigami who ends up saving the people she’s supposed to reap, and instructors like Moshi Moshi Yusuke, who teaches Japanese through his monologues as he takes viewers on tours of daily life in Japan.

Kitsunekko

Anime fans, you’re in luck: this is the go-to site for Japanese subtitles for anime.

Kitsunekko has a gigantic collection of subtitles for both contemporary and classic anime.

Whether you want to watch classics like “Ghost in the Shell,” contemporary hits like “The Promised Neverland” or something niche like “Golden Kamuy,” you’ll never run out of shows to watch subbed in their original language!

It’s worth noting that Kitsunekko, as well as the following websites, provide subtitle files, not the shows themselves.

To use them, download the .srt or .ass file you want and input them into a browser extension or subtitle program (such as Aegisub) to put on top of the shows you already have access to.

Itazuraneko

Like Kitsunekko, Itazuraneko offers a huge wealth of subtitles for Japanese movies and anime. You can search their page to find the show/movie you’re looking for to obtain the subtitle file.

Some show names are in Japanese, so make sure you have the Japanese title of the show you’re looking for during your search.

Project Modelino

Project Modelino offers subtitles for Japanese movies and a few TV shows. While the collection is a bit limited, the variety within it is nothing to sneeze at.

You can find Akira Kurosawa classics right alongside contemporary hits!

This site also walks you through the process of legally acquiring these movies and adding the Japanese subtitle files to them. Fantastic for newbies to the subtitle game!

Asian Drama Wiki

Managed by D-Addicts, Asian Drama Wiki is a true gold mine of fansubs for Japanese dramas.

While you need an account to access the subtitle index, subs are available for hundreds of shows.

Make sure to look carefully at how many episodes of each series have been subtitled as sometimes, episodes will be missing or the series is only partially complete.

If there happens to be a drama you have your eye on that doesn’t have Japanese subtitles yet, you can make a request in the forums.

Who knows, maybe a subbing group will pick it up!

4 Techniques for Learning with Japanese Subtitles

1. Simply Rewatch to Learn with Subtitles

One strategy can make a big difference in your Japanese learning experience.

This is to simply watch each episode with subtitles, to try and listen out for the grammar and vocabulary that’s used, and then to watch the episode again without subtitles.

When you watch the episode for a second time, you’ll notice that you remember the general gist of the conversations and the plot. The challenging part will be to listen and comprehend.

From your first viewing, you’ll have picked up some new vocabulary, as well as heard the words and grammar that you do know.

With this in mind, the first thing you need to do on your second viewing is to pick these out again plus the new vocabulary you heard previously.

You can build upon this by watching the same drama again and again. After enough viewings, you’ll find you can easily watch the episode without subtitles.

A special aspect of this is that Japanese dramas tend to only have eleven episodes, so if you can understand one episode, then you’re perfectly positioned to watch the other episodes with little preparation. You could even challenge yourself to watch the rest of the series without subtitles.

If your medium of choice isn’t a drama though—let’s say it’s an anime—try to either choose one with short episodes or split up long episodes into short chunks (say, 15-minute segments).

As for movies, the same rule applies. Don’t try to dissect the full movie in one sitting unless you’re looking for burnout and exhaustion.

2. Dissect the Japanese Subtitles and Master Every Word

It’s often not enough to just compare the Japanese subtitles and English translation.

To really master the words, you need to dissect the subtitles and study each word individually. This involves steps like:

  • Looking words up in a good dictionary or thesaurus. This helps clarify the meaning. By using a thesaurus as well, you can discover similar words.

  • Find good examples so you know how the words are used. It’s often not enough to just use the information provided in a dictionary. You need to get examples and kick the tires a bit.

  • Input words and examples into flashcards. To increase your efficiency and be more systematic, you can create flashcards based on the dictionary and thesaurus. You can either do this online through an app and add your new vocabulary to your flashcard deck, or simply create a physical flashcard deck. For hardcore flashcard aficionados who use Anki and have some technical prowess, this open-source project called subs2srs might really speed up your learning process.

  • Review words on a periodic basis with your flashcards. You need to be consistent with your review, and also systematic with scheduling words. You don’t want to spend too much time studying easy words, for example.

3. Reverse Engineering: Use Japanese Subtitles to Translate the Dialogue Back to Japanese

This method is an extremely good way of using subtitles, but it’s very challenging and time-consuming.

The combination of video, sound and English subtitles are weapons to be used, we just need to learn how to use them.

First, watch the episode, video or clip with subtitles to give you an idea about the plot, as well as what’s said in the dialogues and, more specifically, the kind of language that’s used.

The next step is to try and transcribe the dialogue, with the subtitles turned off, in Japanese. This will require repeated viewings and you’ll have to listen very carefully to get everything written down.

If you’re watching on a computer, you can take advantage of certain software to slow down the video so that you can hear every syllable.

Once you’re finished, you’ll have a transcription of the Japanese dialogue along with the video and audio to listen to, and the subtitles for reference so you understand how the Japanese content has been translated.

You can pick up a lot of vocabulary and grammar, see the differences between how different genders and generations speak and also gain an insight into the translation process.

4. Listen and Repeat: An Easy Method to Improve Your Speaking and Listening Through Japanese Subtitles

A very simple tactic you can use is to simply pick a scene, listen to the dialogue and repeat it out loud.

The subtitles provide you with the English meaning for what each character is saying so you don’t have to look it up.

Drama episodes take especially well to this method. Only one character tends to talk at any given moment, so you can usually hear very clear sentences that you can practice saying out loud.

If you can get to the point where you’re able to easily repeat the dialogue, you’ll find that you’re also making progress in your listening and speaking skills in general.

And there you have it—four techniques for using Japanese subtitles and eight resources to get you one step (or ten) closer to fluency!

By consistently using the methods listed above, you’ll find that your favorite Japanese media becomes easier to comprehend (with or without subtitles) by the day.

Download: This blog post is available as a convenient and portable PDF that you can take anywhere. Click here to get a copy. (Download)

Python处理PDF文件自动化

场景和模块

对应的模块安装:

pip install docx2pdf
pip install pdf2docx
pip install pdfminer3k
pip install pyinstaller

Word转PDF

全自动化,支持doc、docx。
创建word2pdf.py文件,输入以下代码:

from win32com import client
import os

'''
代码描述:
用来实现word文档转pdf的一个软件

特色:
可穿透指定路径下的所有文件,对找到的所有word文档进行操作
并把结果输出到指定路径中

注意事项:
请确认没有同名文件,否则文件会覆盖
'''


# 转换doc为pdf
def doc2pdf(fn):
    word = client.Dispatch("Word.Application")  # 打开word应用程序
    doc = word.Documents.Open(fn)  # 打开word文件

    a = os.path.split(fn)  # 分离路径和文件
    b = os.path.splitext(a[-1])[0]  # 拿到文件名

    doc.SaveAs("{}\\{}.pdf".format(path1, b), 17)  # 另存为后缀为".pdf"的文件,其中参数17表示为pdf
    doc.Close()  # 关闭原来word文件
    word.Quit()


# 转换docx为pdf
def docx2pdf(fn):
    word = client.Dispatch("Word.Application")  # 打开word应用程序
    doc = word.Documents.Open(fn)  # 打开word文件

    a = os.path.split(fn)  # 分离路径和文件
    b = os.path.splitext(a[-1])[0]  # 拿到文件名

    doc.SaveAs("{}\\{}.pdf".format(path1, b), 17)  # 另存为后缀为".pdf"的文件,其中参数17表示为pdf
    doc.Close()  # 关闭原来word文件
    word.Quit()


# 获取指定路径下的所有word文件
# 可以穿透指定路径下的所有文件
def getfile(path):
    word_list = []  # 用来存储所有的word文件路径
    for current_folder, list_folders, files in os.walk(path):
        for f in files:  # 用来遍历所有的文件,只取文件名,不取路径名
            if f.endswith('doc') or f.endswith('docx'):  # 判断word文档
                word_list.append(current_folder + '\\' + f)  # 把路径添加到列表中
    return word_list  # 返回这个word文档的路径


if __name__ == '__main__':
    word_path = input('[+] 请给出word文档所在路径:')

    # 设置一个路径path1,保存输出结果
    print("[+] 请输入一个路径,用来存放所有的处理结果")
    print("[+] 或者按回车键,我将自动把处理之后的文件存放在你的桌面")
    path1 = input('')  # path1 用来存放所有的处理结果
    if len(path1):
        pass
    else:
        desktop_path = os.path.join(os.path.expanduser("~"), 'Desktop')  # 获取桌面路径
        path1 = os.path.join(desktop_path, '所有的处理结果')
        os.makedirs(path1)

    print('[+] 转换中,请稍等……')
    words = getfile(word_path)
    for word in words:
        if word.endswith('doc'):
            doc2pdf(word)
        else:
            docx2pdf(word)
    print('[+] 转换完毕')

使用pyinstaller打包,EXE文件在dist文件夹中:

pyinstaller -F word2pdf.py

doc与docx互转

请确认没有同名文件,否则文件会覆盖,或者使用Everything过滤出word文档之后,再进行互转。
创建 doc与docx互转.py文件,输入以下代码:

from win32com import client
import os
'''
代码描述:
用来实现doc与docx互转的一个软件

特色:
可穿透指定路径下的所有文件,对找到的所有word文档进行操作
并把结果输出到指定路径中

注意事项:
请确认没有同名文件,否则文件会覆盖
'''

# 转换doc为docx
def doc2docx(fn):
    word = client.Dispatch("Word.Application")  # 打开word应用程序
    doc = word.Documents.Open(fn)  # 打开word文件

    a = os.path.split(fn)  # 分离路径和文件
    b = os.path.splitext(a[-1])[0]  # 拿到文件名

    doc.SaveAs("{}\\{}.docx".format(path1, b), 12)  # 另存为后缀为".docx"的文件,其中参数12或16指docx文件
    doc.Close()  # 关闭原来word文件
    word.Quit()


# 转换docx为doc
def docx2doc(fn):
    word = client.Dispatch("Word.Application")  # 打开word应用程序
    doc = word.Documents.Open(fn)  # 打开word文件

    a = os.path.split(fn)  # 分离路径和文件
    b = os.path.splitext(a[-1])[0]  # 拿到文件名

    doc.SaveAs("{}\\{}.doc".format(path1, b), 0)  # 另存为后缀为".docx"的文件,其中参数0指doc
    doc.Close()  # 关闭原来word文件
    word.Quit()


# 获取指定路径下的所有word文件
# 可以穿透指定路径下的所有文件
def getfile(path):
    word_list = []  # 用来存储所有的word文件路径
    for current_folder, list_folders, files in os.walk(path):
        for f in files:  # 用来遍历所有的文件,只取文件名,不取路径名
            if f.endswith('doc') or f.endswith('docx'):  # 判断word文档
                word_list.append(current_folder + '\\' + f)  # 把路径添加到列表中
    return word_list  # 返回这个word文档的路径


# 用户选择的转换模式
def choice():
    num_list = ['1', '2', '3']
    a = 1
    print('请选择转换模式:')
    while a:
        print('doc与docx互转请输入:\t1')
        print('doc转docx请输入:\t2')
        print('docx转doc请输入:\t3')
        user_choice = input('我选择:')
        if user_choice in num_list:
            a = 0
            return user_choice
        else:
            print('请输入正确的选项')


if __name__ == '__main__':
    word_path = input('请给出word文档所在路径:')
    words = getfile(word_path)

    # 设置一个路径path1,保存输出结果
    print("[+] 请输入一个路径,用来存放所有的处理结果")
    print("[+] 或者按回车键,我将自动把处理之后的文件存放在你的桌面")
    path1 = input('')  # path1 用来存放所有的处理结果
    if len(path1):
        pass
    else:
        desktop_path = os.path.join(os.path.expanduser("~"), 'Desktop')  # 获取桌面路径
        path1 = os.path.join(desktop_path, '所有的处理结果')
        os.makedirs(path1)

    user_choice = choice()
    print('转换中,请稍等……')
    if user_choice == '1':
        for word in words:
            if word.endswith('doc'):
                doc2docx(word)
            else:
                docx2doc(word)
    if user_choice == '2':
        for word in words:
            if word.endswith('doc'):
                doc2docx(word)
    if user_choice == '3':
        for word in words:
            if word.endswith('docx'):
                docx2doc(word)
    print('转换完毕')

使用pyinstaller打包,EXE文件在dist文件夹中:

pyinstaller -F doc与docx互转.py

参考

python实现——doc与docx互转(终极版)_doc转docx python
python实现——WORD转PDF(全自动化,支持doc、docx)_python doc转pdf
推荐书目:让工作化繁为简:用Python实现办公自动化-李杰臣编著

在Windows服务器上安装Oracle数据库教程

在Windows服务器上安装Oracle数据库教程

安装Oracle

解压Oracle安装包时两个压缩包都要解压,否则安装时会缺失各种文件。

Oracle服务端11g\win64_11gR2_database_2of2.zip

Oracle服务端11g\win64_11gR2_database_1of2.zip

打开../database/stage/cvu/cvu_prereq

在<CERTIFIED_SYSTEMS>之后添加:

<OPERATING_SYSTEM RELEASE="6.2">
    <VERSION VALUE="3"/>
    <ARCHITECTURE VALUE="64-bit"/>
    <NAME VALUE="Windows 8"/>
    <ENV_VAR_LIST>
        <ENV_VAR NAME="PATH" MAX_LENGTH="1023" />
    </ENV_VAR_LIST>
</OPERATING_SYSTEM>

NAME VALUE填写系统名称,如果在Windows 10上安装就填“Windows 10”;

ARCHITECTURE VALUE=“64-bit"对应的是多少位系统就填多少位;

如果 cvu_prereq文件配置为OPERATING_SYSTEM RELEASE=“6.1”,可能会遇到:

[INS-13001]此环境不满足最低配置”

改成OPERATING_SYSTEM RELEASE=“6.2”

ENV_VAR NAME=“PATH” MAX_LENGTH=“1023”

启动setup.exe,会出现cmd程序:

正在启动 Oracle Universal Installer...

检查监视器: 监视器配置至少必须显示 256 种颜色 高于 256 。    实际为 4294967296     通过
 准备从以下地址启动 Oracle Universal Installer C:\Users\aijia\AppData\Local\Temp\OraInstall2023-05-30_10-21-25PM. 请稍候...

不必管它。

取消勾选“我希望通过 My Oracle Support 接收安全更新)。”

出现尚未提供电子邮件地址,选择是。

继续。

选桌面。不要急多等一会。

建议在Windows及Windows虚拟机上安装时不要安装到C盘。

填写管理口令,注意提示。

点击保存响应文件,完成。

接下来会跳出防火墙警告,选择允许访问。

安装.NET Framework 3.5。

等待安装程序完成,这里如果安装压缩包未全部解压,会出现大量缺失文件提示。

安装进度条100%后会跳出该界面,重点内容如下:

Database Control URL 为 https://localhost:1158/em

管理资料档案库已置于安全模式下, 在此模式下将对 Enterprise Manager 数据进行加密。加密密钥已放置在文件 D:/Oracle/Oracle11g/product/11.2.0/dbhome_1/localhost_orcl/sysman/config/emkey.ora 中。请务必备份此文件, 因为如果此文件丢失, 则加密数据将不可用。

点击口令管理…,进行如下设置:

1.解锁scott并修改口令

2.选择“口令管理”,查看并修改以下用户

取消勾选是否锁定账户(这是设置完成后再打开的样子)

(1)普通用户:SCOTT(密码:tiger)

(2)普通管理员:SYSTEM(密码:manager)

(3)超级管理员:SYS(密码:manager)

(4)普通用户:HR(密码:hr)

设置完成之后会有警告,点击继续,即可

修改完成之后单击确定。

Enterprise Manager Database Control URL - (orcl) :

https://localhost:1158/em

口令管理修改后再进入界面就是这个样子。

最后我们完成了安装。

数据库配置文件已经安装到 D:\Oracle\Oracle11g,同时其他选定的安装组件也已经安装到 D:\Oracle\Oracle11g\product\11.2.0\dbhome_1。

最后一步打开网址:https://localhost:1158/em

edge显示:

点击帮助出现“完成 此对话框显示 Oracle 数据库的安装已成功。 单击关闭。 版权所有 © 2007, 2009, Oracle 和/或其子公司。保留所有权利。”

说明安装成功。

PL/SQL developer的下载、安装、使用、破解

PL/SQL Developer是一个集成开发环境,专门开发面向Oracle数据库的应用。PL/SQL也是一种程序语言,叫做过程化SQL语言(Procedural Language/SQL)。PL/SQL是Oracle数据库对SQL语句的扩展。在普通SQL语句的使用上增加了编程语言的特点,所以PL/SQL把数据操作和查询语句组织在PL/SQL代码的过程性单元中,通过逻辑判断、循环等操作实现复杂的功能或者计算。PL/SQL 只有 Oracle 数据库有。 MySQL 目前不支持 PL/SQL 的,但支持Navicat Premium。

下载 PL/SQL developer

直接进入官网下载网址:https://www.allroundautomations.com/registered-plsqldev/

或者进入官网,自己寻找下载

进入PL/SQL developer官网https://www.allroundautomations.com/

找到下载完的安装包,双击打开。

选择enter license information,

本站下载并解压,

运行keygen注册机,将注册机中的注册信息对应复制到软件中,点击next,

安装中,稍等一会儿,安装完成,点击finish退出向导

运行PL/SQL developer

打开软件后,

参考

Oracle 11g安装及配置详解

PL/SQL developer的下载、安装、使用、破解,亲自测试。安全使用。

PL/SQL Developer v15.0.3.2059 中文激活版(附补丁+安装教程) 32位/64位

Oracle 11g+PLSQL Developer+SQL Developer+JDK 详细安装教程

win10安装Oracle11g常见问题

Windows下Oracle安装图解—-oracle-win-64-11g 详细安装步骤

(保姆级)Oracle的下载及安装详细教程

oracle-解决httpslocalhost1158em页面无法打开的问题.docx

Win10下安装Oracle11g 不满足配置解决方法

win11&win7下安装oracle11g数据库全过程

oracle-安装系统报:Environment variable: “PATH” 预期值 : 1023 实际值 : 1090,解决方案

安装ORACLE服务出现Oracle Net Configuration Assistant 失败问题

Windows10安装出现Oracle Net Configuration Assistant 失败

Oracle 11g安装错误提示未找到wfmlrsvcapp.ear的解决方法

使用Sublime Text 4写Markdown

使用Sublime Text 4写Markdown

编辑插件

推荐安装Markdown Editing, github主页
Ctrl+Shift+P,输入install打开 Package Control: Install Package,搜索选中MarkdownEditing,回车安装。
菜单栏打开首选项-配色方案,输入 MarkdownEditing,有MarkdownEditor、MarkdownEditor-Dark、MarkdownEditor-Focus、MarkdownEditor-Yellow、MarkdownEditor-Arcdark四种配色方案。
接下来看一下插件设置,打开首选项-Package-Settings-Markdown Editing,打开了一个Preference.sublime-settings文件,有些朋友打开以后可能跟我一样,默认是这样的——

{
	"ignored_packages":
	[
		"Vintage",
	],
}

我们查一下什么是Vintage?

启用复古

Vintage是一个用于Sublime Text的vi模式编辑包。它允许您将vi的命令模式与Sublime Text的功能(包括多个选择)组合。
复古默认情况下禁用,通过ignored_pa​​ckages设置。如果您删除“复古”从忽略的软件包列表,你就可以用vi键编辑:

  1. 选择▸设置首选项菜单项
  2. 编辑ignored_pa​​ckages设置,对其进行更改:
"ignored_packages": ["Vintage"]

至:

"ignored_packages": []

现在保存文件。
3. 复制模式现已启用 - 您将在状态栏中看到“INSERT MODE”
默认情况下,复古以插入模式启动。可以通过向用户设置添加以下设置来更改此设置:

"vintage_start_in_command_mode": true

Vintage Mode – Sublime Text 3 Documentation

包含什么

复古包括最基本的动作:d(删除),y(复制),c(更改),gu(小写),gU(大写),g〜(rot13),<(unindent)和>(indent)。

它还包括许多运动,包括l,h,j,k,w,w,e,E,b,B,alt + w(通过子词移动),alt + W(通过子词向后移动) $,^,%,0,G,gg,f,F,t,T,^ f,^ b,H,ML.

支持文本对象,包括单词,引号,括号和标签。

重复(’。’)在那里,指定命令和动作的计数。支持寄存器,宏和书签。还支持许多其他杂项命令,例如*,/,n,N,s,S等。

什么不是

插入模式是常规的Sublime Text编辑,与通常的Sublime Text键绑定:vi插入模式键绑定不会被模拟。
Ex命令不实现,除了:w和:e,它们通过命令选项板工作。

当你打开首选项-配色方案和主题,不作修改,插件设置会多出这两行。

	"color_scheme": "Mariana.sublime-color-scheme",
	"theme": "auto",

这里介绍几个推荐的配置。

"highlight_line": true, // 高亮正在编辑的行
"line_numbers": true,   // 显示行号
"tab_size": 4,          // tab宽度
"translate_tabs_to_spaces": true,   // tab转换为空格
"trim_trailing_white_space_on_save": true,  // 保存时去掉行尾空格
"word_wrap": true,      // 自动换行
"wrap_width": "auto",    // 换行的宽度,默认80会造成左侧大量留白
"mde.keep_centered": true,  // 可以保持你正在编辑的行始终处于屏幕的中间

预览插件

MarkdownLivePreview

MarkdownLivePreview可以实现实时预览,在首选项->Package Setting里修改MarkdownLivePreview的user配置文件,设置在打开时同步预览。

"markdown_live_preview_on_open": true

如果安装后在 Package Setting 中未找到该插件,Ctrl+Shift+P,输入MarkdownLivePreview: Open Settings
官网:MarkdownLivePreview 3
要打开预览,只需打开一个markdown文件,并在命令 调色板,您应该找到MarkdownLivePreview: Open Preview。
如果你想使用一个键绑定,只需要将这个添加到你的 keybinding 文件中。

{
    "keys": ["alt+m"],
    "command": "open_markdown_preview"
}

这个插件的预览效果并不理想,很难加载网络图片链接,比如github仓库图片。

而且不能横向滚动,调整编辑区和预览区中间的界限可以预览完整内容,实在不方便。而且装上它后虽然可以实时预览,但不知道因为什么原因输入的时候会有些卡。

实时自动刷新预览:MarkdownPreview + LiveReload

MarkdownPreview

功能

  1. 支持在浏览器中预览markdown文件
  2. 将md文件导出为html代码

将md文件用浏览器预览——1.常规方法

  1. 组合键 Ctrl+Shift+P 调出命令面板
  2. 输入mdp找到并选中Markdown Preview: Preview in Browser
  3. 出现两个选项:github和markdown。任选其一即可,github是利用GitHub的在线API来解析.md文件,支持在线资源的预览,如在线图片它的解析速度取决于你的联网速度。该方式据说一天只能打开60次。markdown就是传统的本地打开,不支持在线资源的预览。
  4. 默认浏览器中显示预览结果

将md文件用浏览器预览——2.用快捷键打开
在Preferences -> Package Settings -> Markdown Editing -> Key Bindings打开的文件的右侧栏的中括号中添加一行代码:

{ 
"keys": ["alt+m"],
"command": "markdown_preview",
"args": {"target": "browser", "parser":"markdown"}
}

“alt+m” 可设置为自己喜欢的按键。
“parser”: “markdown"也可设置为"parser”:“github”,改为使用Github在线API解析markdown。

配置Markdown Preview
打开配置文件 Preferences -> Package Settings -> Markdown Preview -> Settings,检查左侧enable_autoreload条目是否为true,若是,跳过。若不是,右侧栏加一条下面这个后重启Sublime:

{
    "enable_autoreload": true
}

LiveReload

Ctrl+Shift+p, 输入 Install Package,输入LiveReload,回车安装
安装成功后,再次Ctrl+shift+p,输入LiveReload: Enable/disable plug-ins,回车,选择 Simple Reload with delay (400ms)或者Simple Reload,两者的区别仅仅在于后者没有延迟。
Package Control下载报错

打开控制台查看Ctrl + 反引号

DPI mode: system
DPI scale: 1
startup, version: 4143 windows x64 channel: stable
executable: /C/Program Files/Sublime Text/sublime_text.exe
application: /C/Program Files/Sublime Text
working dir: /C/Program Files/Sublime Text
packages path: /C/Users/Administrator/AppData/Roaming/Sublime Text/Packages
state path: /C/Users/Administrator/AppData/Roaming/Sublime Text/Local
zip path: /C/Program Files/Sublime Text/Packages
zip path: /C/Users/Administrator/AppData/Roaming/Sublime Text/Installed Packages
ignored_packages: ["Vintage"]
pre session restore time: 0.120201
startup time: 0.146201
first paint time: 0.209201
git: using configuration from C:\Program Files\Git\cmd\git.exe
git: tracking working dir E:\xiaxi626.github.io
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading python 3.3 plugin 0_package_control_loader.00-package_control
reloading plugin Default.symbol
reloading python 3.3 plugin 0_package_control_loader.01-pygments
reloading plugin Default.transform
reloading plugin Default.transpose
reloading python 3.3 plugin 0_package_control_loader.50-backrefs
reloading python 3.3 plugin 0_package_control_loader.50-markupsafe
reloading plugin Default.ui
reloading python 3.3 plugin 0_package_control_loader.50-pymdownx
reloading python 3.3 plugin 0_package_control_loader.50-python-markdown
reloading python 3.3 plugin 0_package_control_loader.50-pyyaml
reloading python 3.3 plugin 0_package_control_loader.51-python-jinja2
reloading python 3.3 plugin 0_package_control_loader.55-mdpopups
reloading python 3.3 plugin Alignment.Alignment
reloading plugin CSS.css_completions
reloading python 3.3 plugin AutoFileName.autofilename
reloading python 3.3 plugin AutoFileName.getimageinfo
reloading python 3.3 plugin BracketHighlighter.bh_core
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin ShellScript.ShellScript
reloading plugin Emmet.main
reloading plugin MarkdownEditing.plugin
reloading python 3.3 plugin BracketHighlighter.bh_logging
reloading python 3.3 plugin BracketHighlighter.bh_plugin
reloading python 3.3 plugin BracketHighlighter.bh_popup
reloading python 3.3 plugin BracketHighlighter.bh_regions
reloading python 3.3 plugin BracketHighlighter.bh_remove
reloading python 3.3 plugin BracketHighlighter.bh_rules
reloading python 3.3 plugin BracketHighlighter.bh_search
reloading python 3.3 plugin BracketHighlighter.bh_swapping
reloading python 3.3 plugin BracketHighlighter.bh_wrapping
reloading python 3.3 plugin BracketHighlighter.support
reloading python 3.3 plugin ChineseLocalizations.Localization
reloading python 3.3 plugin DocBlockr.jsdocs
reloading python 3.3 plugin FileDiffs.file_diffs
reloading python 3.3 plugin Markdown Preview.helper
reloading python 3.3 plugin Markdown Preview.markdown_settings
reloading python 3.3 plugin Markdown Preview.markdown_wrapper
reloading python 3.3 plugin Markdown Preview.MarkdownPreview
reloading python 3.3 plugin Package Control.1_reloader
reloading python 3.3 plugin Package Control.2_bootstrap
reloading python 3.3 plugin Package Control.Package Control
plugins loaded
Package Control: Skipping automatic upgrade, last run at 2023-05-02 20:12:26, next run at 2023-05-02 21:12:26 or after

没找到所谓

由于github采用https协议,sublime使用urllib就会报错

解决方法1:
Preference -> Package Setting -> Package Control -> User Setting
增加如下内容:

"debug": true,
"downloader_precedence":
{
    "linux": [ "curl", "urllib", "wget" ],
    "osx": [ "curl", "urllib" ],
    "windows": [ "wininet" ]
},

最终内容如下:

{
    "bootstrapped": true,
    "debug": true,
    "installed_packages":
    [
        "Package Control"
    ],
    "downloader_precedence":
    {
        "linux": [ "curl", "urllib",    "wget" ],
        "osx": [ "curl", "urllib" ],
        "windows": [ "wininet" ]
    },
}

再次安装插件就没问题了。

解决方法2:
大家安装时会注意到该插件已经是2013年的插件了

直接打开网址发现已经404,搜索同名插件会发现一个sgricci/LiveReload-sublimetext2
仓库让我们

Install with [Sublime Package Control](http://wbond.net/sublime_packages/package_control “Sublime Package Control), search for LiveReload and install.

但这样安装不了它,我们可以从指定github仓库安装插件

  1. Crtl + Shift + p 调出 package control,输入 add repository,确定
  2. 输入 github 仓库地址,例如 https://github.com/sgricci/LiveReload-sublimetext2 (Notice:结尾的.git要去掉)
  3. Crtl + Shift + p 调出 package control,输入 install package,确定,然后再输入 github 仓库的名称,比如 LiveReload,确定安装。

解决方法3:
安装另一款更新的LiveReload,如NickWoodhams/LiveReload,方法同上。

Installation

Open package control and choose Package Control: Add Repository Add this git repository https://github.com/NickWoodhams/LiveReload.git Open package control again and choose Package Control: Install Package Search for LiveReload and you’ll see the Git url under the title. Choose the LiveReload we just added.

To Use

Open package control and search LiveReload and you’ll see several options including Disable/enable plugins.

开始使用

如前面提到的手动或者快捷键打开预览网页,之后便再也不用管它,只要你的sublime保存一次,网页那边就会自动刷新预览。

OmniMarkupPreviewer

OmniMarkupPreviewer是Sublime Text 2和Sublime Text 3的一个插件,用于在Web浏览器中预览markups。OmniMarkupPreviewer将Markup呈现为htmls并将其发送到后台的Web浏览器,从而实现实时预览。此外,OmniMarkupPreviewer还支持将结果导出到html文件。

  1. 调出命令面板(Windows和Linux上的Ctrl+Shift+P。OS X上的++P)。
  2. 键入“Install”并选择“Package Control: Install Package”。
  3. 从列表中选择“OmniMarkupPreviewer”。

Key Bindings
默认 key bindings:

Windows, Linux:

  • Ctrl+Alt+O: 在浏览器中预览Markup。
  • Ctrl+Alt+X: 将Markup导出为HTML。
  • Ctrl+Alt+C: 将Markup复制为HTML。

OSX:

  • ++O: 在浏览器中预览Markup。
  • ++X: 将Markup导出为HTML。
  • Ctrl+Alt+C: 将Markup复制为HTML。

Command Palette

命令选项板中可用的OmniMarkupPreviewer命令:

  • OmniMarkupPreviewer: Preview Current Markup in Browser
  • OmniMarkupPreviewer: Export Current Markup as HTML
  • OmniMarkupPreviewer: Empty Cache

注意 如果当前文件语法(或文件名)与任何OmniMarkupPreviewer渲染器都不匹配,则命令将不可用(灰显)。

Error: 404 Not Found

Sorry, the requested URL 'http://127.0.0.1:50000/view/68' caused an error:

'buffer_id(68) is not valid (closed or unsupported file format)'

**NOTE:** If you run multiple instances of Sublime Text, you may want to adjust
the `server_port` option in order to get this plugin work again.

请修改OmniMarkupPreviewer的Settings-Default,调整“server_port”选项,默认为

"server_port": 51004,

1、127.0.0.1拒绝了我们的连接请求
在控制面板中,打开程序与功能。

重新安装llS,记得展开全部勾选。安装完毕后,进入127.0.0.1出现以下画面就是成功了。

2、‘buffer_id(68) is not valid (closed or unsupported file format)’
修改“server_port”为80得,

于是我上网查了一下,有这么几种方法——

更改服务器或端口

404错误有可能是服务器更改服务器地址或者端口出错,这两样可以在Preferences > Package Settings > OmniMarkupPreviewer > Settings - Default里面更改:

// 原配置
"server_host": "127.0.0.1",
"server_port": 51004,

// 更改后的配置
"server_host": "0.0.0.0",
"server_port": 52000,

并不确定是端口还是服务器地址的问题,所以可以一项项更改后看效果。

删除Strikethrough扩展

进入Preferences > Package Settings > OmniMarkupPreviewer > Settings - User 粘贴以下内容,然后保存。\

{
    "renderer_options-MarkdownRenderer": {
        "extensions": ["tables", "fenced_code", "codehilite"]
    }
}

修复Strikethrough扩展

要修复这个扩展需要先找到扩展的存放位置:

Mac

subl “/Users//Library/Application Support/Sublime Text 3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/mdx_strikeout.py”

Linux

~/.config/sublime-text-3/Packages/OmniMarkupPreviewer/OmniMarkupLib/Renderers/libs/mdx_strikeout.py

Windows平台就自己找了,文件是OmniMarkupPreviewer目录下的mdx_strikeout.py即可。

然后直接更改配置文件,将最后的

def makeExtension(configs=None):
    return StrikeoutExtension(configs=configs)

更改完后是这样的:

import markdown
from markdown.inlinepatterns import SimpleTagPattern


STRIKEOUT_RE = r'(\~\~)([^\s](?:.*))(\~\~)'


class StrikeoutExtension(markdown.Extension):
    """ Strikeout extension for Python-Markdown. """

    def extendMarkdown(self, md, md_globals):
        """ Modifies inline patterns. """
        md.inlinePatterns.add('del', SimpleTagPattern(STRIKEOUT_RE, 'del'), '<not_strong')


#def makeExtension(configs=None):
#    return StrikeoutExtension(configs=configs)
def makeExtension(*args, **kwargs):
    return StrikeoutExtension(*args, **kwargs)

表格格式化+自动完成

Table Editor 可以帮助你自动完成表格并格式化,快捷键tab
Ctrl+Shift+P,选择 Table Editor: Enable for current syntax or Table Editor: Enable for current view 或 “Table Editor: Set table syntax … for current view”
然后在 Table Editor 启用时键入

| Name | Phone |
|-

然后按Tab键,你会得到漂亮的打印表

| Name | Phone |
|------|-------|
| _    |       |

然后填写数据并按Tab键导航到下一个字段或添加新行(如有必要)

|    Name   |   Phone   |
|-----------|-----------|
| Anna      | 123456789 |
| Alexander | 987654321 |
| _         |           |

要让更快一点键入表格,只需

|Name|Phone

然后点击Ctrl+K,回车。

| Name | Phone |
|------|-------|
| _    |       |

Table Editor 支持带有字符‘=’的双插边线。在下面键入

| Name | Phone |
|=

并单击Tab键

| Name | Phone |
|======|=======|
| _    |       |

然后填充行并点击ctrl+k,每次光标在 Phone 位置时输入

|    Name   |   Phone   |
|===========|===========|
| Anna      | 123456789 |
|-----------|-----------|
| Alexander | 987654321 |
|-----------|-----------|
| _         |           |

除了tab和shift+tab之外,如果需要,还可以使用enter来向下移动光标并插入新行。
详细教程请见项目的github主页

生成目录

推荐使用 MarkdownTOC,MarkdownTOC插件具有丰富的功能和自定义功能,对于在单个 Markdown 文件或如果您有多个 Markdown需要特殊TOC生成的文档。

快速启动

  1. 安装 MarkdownTOC插件
  2. 打开 Markdown文件
  3. 将光标放在要插入目录的位置
  4. 从菜单中选择:工具>Markdown TOC>插入TOC
  5. 目录插入到 Markdown文件
  6. 保存文档,就完成了

现在你可以继续编辑你的文档,或者你可以自定义你的目录,详细介绍原文请查阅github仓库。本人全文翻译如下。

根据Markdown文档中的标题插入TOC

示例markdown文档:


# Heading 0

Headings before MarkdownTOC tags will be ignored.

◀ place the cursor here and generate the TOC

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

MarkdownTOC插件将开箱即用生成:

# Heading 0

Headings before MarkdownTOC tags will be ignored.

<!-- MarkdownTOC -->

- Heading 1
  - Heading 2

<!-- /MarkdownTOC -->

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

由此可见,在MarkdownTOC标签部分之上的标题被忽略,只有文档的其余部分被考虑在范围内。

保存Markdown文档时自动刷新目录

如果我们再编辑Markdown文档并添加一个额外的标题:

## Heading 3

当我们保存文档时,TOC会自动更新。

<!-- MarkdownTOC -->

- Heading 1
  - Heading 2
  - Heading 3

<!-- /MarkdownTOC -->

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

## Heading 3
Lorem ipsum... (the added text)

删除的标题也是如此,这些都被清除了。
通过从菜单中选择,也可以在不保存的情况下完成TOC的更新:工具>Markdown TOC>更新TOC

支持的文件扩展名

确保文件的扩展名在以下列表中。
.md .markdown .mdown .mdwn .mkdn .mkd .mark

使用属性自定义TOC的生成

<!-- MarkdownTOC autolink="true" -->

- [Heading 1](#heading-1)
  - [Heading 2](#heading-2)
  - [Heading 3](#heading-3)

<!-- /MarkdownTOC -->

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

## Heading 3
Lorem ipsum... (the added text)
  1. TOC标记可以覆盖默认值 属性 使用本地设置并影响TOC的呈现。参见: 配置 关于如何为插件设置自己的默认值
  2. 标题可以自动链接(请参阅:自动链接
  3. 标题可以自动链接锚点(请参阅:当标题已定义锚点时自动锚定

默认行为也可以描述为:

<!-- MarkdownTOC levels="1,2,3,4,5,6" autolink="false" bracket="round" autoanchor="false" style="unordered" indent="\t" -->

请看: Github配置 以获取配置MarkdownTOC的指南 GitHub使用。

当标题已定义锚点时自动锚点

您可以在标题前自动添加HTML锚(<a name="xxx"></a>)。

# Heading with anchor [with-anchor]

TOC生成可以被指定为尊重这一点,并且生成以下格式的TOC元素:

- [Heading with anchor](#with-anchor)

请注意,该属性的默认值为:autoanchorfalse。您可以在标题前自动添加HTML锚点(<a name="xxx"></a>)。

<!-- MarkdownTOC autolink="true" autoanchor="true" -->

- [Changelog](#changelog)
- [Glossary](#glossary)
- [API Specification](#api-specification)

<!-- /MarkdownTOC -->

<a name="changelog"></a>
# Changelog
Lorem ipsum...

<a name="glossary"></a>
# Glossary
Lorem ipsum...

<a name="api-specification"></a>
# API Specification
Lorem ipsum...

请注意,自动链接的默认值是由属性false定义的defaults.autoanchor。另请参阅:如何删除MarkdownTOC添加的锚点

可点击目录的自动链接

该插件可以被指定为自动链接标题,这样你就可以得到一个带有可点击超链接元素的目录。
以下示例文档:

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

## Heading 3
Lorem ipsum...

autolink设置为true将呈现以下内容:

<!-- MarkdownTOC autolink="true" -->

- [Heading 1](#heading-1)
  - [Heading 2](#heading-2)
  - [Heading 3](#heading-3)
  - [Heading 4](#heading-4)
- [Heading with anchor](#with-anchor)

<!-- /MarkdownTOC -->

自动链接标记样式可以是以下样式之一:

请注意,自动链接的默认值是由属性false定义的defaults.autolink

<!-- MarkdownTOC autolink="false" -->

- MarkdownTOC Plugin for Sublime Text
  - Feature
  - Feature
  - Feature

<!-- /MarkdownTOC -->
<!-- MarkdownTOC autolink="true" -->

- [MarkdownTOC Plugin for Sublime Text](#markdowntoc-plugin-for-sublime-text)
  - [Feature](#feature)
  - [Feature](#feature-1)
  - [Feature](#feature-2)

<!-- /MarkdownTOC -->

round: 根据 Github 风格。

<!-- MarkdownTOC bracket="round" -->

- [Heading](#heading)

<!-- /MarkdownTOC -->

square: 根据 “Markdown standard reference-style links”

<!-- MarkdownTOC bracket="square" -->

- [Heading][heading]

<!-- /MarkdownTOC -->

Lowercasing in ids(在ids中小写)

默认情况下,插件小写ASCII基于字母(az)的自动链接。

<!-- MarkdownTOC autolink="true" -->

- [ПРИМЕР EXAMPLE][ПРИМЕР-example]

<!-- /MarkdownTOC -->

# ПРИМЕР EXAMPLE

这与将lowercase属性设置为only_ascii相同。

<!-- MarkdownTOC autolink="true" lowercase="only_ascii" -->

- [ПРИМЕР EXAMPLE][ПРИМЕР-example]

<!-- /MarkdownTOC -->

# ПРИМЕР EXAMPLE
保存案例

您可以通过将lowecase属性设置为false来禁用小写功能。

<!-- MarkdownTOC autolink="true" lowercase="false" -->

- [One Two Three][One-Two-Three]

<!-- /MarkdownTOC -->

# One Two Three
小写所有字符

此外,您还可以通过将lowercase属性设置为all(或除falseonly_ascii之外的任何值)来扩展小写功能。

<!-- MarkdownTOC autolink="true" lowercase="all" -->

- [ПРИМЕР EXAMPLE][пример-example]

<!-- /MarkdownTOC -->

# ПРИМЕР EXAMPLE

您也可以在配置中使用密钥 defaults.lowercase 来指定这一点。

自动链接ID的操作

您可以使用密钥 id_replacements配置中操作链接ID。

{
  "id_replacements": [
    {
      "pattern": "\\s+",
      "replacement": "-"
    },
    {
      "pattern": "!|#|$|&|'|\\(|\\)|\\*|\\+|,|/|:|;|=|_|\\?|@|\\[|\\]|`|\"|\\.|<|>|{|}|™|®|©|&lt;|&gt;|&amp;|&apos;|&quot;|&#60;|&#62;|&#38;|&#39;|&#34;",
      "replacement": ""
    }
  ]
}
  1. 每个集合都允许使用正则表达式
    • 它将被简单地扩展为python的re。sub(pattern,replacement,id)
  2. 替换序列从上到下执行

举个例子:

# Super Product™

此标题的此标题链接更改为以下id

#super-product
  • 由于’ ‘包含在第一组中,因此将-(空格)替换为’ ‘(破折号)
  • 由于“™”包含在第二个集合中,因此“™”被替换为空

URI编码

默认情况下,链接ID中的非ASCII字符是URL编码的。

<!-- MarkdownTOC autolink="true" -->

- [Ejemplos de español](#ejemplos-de-espa%C3%B1ol)
- [日本語の例](#%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E4%BE%8B)
- [Примеры русского](#%D0%9F%D1%80%D0%B8%D0%BC%D0%B5%D1%80%D1%8B-%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%BE%D0%B3%D0%BE)
- [中国的例子](#%E4%B8%AD%E5%9B%BD%E7%9A%84%E4%BE%8B%E5%AD%90)

<!-- /MarkdownTOC -->

# Ejemplos de español
# 日本語の例
# Примеры русского
# 中国的例子

如前所述,您可以通过将uri_encoding属性设置为false来禁用此选项,如下所示:uri_encoding="false".

<!-- MarkdownTOC autolink="true" uri_encoding="false" -->

- [Ejemplos de español](#ejemplos-de-español)
- [日本語の例](#日本語の例)
- [Примеры русского](#Примеры-русского)
- [中国的例子](#中国的例子)

<!-- /MarkdownTOC -->

# Ejemplos de español
# 日本語の例
# Примеры русского
# 中国的例子

Markdown Preview兼容

如果你想在 Markdown Preview 中使用MarkdownTOC,您应该使用markdown_preview属性。 您可以将此属性设置为markdowngithub
当你将它设置为markdown时,你可以得到MarkdownPreview的markdown解析器呈现的相同链接。

<!-- MarkdownTOC autolink="true" markdown_preview="markdown" -->

- [Hello 世界 World](#hello-world)
- [ESPAÑA](#espana)
- [ПРИМЕР RUSSIAN](#russian)

<!-- /MarkdownTOC -->

# Hello 世界 World
# ESPAÑA
# ПРИМЕР RUSSIAN

当你将它设置为github时,你可以得到MarkdownPreview的github解析器呈现的相同链接。

<!-- MarkdownTOC autolink="true" markdown_preview="github" -->

- [Hello 世界 World](#hello-%25E4%25B8%2596%25E7%2595%258C-world)
- [ESPAÑA](#espa%25C3%25B1a)
- [ПРИМЕР RUSSIAN](#%25D0%25BF%25D1%2580%25D0%25B8%25D0%25BC%25D0%25B5%25D1%2580-russian)

<!-- /MarkdownTOC -->

# Hello 世界 World
# ESPAÑA
# ПРИМЕР RUSSIAN

目前不支持其他解析器。
如果要禁用此功能,请将其设置为false

链接前缀

也可以设置链接的前缀。

<!-- MarkdownTOC autolink=true link_prefix="user-content-" -->

- [My Heading](#user-content-my-heading)

<!-- /MarkdownTOC -->

# My Heading

您可以在您的配置中使用密钥 defaults.link_prefix 进行操作。

控制TOC中列出的等级

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

### Heading 3
Lorem ipsum...

#### Heading 4
Lorem ipsum...

使用默认级别:

<!-- MarkdownTOC -->

- Heading 1
  - Heading 2
    - Heading 3
      - Heading 4

<!-- /MarkdownTOC -->

将级别设置为1,2时:

<!-- MarkdownTOC levels="1,2" -->

- Heading 1
  - Heading 2

<!-- /MarkdownTOC -->

请注意, 属性levels是"1,2,3,4,5,6",这意味着将包括所有标题大小。
您也可以在配置中使用密钥 defaults.levels 来指定这一点。
标题的最大大小为6,根据 Markdown规范

TOC元素的有序或无序样式

该插件支持两种样式的TOC元素列表:

  • unordered
  • ordered

一个Markdown文档,包含以下内容:

# Heading 1
Lorem ipsum...

## Heading 2
Lorem ipsum...

### Heading 3
Lorem ipsum...

### Heading 4
Lorem ipsum...

## Heading 5
Lorem ipsum...

# Heading 6
Lorem ipsum...

将使用 unordered 样式:

<!-- MarkdownTOC style="unordered" -->

- Heading 1
  - Heading 2
    - Heading 3
    - Heading 4
  - Heading 5
- Heading 6

<!-- /MarkdownTOC -->

ordered 样式:

<!-- MarkdownTOC style="ordered" -->

1. Heading 1
  1. Heading 2
    1. Heading 3
    1. Heading 4
  1. Heading 5
1. Heading 6

<!-- /MarkdownTOC -->

请注意,该属性的默认值为:unordered
您可以在配置中使用密钥 defaults.style 设置默认样式。

TOC中可自定义列表项目符号

您可以定义用于每个级别的TOC的列表项。第一个项目用于第一级,第二个项目用于第二级,依此类推,直到列表的最后一个项目,然后从头开始。

<!-- MarkdownTOC bullets="-,+,*" -->

- foo
  + bar
    * baz
      - foo
        + bar
          * baz

<!-- /MarkdownTOC -->

您可以在配置中使用密钥 defaults.bullets 设置默认列表项目符号。
上面的例子也可以描述为:

{
  "defaults": {
    "bullets": ["-","+","*"]
  }
}

也可以在属性中设置。在这种情况下,值类型是**‘conmma separated string’**。

<!-- MarkdownTOC bullets="-,+,*" -->

指定自定义缩进前缀

缩进前缀是用于缩进TOC元素的字符串的规范。
一个_丑陋_但具有示范性的例子可能是使用表情符号

<!-- MarkdownTOC autolink="true" indent=":point_right: " -->

- [Heading 1](#heading-1)
:point_right: - [Heading 2](#heading-2)
:point_right: :point_right: - [Heading 3](#heading-3)
:point_right: :point_right: - [Heading 4](#heading-4)
:point_right: - [Heading 5](#heading-5)
- [Heading 6](#heading-6)

<!-- /MarkdownTOC -->

请注意,该属性的默认值为:'\t'
您可以使用密钥 defaults.indent配置中设置默认缩进。

保留标题中的图像

如果要保留标题中的图像,请将remove_image设置为false

<!-- MarkdownTOC remove_image="false" -->

- ![check](check.png) Everything is OK

<!-- /MarkdownTOC -->

# ![check](check.png) Everything is OK

请注意,该属性的默认值为:false

<!-- MarkdownTOC -->

- Everything is OK

<!-- /MarkdownTOC -->

# ![check](check.png) Everything is OK

您可以使用密钥 remove_image 默认值更改配置中的默认设置。

排除标题

您可以通过在包含标题的行上方的行添加特殊注释来排除TOC中的某些标题,如下所示。

<!-- MarkdownTOC:excluded -->
## This heading will be excluded

Usage用途

  1. 打开 Markdown文件
  2. 将光标设置为要插入TOC的位置
  3. 从菜单中选择:工具>Markdown TOC>插入TOC
  4. TOC插入文档中
  5. 评估TOC并使用 attributes(属性) 或 configuration(配置)
  6. 更新内容并保存…
  7. TOC已更新

如果你想每次保存时都更新,不要删除评论标签(comment tags)。

Tips

局限性

Attributes属性

以下属性可用于控制TOC的生成。

attribute values default
autoanchor trueorfalse false
autolink trueorfalse false
bracket “round"or"square” “round”
indent string “\t”
levels string (decimal list separated with ,) “1,2,3,4,5,6”
link_prefix string "”
bullets string “-”
lowercase “all"or"only_ascii"or"false” “only_ascii”
remove_image trueorfalse true
style “ordered” or “unordered” “unordered”
uri_encoding trueorfalse true
markdown_preview ““or"github"or"markdown” "”

你可以通过软件包首选项来定义自己的默认值,这是Sublime Text允许用户自定义软件包设置的方式。有关MarkdownTOC的更多详细信息,请参阅配置部分

Installation 安装

Configuration 配置

你可以用属性在单个目录中自定义目录 Markdown 文档,但如果您希望跨多个目录保持相同的目录配置 Markdown 文档,您可以配置自己的默认值。

选择:Sublime Text > Preferences > Package Settings > MarkdownTOC > Settings - User

或者,您可以手动创建文件 ~/Library/Application Support/Sublime Text 3/Packages/User/MarkdownTOC.sublime-settings。

示例:MarkdownTOC.sublime-settings

{
 "defaults": {
   "autolink": true,
   "bracket": "square",
   "levels": "1,2",
   "indent": "    ",
   "remove_image": false,
   "bullets": "*",
   "style": "ordered"
 },
 "id_replacements": [
   {
     "pattern": "\\s+",
     "replacement": "-"
   },
   {
     "pattern": "&lt;|&gt;|&amp;|&apos;|&quot;|&#60;|&#62;|&#38;|&#39;|&#34;|!|#|$|&|'|\\(|\\)|\\*|\\+|,|/|:|;|=|_|\\?|@|\\[|\\]|`|\"|\\.|<|>|{|}|™|®|©",
     "replacement": ""
   }
 ]
}

请参阅属性以获得值和自定义部分
配置优先级如下:

  1. MarkdownTOC开始标记中指定的属性(请参见:使用属性自定义TOC的生成
  2. MarkdownTOC设置-用户(本节)
  3. MarkdownTOC设置-默认(请参见:属性

有关属性背后的特定行为的概述,请参阅以下列表。

  • defaults.autolink, (see: Auto linking for clickable TOC)
  • defaults.autoanchor, (see: Auto anchoring when heading has anchor defined)
  • defaults.bracket, (see: Auto linking for clickable TOC)
  • defaults.indent, (see: Specify custom indentation prefix)
  • defaults.link_prefix, (see: Link Prefix)
  • defaults.levels, (see: Control of levels listed in TOC)
  • defaults.bullets, (see: Customizable list bullets in TOC)
  • defaults.lowercase, (see: Lowercasing in ids)
  • defaults.remove_image, (see: Preserve images in headings)
  • defaults.style, (see: Ordered or unordered style for TOC elements)
  • defaults.uri_encoding, (see: URI encoding)
  • defaults.markdown_preview, (see: Markdown Preview compatible)
  • id_replacements, (see: Manipulation of auto link ids)

Github配置

一种用于编写Markdown的配置,主要用于 GitHub 可以看起来像下面这样:

{
  "defaults": {
    "autolink": true,
    "bracket": "round",
    "lowercase": "only_ascii"
  }
}

配置和协作

你应该知道,如果你与其他Markdown编写者和MarkdownTOC的用户合作,你可能会因为不同的配置而来回更改。

如果是这种情况,并且您无法就配置达成一致,请选择使用文档中指定的属性进行配置。

文件中上述配置设置的属性配置示例:

<!-- MarkdownTOC autolink="true" bracket="round" autoanchor="true" -->

参考

使用Sublime Text 3写Markdown
sublime-text3打造markdown编辑器
Vintage Mode – Sublime Text 3 Documentation
Sublime Text 解决 Unable to download XXX 问题
Package Control下载报错
Sublime - 从指定github仓库安装插件_sumlime4 add repository

Sublime Text4安装及插件的安装卸载

Sublime Text4安装及插件的安装卸载

1、安装Sublime Text4

https://www.sublimetext.com/download 下载安装包,下载完成后点击安装即可。

2、安装插件

Package Control

要想安装其他的插件,首先就得安装Package Control。
打开Sublime Text4,按下Ctr+Shift+P快捷键,打开命令窗口,输入Install,选择Package Control: Install Package选项。

汉化

重复上一步的操作,会弹出如下搜索框,输入 Chinese,并选择第一项——“ChineseLocalizations”。

安装其他插件

重复操作。
在组件窗口中输入插件名称,选择插件进行安装。

等待安装,安装完成后,查看,Package Settings中是否存在插件。

从仓库安装插件

  1. Crtl + Shift + p 调出 package control,输入 add repository,确定
  2. 输入 github 仓库地址,例如 https://github.com/bani/SublimeFormatSQL (Notice:结尾的.git要去掉)
  3. Crtl + Shift + p 调出 package control,输入 install package,确定,然后再输入 github 仓库的名称,比如 SublimeFormatSQL,确定安装。

3、卸载插件

Ctrl+Shift+P 打开Package Control,输入remove package回车,然后找到你要卸载的插件进行卸载。

4、插件推荐

Emmet

代码快速编辑神器 视频演示地址http://docs.emmet.io/
只需要简单的输入一行代码,就可以快速生成代码结构

JSFormat

JavaScript的代码格式化插件
在已压缩的JS文件中,右键选择jsFormat或者使用默认快捷键(Ctrl+Alt+F)

SublimeCodeIntel

SublimeCodeIntel 作为一个代码提示和补全插件,支持 JavaScript、Mason、XBL、XUL、RHTML、SCSS、Python、HTML、Ruby、Python3、XML、Sass、XSLT、Django、HTML5、Perl、CSS、Twig、Less、Smarty、Node.js、Tcl、TemplateToolkit 和 PHP 等所有语言,是 Sublime Text 自带代码提示功能基础上一个更好的扩展,自带代码提示功能只可提示系统代码,而SublimeCodeIntel则可以提示用户自定义代码。SublimeCodeIntel支持跳转到变量、函数定义的功能,另外还有自动补全的功能,十分方便。

SublimeLinter

SublimeLinter是少数几个能在sublime text 3工作的代码检查插件,SublimeLinter支持JavaScript、CSS、HTML、Java、PHP、Python、Ruby等十多种开发语言,但前提是需要配置相应语言的环境,要检查JavaScript代码需要安装node.js,检查PHP代码需要安装PHP并配置环境等。SublimeLinter可以及时提示编写代码中存在的不规范和错误的写法,并培养我们良好的编码习惯和风格。

sublime-autoprefixer

快速给CSS添加私有前缀插件(解决各大浏览器兼容性问题)
Ctrl+Shift+P,选择autoprefixer

Bracket Highlighter

符号匹配插件
可匹配[], (), {}, “”, ”, <tag></tag>,高亮标记,便于查看起始和结束标记

Doc​Blockr

快速生成注释
输入/*、/**然后回车,还有很多用法https://packagecontrol.io/packages/DocBlockr

Alignment

Aligment插件让开发者自动对齐代码,包括PHP、CSS、JavaScript语言。使得代码看起来更整齐美观,更具可读性。

FileDiffs

FileDiffs插件可以让开发者比较两个不同文件的差异,比较的对象包括当前文件、另一文件、剪切板中的代码甚至未保存文件等。

ColorPicker

功能:调色板
简介:需要输入颜色时,可直接选取颜色
使用:快捷键Windows: ctrl+shift+c

IMESupport

sublime中文输入法支持光标跟随

ConvertToUTF8

功能:文件转码成utf-8
简介:通过本插件,您可以编辑并保存目前编码不被 Sublime Text 支持的文件,特别是中日韩用户使用的 GB2312,GBK,BIG5,EUC-KR,EUC-JP ,ANSI等。ConvertToUTF8 同时支持 Sublime Text 2 和 3。
使用:安装插件后自动转换为utf-8格式
使用:快捷操作为: Ctrl + Shift + h

AutoFileName

快捷输入文件名
输入"/"即可看到相对于本项目文件夹的其他文件

Git

功能:git管理
简介:插件基本上实现了git的所有功能
使用:https://github.com/kemayo/sublime-text-git/wiki

html-css-js prettify

功能:快速整理我们的代码结构,让代码缩进合适,删除多余的空格/空行
简介:一键美化HTML/CSS/JS代码

livereload

功能:插件实时预览html文件
使用:Sublime中使用livereload插件实时预览html文件

插件安装问题

解决There are no packages available for installation

通过Sublime Text的Package Control来安装一些插件,但是点击Package Control:Install Package之后一段时间,弹出一个窗口,提示信息为:There are no packages available for installation:

解决方法:
首选项-Package Settings-Package Control-Settings
添加如下配置:

"channels":[
		"http://cst.stu.126.net/u/json/cms/channel_v3.json"
	],

重启可用。

解决Unable to download XXX. Please view the console for more details.

解决方法:
Preferences 》Package Settings 》 Package Control 》 Settings - User
增加如下内容:

"debug": true,
"downloader_precedence":
{
    "linux": [ "curl", "urllib", "wget" ],
    "osx": [ "curl", "urllib" ],
    "windows": [ "wininet" ]
},

最终内容如下:

{
    "bootstrapped": true,
    "debug": true,
    "installed_packages":
    [
        "Package Control"
    ],
    "downloader_precedence":
    {
        "linux": [ "curl", "urllib",    "wget" ],
        "osx": [ "curl", "urllib" ],
        "windows": [ "wininet" ]
    },
}

再次安装插件就没问题了。

参考

sublime实用插件推荐(最全)
推荐几款炫酷的Sublime Text插件
Git学习第(三)篇:Sublime Text3 Git插件安装与使用_sublime text git
VScode前端开发必备插件——Emmet配置及常用语法_vscode emmet插件
Sublime Text3安装及插件的安装卸载
Sublime Text 4 设置中文、汉化_sublime text4 中文
Sublime Text3解决There are no packages available for installation
Sublime Text 解决 Unable to download XXX 问题
Sublime - 从指定github仓库安装插件_sumlime4 add repository
sublime插件 —— 一键美化HTML/CSS/JS代码_sublime美化代码_我有两颗糖的博客
Sublime中使用livereload插件实时预览html文件_sublime预览html_fujuhao的博客

vim 的安装及配置

 vim 的安装及配置

vim的下载与安装

下载windows版vim

从github下载windows版的vim:https://github.com/vim/vim-win32-installer/releases

安装vim

无特殊要求默认安装即可。
安装完成后默认打开README文件。

添加环境变量

在安装路径中找到vim.exe或者gvim.exe(两者在同一文件夹下),复制路径。

右键我的电脑->属性->高级系统设置->环境变量,选中Path,并点击编辑,添加路径。

添加vim的一个用户变量$VIM,右键我的电脑->属性->高级系统设置->环境变量,点击上面的新建。
然后输入新建的环境变量名VIM以及变量值,并点击确定。

认识vim

安装结束后桌面Vim

菜单栏Vim

  1. 有g和没有g
    gVim 是在windows下的Gui图形用户界面的的 vim (GUI Vim),支持windows的一些快捷方式,支持鼠标操作
    vim 是在windows下的类似linux vi 编辑的界面,只能用键盘操作
    vim的操作指令同时适用于gVim
  2. Vim, Vim Diff, Vim Easy, Vim Read-only
    Diff 是用来对比两个文件内容用的,直接打开挺没用的,不过直接拖2个文件到快捷方式上倒是可行;
    Easy启动的时候是insert模式,适合普通windows用户的习惯;
    Read-Only的用途:比如用read-only打开已经用vim打开过的文件,就不会提示让人烦躁的.swp文件存在的问题;

我们暂时会使用Vim来入门,最后您会使用gVim编程,这是因为gVim在没有配置的时候比Vim还不方便操作。

Vim基本的使用说明

用Vim打开文件

在cmd下输入vim + 路径即可,同时直接将文件拖动到快捷方式图标上也可以。

Vim的四种模式

vim 共分为四种模式,分别是普通模式(Normal mode)、底行模式(Last line mode)、输入模式(Insert mode)和可视化模式(Visual mode)。四种模式的切换与作用如下

Normal Mode

这个模式一般用于浏览代码与进入底行模式输入命令,使用快捷键修改文章

快捷键 效果
h 或 向左箭头键(←) 光标向左移动一个字符
j 或 向下箭头键(↓) 光标向下移动一个字符
k 或 向上箭头键(↑) 光标向上移动一个字符
l 或 向右箭头键(→) 光标向右移动一个字符

用上面的按键你就可以上下浏览代码了,但是不建议使用方向键
Vim中还有一些键位是进行光标移动的

快捷键 效果
[Ctrl] + [f] 屏幕『向下』移动一页,相当于 [Page Down]按键 (常用)
[Ctrl] + [b] 屏幕『向上』移动一页,相当于 [Page Up] 按键 (常用)
[Ctrl] + [d] 屏幕『向下』移动半页
[Ctrl] + [u] 屏幕『向上』移动半页
+ 光标移动到非空格符的下一行
- 光标移动到非空格符的上一行
n < space > 那个 n 表示『数字』,例如 20 。按下数字后再按空格键,光标会向右移动这一行的 n 个字符。例如 20< space > 则光标会向后面移动 20 个字符距离。
M 光标移动到这个屏幕的中央那一行的第一个字符
L 光标移动到这个屏幕的最下方那一行的第一个字符
G 移动到这个档案的最后一行(常用)
nG n 为数字。移动到这个档案的第 n 行。例如 20G 则会移动到这个档案的第 20 行(可配合 :set nu)
gg 移动到这个档案的第一行,相当于 1G 啊! (常用)
n< Enter > n 为数字。光标向下移动 n 行(常用)

以上是光标移动命令,然后是文档查询替换命令

命令 作用
/word 向光标之下寻找一个名称为 word 的字符串。例如要在档案内搜寻 vbird 这个字符串,就输入 / vbird 即可! (常用)
?word 向光标之上寻找一个字符串名称为 word 的字符串。
n 这个 n 是英文按键。代表重复前一个搜寻的动作。举例来说, 如果刚刚我们执行 /vbird 去向下搜寻 vbird 这个字符串,则按下 n 后,会向下继续搜寻下一个名称为 vbird 的字符串。如果是执行 ?vbird 的话,那么按下 n 则会向上继续搜寻名称为 vbird 的字符串!
N 这个 N 是英文按键。与 n 刚好相反,为『反向』进行前一个搜寻动作。 例如 /vbird 后,按下 N 则表示『向上』搜寻 vbird 。
使用 /word 配合 n 及 N 是非常有帮助的!可以让你重复的找到一些你搜寻的关键词!
:n1,n2s/word1/word2/g n1 与 n2 为数字。在第 n1 与 n2 行之间寻找 word1 这个字符串,并将该字符串取代为 word2 !举例来说,在 100 到 200 行之间搜寻 vbird 并取代为 VBIRD 则: 『:100,200s/vbird/VBIRD/g』。(常用)
:1,$s/word1/word2/g 或 :%s/word1/word2/g 从第一行到最后一行寻找 word1 字符串,并将该字符串取代为 word2 !(常用)
:1,$s/word1/word2/gc 或 :%s/word1/word2/gc 从第一行到最后一行寻找 word1 字符串,并将该字符串取代为 word2 !且在取代前显示提示字符给用户确认 (confirm) 是否需要取代!(常用)

最后是最常用的增删改命令

快捷键 作用
x, X 在一行字当中,x 为向后删除一个字符 (相当于 [del] 按键), X 为向前删除一个字符( 相当于 [backspace] 亦即是退格键) (常用)
nx n 为数字,连续向后删除 n 个字符。举例来说,我要连续删除 10 个字符, 『10x』。
dd 删除游标所在的那一整行(常用)
ndd n 为数字。删除光标所在的向下 n 行,例如 20dd 则是删除 20 行 (常用)
d1G 删除光标所在到第一行的所有数据
dG 删除光标所在到最后一行的所有数据
d$ 删除游标所在处,到该行的最后一个字符
d0 那个是数字的 0 ,删除游标所在处,到该行的最前面一个字符
yy 复制游标所在的那一行(常用)
nyy n 为数字。复制光标所在的向下 n 行,例如 20yy 则是复制 20 行(常用)
y1G 复制游标所在行到第一行的所有数据
yG 复制游标所在行到最后一行的所有数据
y0 复制光标所在的那个字符到该行行首的所有数据
y$ 复制光标所在的那个字符到该行行尾的所有数据
p, P p 为将已复制的数据在光标下一行贴上,P 则为贴在游标上一行! 举例来说,我目前光标在第 20 行,且已经复制了 10 行数据。则按下 p 后, 那 10 行数据会贴在原本的 20 行之后,亦即由 21 行开始贴。但如果是按下 P 呢? 那么原本的第 20 行会被推到变成 30 行。 (常用)
J 将光标所在行与下一行的数据结合成同一行
c 重复删除多个数据,例如向下删除 10 行,[ 10cj ]
u 复原前一个动作。(常用)
[Ctrl]+r 重做上一个动作。(常用)
. 不要怀疑!这就是小数点!意思是重复前一个动作的意思。 如果你想要重复删除、重复贴上等等动作,按下小数点『.』就好了! (常用)

以上的增删改查命令有一定的命名规律,比如y是复制,然后复制什么没说,你用yw就是复制一个单词(word),重复写一个命令就是对这个对行操作,例如yy就是复制一行,还可以y+数字,例如y3就是复制三行,还可以与其他命令组合比如yG就是从当前光标位置复制到文档最后,这样组合才可以让我们高效的使用Vim

Last line mode模式

我一直觉得这就是Vim的Normal模式,结果别人都觉得这是一个新模式,那就当他是个新模式吧
你会发现在没有配置Vim的其他功能的时候,Vim的下面会写有一个Normal等,但是似乎下面还有一行,这一行是让你输入命令的,想要输入命令必须使用\或者:触发,\是用来查找内容的,严格说属于Normal模式,所以其实只有:开头的命令

命令 作用
:w 将编辑的数据写入硬盘档案中(常用)
:w! 若文件属性为『只读』时,强制写入该档案。不过,到底能不能写入, 还是跟你对该档案的档案权限有关啊!
:q 离开 vi (常用)
:q! 若曾修改过档案,又不想储存,使用 ! 为强制离开不储存档案。
注意一下啊,那个惊叹号 (!) 在 vi 当中,常常具有『强制』的意思~
:wq 储存后离开,若为 :wq! 则为强制储存后离开 (常用)
:w [filename] 将编辑的数据储存成另一个档案(类似另存新档)
:r [filename] 在编辑的数据中,读入另一个档案的数据。亦即将 『filename』 这个档案内容加到游标所在行后面
:n1,n2 w [filename] 将 n1 到 n2 的内容储存成 filename 这个档案。
:! command 暂时离开 vi 到指令行模式下执行 command 的显示结果!例如 『:! ls /home』即可在 vi 当中察看 /home 底下以 ls 输出的档案信息!

还有很多,但是都是特殊的命令,或者某一个插件特有的,这里不做介绍

Insert模式

插入模式是让你正常写代码的,注意的是,插入模式下hjkl的上下左右切换是失效的,可以用方向键,但是不建议,还是退出编辑模式在normal下改光标方便,进入插入模式的快捷键最常用的是i,还有如下的也可以

快捷键 作用
i, I 进入输入模式(Insert mode): i 为『从目前光标所在处输入』, I 为『在目前所在行的第一个非空格符处开始输入』。 (常用)
a, A 进入输入模式(Insert mode): a 为『从目前光标所在的下一个字符处开始输入』, A 为『从光标所在行的最后一个字符处开始输入』。(常用)
o, O 进入输入模式(Insert mode): 这是英文字母 o 的大小写。o 为『在目前光标所在的下一行处输入新的一行』; O 为在目前光标所在处的上一行输入新的一行!(常用)
r, R 进入取代模式(Replace mode): r 只会取代光标所在的那一个字符一次;R会一直取代光标所在的文字,直到按下 ESC 为止;(常用)

这一部分没什么好说的,因为没有快捷键(否则你打着打着代码就触发了什么快捷键)

Visual模式

可视化模式在很多文献中都没有介绍,但是是一个非常好用的模式,在这个模式下你可以用鼠标选择内容要选取一段文本,首先将光标移到段首,在普通模式下按 v 进入可视模式,然后把光标移到段末。 需要注意,光标所在字符是包含在选区中的

  • v 进入字符可视化模式
  • V 进入行可视化模式
  • Ctrl+v 进入块可视化模式
    块选择在表格中删除指定列非常有用
    用 v 命令进入的字符可视化模式(Characterwise visual mode)。文本选择是以字符为单位的。
    用 V 命令进入的行可视化模式(Linewise visual mode)。文本选择是以行为单位的。
    用 ctrl-V 进入的块可视化模式(Blockwise visual mode)。可以选择一个矩形内的文本。

使用鼠标或者hjkl即可选中字符/行/块,然后可以y,x…
更有用的是对块批量操作,例如批量注释可以这么写
批量注释:
Ctrl + v 进入块选择模式,然后移动光标选中你要注释的行,再按大写的 I 进入行首插入模式输入注释符号如 // 或 #,输入完毕之后,按两下 ESC,Vim 会自动将你选中的所有行首都加上注释,保存退出完成注释。
取消注释:
Ctrl + v 进入块选择模式,选中你要删除的行首的注释符号,注意 // 要选中两个,选好之后按 d 即可删除注释,ESC 保存退出
还可以在选择文字后输入:然后把你在平时这么用的就怎么写,注意按:会多出一些东西不要管他,例如

:A //这是一堆注释

然后Vim会根据你所写,先对每一样在Normal模式下使用A把光标移动到该行行尾,然后进入Insert模式输入//这是一堆注释对每一行都操作结束之后就会自动退出到Normal模式
具体的这个模式如何使用见Vim可视化入门

配置vim

安装好的vim文件夹下有一个_vimrc文件,相当于Linux下vim的.vimrc文件,在里面配置vim,大多数情况和Linux一样。
Windows 7 C:\Program Files\Vim\_vimrc中默认是这样的——

" Vim with all enhancements
source $VIMRUNTIME/vimrc_example.vim

" Use the internal diff if available.
" Otherwise use the special 'diffexpr' for Windows.
if &diffopt !~# 'internal'
  set diffexpr=MyDiff()
endif
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg1 = substitute(arg1, '!', '\!', 'g')
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg2 = substitute(arg2, '!', '\!', 'g')
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let arg3 = substitute(arg3, '!', '\!', 'g')
  if $VIMRUNTIME =~ ' '
    if &sh =~ '\<cmd'
      if empty(&shellxquote)
        let l:shxq_sav = ''
        set shellxquote&
      endif
      let cmd = '"' . $VIMRUNTIME . '\diff"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '\diff'
  endif
  let cmd = substitute(cmd, '!', '\!', 'g')
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3
  if exists('l:shxq_sav')
    let &shellxquote=l:shxq_sav
  endif
endfunction

你会发现在Vim安装目录和C://User/你的用户名下还有一个,我们使用自己用户名下的,如果没有的话就自己新建一个,这个不是因为你的Vim没安装,他就是没有。

第一个Vim配置,行号

找到或者新建这个文件,右键选中用Vim打开,我们就打开了一个空的_vimrc文件,试着往里面写下set number,这个配置的意思是自动为添加行号,这样你写代码就可以在左边看到行号了
按动ZZ(大写的)保存文件,然而行号并没有出来,这是因为我们没有"刷新配置文件",在Normal下输入命令:source $MYVIMRC然后你就可以看到行号了,至此你成功配置了第一个Vimrc

设置快捷键映射

但是这似乎比较麻烦,每次修改之后还要输入那么长的刷新保存,如果有个快捷键帮助我们就好了,我设置的快捷键是大写的R,也就是Shift+R,那么我们应该如何设置呢?首先要想好自己要设置的快捷键,不能与之前的快捷键相重合,还有快捷键的生效范围,是只有在Normal模式下生效还是在四个模式下都生效。例如我将大写R作为快捷键最好只在Normal下操作,否则在Insert模式下我输入大写的R就没法输入了,但是例如F5这样的快捷键从来不会与其他模式冲突我们就可以设置为全局的
快捷键映射可以将一个组合键映射到一个命令,一个其他的组合键或者其他语法为

前缀+map 快捷键 映射结果

这里的前缀限定了map的作用范围是那几个模式,不写前缀默认是前缀n

  • nmap:只有在Normal模式下生效
  • vmap:只有在Visual模式下生效
  • imap:只有在Insert模式下生效
  • cmap:只有在行底命令的模式下生效
  • Xnoremap:X是前面的n/v/i/c,nore表示非递归的例如a被映射为了b,b被映射为了c,那么如果是递归的的话a就映射为了c

对于被映射与要映射的动作按键遵循以下写法

  • 普通按键就直接写
  • Alt组合键写成<A-X>,例如Alt+S就是<A-S>
  • Ctrl组合键写成<C-X>,例如Ctrl+S就是<C-S>
  • FX写成<FX>,例如<F5>就是F5
  • 四个方向键写成<方向>,例如<LEFT>就是方向左键
  • ESC就写成<ESC>
  • Leader键就写成
  • 回车写成<CR>

关于leader键:
Vim预置有很多快捷键,再加上各类插件的快捷键,大量快捷键出现在单层空间中难免引起冲突。为缓解该问题,而引入了前缀键<leader>。藉由前缀键, 则可以衍生出更多的快捷键命名空间(namespace)。例如将r键配置为<leader>r<leader><leader>r等多个快捷键。前缀键默认为\
但是在我的键盘上\太远了,于是我就把leader换成了空格,只需要如下的命令let mapleader = "\<space>"写在开头就完成了替换。

针对上面的问题我们就可以把刷新配置文件映射成S,配置如下

map R :source $MYVIMRC<CR>

安装插件管理器

Vim好用就在于有大量插件供我们使用,这样我们可以自己配置自己喜欢的Vim,这里我们介绍插件管理器Vim-Pluig,同时我们一般的插件都是在GitHub上托管的,所以我们一般也是在GitHub上找插件,Vim的插件非常好识别,他使用的语言大多会写Vim script

打开插件管理器所在仓库。

下载如下文件并放入Vim的安装目录下的autoload。

这样我们就完成了插件管理器的安装
之后我们开始尝试安装第一个插件
首先在vimrc中写下这样三行,他可以帮助插件管理器识别你要装那些插件

call plug#begin('~/.vim/plugged')

call plug#end()

以后只要是需要安装的插件我们只需要把地址写在里面就可以直接安装了

另一款插件管理器—— Vundle 的安装教程:Windows gvim安装插件_gvim插件

尝试安装第一个插件

我们先来尝试安装一个主题插件。
首先我们找到这个主题的GitHub库
那如何告诉插件管理器我要安装这个插件,这个插件的安装包在哪里呢?
刚刚那个库的地址是
https://github.com/connorholyday/vim-snazzy
我们发现https://github.com/是GitHub的前缀,而插件管理器默认库在GitHub所以只要告诉插件connorholyday/vim-snazzy就可以了,于是我们只需要在哪两行代中间写上:

Plug 'connorholyday/vim-snazzy'

即为——

call plug#begin('~/.vim/plugged')
Plug 'connorholyday/vim-snazzy'
call plug#end()

完事,我们要让插件管理器去安装它,只需保存并刷新配置文件,输入命令:PlugInstall回车,等他跑完进度条即可。
至此我们完成了第一个插件的安装。

尝试卸载第一个插件

如果哪一天插件不想要了,可以卸载,方法很简单,要么删除插件安装的哪一行,要么把他注释掉(vim下的注释是"),然后保存刷新配置文件,输入命令:PlugClean

Powershell中使用Vim

执行Set-ExecutionPolicy RemoteSigned命令,在对话框中选择Y

重启Shell,输入vim进行测试

参考

1. vim 的安装及配置 - QIYUEXIN - 博客园
windows10安装配置vim_win10 vim_八块腹肌怎么练的博客
Vim使用全指南 (环境配置,插件推荐,美化) (C++,Python,MarkDown,R…)_vim 编辑插件_Liukairui的博客
Powershell中使用Vim_powershell输入vim后蓝屏了_themingyi的博客
(Linux学习笔记) - vi/vim编辑器的使用
Windows gvim安装插件_gvim插件_其铄的博客-CSDN博客

Hexo + Gitee 博客搭建详细指南

Hexo + Gitee 博客搭建详细指南

hexo安装

Hexo简介

Hexo是一款基于Node.js的静态博客框架,依赖少易于安装使用,可以方便的生成静态网页托管在GitHub和Coding上。
Hexo官网——快速、简洁且高效的博客框架

Hexo安装

1. 安装git,略

2. 安装node.js,略

3. 安装hexo

打开cmd或git bash,安装hexo

npm install -g hexo-cli

(卸载hexo)

npm uninstall hexo-cli -g

hexo -v 查看hexo版本

hexo -v

新建一个blog路径,初始化hexo

hexo init myblog

定位到myblog文件夹安装node_modules

cd myblog
npm install

npm install 报错问题解决合集
安装Node时自带的npm地址默认是:http://registry.npmjs.org ,npm install没反应。
使用国内镜像有2种方法:
一、直接修改镜像地址
方式一、npm config set key value 命令,设置指定的镜像地址

npm config set registry https://registry.npmmirror.com 
npm info underscore (这个只是为了检验上面的设置命令是否成功,若成功,会返回[指定包]的信息)

方式二、npm –registry命令

npm --registry https://registry.npmmirror.com info underscore (npm info underscore依然是为了检验是否设置成功)

方式三、修改配置文件~/.npmrc (win系统在C:\Users\用户名.npmrc) 加入下面内容

registry = https://registry.npmmirror.com

其实1,2,3都是修改npm的配置文件.npmrc .
二、用封装好的cnpm命令
cnpm
如果觉得直接修改比较麻烦的话,就用cnpm命令吧,先用

$ npm install -g cnpm --registry=https://registry.npmmirror.com

如果需要解除镜像并恢复到官方源,请执行以下命令:

npm config set registry https://registry.npmjs.org​
 hexo g  --生成网站静态文件到默认设置的 public 文件夹
 hexo s	 --启动本地服务器,默认地址:http://localhost:4000/
 hexo clean	 --清除缓存文件 db.json 和已生成的静态文件 public

hexo暂时修改默认端口:

hexo s -p 5000

永久修改启动端口:

vim node_modules\hexo-server\index.js

修改其中默认的port值。
默认hexo主题如图所示——

hexo主题修改

安装

我选择 hexo-theme-shana主题,git拉取到themes文件夹下

git clone https://github.com/ShanaMaid/hexo-theme-shana themes/shana

配置

修改hexo根目录下的 _config.yml

`language: zh-CN`
`theme: shana`

同时将themes/shana/_source/tagscategories文件夹拷贝到hexo根目录下的source文件夹下

更新

cd themes/shana
git pull origin master

使用该主题的同志请阅读hexo-theme-shana/README.md at master · ShanaMaid/hexo-theme-shana,这里就不赘述了。

主题也可以通过npm方式安装,这种方式就不在themes目录下,而在node_modules目录,详情可以看各主题的文档说明。

Gitee配置

创建gitee公开仓库

仓库名必须是用户名

安装部署命令

npm install hexo-deployer-git --save

配置 _confing.yml

找到Deployment,配置gitee仓库

# Deployment
## Docs: https://hexo.io/docs/one-command-deployment
deploy:
  type: git
  repository: https://gitee.com/xiaxi626/xiaxi.git
  branch: master

创建仓库时的README.md描述文件会被hexo 提交覆盖掉。
在source目录下创建README.md
在_confing.yml配置中找到skip_render添加

skip_render: README.md

hexo 推送

hexo c    -- 清除缓存json和生成的静态文件
hexo g    --生成静态文件
hexo d	  --上传到git

开启GiteePages

服务→Gitee Pages→启动
需要实名认证,等待2个工作日

参考

Hexo + Gitee 博客搭建详细指南 - 腾讯云开发者社区-腾讯云
npm install 使用国内镜像 - 趙小傑 - 博客园
使用阿里云npm镜像加速-阿里云开发者社区
在Gitee搭建属于自己的博客_gitee搭建个人博客_jiuqi_玖柒的博客-CSDN博客

0%