Let’s face it, Mac and Linux are definitely better for developers than Windows; But as long as the toss, Windows is also a lot of sharp tools. This was previously documented in the article Essential Software for Efficiency under Windows; It’s not as crazy as Oh-my-zsh, but it’s still pretty darn good, at least better than the Windows native Cmd. “Must have” because it is easy to use.
1. Cmder is introduced
Cmder’s official website (it bundles conemu, msysgit, and Clink together so you can use a really clean Linux terminal with no configuration! It even comes with a nice Monokai color theme.) ; As a compressed file exists, press and play. You can even put it on a USB Drive and take it with you at any time. Even the Settings are stored in this directory, which doesn’t use Registry, so it’s great for sharing across multiple computers.
1.1 installation Cmder
- Recommended to download: Cmder official website
At the time of download, there are two versions, mini and Full; The only difference is that there is no built-in MsysGit tool, which comes standard with Git for Windows. The full installation version of Cmder comes with msysgit, in addition to git itself this command, which can use a large number of Linux commands; Grep, curl(no wget); Like vim, grep, tar, unzip, SSH, ls, bash, perl, etc.
May need to climb the wall, here is another download address
cmder.zip cmder_mini.zip
Api-ms-crt-runtime may be prompted
Install some runtime libraries msvBCRT_AIo.7z
1.2 Cmder component composition
Cmder is a combination of several software packages, including Msysgit and, most importantly, ConEmu and Clink, which are the real core components of Cmder.
- Msysgit provides Git for Windows, including less, ls, tar, unzip, md5sum, grep, sed… And so on multiple sets of tools. Grep alone is hundreds of times better than findstr built into Windows!
- ConEmu can also exist as a separate piece of software, once infatuated with it, but the experience is not like CMder, and then abandoned it.
- Clink integrates the GNU Readline library into the native Windows command prompt character window, providing powerful editing and typing capabilities in command line mode, which is exactly what Cmder feels like in Linux.
2. Configuration Cmder
2.1 start Cmder
Because it’s the green version, click on cmder.exe to run it. Obviously, this is not a very fast way to open it, even if Listary is efficient to search it, and then click on it is very troublesome;
We can do this:
- You can add the directory where Cmder. Exe is stored to the system environment variable. After adding,Win+ R type cmder to add cmder to right-click menu
- Open the terminal in a folder, this is a (super) pain point requirement, in fact, the previous step to add Cmder to the environment variable to service this, on the administrator terminal type the following statement: cmder.exe /REGISTER ALL
- Create a shortcut to the taskbar and click on it
2.1.1 Opening an administrator terminal
Enter Ctrl+ T in any Cmder window or click the green plus sign on the lower control bar in the Cmder window and select Run as Administrator to set the administrator to Run in the properties compatibility of the EXE file
2.1.2 Setting the alias of a command
Block syntax follows standard Markdown code, for example:
la=ls -aF --show-control-chars --color
ll=ls -alF --show-control-chars --color
ls=ls --show-control-chars -F --color
Copy the code
Add to the end of cmder/config/user-aliases. CMD
2.1.3 Modifying command Prompt symbols
Cmder’s default life prompt is λ; If you are not comfortable with this character, you can change it to the common $symbol on Mac/Linux as follows:
Edit the batch file vendor\clink. Lua in the Cmder installation directory (search for local cmder_prompt) and add:
{lamb}
Copy the code
Modified into
$
Copy the code
2.2 the shortcut
I can use Tab, Open the setting panel => Win+Alt+P Open a new Tab => Ctrl+T Close the Tab => Ctrl+W Switch the Tab => Ctrl+Tab Close all tabs => Alt+F4 Quickly open a CMD => Shift+Alt+1 Quickly open a PowerShell => Shift+Alt+2 Quickly switch to the first TAB => Ctrl+1 Quickly switch to the NTH TAB (the n value has no upper limit) => Ctrl+ N Search for historical commands => Ctr+ R Full screen => Alt+Enter
3. Chocolatey Package management system
Chocolatey’s official website, Chocolatey.org. On Linux, people like to use apt-get(Brew for MAC) to install applications, but now on Windows, you can use Chocolatey to quickly download and set up a development environment. Chocolatey’s philosophy is to install applications entirely on the command line, more like a package management tool (Nuget behind it)
In addition, Chocolatey only encapsulated the official download path into Chocolatey, so the download source is its official path, so the download must be legal, but if the original software needs to be registered with a Licence, So Chocolatey download installed software or you need to buy registration. Chocolatey, however, usually uses software available from a free Licence.
3.1 installation chocolatey
Run the following command (administrator permission required) :
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%; %ALLUSERSPROFILE%\chocolatey\binCopy the code
Chocolatey (choco.exe) is now ready. “Indicates that the installation is successful
3.2 Choco Installation Software
The choco install softwareName command is cinst softwareName
The installable application, installed by default in C: Program Files\, can be seen in its Package list
The following are common development environment applications for Windows development:
Choco install Autohotkey. Portable # Install Autohotkey (portable) Choco install nodejs Choco install python choco install jdk8 Install googlechrome # install Chrome choco install Google Chrome - x64 # Google Chrome (64 - bit only) choco install firefox # installation Firefox choco install notepad++ choco install Atom choco install SublimeText3 # SublimeText3Copy the code
4. Scoop Package management System
Scoop is a command line installation program on Windows, mainly for the command line developer tools, and program ape with oh. My personal feeling is that Scoop is more like Homebrew on Mac, and Chocolatey is more like Homebrew-Cask. For more information about Scoop, see the official website: scoop.sh/. Scoop is also an open source project.
4.1 run the installation
Scoop installation requires PowerShell version installed on Windows of at least PowerShell 3, and PowerShell must be enabled for your user account. Windows 10 or Windows Server 2012 should have PowerShell 3 installed by default, but Windows 7 and Windows Server 2008 May be older versions.
4.2 upgrade PowerShell
If you are running Windows 7, you may need to upgrade PowerShell. There are two ways to upgrade PowerShell: download the PowerShell 3 package directly or upgrade from Chocolatey. The second method is recommended. The following describes the upgrade method of the second method. Install Chocolatey first, as described above. Only Powershell 4 and Powershell 5 are found using the Choco Search powershell command. Although PowerShell 3 was found in Packages on the official website, it seems that PowerShell 3 was not approved, and I failed to install PowerShell 5 by force. Finally, I directly installed PowerShell 5, and entered the following command under PowerShell command line:
choco install powershell
Copy the code
Do you want to run the script? ([Y]es/[N]o/[P]rint):
Note: You can run the get-host command to view the PowerShell version. After installing PowerShell, you need to restart the PC for the new PowerShell to take effect.
4.3 Start installing Scoop
Before installing Scoop, make sure you have allowed PowerShell to execute local scripts by executing the following command:
set-executionpolicy remotesigned -scope currentuser
Copy the code
Executing this command might prompt:
Do you want to change the execution policy? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"):Copy the code
Just type in y or A. To start installing Scoop, execute the following command:
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
Copy the code
When you’re done, it’s ready to use
4.4 Common Commands
Scoop Help # View scoop install # install APP scoop uninstall # Uninstall APP scoop list # List of installed apps scoop Search # Search APP Scoop Update # Update APP and Scoop itselfCopy the code
In fact, only need to remember the scoop help command on the line, other commands forget to directly view through this command.
4.5 Common Software
Scoop install git # Scoop install openssh # scoop install concfg Install the console configuration file import/export toolCopy the code
The four commands above can be combined into a single command scoop Install 7zip git openssh concfg. More supported software can be found here: github.com/lukesampson… .
4.6 Other configurations of Scoop
Above is an official rendering from Scoop, using the Solarized theme. Themes and fonts are configured using the CONCFG plugin, which is a tool for importing and exporting Windows console configurations such as fonts and colors. Use the scoop Install concfg command to install. Personally, the best part of Scoop lies in Buckets, and they can even make their own Buckets, which is more configurable. For reasons of length, I will write this later when I have the opportunity.
5. Scoop VS Chocolatey
Scoop and Chocolatey differ in a few ways:
It is installed independently and does not conflict with existing software
There is no permissions dialog box because the program is installed in the user directory
Does not contaminate the path
Don’t use NuGet, don’t worry about dependencies
Instead of a package manager, it just reads a JSON on how to install the program
No specific version is installed, only the latest version is supported.