Intro
I'm currently a Ruby/Rails/iOS app developer and instructor, this is my personal Vim configurations and some plugins which I used in my daily job, and I removed and reorganized redundant settings and plugins from my another vim repository https://github.com/kaochenlong/eddie-vim
I put Vim related settings in plugin/settings/settings.vim
, and isolated other plugins' settings in plugin/settings
directory.
You might notice that there are several vimrc files:
vimrc
, standard version vimrc.vimrc_easy
, same as vimrc, but add some easier key mapping for new Vimer.vimrc_pro
, same as vimrc, but remove the arrow keys mapping.vimrc_experimental
, same as pro-vimrc, but just for experimental purpose.
you can make a symbolic link of your ~/.vimrc
to any one of them as you wish :)
my Vim looks like:
color theme: solarized dark
Usage
Installation and Requisites:
Automatic installer... (DO YOU TRUST ME?)
If you already install git
in your machine, and you trust me and my automatic install shell script, you can install my vimrc via curl
or wget
, just copy one of the following line and paste in terminal:
-
via
curl
:sh <(curl -L https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install.sh)
-
or via
wget
:sh <(wget --no-check-certificate https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install.sh -O -)
Manual installation
-
BACKUP your
.vim
directory and.vimrc
first.(IMPORTANT!) -
cd ~
to change directory to your home directory. -
copy files to your home directory:
git clone git://github.com/kaochenlong/eddie-vim2.git .vim
-
make a symbolic link to vimrc:
ln -s .vim/vimrc .vimrc
-
if you're still not familiar with the movements in vim by HJKL or yanking and pasting text, I've made a easier version:
ln -s .vim/vimrc_easy .vimrc
-
if you use GUI version VIM, such as MacVim or GVim, you can also link to
.gvimrc
:ln -s .vim/gvimrc .gvimrc
-
if you use Airline under Ubuntu or something which can not show the correct icons/fonts on the bottom, you can check this link, patch the font and it should look pretty nice.
-
you might need to install
ack
orsilver searcher
if you useack.vim
.
Features and Key Mappings:
-
my
<leader>
key is\
. -
Toggle between working mode and presentation mode by
<leader>z
, but it only works in GUI version Vim. You can check here to see how it looks like. -
some usually used key mappings in normal mode:
<F2>
to toggle NERDTree on and off.<F4>
to toggle Taglist window.<F5>
is the script runner, according to it's filetype, it will run Ruby(*.rb) ,Python(*.py) or PHP(*.php) file, even CoffeeScript(*.coffee, but you may have to install CoffeeScript first). If the filetype is VimScript,<F5>
will reloadrun:source %
and reload the current file.- hit
<ctrl>p
will launch a quick window to match keywords from your current working directory, not only file name, but also path name. - hit
<leader>
twice to toggle comment on and off. <tab>
and<shift><tab>
to increase and decrease the syntax identation.
-
Remove tailing whitespace automatically while saving.
FAQ
if you can not found ctags
command, just find your ctags path and replace my settings in plugin/settings/ctags.vim
file:
let Tlist_Ctags_Cmd = '/your/path/to/ctags'
and Exuberant Ctags is recommended.
Contact
Enjoy it, and if there's any question or comment, feel free to let me know, or just fire an issue here :)
Eddie Kao ([email protected])
็ฐกไป
ๆ็ฎๅๆฏไฝ Ruby/Rails/iOS app ็้็ผ่ /่ฌๅธซ๏ผ้ๆฏๆ่ชๅทฑๆฏๅคฉๅทฅไฝไธๆ็จๅฐ็ Vim ่จญๅฎๆช่ท็จๅฐ็ pluginใๅ ถๅฏฆ้ๆฏๆๅพๅฆไธๅๅฐๆกๆฟๆไธๅธธ็จ็่จญๅฎๅ plugin๏ผ้ๆฐๆด็่ๆ็ใ
ๆๆ Vim ็ไธป่ฆ่จญๅฎๆชๆพๅจ plugin/settings/settings.vim
๏ผไธฆไธๆๅ
ถๅฎ plugin ็่จญๅฎๆพๅจ plugin/settings
่ณๆๅคพไธญใ
ไฝ ๅฏ่ฝๆ็ผ็พ๏ผๆๆๅฅฝๅนพๅ vim ่จญๅฎๆช๏ผ
vimrc
, ๆจๆบ็ๆฌใvimrc_easy
, ๅ 1๏ผไฝๅ ไบไธไบ็ตฆๆฐๆ็ๅฐๆ้ต(ไพๅฆ Ctrl+cใCtrl+v ็่ค่ฃฝ่ฒผไธ)ใvimrc_pro
, ๅ 1๏ผไฝๆๆนๅ้ตๆฟๆไบ(ๅฐฑๆฏๅผท่ฟซ่ชๅทฑๅช่ฝไฝฟ็จ h, j, k, l ็ๆๆ)ใvimrc_experimental
, ๅ 3๏ผไฝๆๆๅๆ่ฉฆไธไบๅฏฆ้ฉๆง็ๅ่ฝใ
ไฝ ๅฏไปฅ้ธไธๅไฝ ๅๆญก็ไพ็จ(ๅ symbolic link ้ฃ็ตๅฐ ~/.vimrc
ๅณๅฏ)
็พๅจๅฎ็่ตทไพๅ้ๆจฃ๏ผ
่ฒๅฝฉไธป้ก๏ผsolarized dark
ไฝฟ็จๆนๆณ
ๅฎ่ฃ
ๅฟซ้ๅฎ่ฃ... (DO YOU TRUST ME?)
ๅฆๆไฝ ๅทฒๅจไฝ ็้ป่
ฆๅฎ่ฃ git
๏ผ่ไธไฝ ็ธไฟกๆ้ๅ่ชๅๅฎ่ฃ็จๅผๆฒๆๆพๆชๆช็ๆฑ่ฅฟๅจ่ฃก้ข็่ฉฑ๏ผไฝ ๅฏไปฅไฝฟ็จไธ้ข้ๅ
ฉ็จฎๆนๅผไพๅฎ่ฃ๏ผ
-
ไฝฟ็จ
curl
:sh <(curl -L https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install_zhtw.sh)
-
ๆไฝฟ็จ
wget
:sh <(wget --no-check-certificate https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install_zhtw.sh -O -)
ไปฅไธๅ ฉๅ้จไพฟ้ธไธๅไฝ ๅๆญก็๏ผ่ค่ฃฝไธฆๅจไฝ ็็ต็ซฏๆฉ่ฆ็ช่ฒผไธๆไปคๅณๅฏใ
ๆๅๅฎ่ฃ
-
ๅ ๅไปฝไฝ ็
.vim
่ณๆๅคพไปฅๅ.vimrc
่จญๅฎๆช(้่ฆ!) -
cd ~
ๆไปคๅๆๅฐ Home ็ฎ้ใ -
ไฝฟ็จ
git
ๆๆชๆก่ค่ฃฝไธไปฝไธไพ๏ผgit clone git://github.com/kaochenlong/eddie-vim2.git .vim
-
ไฝฟ็จ
ln -s
ๆไปคๅไธๅ symbolic link ้ฃๅฐ.vim/vimrc
๏ผln -s .vim/vimrc .vimrc
-
ๅฆๆไฝ ๅฐ Vim ็ HJKL ็งปๅๆไฝ้ไธ็ๆ็่ฉฑ๏ผๅฏไปฅ่ฉฆ่ฉฆ็ฐกๅฎ็็่จญๅฎ๏ผ
ln -s .vim/vimrc_easy .vimrc
-
ๅฆๆไฝ ๆไฝฟ็จ GUI ็็ Vim๏ผๅๆฏ MacVim ๆ GVim๏ผไฝ ๅฏไปฅ้ ไพฟ้ฃ็ตไธไธ
.gvimrc
๏ผln -s .vim/gvimrc .gvimrc
-
ๅฆๆไฝ ็ Airline ็่ตทไพๅญๅฝขๆไบๆชๆช็๏ผๅฏไปฅ็ไธไธ้ๅ้ฃ็ต๏ผๅฎๆๆไฝ ๆ้บผๆดๆฐไฝ ็ๅญๅใ
-
ไฝ ๅฆๆ่ฆไฝฟ็จ
ack
ๆๅฐ็่ฉฑ๏ผไฝ ๆ้่ฆๅ ๅฎ่ฃack
ๆsilver searcher
ใ
ๅ่ฝๅ่จญๅฎ
-
ๆ็
<leader>
้ตๆฏ\
ใ -
ไฝฟ็จ
<leader>z
้ตๅฏไปฅๅฟซ้ๅๆๅทฅไฝๆจกๅผไปฅๅๆผ่ฌๆจกๅผ๏ผไธ้ๅญๅๅคงๅฐ็่ชฟๆดๅชๆๅจ GUI ็็ Vim ๆๆๆ๏ผไฝ ๅฏไปฅ็ไธไธ้ๅ้ฃ็ต๏ผ็็ๅฎๆฏๆ้บผ็ฉ็ใ -
ๅจไธ่ฌ(ๆๅฝไปค)ๆจกๅผไธๅธธ็จ็่จญๅฎ๏ผ
<F2>
ๅฏ้ๅ/้้ NERDTree ่ฆ็ชใ<F4>
้ๅ/้้ Taglist ่ฆ็ชใ<F5>
ๅฏไปฅๆ นๆๆชๆก้กๅ็ดๆฅๅจ Vim ่ฆ็ช่ฃก่ผธๅบ็จๅผ็ๅท่ก็ตๆใ(ๆฏๆด RubyใPythonใPHP ไปฅๅ CoffeeScript ็ญ็จๅผ)ใๅฆๆๆฏ VimScript๏ผ<F5>
ๆ็ดๆฅ้ๆฐ่ผๅ ฅ็ฎๅ้ๅๆชๆกใ<ctrl>p
ๅฏๅฟซ้ๆๅฐ็ฎๅๆๅจ่ณๆๅคพไนๆชๆกใ- ๆ
<leader>
้ต 2 ๆฌกๅฏไปฅๅ ไธๆ็งป้ค่จป่งฃ(ๆ นๆๆชๆก้กๅไธๅๆๆไธๅๆๆ)ใ <tab>
ไปฅๅ<shift><tab>
ๅฏไปฅๅขๅ ๆๆธๅฐ็จๅผ็ขผ็ธฎๆใ
-
ๅจๅญๆช็ๆๅ๏ผ่ชๅ็งป้ค่กๅฐพ็็ฉบ็ฝๅญๅ ใ
ๅธธ่ฆๅ้ก
ๅฆๆไฝ ็ผ็พๆพไธๅฐ ctags
ๆไปค๏ผไฝ ๅฏไปฅๆพไธไธไฝ ้ป่
ฆ่ฃก็ ctags ็จๅผๅฎ่ฃ่ทฏๅพ๏ผ็ถๅพๆ plugin/settings/ctags.vim
่ฃก็่จญๅฎๆๆ๏ผ
let Tlist_Ctags_Cmd = '/your/path/to/ctags'
Exuberant Ctags ๆฏๅไธ้ฏ็้ธๆใ
้ฃ็ตก
ๅธๆๆๅนซไธๅคงๅฎถ็ๅฟ๏ผๅฆๆๆไปปไฝๅ้กๆๅปบ่ญฐ๏ผ่ซๅฅๅฎขๆฐฃ่ฎๆ็ฅ้๏ผๆๆฏ็ดๆฅๅจ้่ฃก้ๅ issue ไน่ก :)
้ซ่ฆ้พ ([email protected])