Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

工具初始化 #26

Closed
imsobear opened this issue Oct 4, 2013 · 8 comments
Closed

工具初始化 #26

imsobear opened this issue Oct 4, 2013 · 8 comments
Labels

Comments

@imsobear
Copy link
Owner

imsobear commented Oct 4, 2013

重装一次系统,要去安装配置各种工具,编辑器、版本控制等等,这里就把中间遇到的小问题整理一下:

1. sublime text3 安装与配置:

  • V3 不能用之前的方法安装 package control ,新的方法是 Ctrl + ~ 打开命令行,输入:
import urllib.request,os; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); open(os.path.join(ipp, pf), 'wb').write(urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ','%20')).read())

参见 https://sublime.wbond.net/installation

  • 这时候输入 package install 就可以安装插件了,但是有时候会有出错信息 Unable to find git.exe ,在 Preferences -> Package Settings -> Package Control -> Settings - User 添加:
    "ignore_vcs_packages":true
    参见 http://www.ladyloveit.com/sublime/sublime-unable-to-find-git-exe-error/
  • 安装主要的插件:emmet sidebar enhancement and so on ~
  • sublime运行js文件:先安装node,然后在sublime中选择 Tools—> Build system—> New build system,输入:
{
    "cmd": ["node", "$file"],
    "selector": "source.js"
}

保存后,js文件下 Ctrl + b 就可以直接运行了。

2. windows 下 git 的使用:

windows下git的工具可以用msysgit,大部分的 linux 命令都可以使用,不过中文的输入显示会有一些问题,不过我今天装 1.8.4 的时候已经可以输入中文了,所以只剩下 ls 时中文文件名乱码的问题了,解决方案:找到 msysgit 的安装目录,在 git-completion.bash 文件最后添加 alias ls='ls --show-control-chars --color=auto'

如果输入中文也有问题,可参考 http://www.cnblogs.com/liangxiaxu/archive/2012/08/05/2623678.html ,不过我之前的旧版本按照这些方法都没用,所以最好还是升级版本吧。

3. github pages:

本来没github什么事的,结果因为想给博客搞个域名指向,设置DNS -> 新建CNAME文件,看起来很简单的事,却不知道哪里出了问题,搞好了再知晓~

搞好了,请轻戳

--OVER--

@ma6174
Copy link

ma6174 commented Oct 5, 2013

watch 之后你发的文章都有邮件通知!!这是传统博客没有的。。。

我可以修改你的~~~

@imsobear
Copy link
Owner Author

imsobear commented Oct 5, 2013

@ma6174 这么嗨...不过这个貌似是在github中可以设置的~

@robling
Copy link

robling commented Oct 5, 2013

哪天发个抽多更新了几条我这里连续收到了50多封邮件,然后我就取消关注了。

Date: Fri, 4 Oct 2013 18:44:07 -0700
From: notifications@github.com
To: MyBlog@noreply.github.com
Subject: Re: [MyBlog] 工具问题汇总(未完) (#26)

@ma6174 这么嗨...不过这个貌似是在github中可以设置的~


Reply to this email directly or view it on GitHub.

@imsobear
Copy link
Owner Author

imsobear commented Oct 5, 2013

@robling 好吧,我错了,意外情况,保证以后不会发森~~~

@imsobear
Copy link
Owner Author

@ma6174 还记的那个可以画画的网站吗?求画画网站的网址和推荐画画网站的网站的网址...(好绕,哈哈)

@ma6174
Copy link

ma6174 commented Dec 23, 2013

@imsobear 你github怎么改用户名了?刚看到这个没反应过来
画画的网址:http://jenniferdewalt.com/node/all_draw
推荐画画网站的网站的网址:http://www.oschina.net/news/44785/after-180-websites-im-ready-to-start-the-rest-of-my
找了半天,最后在麦库翻到了

@imsobear
Copy link
Owner Author

@ma6174 ok,github有一次改nick的机会,然后我就改了,哈哈~

@imsobear
Copy link
Owner Author

sublime 添加 snippets:

所谓 snippets,大体可理解为我们输入一个指令,编辑器为我们生成一堆字符,当然,输入的指令和生成的东西都是我们自定义的。

在菜单栏选择 tools->New Snippet,然后会打开一个新文件,内容如下:

<snippet>
    <content><![CDATA[
<!-- 生成的代码或字符 -->
]]></content>
    <tabTrigger>输入的指令</tabTrigger>
</snippet>

tabTrigger 对应的内容就是我们要输入的指令,而CDATA中的内容就是生成的代码字符。

举个栗子,我希望在文件头输入/*file,然后按tab会生成对应的注释信息:

/* 
 * des: 
 * author: sobear
 * date: 2014-

那我的文件内容就是这样的:

<snippet>
    <content><![CDATA[
/*
 * des: 
 * author: sobear <>
 * date: 2013- 
 */
]]></content>
    <tabTrigger>/*file</tabTrigger>
</snippet>

输入完成后将文件保存在\Sublime Text 3\Packages\User下,后缀名为.sublime-snippet,文件名自定义就ok。

这就是最基本的应用场景了,还有光标位置之类的遇到时再说吧。

参考文章:

@imsobear imsobear closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants