Mercurial > ec-dotfiles
annotate rc/vimrc @ 431:be08a29208ab
Added foldmethod setting.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Sat, 29 Dec 2012 22:07:00 +0700 |
parents | 5a347898e12f |
children | 087278fd11d8 |
rev | line source |
---|---|
424 | 1 set showmode " shows mode insert/replace/visual |
2 set showcmd " shows last command on screen | |
3 set nomodeline " disallow automatic vim command execution on arbitrary file | |
3 | 4 set autoindent |
5 set lazyredraw | |
424 | 6 set vb t_vb= " disables visual bell |
3 | 7 set ruler |
8 set nocompatible | |
424 | 9 set backspace=2 " make backspace work like most other apps |
3 | 10 set esckeys |
11 set noerrorbells | |
424 | 12 set ts=8 |
13 set sw=2 | |
3 | 14 set expandtab |
32 | 15 set title |
424 | 16 set hlsearch |
17 set ls=2 " always show status line | |
18 set list listchars=tab:>-,trail:.,extends:> | |
19 set number | |
20 | |
21 if has('call') | |
22 call pathogen#infect() | |
23 endif | |
24 if has('filetype') | |
25 filetype plugin indent on | |
26 endif | |
33 | 27 |
28 map <C-t><up> :tabr<cr> | |
29 map <C-t><down> :tabl<cr> | |
30 map <C-t><left> :tabp<cr> | |
31 map <C-t><right> :tabn<cr> | |
35
a8dc309a1b8a
Misc adjusments for vim keys
Edho Prima Arief <me@myconan.net>
parents:
33
diff
changeset
|
32 map <C-t>p :tabp<cr> |
a8dc309a1b8a
Misc adjusments for vim keys
Edho Prima Arief <me@myconan.net>
parents:
33
diff
changeset
|
33 map <C-t>n :tabn<cr> |
33 | 34 map <C-t><C-t> :NERDTreeToggle<cr> |
35 map <C-t><C-m> :NERDTreeMirror<cr> | |
36 | |
430 | 37 nmap _cs :let @/ = ''<cr> |
424 | 38 nmap _pa :set number! list!<cr> |
39 | |
33 | 40 "autocmd VimEnter * NERDTree |
41 "autocmd BufEnter * NERDTreeMirror | |
42 | |
329
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
43 if has('syntax') |
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
44 syntax on |
431 | 45 set foldmethod=syntax |
423
f4a29755dd01
Switch color default to light.
Edho Arief <edho@myconan.net>
parents:
418
diff
changeset
|
46 set background=light |
336
f0771672c559
[rc/vimrc] Forces transparent background for vim on gnome-terminal.
Edho Arief <edho@myconan.net>
parents:
329
diff
changeset
|
47 let g:solarized_termtrans=1 |
329
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
48 colorscheme solarized |
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
49 endif |
350 | 50 |
51 if has("autocmd") | |
52 autocmd BufRead,BufNewFile supervisord.conf :set ft=dosini | |
353 | 53 autocmd BufRead,BufNewFile Gemfile :set ft=ruby |
424 | 54 autocmd BufRead,BufNewFile crontab.* :set noet |
55 autocmd BufRead,BufNewFile crontab :set noet | |
56 autocmd BufRead,BufNewFile fstab :set noet | |
57 autocmd BufRead,BufNewFile .git/COMMIT_EDITMSG :set noet | |
58 autocmd BufRead,BufNewFile .gitconfig :set noet | |
59 autocmd BufRead,BufNewFile .git/config :set noet | |
60 autocmd BufRead,BufNewFile *.erb :set ft=eruby | |
393
0aabb2b34ef6
Added scss vim syntax support.
Edho Arief <edho@myconan.net>
parents:
390
diff
changeset
|
61 autocmd BufRead,BufNewFile *.scss :set ft=scss |
410
fd0a889066a6
Added syntax highlight for coffeescript.
Edho Arief <edho@myconan.net>
parents:
393
diff
changeset
|
62 autocmd BufRead,BufNewFile *.coffee :set ft=coffee |
350 | 63 endif |
412
7ceec4404caf
Add restore cursor position for vim.
Edho Arief <edho@myconan.net>
parents:
410
diff
changeset
|
64 |
424 | 65 if has('function') |
418
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
66 "Restore cursor position |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
67 set viminfo='10,\"100,:20,%,n~/.viminfo |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
68 function! ResCur() |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
69 if line("'\"") <= line("$") |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
70 normal! g`" |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
71 return 1 |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
72 endif |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
73 endfunction |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
74 augroup resCur |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
75 autocmd! |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
76 autocmd BufWinEnter * call ResCur() |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
77 augroup END |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
78 endif |
424 | 79 |
80 if has('statusline') | |
81 " Status line detail: | |
82 " %f file path | |
83 " %y file type between braces (if defined) | |
84 " %([%R%M]%) read-only, modified and modifiable flags between braces | |
85 " %{'!'[&ff=='default_file_format']} | |
86 " shows a '!' if the file format is not the platform | |
87 " default | |
88 " %{'$'[!&list]} shows a '*' if in list mode | |
89 " %{'~'[&pm=='']} shows a '~' if in patchmode | |
90 " (%{synIDattr(synID(line('.'),col('.'),0),'name')}) | |
91 " only for debug : display the current syntax item name | |
92 " %= right-align following items | |
93 " #%n buffer number | |
94 " %l/%L,%c%V line number, total number of lines, and column number | |
95 function SetStatusLineStyle() | |
96 if &stl == '' || &stl =~ 'synID' | |
97 let &stl="%f %y%([%R%M]%)%{'!'[&ff=='".&ff."']}%{'$'[!&list]}%{'~'[&pm=='']}%=#%n %l/%L,%c%V " | |
98 else | |
99 let &stl="%f %y%([%R%M]%)%{'!'[&ff=='".&ff."']}%{'$'[!&list]} (%{synIDattr(synID(line('.'),col('.'),0),'name')})%=#%n %l/%L,%c%V " | |
100 endif | |
101 endfunc | |
102 " Switch between the normal and vim-debug modes in the status line | |
103 nmap _ds :call SetStatusLineStyle()<CR> | |
104 call SetStatusLineStyle() | |
105 " Window title | |
106 if has('title') | |
107 set titlestring=%t%(\ [%R%M]%) | |
108 endif | |
109 endif |