0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

自分用 環境設定

Last updated at Posted at 2019-03-29

.bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
    . ~/.bashrc
fi


# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export PATH=$HOME/.nodebrew/current/bin:$PATH
export PATH="$HOME/.yarn/bin:$PATH"

# for Ruby
export PATH="~/.rbenv/shims:/usr/local/bin:$PATH"
eval "$(rbenv init -)"


# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/opt/anaconda3/etc/profile.d/conda.sh"
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

export GOOGLE_APPLICATION_CREDENTIALS="$HOME/.ssh/secret-descent-267513-099efb8a4194.json"

.bashrc

# User specific aliases and functions
alias ll='ls -al'
alias rm='rm -i'
alias tree='tree -C'


# Source global definitions
if [ -f /etc/bashrc ]; then
     . /etc/bashrc
fi


# disactivate Ctrl + s / stop stdout
stty stop undef


# activate bash_completion
if [ -f $(brew --prefix)/etc/bash_completion ]; then
  source $(brew --prefix)/etc/bash_completion
fi
source /Users/xxxxx/.git-completion.bash


# export environmental variables
PS1="\[\033[0;36m\][\u@\h \w]\$\[\033[0m\] "
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export MANPATH="/opt/local/man:$MANPATH"

PS1 = ... の行の[0;36m] ~[0m] で囲まれた部分に色が付けられる。
参考: http://babyp.blog55.fc2.com/blog-entry-663.html

.inputrc

Tab 補完で小文字大文字の区別をなくす。

set completion-ignore-case on

git で補完を効かせる

bash の場合

$ curl -s -o $HOME/.git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash

.bashrc で読み込ませるようにする

$ echo "source $HOME/.git-completion.bash" >> $HOME/.bashrc

.vimrc

"vi Compatible OFF
set nocompatible

"Display
set number
set showmatch
set laststatus=2
syntax on

"Input
set backspace=2
set autoindent
set shiftwidth=4
set tabstop=4
set expandtab

" Vimのインクリメントでアルファベットをインクリメントできるようにする
" set nf=alpha

" F1でヘルプ開くのを無効化
nmap <F1> <nop>
imap <F1> <nop>

"Encode
set encoding=utf-8
set fileencodings=utf-8,iso-2022-jp,euc-jp,ucs-2le,ucs-2,cp932

"vimでヤンクした内容をクリップボードにも保存
set clipboard=unnamed,autoselect

"fast move
noremap H b
noremap J }
noremap K {
noremap L w

nnoremap <silent> co :ContinuousNumber <C-a><CR>
vnoremap <silent> co :ContinuousNumber <C-a><CR>
command! -count -nargs=1 ContinuousNumber let c = col('.')|for n in range(1, <count>?<count>-line('.'):1)|exec     'normal! j' . n . <q-args>|call cursor('.', c)|endfor

ヤンクしたテキストをクリックボードにも保存

https://qiita.com/m_ohsumi/items/3ca4ab80fc465d8eed7e を参考に対応。

  1. https://www.macports.org/ の'Available Downloads' を押下

  2. https://github.com/macports/macports-base/releases/tag/v2.4.2 に遷移したので、対象のパッケージをDL(pkg)

  3. DLしたパッケージをインストール

  4. $ ~ vim ~/.bashrcに以下を追記 (zshrcなら ~/.zshrc)

export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export MANPATH="/opt/local/man:$MANPATH"

sourceで反映をしたのち、以下のコマンドを実行していく。

# コマンド反映の確認
$ port version

# portコマンドを最新化
$ sudo port selfupdate

# portsリストを反映
$ sudo port sync でportsリストを反映
 
# clipboardの取得
$ sudo port deactivate vim
$ sudo port install vim +clipboard
 
# +clipboardの確認
$ vim --version | grep clipboard

screenrc

今時いらんかもね

escape ^Tt 

caption always "%-w%10L>%{=b bw}%n %t%{-}%+w%-0="
shelltitle "$ |shell"

参考 http://mksmemorandum.blogspot.jp/2010/01/screenrc-utf-8.html

Git設定

mergetoolを使う場合はvimdiffにしておくと便利  https://qiita.com/yuya_presto/items/5d99499cf96c0ebb09f8

$ git config --global merge.tool vimdiff

# 設定内容の確認
$ git config --global --list
0
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?