Two recent articles here on SitePoint talked about how people set up their development environments. Zack Wallace talked about setting up a Windows development environment, and Shaumik Daityari talked about his experience working with Ubuntu Linux.
SitePoint上最近的两篇文章讨论了人们如何设置开发环境。 Zack Wallace谈到了建立Windows开发环境的问题, Shaumik Daityari谈到了他在Ubuntu Linux上的工作经验。
In this article, I want to talk about how I set up a development environment on Mac OS X. But first, a little bit of background.
在本文中,我想谈一谈如何在Mac OS X上设置开发环境。但是,首先要介绍一些背景知识。
I’m a freelance software developer and technical writer. Given that, I need a wide variety of tools on a regular basis, whether they’re for software development, research, writing or experimentation.
我是一名自由软件开发人员和技术作家。 鉴于此,我需要定期使用各种各样的工具,无论它们是用于软件开发,研究,编写还是实验。
It definitely is demanding having to cover everything from managing code, accessing remote servers and managing databases to writing and reviewing content. However, the great thing about the Mac is that there are so many tools available for it.
从管理代码,访问远程服务器和管理数据库到编写和查看内容,它绝对需要涵盖所有内容。 但是,Mac的一大优点是有许多可用的工具。
New Macs come with the iWork suite, Safari, Preview and The Unarchiver, amongst a range of other GUI tools. On the command line, they come with various open source tools, such as SSH, Wget, and cURL. However, these alone aren’t enough. To do proper web development, and technical writing, we need a number of others. Specifically, I regularly use a combination of the following:
新的Mac随附了iWork套件,Safari,Preview和The Unarchiver,以及其他一系列GUI工具。 在命令行上,它们带有各种开源工具,例如SSH,Wget和cURL。 但是,仅凭这些还不够。 为了进行适当的Web开发和技术写作,我们需要许多其他东西。 具体来说,我经常结合使用以下内容:
Dropbox and Google Drive
Dropbox和Google云端硬盘
Firefox, Google Chrome and Chromium
Firefox , Google Chrome和Chromium
Pixelmator and Skitch
Pixelmator和Skitch
Colloquy, Skype and Slack
对话 , Skype和Slack
Evernote and Wunderlist.
Evernote和Wunderlist 。
These tools are pretty much indispensable on a day-to-day basis.
这些工具在日常工作中几乎是必不可少的。
Dropbox and Google Drive allow me to share files with clients. I could use the in-browser versions, but installing the apps makes syncing even simpler.
Dropbox和Google云端硬盘使我可以与客户端共享文件。 我可以使用浏览器内版本,但是安装应用程序可使同步更加简单。
And no web development environment would be complete without all of the modern browsers. As Internet Explorer isn’t supported on the Mac, like Zack, I use a range of tools – such as BrowserStack – for testing sites in IE.
没有所有现代浏览器,就不会有完整的Web开发环境。 由于Mac在Mac上不支持Zack等Zack,因此我使用了一系列工具(例如BrowserStack )来测试IE中的网站。
Pixelmator and Skitch make it simple to edit and make annotations to images. Pixelmator isn’t free, but isn’t that expensive either. You could use GIMP instead, but I find its interface leaves a lot to be desired.
Pixelmator和Skitch使编辑图像和为图像添加注释变得简单。 Pixelmator不是免费的,但也不是那么昂贵。 您可以改用GIMP ,但是我发现它的界面还有很多不足之处。
For making and storing notes, I use Evernote. It’s definitely got that space nailed. And all I need for project management is Wunderlist. With it, I can stay on top of all the work I have to do for each client, as well as keep notes about conversations we’ve had and what I still have to do.
为了制作和存储笔记,我使用Evernote。 肯定有足够的空间。 我需要的项目管理就是Wunderlist。 有了它,我可以掌握为每个客户要做的所有工作,并记下我们已经进行的对话以及我仍然要做的事情。
But now let’s get in to the more serious stuff: editing. I do two types of editing – content and code – so my discussion of editors will reflect that. Regardless of which one you’re doing, there are several very good editors available for the Mac.
但是,现在让我们进入更严肃的东西:编辑。 我执行两种类型的编辑-内容和代码-因此我对编辑器的讨论将反映出这一点。 无论您正在执行哪种操作,Mac上都有几种非常好的编辑器。
When I write, I write in Markdown format. It lets you write structured content in any text editor, without the need for special software (such as Microsoft Word) which can leave you at the behest of one vendor or another. Using tools such as Pandoc, you can export your content to nearly any other file format.
当我写作时,我以Markdown格式写作。 它使您可以在任何文本编辑器中编写结构化的内容,而无需使用特殊的软件(例如Microsoft Word),这可以使您不受某个供应商或另一供应商的要求。 使用Pandoc等工具,您可以将内容导出为几乎任何其他文件格式。
For writing in Markdown, there are several great native apps available, including MacDown, iA Writer and Writer Pro and Mou. Heck, you could even use TextEdit, though it’s not really well suited to the task. In addition, there are various online Markdown editors, including Gingko, Draft and Bruno Škvorc’s favorite, StackEdit.
对于使用Markdown进行书写,有多种出色的本机应用程序可用,包括MacDown , iA Writer和Writer Pro和Mou 。 哎呀,您甚至可以使用TextEdit,尽管它并不十分适合该任务。 此外,还有各种在线Markdown编辑器,包括Gingko , Draft和BrunoŠkvorc的最爱StackEdit 。
I’ve tried and can vouch for all of these, though I don’t use them on a regular basis. For me, the best tool to use is Vim, ideally MacVim. It does take a little bit longer to set up and configure. But once done, it’s amazing. What’s more – it’s free. If you’re keen, or struggling, checkout my Vim configuration repository on GitHub.
尽管我不定期使用它们,但我已经尝试过并可以保证所有这些。 对我而言,最好使用的工具是Vim,最好是MacVim 。 确实需要花费一些时间来设置和配置。 但是一旦完成,那就太神奇了。 而且, 它是免费的 。 如果您热衷或挣扎,请在GitHub上检出我的Vim配置库 。
Next there’s code. The Mac has a number of code editors available, irrespective of whether you’re a PHP, Python, Ruby, Go, Haskell or C++ developer.
接下来是代码。 Mac具有许多可用的代码编辑器,无论您是PHP,Python,Ruby,Go,Haskell还是C ++开发人员。
There’s the ever present, excellent quality Sublime Text 3, which I’ve used often and happily attest to. There’s also TextMate 3, which is light, simple and extensible. But for me, my go-to editor of choice is PhpStorm. Based on IntelliJ, it just does so much; and what it doesn’t do natively, there’s likely a plugin for. Having said that, it’s not free. But the price really isn’t that much, especially when you weigh up the benefits.
我经常使用并愉快地证明了有史以来最优质的Sublime Text 3 。 还有TextMate 3 ,它轻巧,简单且可扩展。 但是对我来说,我的首选编辑是PhpStorm 。 基于IntelliJ ,它可以完成很多工作; 而且它本身没有做,可能有一个插件。 话虽如此,它不是免费的。 但是价格确实不高,尤其是当您权衡收益时。
Next, let’s look at version control. Whether I’m writing or coding, I always use version control. And my version control system of choice is Git. To me, that’s a no-brainer. However, you may be equally as comfortable using Mercurial. If you’re using Subversion, OK. But I can’t honestly support CVS.
接下来,让我们看一下版本控制。 无论是编写还是编码,我总是使用版本控制。 我选择的版本控制系统是Git 。 对我来说,这很容易。 但是,使用Mercurial可能同样适合您。 如果您使用的是Subversion,请确定。 但是我不能诚实地支持CVS。
Using Git as my frame of reference, there are several good tools for Mac to choose from. Firstly, there’s the more simplistic GitX. Open-source and free, and a Mac clone of Linus Torvolds’ GitK, it provides the key functionality required to manage a Git repository and provides a nice built-in diff viewer.
使用Git作为我的参考框架,Mac有几种不错的工具可供选择。 首先,有更简单的GitX 。 它是开源和免费的,并且是Linus Torvolds的GitK的Mac克隆版本 ,它提供了管理Git存储库所需的关键功能,并提供了一个不错的内置差异查看器。
Then there’s the powerhouse SourceTree. If you’re looking for one app that does it all, one actively developed by a large corporate focused on developer tools, Atlassian, then don’t go past SourceTree. I used it for ages (before I committed to Git from the command line) and it’s excellent.
然后是强大的SourceTree 。 如果您正在寻找一款能够完成所有任务的应用程序,那么这是由一家专注于开发人员工具Atlassian的大型公司积极开发的应用程序,那么请不要错过SourceTree。 我使用了很长时间(在我从命令行使用Git之前),它很棒。
I’ll also give an honorable mention to SmartGit as well.
我也将对SmartGit表示敬意 。
Of these three, the one that I’ve used the most, and highly recommend, is SourceTree. However, as with MacVim being my text editor of choice, I manage my Git repositories from the command line. (I’m not going to suggest that you should use the command line too. But I will say that it’s worth the investment of time to learn how to use it, as it does help you become a lot more productive. That being said, if you’re not a command line person, SourceTree is the way to go!)
在这三个中,我最常使用并强烈推荐的一个是SourceTree。 但是,就像MacVim是我的首选文本编辑器一样,我从命令行管理Git存储库。 (我不会建议您也使用命令行。但是,我想说,值得花时间学习如何使用它,因为它确实可以帮助您提高生产力。如果您不是命令行用户,那么SourceTree是必经之路!)
For servers, I take one of two options. I either use built-in servers, such as those with Ruby and PHP, and run without the overhead of much additional software, or I run up a virtual machine. I’ve used VirtualBox and Ubuntu Linux for this, but increasingly I create my own using Ansible and Vagrant.
对于服务器,我采用两个选项之一。 我要么使用内置服务器(例如带有Ruby和PHP的服务器),然后运行,而无需支付许多其他软件的开销,要么运行虚拟机。 我为此使用VirtualBox和Ubuntu Linux,但是越来越多的我使用Ansible和Vagrant创建自己的。
There’s a whole series of tools that you can call on, and by default there are lots of language libraries and extensions that don’t come with binaries installed on the Mac, and even the versions that are installed may not be new enough. To get around this, I use Homebrew, one of two excellent package managers for the Mac.
您可以调用一整套工具,默认情况下,Mac上没有安装二进制文件附带的许多语言库和扩展,甚至安装的版本可能还不够新。 为了解决这个问题,我使用Homebrew ,它是Mac上两个出色的软件包管理器之一。
Homebrew works similarly to APT and yum on Linux, in that you can search a package repository and install, upgrade, and configure packages using it. For a good understanding of how it works and what it offers, check out Homebrew’s online documentation.
Homebrew的工作方式与Linux上的APT和yum相似,因为您可以搜索软件包存储库并使用它来安装,升级和配置软件包。 要更好地了解它的工作原理和功能,请查看Homebrew的在线文档 。
For database work, I mostly use MySQL. I guess you could put that down to my PHP heritage. But I also regularly work with both PostgreSQL and SQLite as well. To install any of these databases, you can download them from their respective vendors, via the links.
对于数据库工作,我主要使用MySQL 。 我想您可以将其归结为我PHP传统。 但是我也经常使用PostgreSQL和SQLite 。 要安装这些数据库中的任何一个,您可以通过链接从各自的供应商处下载它们。
Whilst I’d like to think of myself as a hardcore command line guru, I’m not when it comes to databases. For that I’ve been using Navicat Lite for some years. It’s an excellent tool that provides uniform access to a wide number of databases.
虽然我想将自己看作是一个核心的命令行专家,但对于数据库我却不是。 为此,我已经使用Navicat Lite多年了。 这是一个出色的工具,可提供对大量数据库的统一访问。
Navicat not only supports MySQL, PostreSQL and SQLite, but also Oracle and SQLServer. It allows for painless creation of any schema element, creating and running queries by hand, searching, creating and updating records – everything you’d expect from a database management tool.
Navicat不仅支持MySQL,PostreSQL和SQLite,还支持Oracle和SQLServer。 它允许轻松地创建任何架构元素,手动创建和运行查询,搜索,创建和更新记录,这些都是数据库管理工具所期望的。
For outside access, I regularly use the SSH library of tools, whether that’s SSH-ing to a remote server, or copying files to or from my development environment. In addition to that, I also regularly use cURL and Wget for grabbing files and for running requests against APIs and performing website interaction.
对于外部访问,我经常使用SSH工具库 ,无论是SSH到远程服务器,还是将文件复制到开发环境或从开发环境复制文件。 除此之外,我还定期使用cURL和Wget来抓取文件并针对API运行请求并执行网站交互。
But if you’re not so command line inclined, there are some really good GUI tools. There’s the venerable FileZilla, as well as the more slick looking Cyberduck and Transmit. Each of these three tools will allow you to manage files remotely with just your mouse.
但是,如果您不太喜欢命令行,则可以使用一些非常好的GUI工具。 有古老的FileZilla ,以及外观更光滑的Cyberduck和Transmit 。 这三个工具中的每一个都允许您仅用鼠标远程管理文件。
And that’s how I get my environment set up with all the tools I need. I admit that I do use the command line and command line-type tools quite heavily. But I’ve also covered a number of GUI tools that you can use in their place as well, if that’s your preferred style.
这就是我使用所需的所有工具设置环境的方式。 我承认我确实大量使用了命令行和命令行类型的工具。 但是,如果您喜欢这种样式,那么我也介绍了许多GUI工具,您也可以在它们中使用它们。
Despite the derisive comments people often make about the Mac, be in no doubt – there is an abundance of software available for it. And because of its BSD heritage, it has access to the open source and Posix-compliant tools as well. So no matter which way you go, you have a wide array of tools at your disposal when working and developing on the Mac.
尽管人们经常对Mac做出嘲讽的评论,但毫无疑问– 那里有大量可用的软件 。 并且由于其BSD的传统,它也可以访问开源和Posix兼容工具。 因此,无论采用哪种方式,在Mac上进行工作和开发时,都可以使用各种各样的工具。
So, how does my setup compare with yours?
那么,我的设置与您的设置相比如何?
翻译自: https://www.sitepoint.com/set-mac-development-machine/
相关资源:jdk-8u281-windows-x64.exe