装完后会显示 Now using node v0.10.26,而在新开的 shell 中需要 nvm use v0.10.26。所以设置一个默认版本,nvm alias default v0.10.26
貌似 nvm 只能管理使用 nvm 来安装的 nodes,然后按版本被安装到类似$HOME/.nvm/v0.10.26的 path.
CHFLAGS(1) BSD General Commands Manual CHFLAGS(1)
NAME
chflags -- change file flags
SYNOPSIS
chflags [-fhv] [-R [-H | -L | -P]] flags file ...
...
The flags are specified as an octal number or a comma separated list of keywords. The following keywords are currently defined:
arch, archived
set the archived flag (super-user only)
opaque set the opaque flag (owner or super-user only). [Directory is opaque when viewed through a union mount]
nodump set the nodump flag (owner or super-user only)
sappnd, sappend
set the system append-only flag (super-user only)
schg, schange, simmutable
set the system immutable flag (super-user only)
uappnd, uappend
set the user append-only flag (owner or super-user only)
uchg, uchange, uimmutable
set the user immutable flag (owner or super-user only)
hidden set the hidden flag [Hide item from GUI]
Welcome to Haskell Platform. The platform consists of the Glasgow Haskell Compiler (GHC) and an extensive set of standard libraries and utilities with full documentation.
Documentation
Libraries
Documentation for the libraries that come with Haskell Platform & GHC.
GHC
The GHC User’s Guide has all you need to know about using GHC: command line options, language extensions, GHCi, etc.
GHC API
Documentation for the GHC API.
Cabal
An infrastructure for building and distributing Haskell software.
Haddock
A tool for automatically generating documentation from annotated Haskell source code.
What is Installed
On Mac OS X, the Haskell Platform is installed in two major pieces: GHC and Haskell Platform. They are installed respectively in:
Executables are symlinked in /usr/bin and should be available in any shell.
Uninstallation
This and prior versions of GHC and Haskell Platform can be found and then easily removed with the uninstallation command line utility:
/Library/Haskell/bin/uninstall-hs
Simply run it for more information.
Configuring Cabal
The cabal command manages the building and installation of packages, both your own, and those it can fetch from the Hackage repository.
The first time you run cabal, a Mac specific configuration is written into the ~/.cabal directory.
If this is the first time you have ever run cabal, it will be made your active configuration.
If you have run cabal in the past, the new settings are in the file config.platform. You might want to review and incorporate some of the settings into your existing config file, or just replace your config file with it entirely.
The configuration sets up cabal to install packages with the same layout as those installed with the Platform. Packages installed per user (–user, the default) are placed in a parallel tree in ~/Library/Haskell.
N.B. Built executables will be symlink’d into ~/Library/Haskell/bin, you probably want to add that to your $PATH by adding this line to your ~/.bash_profile:
Following is copied from Andrew Marshall’s answer on StackOverflow.
% means “the current file”
As eugene y pointed out, % does indeed mean “the current file name”. Another use for this in Vim is in substitution commands. For example, :%s/foo/bar means “in the current file, replace occurrences of foo with bar.” If you highlight some text before typing :s, you’ll see that the highlighted lines take the place of % as your substitution range.
:w isn’t updating your file
One confusing part of this trick is that you might think :w is modifying your file, but it isn’t. If you opened and modified file1.txt, then ran :w file2.txt, it would be a “save as”; file1.txt wouldn’t be modified, but the current buffer contents would be sent to file2.txt.
Instead of file2.txt, you can substitute a shell command to receive the buffer contents. For instance, :w !cat will just display the contents.
If Vim wasn’t run with sudo access, its :w can’t modify a protected file, but if it passes the buffer contents to the shell, a command in the shell can be run with sudo. In this case, we use tee.
Understanding tee
As for tee, picture the tee command as a T-shaped pipe in a normal bash piping situation: it directs output to specified file(s) and also sends it to standard output, which can be captured by the next piped command.
For example, in ps -ax | tee processes.txt | grep ‘foo’, the list of processes will be written to a text file and passed along to grep.
In the situation your question describes, using tee is a hack because we’re ignoring half of what it does. sudo tee writes to our file and also sends the buffer contents to standard output, but we ignore standard output. We don’t need to pass anything to another piped command in this case; we’re just using tee as an alternate way of writing a file and so that we can call it with sudo.
Making this trick easy
You can add this to your .vimrc to make this trick easy-to-use: just type :w!!.
123
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
The > /dev/null part explicitly throws away the standard output, since, as I said, we don't need to pass anything to another piped command.