Mercurial > ec-dotfiles
annotate rc/vimrc @ 529:de3ff51840a3
Skip clipboard loading for speedup in current setup.
- putty
- opensuse
- no X
author | edogawaconan <me@myconan.net> |
---|---|
date | Thu, 16 Oct 2014 21:47:36 +0900 |
parents | 1dd96a55b7ac |
children | d6e08a057094 |
rev | line source |
---|---|
525
1dd96a55b7ac
Invoke nocompatible earliest so it doesn't override anything preceeded it.
edogawaconan <me@myconan.net>
parents:
503
diff
changeset
|
1 set nocompatible |
424 | 2 set showmode " shows mode insert/replace/visual |
3 set showcmd " shows last command on screen | |
4 set nomodeline " disallow automatic vim command execution on arbitrary file | |
3 | 5 set autoindent |
6 set lazyredraw | |
424 | 7 set vb t_vb= " disables visual bell |
3 | 8 set ruler |
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 | |
529
de3ff51840a3
Skip clipboard loading for speedup in current setup.
edogawaconan <me@myconan.net>
parents:
525
diff
changeset
|
21 " http://stackoverflow.com/questions/14635295/vim-takes-a-very-long-time-to-start-up |
de3ff51840a3
Skip clipboard loading for speedup in current setup.
edogawaconan <me@myconan.net>
parents:
525
diff
changeset
|
22 set clipboard=exclude:.* |
de3ff51840a3
Skip clipboard loading for speedup in current setup.
edogawaconan <me@myconan.net>
parents:
525
diff
changeset
|
23 |
424 | 24 if has('call') |
25 call pathogen#infect() | |
26 endif | |
27 if has('filetype') | |
28 filetype plugin indent on | |
29 endif | |
33 | 30 |
31 map <C-t><up> :tabr<cr> | |
32 map <C-t><down> :tabl<cr> | |
33 map <C-t><left> :tabp<cr> | |
34 map <C-t><right> :tabn<cr> | |
35
a8dc309a1b8a
Misc adjusments for vim keys
Edho Prima Arief <me@myconan.net>
parents:
33
diff
changeset
|
35 map <C-t>p :tabp<cr> |
a8dc309a1b8a
Misc adjusments for vim keys
Edho Prima Arief <me@myconan.net>
parents:
33
diff
changeset
|
36 map <C-t>n :tabn<cr> |
33 | 37 map <C-t><C-t> :NERDTreeToggle<cr> |
38 map <C-t><C-m> :NERDTreeMirror<cr> | |
39 | |
430 | 40 nmap _cs :let @/ = ''<cr> |
424 | 41 nmap _pa :set number! list!<cr> |
42 | |
467 | 43 " format JSON |
44 map <leader>j <esc>:%!python -m json.tool<cr> | |
45 | |
33 | 46 "autocmd VimEnter * NERDTree |
47 "autocmd BufEnter * NERDTreeMirror | |
48 | |
329
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
49 if has('syntax') |
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
50 syntax on |
431 | 51 set foldmethod=syntax |
432 | 52 set nofoldenable |
446
3022c5d1f8ed
Back to dark theme for compatibility with non-personal systems.
Edho Arief <edho@myconan.net>
parents:
432
diff
changeset
|
53 set background=dark |
503
e2b52663763b
Replace solarized with base16.
edogawaconan <me@myconan.net>
parents:
496
diff
changeset
|
54 set t_Co=256 |
e2b52663763b
Replace solarized with base16.
edogawaconan <me@myconan.net>
parents:
496
diff
changeset
|
55 colorscheme base16-default |
329
ea82caf6c059
Added test to verify vim version (lite or full).
Edho Arief <edho@myconan.net>
parents:
315
diff
changeset
|
56 endif |
350 | 57 |
58 if has("autocmd") | |
467 | 59 augroup json_autocmd |
60 autocmd! | |
61 autocmd FileType json set autoindent | |
62 autocmd FileType json set formatoptions=tcq2l | |
63 autocmd FileType json set textwidth=78 shiftwidth=2 | |
64 autocmd FileType json set softtabstop=2 tabstop=8 | |
65 autocmd FileType json set expandtab | |
66 autocmd FileType json set foldmethod=syntax | |
67 augroup END | |
68 au! BufRead,BufNewFile *.json set filetype=json | |
350 | 69 autocmd BufRead,BufNewFile supervisord.conf :set ft=dosini |
353 | 70 autocmd BufRead,BufNewFile Gemfile :set ft=ruby |
454 | 71 autocmd BufRead,BufNewFile config.ru :set ft=ruby |
424 | 72 autocmd BufRead,BufNewFile crontab.* :set noet |
73 autocmd BufRead,BufNewFile crontab :set noet | |
74 autocmd BufRead,BufNewFile fstab :set noet | |
496
6bdf99bfbe97
Newer git use different filename, I think.
edogawaconan <me@myconan.net>
parents:
494
diff
changeset
|
75 autocmd BufRead,BufNewFile */.git/COMMIT_EDITMSG :set noet |
424 | 76 autocmd BufRead,BufNewFile .git/COMMIT_EDITMSG :set noet |
77 autocmd BufRead,BufNewFile .gitconfig :set noet | |
78 autocmd BufRead,BufNewFile .git/config :set noet | |
476 | 79 autocmd BufRead,BufNewFile *.coffee :set ft=coffee |
424 | 80 autocmd BufRead,BufNewFile *.erb :set ft=eruby |
393
0aabb2b34ef6
Added scss vim syntax support.
Edho Arief <edho@myconan.net>
parents:
390
diff
changeset
|
81 autocmd BufRead,BufNewFile *.scss :set ft=scss |
475 | 82 autocmd BufRead,BufNewFile *.slim :set ft=slim |
350 | 83 endif |
412
7ceec4404caf
Add restore cursor position for vim.
Edho Arief <edho@myconan.net>
parents:
410
diff
changeset
|
84 |
448
e0e8de4135bc
Testing for function never returns true. Replaced with autocmd.
Edho Arief <edho@myconan.net>
parents:
446
diff
changeset
|
85 if has('autocmd') |
418
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
86 "Restore cursor position |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
87 set viminfo='10,\"100,:20,%,n~/.viminfo |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
88 function! ResCur() |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
89 if line("'\"") <= line("$") |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
90 normal! g`" |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
91 return 1 |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
92 endif |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
93 endfunction |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
94 augroup resCur |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
95 autocmd! |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
96 autocmd BufWinEnter * call ResCur() |
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
97 augroup END |
496
6bdf99bfbe97
Newer git use different filename, I think.
edogawaconan <me@myconan.net>
parents:
494
diff
changeset
|
98 autocmd BufWinEnter */.git/COMMIT_EDITMSG exe "normal! gg" |
451
abb434518e1f
Always start editing git commit message from line 1.
Edho Arief <edho@myconan.net>
parents:
448
diff
changeset
|
99 autocmd BufWinEnter .git/COMMIT_EDITMSG exe "normal! gg" |
418
c0ac21407903
Disable features on vim basic.
Edho Arief <edho@myconan.net>
parents:
412
diff
changeset
|
100 endif |
424 | 101 |
102 if has('statusline') | |
103 " Status line detail: | |
104 " %f file path | |
105 " %y file type between braces (if defined) | |
106 " %([%R%M]%) read-only, modified and modifiable flags between braces | |
107 " %{'!'[&ff=='default_file_format']} | |
108 " shows a '!' if the file format is not the platform | |
109 " default | |
110 " %{'$'[!&list]} shows a '*' if in list mode | |
111 " %{'~'[&pm=='']} shows a '~' if in patchmode | |
112 " (%{synIDattr(synID(line('.'),col('.'),0),'name')}) | |
113 " only for debug : display the current syntax item name | |
114 " %= right-align following items | |
115 " #%n buffer number | |
116 " %l/%L,%c%V line number, total number of lines, and column number | |
117 function SetStatusLineStyle() | |
118 if &stl == '' || &stl =~ 'synID' | |
119 let &stl="%f %y%([%R%M]%)%{'!'[&ff=='".&ff."']}%{'$'[!&list]}%{'~'[&pm=='']}%=#%n %l/%L,%c%V " | |
120 else | |
121 let &stl="%f %y%([%R%M]%)%{'!'[&ff=='".&ff."']}%{'$'[!&list]} (%{synIDattr(synID(line('.'),col('.'),0),'name')})%=#%n %l/%L,%c%V " | |
122 endif | |
123 endfunc | |
124 " Switch between the normal and vim-debug modes in the status line | |
125 nmap _ds :call SetStatusLineStyle()<CR> | |
126 call SetStatusLineStyle() | |
127 " Window title | |
128 if has('title') | |
493
1ad9091c464e
Properly set window name for vim.
edogawaconan <me@myconan.net>
parents:
476
diff
changeset
|
129 if &term == "screen" |
1ad9091c464e
Properly set window name for vim.
edogawaconan <me@myconan.net>
parents:
476
diff
changeset
|
130 set t_ts=]0; |
1ad9091c464e
Properly set window name for vim.
edogawaconan <me@myconan.net>
parents:
476
diff
changeset
|
131 set t_fs= |
1ad9091c464e
Properly set window name for vim.
edogawaconan <me@myconan.net>
parents:
476
diff
changeset
|
132 endif |
494 | 133 set title |
134 let &titlestring = $user | |
424 | 135 endif |
136 endif |