• Stars
    star
    153
  • Rank 243,368 (Top 5 %)
  • Language
    Vim Script
  • License
    Other
  • Created almost 10 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Yet another vimrc

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:

  1. vimrc, standard version vimrc.
  2. vimrc_easy, same as vimrc, but add some easier key mapping for new Vimer.
  3. vimrc_pro, same as vimrc, but remove the arrow keys mapping.
  4. 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:

image

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:

  1. via curl:

    sh <(curl -L https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install.sh)

  2. or via wget:

    sh <(wget --no-check-certificate https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install.sh -O -)

Manual installation

  1. BACKUP your .vim directory and .vimrc first.(IMPORTANT!)

  2. cd ~ to change directory to your home directory.

  3. copy files to your home directory:

    git clone git://github.com/kaochenlong/eddie-vim2.git .vim

  4. make a symbolic link to vimrc:

     ln -s .vim/vimrc .vimrc
    
  5. 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
    
  6. if you use GUI version VIM, such as MacVim or GVim, you can also link to .gvimrc:

     ln -s .vim/gvimrc .gvimrc
    
  7. 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.

  8. you might need to install ack or silver searcher if you use ack.vim.

Features and Key Mappings:

  1. my <leader> key is \.

  2. 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.

  3. 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.
  4. 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 設定檔:

  1. vimrc, 標準版本。
  2. vimrc_easy, 同 1,但加了一些給新手的對應鍵(例如 Ctrl+c、Ctrl+v 的複製貼上)。
  3. vimrc_pro, 同 1,但把方向鍵拿掉了(就是強迫自己只能使用 h, j, k, l 的意思)。
  4. vimrc_experimental, 同 3,但有時候會試一些實驗性的功能。

你可以選一個你喜歡的來用(做 symbolic link 連結到 ~/.vimrc 即可)

現在它看起來像這樣:

image

色彩主題:solarized dark

使用方法

安裝

快速安裝... (DO YOU TRUST ME?)

如果你已在你的電腦安裝 git,而且你相信我這個自動安裝程式沒有放怪怪的東西在裡面的話,你可以使用下面這兩種方式來安裝:

  1. 使用 curl:

    sh <(curl -L https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install_zhtw.sh)

  2. 或使用 wget:

    sh <(wget --no-check-certificate https://github.com/kaochenlong/eddie-vim2/raw/master/utils/install_zhtw.sh -O -)

以上兩個隨便選一個你喜歡的,複製並在你的終端機視窗貼上指令即可。

手動安裝

  1. 先備份你的 .vim 資料夾以及 .vimrc 設定檔(重要!)

  2. cd ~ 指令切換到 Home 目錄。

  3. 使用 git 把檔案複製一份下來:

    git clone git://github.com/kaochenlong/eddie-vim2.git .vim

  4. 使用 ln -s 指令做一個 symbolic link 連到 .vim/vimrc

     ln -s .vim/vimrc .vimrc
    
  5. 如果你對 Vim 的 HJKL 移動操作還不熟悉的話,可以試試簡單版的設定:

     ln -s .vim/vimrc_easy .vimrc
    
  6. 如果你有使用 GUI 版的 Vim,像是 MacVim 或 GVim,你可以順便連結一下 .gvimrc

     ln -s .vim/gvimrc .gvimrc
    
  7. 如果你的 Airline 看起來字形有些怪怪的,可以看一下這個連結,它有教你怎麼更新你的字型。

  8. 你如果要使用 ack 搜尋的話,你會需要先安裝 acksilver searcher

功能及設定

  1. 我的 <leader> 鍵是 \

  2. 使用 <leader>z 鍵可以快速切換工作模式以及演講模式,不過字型大小的調整只有在 GUI 版的 Vim 才有效,你可以看一下這個連結,看看它是怎麼玩的。

  3. 在一般(或命令)模式下常用的設定:

    • <F2> 可開啟/關閉 NERDTree 視窗。
    • <F4> 開啟/關閉 Taglist 視窗。
    • <F5> 可以根據檔案類型直接在 Vim 視窗裡輸出程式的執行結果。(支援 Ruby、Python、PHP 以及 CoffeeScript 等程式)。如果是 VimScript,<F5> 會直接重新載入目前這個檔案。
    • <ctrl>p 可快速搜尋目前所在資料夾之檔案。
    • <leader> 鍵 2 次可以加上或移除註解(根據檔案類型不同會有不同效果)。
    • <tab> 以及 <shift><tab> 可以增加或減少程式碼縮排。
  4. 在存檔的時候,自動移除行尾的空白字元。

常見問題

如果你發現找不到 ctags 指令,你可以找一下你電腦裡的 ctags 程式安裝路徑,然後把 plugin/settings/ctags.vim 裡的設定換掉:

let Tlist_Ctags_Cmd = '/your/path/to/ctags'

Exuberant Ctags 是個不錯的選擇。

連絡

希望有幫上大家的忙,如果有任何問題或建議,請別客氣讓我知道,或是直接在這裡開個 issue 也行 :)

高見龍 ([email protected])

More Repositories

1

eddie-vim

Yet another vimrc
Vim Script
376
star
2

learn-ruby-on-rails

為你自己學 Ruby on Rails
128
star
3

cch

My yet another Vim setttings
Vim Script
72
star
4

programming-basic

程式設計入門 - 使用 Ruby 及 Swift
23
star
5

rails_app_template

Ruby
17
star
6

shopping_mall

demo project for TDD shopping cart
Ruby
12
star
7

rails-template

Ruby
10
star
8

my-blog

為你自己學 Laravel
PHP
8
star
9

eddie-dotfiles

Shell
8
star
10

xcode-snippets

Xcode Snippets
7
star
11

dummy-git

HTML
5
star
12

cobol-practice

COBOL
5
star
13

code_refactoring_demo

Ruby
5
star
14

EDHexcolor

Hex Color Category for UIColor (iOS)
5
star
15

nthu_library

Ruby
4
star
16

ithelp

PHP
4
star
17

my-citiesocial

Ruby
3
star
18

my_candidates

Ruby
3
star
19

vote

Ruby
3
star
20

bmi_calculator

Ruby
3
star
21

PPT

Ruby
3
star
22

flask-htmx-demo

HTML
2
star
23

cann-lang

TypeScript
2
star
24

cart-with-tests

Ruby
2
star
25

vote-me

Ruby
2
star
26

kaochenlong

2
star
27

my-tello

Ruby
2
star
28

EDStringHelper

some helpers for NSString
Objective-C
2
star
29

my_shopping_mall

Ruby
2
star
30

HappyDjango

sample code for HappyDjango class
Python
2
star
31

rails5_app_template

Ruby
2
star
32

tailwind-css-playground

HTML
2
star
33

wretch-clone

Ruby
2
star
34

uchef

Ruby
1
star
35

rubyist

try to be a better Rubyist :)
1
star
36

flask-demo

Python
1
star
37

python-scraping-data

Python
1
star
38

pydev

Python
1
star
39

mall_v4

Ruby
1
star
40

my_store

Ruby
1
star
41

react-webpack-template

React.js Project Template With Webpack
JavaScript
1
star
42

n1t0

translation package, but just for fun
Ruby
1
star
43

bmi-tauri-app

CSS
1
star
44

NaNote

Ruby
1
star
45

InkMelody

Ruby
1
star
46

go-fiber-wired

Go
1
star
47

bmi-calculator-rs

Rust
1
star
48

DevOps

1
star
49

gulp_env

using ECMAScript 2015 (ES6) syntax in Gulp
JavaScript
1
star
50

auo-project

Vue
1
star
51

neovim

Lua
1
star
52

WishSite

Ruby
1
star
53

PTT-Flash

A simple registration system for PTT-Flash workshop, built with Ruby on Rails
Ruby
1
star
54

candidates

Ruby
1
star
55

store_demo

Ruby
1
star
56

hackntu_shopping_cart

Ruby
1
star
57

hello-world

Ruby
1
star
58

dinbendon

Ruby
1
star
59

ivoting

Ruby
1
star
60

ntub-winter-vacation-camp

台北商業大學 Ruby on Rails 寒假訓練課程
1
star
61

laravel-stimulus

PHP
1
star
62

LetsLearnRuby2

Sample code for my book "Let's Learn Ruby 2.1"
1
star
63

Javascript-group-demo

Ruby
1
star
64

vote_candidate

Ruby
1
star
65

hello-kitty

HTML
1
star
66

my_medium

Ruby
1
star
67

git-demo1234

HTML
1
star
68

vivvi

JavaScript
1
star