Config file is .emacs.d/init.el
Packages are setup with use-package. Most packages are not ensured
(automatically downloaded). To download everything, uncomment the
following line and restart emacs.
(setq use-package-always-ensure t)
On an environment with limited needs, use .emacs.min
as config
file.
brew tap railwaycat/emacsmacport
brew install emacs-mac --with-imagemagick --with-modules --with-xml2 --with-modern-icon
To launch GUI emacs, add the following file emacs
to somewhere in PATH
,
and make sure executable bit is on
#!/bin/bash
exec /usr/local/opt/emacs-mac/Emacs.app/Contents/MacOS/Emacs "$@"
Disable some slow GUI components. Reference: radian-software/radian#180
defaults write org.gnu.Emacs Emacs.ToolBar -string no
defaults write org.gnu.Emacs Emacs.ScrollBar -string no
Disable useless GUI components. Reference same as above, also https://www.gnu.org/software/emacs/manual/html_node/emacs/Table-of-Resources.html
See .Xresources
for details. Use the below command to reload the
resource file.
xrdb -merge ~/.Xresources
control sequence get pasted with Command-v
bracketed paste mode https://cirw.in/blog/bracketed-paste
ChrisJohnsen/tmux-MacOSX-pasteboard#31
xclip-mode
solves the problem? It replied on pbcopy/pbpaste
on
mac, and xclip
on linux (sudo apt-get install xclip
).
problems with copy/paste, opening graphical applications
solution: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard
brew install reattach-to-user-namespace
if-shell 'test "$(uname -s)" = Darwin' 'set-option -g default-command "exec reattach-to-user-namespace -l $SHELL"'
use --user
if no admin privilege
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
python ez_setup.py --user > /dev/null
easy_install --user pip
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
environment variable: PIP_CONFIG_FILE=$HOME/.config/pip/pip.conf
[global]
timeout=3
[list]
format=columns
use pip3
for python3 packages
# if use python instead of ipython, remove (elpy-use-ipython) from .emacs
pip install --user ipython
# for elpy completion and error detection
pip install --user jedi importmagic flake8
pip list --outdated
pip
supports multiple arguments, so -n1
option to xargs
is not needed.
If format
option to pip is set to columns
, skip first 2 lines in
pip list --outdated
output (start printing from the 3rd line).
pip list --outdated | tail -n +3 | awk '{print $1}' | xargs pip install -U
pip3 list --outdated | tail -n +3 | awk '{print $1}' | xargs pip3 install -U
To see the command composed by xargs
before executing it,
use xargs [xargs-options] echo [command]
.
Most packages are available for both python2 and python3 under the same name,
while at the same time, they are linked as an executable in /usr/local/bin
.
It is sometimes confusing whether you are using python 2 or 3 package if
directly invoked from command line.
Since I prefer python3 to python2, first upgrade python 2 packages,
then upgrade python3 packages, so that python3 packages would overwrite
python2 ones in /usr/local/bin
.
When trying to run a tool only under python 2/3, use the following.
python -m flake8
python3 -m flake8
apt-get build-dep python3
# install pyenv
# curl: from github
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
- nice gdb interface
- https://github.com/cyrus-and/gdb-dashboard
wget -P ~ git.io/.gdbinit
# on Mac
brew install llvm --with-clang
# on ubuntu
apt-get install llvm-dev clang libclang-dev
brew install cmake
apt-get install cmake
M-x irony-install-server
: Make sure to specify the following
-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
amazing c++ documentation, from https://github.com/jeaye/stdman
brew install stdman
- nodejs, npm
# Mac
brew install nodejs npm
# ubuntu
apt-get install nodejs npm
# for ubuntu, node might have to be symlinked
ln -s /usr/bin/nodejs /usr/bin/node
- npm install user global:
https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
- local directory
mkdir "${HOME}/.npm-packages"
- add to
~/.npmrc
prefix=${HOME}/.npm-packages
- add to
.bashrc
NPM_PACKAGES="${HOME}/.npm-packages" PATH="$NPM_PACKAGES/bin:$PATH" # Unset manpath so we can inherit from /etc/manpath via the `manpath` command unset MANPATH # delete if you already modified MANPATH elsewhere in your config export MANPATH="$NPM_PACKAGES/share/man:$(manpath)"
- local directory
# no need to sudo
npm install -g eslint tern
tern
: add a default config under home directory// ~/.tern-project { "plugins": { "es_modules": {}, "node": {} }, "libs": [ "ecma5", "ecma6" ], "ecmaVersion": 6 }
eslint
: add a default config under home directory// ~/.eslintrc.json { "env": { "browser": true, "node": true, "es6": true }, "rules": { "no-use-before-define": "error" } }
add ~/.bash_profile
with
if [[ $- == *i* ]] && [ -r ~/.bashrc ]; then
. ~/.bashrc
fi
pip install powerline-status
more stuff to do
- http://powerline.readthedocs.io/en/master/usage/shell-prompts.html#bash-prompt
- fonts
sudo apt-get install fonts-powerline
- http://powerline.readthedocs.io/en/master/configuration.html#quick-setup-guide
- potiential problem:
- exit code, git status not showing up
- powerline/powerline#186 (comment)
- add
~/.config/powerline/config.json
- set
ext.shell.theme = "default_leftonly"
- exit code, git status not showing up
brew install shellcheck
apt-get install shellcheck
gem install pry robocop jekyll
For mac, emulate ip
from Linux
brew tap brona/iproute2mac
brew install iproute2mac
https://github.com/defunkt/gist
DATADIR=/var/lib/znc
sudo apt install znc znc-dev
getent passwd znc || sudo useradd znc
mkdir -p $DATADIR && chown -R znc:znc $DATADIR
sudo -u znc znc --makeconf --datadir $DATADIR
git clone https://github.com/jpnurmi/znc-playback.git
cd znc-playback/ && znc-buildmod playback.cpp
mkdir -p $DATADIR/modules && mv playback.so $DATADIR/modules
chown -R znc:znc ~/.znc # permission issue
# then follow instructions here to activate the playback module
# https://wiki.znc.in/Playback
# start znc as follows
sudo -u znc znc --datadir $DATADIR
reference: https://www.andrewstambrosky.com/2016/11/19/znc-ubuntu-1604/