-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
148 lines (112 loc) · 3.07 KB
/
vimrc
File metadata and controls
148 lines (112 loc) · 3.07 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
"===================================="
" GLOBALS "
"===================================="
" set nocompatible with vi
set nocompatible
syntax on
" my preferable color scheme for rails
" colorscheme vividchalk
" colorscheme ir_black
set background=light
colorscheme solarized
" changing status line like Derek Wyatt
set stl=%f\ %m\ %r\ Line:%l/%L[%p%%]\ Col:%c\ Buf:%n
" always leave status line
set laststatus=2
" have command line of two lines high
set ch=2
" I've added this for Rails support
filetype plugin indent on
" Load matchit (% to bounce from do to end, etc.)
runtime! macros/matchit.vim
" show last status 2
set laststatus=2
" shows all commands
set showcmd
" show a mode in which you currently are
set showmode
" Expand the command line using tab
set wildchar=<Tab>
" Auto indentation
set autoindent
" Smart indentation
set smartindent
" auto file type match
filetype plugin indent on
" indents equals 4 spaces
set tabstop=2
"set blinking on matching brackets
set mat=5
" autoindets tabs
set shiftwidth=2
" show numbers
set number
" enable code folding
set foldenable
set foldmethod=syntax
" always keep visible 8 lines below and above
set scrolloff=8
" split buffers more logically
set splitbelow
set splitright
" changes the default leader to coma
let mapleader = ","
" hide scrollbars and menus
set guioptions-=m
set guioptions-=T
set guioptions-=r
"===================================="
" PLUGINS "
"===================================="
" enabling pathogen plugin (autoload)
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
" Add recently accessed projects menu (project plugin)
set viminfo^=!
"===================================="
" AUTOCMDs "
"===================================="
" some filetypes:
au! BufRead,BufNewFile *.sass setfiletype sass
au! BufRead,BufNewFile *.scss setfiletype scss
" special indentation for rails
augroup myfiletypes
" Clear old autocmds in group
autocmd!
"autoindent with two spaces, always expand tabs
autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
augroup END
" reload .vimrc every time you save it
autocmd bufwritepost .vimrc source ~/.vimrc
"===================================="
" MAPPING "
"===================================="
" remap default keys of 'j' and 'k'
map j gj
map k gk
" in insert mode to escape to normal mode press 'jj'
imap jj <ESC>
" remap keys in insert mode to make html entites for polish letters
" imap Ą Ą
" imap ą ą
" imap Ć Ć
" imap ć ć
" imap Ę Ę
" imap ę ę
" imap Ł Ł
" imap ł ł
" imap Ń Ń
" imap ń ń
" imap Ó Ó
" imap ó ó
" imap Ś Ś
" imap ś ś
" imap Ź Ź
" imap ź ź
" imap Ż Ż
" imap ż ż
" mappings for editing files relativley to the current open file
map <leader>ew :e <C-R>=expand("%:p:h") . "/" <CR>
map <leader>es :sp <C-R>=expand("%:p:h") . "/" <CR>
map <leader>ev :vsp <C-R>=expand("%:p:h") . "/" <CR>
map <leader>et :tabe <C-R>=expand("%:p:h") . "/" <CR>