-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
147 lines (116 loc) · 3.86 KB
/
Copy path.vimrc
File metadata and controls
147 lines (116 loc) · 3.86 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
syntax on
" Who's our leader?
let mapleader=","
set nocompatible
filetype indent plugin on
colorscheme torte
set ts=2 sw=2 sts=2 expandtab
set autoindent
set number
set invlist
set listchars=tab:▸\ ,eol:¬
set undofile
set incsearch
nnoremap <leader>w :%s/\s\+$//<cr>:let @/=''<CR>
" Bubble single lines
nmap <C-Up> [e
nmap <C-Down> ]e
" Bubble multiple lines
vmap <C-Up> [egv
vmap <C-Down> ]egv
" Visually select the text that was last edited/pasted
nmap gV `[v`]
" Press F4 to toggle highlighting on/off, and show current value.
:noremap <F4> :set hlsearch! hlsearch?<CR>
" enable matchit for vim-textobj-rubyblock plugin
runtime macros/matchit.vim
" toggle NERDTree with \s
nnoremap <leader>s :NERDTreeToggle<cr>
" toggle Command-T with \v
nnoremap <leader>v :CommandT<cr>
nmap <F5> :CommandTFlush<CR>
let g:CommandTMaxFiles=100000
" Remember last location in file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal g'\"" | endif
endif
" ruby
autocmd FileType ruby,eruby,cucumber set expandtab tabstop=2 shiftwidth=2 tabstop=2
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
" enable syntax highlighting
syntax on
set bg=dark
" always show the menu, insert longest match
set completeopt=menuone,longest
" bash-like tab completion
set wildmode=longest,list,full
" Status line
set laststatus=2
set statusline=%F%m%r%h%w%=[%{&ff}]%y[%p%%][line\ %l\/%L,\ col\ %c]
" | | | | | | | | | | | |
" | | | | | | | | | | | + current column
" | | | | | | | | | | +-- total number of lines
" | | | | | | | | | +-- current line
" | | | | | | | | +-- current % into file
" | | | | | | | +-- current syntax in square brackets
" | | | | | | +-- current fileformat
" | | | | | +-- align right
" | | | | +-- preview flag in square brackets
" | | | +-- help flag in square brackets
" | | +-- readonly flag in square brackets
" | +-- rodified flag in square brackets
" +-- full path to file in the buffer
" movement by screenline instead of file line
nnoremap j gj
nnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
" Split window
nnoremap <Leader>h <C-w>s<C-w>j
nnoremap <Leader>v <C-w>v<C-w>l
" Switch window positions
nnoremap <Leader>X <C-w>x
" Close window
nnoremap <Leader>x <C-w>c
" Navigation
nmap <C-h> <C-w>h
nmap <C-j> <C-w>j
nmap <C-k> <C-w>k
nmap <C-l> <C-w>l
" No bells and whistles
set novisualbell " No blinking
set noerrorbells " No noise
" Allow backspacing over everything in insert mode
set backspace=indent,eol,start
" Time to wait after ESC (default causes an annoying delay)
set timeoutlen=250
" We have a fast terminal connection
set ttyfast
" Enable the use of a mouse from a terminal
set mouse=a
" Saving, undoing, backups & files
set backup " Enable creation of backup file.
set backupdir=~/.vim-local/backups " Where backups will go.
set directory=~/.vim-local/tmp " Where temporary files will go.
set undodir=~/.vim-local/undo
set undofile
set undolevels=1000
set undoreload=10000
au FocusLost * :wa
" Edit vimrc
nnoremap <Leader>ev <C-w><C-v><C-l>:e $MYVIMRC<cr>
nnoremap <Leader>rr :source $MYVIMRC<cr>
" No pipes in vertical split separators.
set fillchars=vert:\
" Highlight current column and line
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline nocursorcolumn
set cursorline nocursorcolumn
" Add Gundo key mapping
nnoremap <Leader>G :GundoToggle<CR>