LoginSignup
6
6

More than 5 years have passed since last update.

個人用Mac環境構築メモ

Last updated at Posted at 2018-04-08

Homebrew

まずはHomebrewのインストール
Homebrewのホームページにインストール手順が書いてある

Vim

1.~/.vimrcを編集する

syntax on
colorscheme molokai
" 行番号表示
set number

"---------------------------------
" 検索
"---------------------------------
" 検索がファイル末尾まで進んだら、ファイル先頭から再び検索
set wrapscan
" インクリメンタル検索(検索ワードの最初の文字を入力した時点で検索開始)
set incsearch
" 検索結果をハイライト表示
set hlsearch


"---------------------------------
" 表示設定
"---------------------------------
" コメントの色を水色
hi Comment ctermfg=3
" エラーメッセージの表示時にビープを鳴らさない
set noerrorbells
" Windowsでパスの区切り文字をスラッシュで扱う
set shellslash
" 対応する括弧やフレーズを表示
set showmatch matchtime=1
" 対応する括弧を強調表示
set showmatch
" インデント幅
set shiftwidth=2
" タブキー押下時に挿入される文字幅を指定
set softtabstop=2
" ファイル内にあるタブ文字の表示幅
set tabstop=2
" yでコピーした時にクリップボードに入る
set guioptions+=a
" 入力モードでタブキー押下時に半角スペースを挿入
set expandtab
" 改行時に入力された行の末尾に合わせて次の行のインデントを増減する
set smartindent
" スワップファイルを作成しない
set noswapfile
" タイトルを表示
set title
" ヤンクでクリップボードにコピー
set clipboard=unnamed,autoselect
" Escの2回押しでハイライト消去
nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
" 行をまたいて移動
set whichwrap=b,s,h,l,<,>,[,],~
" 最新版vimはバックスペースが効かないため下のコマンドを追加する
set backspace=indent,eol,start

" auto reload .vimrc
augroup source-vimrc
  autocmd!
  autocmd BufWritePost *vimrc source $MYVIMRC | set foldmethod=marker
  autocmd BufWritePost *gvimrc if has('gui_running') source $MYGVIMRC
augroup END

" auto comment off
augroup auto_comment_off
  autocmd!
  autocmd BufEnter * setlocal formatoptions-=r
  autocmd BufEnter * setlocal formatoptions-=o
augroup END

" HTML/XML閉じタグ自動補完
augroup MyXML
  autocmd!
  autocmd Filetype xml inoremap <buffer> </ </<C-x><C-o>
  autocmd Filetype html inoremap <buffer> </ </<C-x><C-o>
augroup END

" 編集箇所のカーソルを記憶
if has("autocmd")
  augroup redhat
    " In text files, always limit the width of text to 78 characters
    autocmd BufRead *.txt set tw=78
    " When editing a file, always jump to the last cursor position
    autocmd BufReadPost *
    \ if line("'\"") > 0 && line ("'\"") <= line("$") |
    \   exe "normal! g'\"" |
    \ endif
  augroup END
endif

colorscheme molokai
を使いたい場合まずダウンロードする必要がある(プラグインを使わない)
vimのカラースキーム (colorscheme) を "molokai" に設定する

2.clipboardの連携(Mac)

初心者向け Vimでクリップボード連携(コピー&ペースト)する方法

3.clipboardの連携(tmux)

$ brew install reattach-to-user-namespace

$ echo 'set-option -g default-command "reattach-to-user-namespace -l bash"' >> ~/.tmux.conf

補足:vimのプラグイン管理ツールNeoBundleのインストール手順
https://github.com/Shougo/neobundle.vim

tmux

Homebrewでインストールして設定する

$ brew install tmux

達人に学ぶ.tmux.confの基本設定

tmuxを使い始めたので基本的な機能の使い方とかを整理してみた

tmuxチートシート

ターミナルマルチプレクサ tmux をカスタマイズする

pyenv

Homebrewでインストールしてパスを通す

$ brew install pyenv
$ echo 'export PYENV_ROOT=/usr/local/var/pyenv' >> ~/.bash_profile
$ echo 'if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi' >> ~/.bash_profile
$ pyenv --version

MeCab

$ brew install mecab
$ brew install mecab-ipadic
$ pip install mecab-python3

git-prompt

vimでPythonのコーディングチェック(PEP8)

vimでpythonのコーディングスタイルを自動でチェック&自動修正する

6
6
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
6
6