/
README
99 lines (79 loc) · 4.06 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
A set of Vim configurations to use specially with Rails + Git
-- to set up the .vimrc file, use this command to create a symbolic link
- 'ln -s vimrc ~/.vimrc'
- 'ln -s gvimrc ~/.gvimrc'
We are now using Vundle to manage the plugins \o/.
The first time you clone this repo you will also to clone the vundle plugin:
'git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle'
-- to set up the plugins
You can run this from command line:
'vim +BundleInstall +qall'
or after opening vim you can use the command:
':BundleInstall'
If you want to use the fancy status bar on the Mac (on by default on the Mac) you will also need to install the Menlo-Powerline font on the extra/ folder.
Font from: https://gist.github.com/1595572
Needs:
- ctags (>= 5.8) http://ctags.sourceforge.net/
- git (>= 1.7.4.4) http://git-scm.com/
Shortcuts: (fairly outdated list, I will update them soon)
AutoComplete
<Control-Shift-Space> : opens the autocomplete menu
NerdTree
<F2> : open the NERDTree windows (drawer)
Search/Open
<Alt/Option-Shift-f> : search for a file (it is possible to filter the search)
<Alt/Option-Shift-o> : show the open files (buffers). The last viewed file is selected and you can also filter the result
<Alt/Option-Shift-t> c : search for a tag in the current buffer
<Alt/Option-Shift-t> a : search for a tag in all open buffers
<Alt/Option-Shift-t> w : search for the word under the cursor as a tag in current buffer
<Alt/Option-Shift-t> W : search for the word under the cursor as a tag in all open buffers
<Alt/Option-Shift-t> s : search for the selection as a tag in current buffer
<Alt/Option-Shift-t> S : search for the selection as a tag in all open buffers
Rails specific (you can press tab to auto-complete in most of them)
<Alt/Option-Shift-m> : opens a model
<Alt/Option-Shift-c> : opens a controller
<Alt/Option-Shift-v> : opens a view
<Alt/Option-Shift-s> : runs a script
<Alt/Option-Shift-e> : extract a partial
<Alt/Option-Shift-g> : runs generate
<Alt/Option-Shift-l> : opens the log
<Alt/Option-Shift-p> : preview the file
<Alt/Option-Shift-t> t : create tags file for the current project (works only for rails projects)
<F3> : goes to the test file (test unit/rspec)
<F4> : goes to the migration file (models) or view file (controller method)
<F5> : runs the test file
<F6> : runs the test under the cursor
Git specific
<F7> : blame
<Shift-F7> : diff
Navigation
<Control-Tab> : goes to the next tab
<Control-Shift-Tab> : goes to the previous tab
<Control-Down> : scrolls down
<Control-Up> : scrolls up
Windows
<Space><Space> : expand the current window
<Space>= : set the window back to the default size
<Space>o : keep only the current window open
<Space>_ : expand current horizontal split
<Space>| : expand current vertical split
<Control-h> : goes to the splitted window at the left
<Control-j> : goes to the splitted window at the down
<Control-k> : goes to the splitted window at the up
<Control-l> : goes to the splitted window at the right
- : decrease the font size
+ : increase the font size
Dealing with lines
<Alt/Option-Shift-Up> : move the selected text or line up
<Alt/Option-Shift-Down> : move the selected text or line down
<Alt/Option-Shift-d> : duplicate the line under the cursor
<Alt/Option-/> : comment the line
Other
<Alt/Option-a> : select all
TagBar
<Alt/Option-i> : open the tagbar and focus it
<Alt/Option-Shift-i> : toggle the tagbar
Gundo
<Alt/Option-Shift-u> : toggle gundo and focus it
Tasks
<Alt/Option-Shift-Enter> : toggle task (done/undone)