macbook怎么改编码_如何设置新的MacBook进行编码

本文分享了一位开发者在新MacBook Pro上的必备设置,包括终端优化、Git配置、自动化工具、编辑器选择及生产力提升应用。作者推荐了一系列免费软件,如iTerm2、oh-my-zsh、Homebrew等,以及如何设置.gitconfig和.gitignore_global以提高工作效率。

macbook怎么改编码

I started a new job on Monday (it's going awesome, thanks for asking) and that means a brand new, blank-slate MacBook Pro. Fortunately, I still have my old work computer (my last job maybe wasn't so wonderful, as I had to bring my own every day...). But next time, I'll probably have to turn my new work computer in, so I wanted to create a record of my setup.  Maybe it's helpful for others too!  By the way, almost all of these programs are F-R-E-E.

我星期一开始了新工作(真是太好了,谢谢您的询问),这意味着要使用全新的空白版MacBook Pro。 幸运的是,我仍然拥有旧的工作计算机(我的上一份工作可能并不那么好,因为我每天都必须自己带上自己的电脑...)。 但是下一次,我可能必须打开新的工作计算机,所以我想创建我的安装记录。 也许对其他人也有帮助! 顺便说一下,几乎所有这些程序都是免费的。

终点站 (The Terminal)

It's absolutely essential to get your terminal set up so you can work efficiently. If you are running the default terminal with no adjustments, these tips could save you a lot of time and frustration.

设置终端绝对重要,这样您才能有效地工作。 如果您在运行默认终端时不做任何调整,那么这些技巧可以为您节省很多时间和沮丧的时间。

iTerm2 (iTerm2)

Go on and download iTerm2 and then be very pleased with all the features. My favorites are:

继续下载iTerm2 ,然后对所有功能都很满意。 我的最爱是:

  • Scroll (arrow keys) up and down to move through commands. Type partial commands to filter, then scroll.

    上下滚动(箭头键)以浏览命令。 键入要过滤的部分命令,然后滚动。
  • Auto-copy - just highlight text in iTerm and it will automatically be copied to the clipboard.

    自动复制-只需在iTerm中突出显示文本,它将自动复制到剪贴板。

哦,我的zsh (oh my zsh)

If you, like me, want to make your terminal work for you, get oh my zsh. Here's what my terminal prompt looks like:

如果您像我一样想要使您的终端为您工作,请获取我的zsh 。 这是我的终端提示符:

When I have uncommitted changes, I get a yellow x to the left of my cursor. It's really handy for recognizing that I have changes hanging out.

取消更改后,光标左侧会显示一个黄色的x。 认识到我有很多变化很方便。

You can do lots of things with oh my zsh - there's a library of different ways you can style your terminal. I use theme "robbyrussel". Note that you will also want to use .zshrc instead of .bashrc for aliases and other modifications to terminal settings.

哦,我的zsh可以做很多事情-有很多不同的方式可以设置终端的样式。 我使用主题“ robbyrussel”。 请注意,您还需要使用.zshrc而不是.bashrc来别名和对终端设置进行其他修改。

While we're here, let's give a huge shout to terminal aliases. I love the "insider" language I have with my terminal. Here are a few I put into .zshrc. I don't need all of them anymore, but I left them here to show some of the ridiculously long commands that can be aliased to something very short.

当我们在这里时,让我们大声喊叫终端别名。 我喜欢终端机上使用的“内部人员”语言。 这是我放入.zshrc 。 我不再需要所有这些命令了,但是我把它们留在这里显示了一些可笑的长命令,这些命令可以别名为很短的东西。

alias j-u='jest --updateSnapshot'
alias ytu='yarn test-update'
alias dcu='docker-compose up'
alias dcd='docker-compose down'
alias lint-front='docker-compose exec front yarn gulp lint'
alias back-bash='docker-compose exec back bash'

.gitconfig (.gitconfig)

You probably have a .gitconfig on your computer, but you may not be using git aliases to save yourself some keystrokes. Here's mine:

您的计算机上可能有一个.gitconfig ,但是您可能没有使用git别名来保存一些击键。 这是我的:

# This is Git's per-user configuration file.
[user]
    name = amberwilkie
    email = amber@amberwilkie.com
[alias]
    co = checkout
    st = status
    ci = commit
    lp = log --oneline
    poh = push origin head
    rc = rebase --continue
    prom = pull --rebase origin master

Under that [alias] header, you can put whatever you want, including complicated git commands particular to your organization. It's super-handy.

在该[alias]标头下,您可以放置​​任何所需的内容,包括特定于组织的复杂git命令。 超级方便。

.gitignore_global (.gitignore_global)

Did you know you can automatically ignore files in every git repo on your computer? Put them in .gitignore_global and never have to fuss with .DS_Store in your .gitignore again. I put .idea in mine as well, since my editor of choice generates profiles in every repo.

您是否知道可以自动忽略计算机上每个git repo中的文件? 把它们放在.gitignore_global和永远不必大惊小怪与.DS_Store.gitignore一次。 我也将.idea放在了自己的目录中,因为我选择的编辑器会在每个回购中生成配置文件。

Github SSH密钥 (Github SSH keys)

New computer, new SSH keys. Follow the Github instructions so you don't have to type in your credentials ever again.

新计算机,新SSH密钥。 按照Github的说明进行操作,因此您无需再次输入凭据。

垃圾 (Trash)

Have you ever felt that rm -rf folder was a little too final? With this simple Trash npm package, you can call trash file/folder to literally move it to your computer's trash instead of deleting it from memory. It can be recalled, or otherwise managed. This has saved me plenty of times.

您是否曾经觉得rm -rf folder有点太定了? 使用这个简单的Trash npm软件包 ,您可以调用trash file/folder ,将其从字面上移到计算机的垃圾中,而不是从内存中删除它。 可以调用或以其他方式对其进行管理。 这为我节省了很多时间。

Pro tip: Always run rm -rf node_modules instead of trash node_modules (you 100% never need to recall your old node_modules).

专家提示:始终运行rm -rf node_modules而不是trash node_modules (您100%无需调用旧的node_modules )。

自制酒桶 (Homebrew & Cask)

If you have a mac, you already know you need [Homebrew](/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)") and Cask. The first to install packages, the next for applications distributed in binary.

如果您使用的是Mac,则已经知道需要[Homebrew](/ usr / bin / ruby​​ -e“ $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )”)和木桶 首先安装软件包,其次用于二进制分发的应用程序。

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install cask

程式 (Programs)

My editor of choice is Webstorm, though I'm trying to create a workflow with VS Code at the moment. I'll skip all the editor-related stuff, since it's covered so well in my many other places. Here's the rest of what I install on day one.

我选择的编辑器是Webstorm,尽管目前我正在尝试使用VS Code创建工作流。 我将跳过所有与编辑器有关的内容,因为在我的许多其他地方都对此进行了很好的介绍。 这是我第一天安装的其余内容。

超时 (TimeOut)

TimeOut blocks your screen at intervals, forcing you to take a break. I keep mine at 2 minutes every hour and 15 seconds every 15 minutes. It can get annoying, but it's good for my health. We know sitting for extended periods of time is bad for us, but it's far too easy to let four hours go while we just fix this liiiiittttlllllle thing. Conveniently, my break popped up while I was writing this paragraph. (Normally the image and timer are aligned, not sure what is up with that.)

超时会间隔一段时间阻塞屏幕,迫使您休息一下。 我每小时保持2分钟,每15分钟保持15秒。 可能会令人讨厌,但这对我的健康有益。 我们知道长时间坐对我们不利,但是在我们解决这个问题时放开四个小时实在太容易了。 方便地,在撰写本段内容时,我的休息弹出了。 (通常,图像和计时器是对齐的,不确定是怎么回事。)

You can set the image to be whatever you want and can add text.

您可以将图像设置为任意图像,并可以添加文本。

gitx (gitx)

I would love to install gitx because I was using it extensively on my old computer. Unfortunately, it's no longer maintained! I have been experimenting with other git UIs but none of them are meeting my needs yet. More investigation is needed. If you have an older version of Mac, you might be able to get your hands on this original, extremely useful, tool. And if you can write natively, consider contributing!GitX is extremely useful for quickly reviewing changes in your current commit and editing those changes.

我想安装gitx,因为我在旧计算机上广泛使用了它。 不幸的是,它不再维护! 我一直在尝试其他git UI,但是它们都不能满足我的需求。 需要更多调查。 如果您使用的是较旧版本的Mac,则可以使用此原始的极其有用的工具。 而且,如果您可以本地编写,请考虑做出贡献!GitX对于快速查看当前提交中的更改并编辑这些更改非常有用。

阿尔弗雷德 (Alfred)

I always install Alfred, though I honestly have not yet taken the time to fall in love. I am aware that there are a thousand features that developers use every day. It's on my productivity improvements list to figure out! I'm likely to buy the power pack so that I can access the improved clipboard, which looks awesome.

我一直安装Alfred,尽管老实说我还没有花时间去恋爱。 我知道开发人员每天都会使用上千种功能。 可以在我的生产率提高列表上找到答案! 我可能会购买电源盒,以便可以访问改进的剪贴板,它看起来很棒。

I was using Clipy before, but the visual preview of what you are going to paste seems incredibly helpful.

我以前使用过Clipy ,但是要粘贴的内容的视觉预览似乎非常有用。

But whatever you do, get a damn clipboard extension! Having only one clipboard slot is impossible. How many times have you had to go back and forth between things copying and pasting? Having a better clipboard manager significantly improved my efficiency as a developer.

但无论您做什么,都该死的剪贴板扩展! 只有一个剪贴板插槽是不可能的。 在复制和粘贴内容之间,您不得不来回几次? 拥有更好的剪贴板管理器可以极大地提高我作为开发人员的效率。

眼镜 (Spectacle)

This program allows you to snap windows to various parts of the screen. My new workplace has provided me with a baller 4k monitor, but that thing is so damn huge, when I plug it in, my windows are floating in a sea of desktop. Spectacle allows me to snap them where they belong with keyboard shortcuts. Magic!

该程序允许您将窗口捕捉到屏幕的各个部分。 我的新工作场所为我提供了Baller 4k显示器,但是那东西真是太庞大了,当我插入它时,我的窗户漂浮在桌面的海洋中。 奇观让我可以使用键盘快捷键将它们捕捉到它们所属的位置。 魔法!

Giphy Capture (Giphy Capture)

This may sound silly, but as a web developer who works on the front end (sometimes), I find myself needing to make short gifs to explain functionality constantly. Giphy Capture is the best tool I've found for this - it's intuitive and does everything you need it to do.

这听起来可能很愚蠢,但是作为从事前端工作的Web开发人员(有时),我发现自己需要制作简短的gif图像以不断地解释其功能。 Giphy Capture是我为此找到的最好的工具-它直观且可以完成您需要做的所有事情。

And that is everything I consider core for getting to work as a web developer on a Mac! Naturally, a thousand other programs follow, as dictated by need, but these are the settings and programs I find indispensable in getting started. If you have any tips on other productivity tools that might useful, I'd love to hear.

这就是我认为要成为Mac上的Web开发人员的核心要素! 当然,根据需要,还可以执行其他一千个程序,但是这些是我觉得入门必不可少的设置和程序。 如果您对其他可能有用的生产力工具有任何建议,我很想听听。

This post originally appeared on wilkie.tech . It would be great to chat on the twitters. I'm @heyamberwilkie.

该帖子最初出现在wilkie.tech上 在Twitter上聊天会很棒。 我是@heyamberwilkie

翻译自: https://www.freecodecamp.org/news/how-to-set-up-a-brand-new-macbook/

macbook怎么改编码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值