2012年2月
« 1月    
 12345
6789101112
13141516171819
20212223242526
272829  

カテゴリー

qfixhowmで外部ブラウザとしてChromeを指定する

windows7環境で、Chromeを指定する方法。

" 外部ブラウザ
let QFixHowm_OpenURIcmd        = '!start ' . $HOMEPATH . '\AppData\Local\Google\Chrome\Application\chrome.exe %s --disk-cache-dir="R:\Temp\Chrome"'

環境変数$HOMEPATHが設定されていない場合は、適宜読み替えて設定する。
–disk-cache-dirは個人的な設定(RAMDISKにキャッシュを置いている)なので、なくてもOK。
その前の%sはurlを渡しているところなので必須。

qfixhowmでg,dした時のカーソル位置が]の左ではなく右側にあって欲しい

vimテクニックバイブルで紹介されていたqfixhowmというプラグインを使い始めています。

メモの記録や、TODO管理などで便利すぎてたまりません。
もう少し使い込んだら自分の使い方のをまとめようと思いますが、
まずは細かな設定のメモ。

qfixhowmでg,dした時のカーソル位置が]の左ではなく右側にあって欲しい

通常のマッピング

    n  g,d          * :<C-U>call qfixmemo#InsertDate('Date')<CR>

右を動かすように上書き

    nmap g,d :<C-U>call qfixmemo#InsertDate('Date')<CR><Right>
    nmap g,T :<C-U>call qfixmemo#InsertDate('Time')<CR><Right>

自分はLeaderにfをマッピングしているので、実際にはfd,fTのコマンドとして利用しています。

Vimテクニックバイブル ~作業効率をカイゼンする150の技
Vimサポーターズ
技術評論社
売り上げランキング: 12628

vimprocを使えるようにするメモ (windows7 64bit)

下準備。
vundleでvimprocのインストール
vundleでvimshellのインストール

ココからが難しいとこ

Mingw-toolsのインストール(makeのインストール)

http://jaist.dl.sourceforge.net/project/mingw/Installer/mingw-get-inst/mingw-get-inst-20111118/mingw-get-inst-20111118.exe

インストールディレクトリをMinGW-toolsに指定、コンパイラはインストールせずにMSYS Basic Systemだけインストール。コンパイラは次にダウンロードする64bit版を使うので。

C:\MinGW-tools\msys\1.0\bin pathに追加

Mingw-64bitのインストール

http://jaist.dl.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win64/Automated%20Builds/mingw-w64-bin_i686-mingw_20111220.zip

解凍したファイルを移動して、C:\mingw-w64\ に名前変更

C:\mingw-w64\bin pathに追加

C:\mingw-w64\bin\x86_64-w64-mingw32-gcc.exe を gcc.exeに名前変更

※上記のMingw-tools、及びMingw-64bitは以下を参考に最新をダウンロードするといい。
http://umeji.blogspot.com/2011/10/mingwwindows64bitvimprocdll.html

コマンドプロンプトを起動して、こんな感じで出る

c:\>make -v
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
 
This program built for i686-pc-msys
 
c:\>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw-w64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.0/lto
-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 --
prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --with-sysroot=/c
/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --enable-languages=all,obj
-c++ --enable-fully-dynamic-string --disable-multilib
Thread model: win32
gcc version 4.7.0 20111220 (experimental) (GCC)

vimprocのコンパイル

c:\>cd c:\Users\xxxxxx\.vim\bundle\vimproc
 
c:\Users\xxxxxx\.vim\bundle\vimproc>make -f make_mingw.mak
gcc -O2 -Wall -shared -o autoload/proc.dll autoload/proc_w32.c -lwsock32
autoload/proc_w32.c:31:0: warning: "WINVER" redefined [enabled by default]
In file included from c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../..
/../../x86_64-w64-mingw32/include/stdio.h:9:0,
                 from autoload/proc_w32.c:22:
c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-ming
w32/include/_mingw.h:240:0: note: this is the location of the previous definitio
n
autoload/proc_w32.c:32:0: warning: "_WIN32_WINNT" redefined [enabled by default]
 
In file included from c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../..
/../../x86_64-w64-mingw32/include/stdio.h:9:0,
                 from autoload/proc_w32.c:22:
c:\mingw-w64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-ming
w32/include/_mingw.h:244:0: note: this is the location of the previous definitio
n
autoload/proc_w32.c: In function 'vp_pipe_open':
autoload/proc_w32.c:499:33: warning: cast from pointer to integer of different s
ize [-Wpointer-to-int-cast]
autoload/proc_w32.c:501:33: warning: cast from pointer to integer of different s
ize [-Wpointer-to-int-cast]
autoload/proc_w32.c:504:37: warning: cast from pointer to integer of different s
ize [-Wpointer-to-int-cast]
autoload/proc_w32.c: In function 'ExitRemoteProcess':
autoload/proc_w32.c:648:33: warning: cast to pointer from integer of different s
ize [-Wint-to-pointer-cast]
autoload/proc_w32.c: In function 'vp_open':
autoload/proc_w32.c:949:9: warning: cast from pointer to integer of different si
ze [-Wpointer-to-int-cast]
In file included from autoload/proc_w32.c:44:0:
autoload/proc_w32.c: At top level:
autoload/vimstack.c:42:19: warning: 'vp_stack_null' defined but not used [-Wunus
ed-variable]

動作確認

vimを再起動して、:VimShellを起動、lsを表示してエラーが出なければOK

vim何度目かの環境設定またはBundleでのプラグイン管理が便利すぎ(windows7 64bit)

今回は、Vimテクニックバイブルを購入したのでそれを参考に色々環境を作ってみる。

まずは、まっさらなVimをKaoriyaからダウンロード

http://www.kaoriya.net/software/vim

ダウンロードしたファイルは、
D:\program\vim
に置く。自分でダウンロードしたインストーラのついていないソフトは
全部D:\program\以下に置くようにしている。以前にインストールしていたvimフォルダは
vim_oldとして別名にしてかわしておく。

まっさらなvimの起動

vimrcの設定 基本編

1.windows環境では、runtimepathは通常~/vimfiles/だが、unix環境に合わせて~/.vim/ディレクトリにする
2.$VIMフォルダは改造しないことを基本とする

~/_vimrcファイルをC:\User\ユーザ名\以下に作成、以下だけを記述

1
2
3
4
5
6
7
8
9
10
11
12
13
14
" vim:set ts=8 sts=2 sw=2 tw=0:
" -----------------------------------------------------------------------------
"  ~/_vimrc 最低限の設定を記述
"   2012.01.03 新規設定
" -----------------------------------------------------------------------------
"
" *****************************************************************************
" runtimepath を vimfilesではなく.vim(unix環境)に合わせる
" *****************************************************************************
set runtimepath+=$HOME/.vim,$HOME/.vim/after
" *****************************************************************************
"  設定は ~/.vim/_vimrcを使用
" *****************************************************************************
source ~/.vim/_vimrc

プラグイン管理の環境

インストールや更新を自動でできる”Vundle”というプラグインをインストールして使用する

C:\Users\xxxxxx>git clone http://github.com/gmarik/vundle.git .vim/bundle/vundle
Cloning into .vim/bundle/vundle...
remote: Counting objects: 2225, done.
remote: Compressing objects: 100% (1447/1447), done.
Receiving objects:  71remote: Total 2225 (delta 728), reused 2180 (delta 689)%     /2225)
Receiving objects: 100% (2225/2225), 267.28 KiB | 121 KiB/s, done.
Resolving deltas: 100% (728/728), done.

windowsでVundleが利用できるように、curlを設定(https://github.com/gmarik/vundle/wiki/Vundle-for-Windows)

c:\>git --version
git version 1.7.4.msysgit.0

c:\>curl --version
curl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8k zlib/1.2.3
Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL SSPI libz

vimrcの設定

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
" vim:fdm=marker
" -------------------------------------------------------------------------
"  vundle.vimrc
" -------------------------------------------------------------------------
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
 
" 必須
Bundle 'gmarik/vundle'
 
" from github
Bundle 'motemen/hatena-vim.git'
Bundle 'tpope/vim-fugitive'
 
" from vim.org
Bundle 'YankRing.vim'
Bundle 'bufferlist.vim'
 
filetype plugin indent on

vimを再起動して、:BundleInstall実行
こんな感じでインストールされる

これはちょう便利。

新人OL、つぶれかけの会社をまかされる

新人OL、つぶれかけの会社をまかされる (青春新書PLAYBOOKS)
佐藤義典
青春出版社
売り上げランキング: 9017

 

elm200さんのブログで絶賛されていて、面白そうだと思って読んでみた。
 

ものすごく面白くて、とてもよかった。
差別化の3つの軸の話が凄く納得した。
この本は繰り返し読むと思う。


メモ
・マーケッティングの本。小説仕立てにして、所々でマーケッティングの説明をしてくれる。

・ターゲットを絞る。誰に売りたいか。具体的にイメージ。
×20代女性 → 21歳の就活中学生と、29歳の専業主婦が同じターゲットになるわけない。
・企業の強み、差別化は3つの軸のどれかにしかならない
・手軽軸 ー 競合より安い、早い、手軽、で差別化
・商品軸 ー 競合より高品質、新技術、で差別化
・密着軸 ー 競合より顧客の「個別」ニーズに対応した密着感、で差別化
・この軸はたいてい1つしか選べない。欲張って複数の軸にぶれると失敗する。一貫性重要。

・スポーツでもなんでも、勝つ人は、ほんとうに真剣で、勝ちたい人。
最後に勝負を決めるのは、気迫、執念、想いの強さ。