source: dab-utils/.vimrc @ 3

Revision 3, 8.2 KB checked in by dabbler, 9 years ago (diff)

don't use guifont on linux

  • Property svn:executable set to *
Line 
1
2" Enable editing of gzipped files
3"    read: set binary mode before reading the file
4"          uncompress text in buffer after reading
5"   write: compress file after writing
6"  append: uncompress file, append, compress file
7autocmd BufReadPre,FileReadPre      *.gz set bin
8autocmd BufReadPost,FileReadPost    *.gz '[,']!gunzip
9autocmd BufReadPost,FileReadPost    *.gz set nobin
10
11autocmd BufWritePost,FileWritePost  *.gz !mv <afile> <afile>r
12autocmd BufWritePost,FileWritePost  *.gz !gzip <afile>r
13
14autocmd FileAppendPre           *.gz !gunzip <afile>
15autocmd FileAppendPre           *.gz !mv <afile>r <afile>
16autocmd FileAppendPost          *.gz !mv <afile> <afile>r
17autocmd FileAppendPost          *.gz !gzip <afile>r
18
19
20autocmd BufReadPost,FileReadPost,FilterReadPost *.thtml,*.ctp   set syntax=thtml tw=0
21autocmd BufReadPost,FileReadPost,FilterReadPost *.c,*.cpp,*.cc,*.h,*.hpp,*.php,*.tpl    set tw=0
22autocmd BufReadPost,FileReadPost,FilterReadPost /tmp/mutt*      set nocindent tw=72
23
24autocmd BufReadPre,FileReadPre      *.htm,*.html,*.css exe 'setlocal equalprg=E:/cygwin/bin/tidy\ -quiet\ --wrap\ 160\ --indent\ auto\ --indent-spaces\ 2\ --break-before-br\ yes\ -utf8\ --tidy-mark\ no\ --ascii-chars\ yes\ --uppercase-tags\ yes\ -f\ '.&errorfile
25autocmd BufReadPre,FileReadPre      *.htm,*.html,*.css setlocal makeprg=E:/cygwin/bin/tidy\ -quiet\ --wrap\ 160\ --indent\ auto\ --indent-spaces\ 2\ --break-before-br\ yes\ -utf8\ --tidy-mark\ no\ --ascii-chars\ yes\ --uppercase-tags\ yes\ -e\ %
26
27
28set tags=./tags,tags,/usr/src/linux/tags
29set winheight=15
30set foldmethod=marker
31let g:xml_syntax_folding=1
32autocmd FileType xml setlocal foldmethod=syntax
33"set tw=72
34
35map gF ]]V?(<CR>y{pi/** {{{ <ESC>/{<CR>dd/^{<CR>?(<CR>O0<C-D> */<ESC>][o/* }}} */<ESC>+
36
37map <C-Enter> <C-w><C-]><C-w>T
38map <C-T>       :bro tabnew .<CR>
39map <C-N>       :tabnext<CR>
40map <C-P>       :tabprev<CR>
41map <F1>        [[zz
42map <F2>        ]]zz
43map <F3> '<O0/ *hx'>o0*/'<
44map <F11> '<O#ifdef ANTIQUE'>o#else #endif'<b
45
46map g/ :s/^/\/\//<CR>
47map g\ :s/^\(\s*\)\/\//\1/<CR>
48
49map g> :s/^\([^>]\)/> \1/<CR>
50map g< :s/^> *//<CR>
51
52map gg  G
53map qq  :e #
54
55map OM
56"map   p :cp
57"map   n :cn
58"map           :cf errlist
59
60map Îw 1G
61map Îu G$
62map ΄ H
63map Îv L$
64imap Îw 1G
65imap Îu G$
66imap ΄ H
67imap Îv L$
68map  :cn
69
70map [6~
71map [5~
72map [2~ i
73imap [2~
74
75set autoindent wrapmargin=0 shiftwidth=4 tabstop=4 showmatch sidescroll=1
76set exrc ruler showmode edcompatible
77set ignorecase
78set nolisp
79set cindent
80set cpoptions=ces$
81set nowrap
82"set iskeyword=a-z,A-Z,0-9,_,.,-,>
83set viminfo='50,:100,/100,\"1000
84"set path=.,inc,../inc,/usr/include,/usr/X11R6/include,C:/Qt/2010.02.1/qt/include/
85set path=.,inc,../inc,/usr/include
86
87set errorfile=errlist
88"set errorformat=%f(%l):\ Error!\ %t%n:%m,file\ %*[^(](%f):%m
89set errorformat=%f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m
90set makeprg=make\ -k
91set shellpipe=|&\ tee
92map  :cn
93
94" the following fix works also
95"map <BS>
96"imap <BS>
97set t_kb=
98set t_kD=
99
100imap <S-Right> W
101imap <S-Left> B
102imap Îv L$
103imap ΄ H
104imap Îu G$
105imap Îw 1G
106map <S-Right> W
107map <S-Left> B
108map Îv L$
109map ΄ H
110map Îu G$
111map Îw 1G
112
113if has("gui") && has('win32')
114        set guifont=Lucida\ Console
115        set guioptions=afgmrbtT
116endif
117
118" Switch on syntax highlighting.
119syntax on
120
121" Switch on search pattern highlighting.
122set hlsearch
123
124" Hide the mouse pointer while typing
125set mousehide
126
127" Set nice colors
128" background for normal text is light grey
129" Text below the last line is darker grey
130" Cursor is green
131" Constants are not underlined but have a slightly lighter background
132highlight Normal guibg=white
133"highlight Cursor guibg=Green guifg=NONE
134"highlight Cursor gui=reverse guibg=Blue
135highlight Cursor gui=reverse guibg=Yellow guifg=NONE
136highlight NonText guibg=grey80
137highlight Constant gui=NONE guibg=grey95
138highlight Special gui=NONE guibg=grey95
139highlight Search guibg=grey92
140
141"menu Comment./*\ */ '<O0/*'>o0*/'<
142"menu Comment.Antique '<O#ifdef ANTIQUE'>o#else #endif'<b
143
144set printoptions=paper:a4
145
146filetype plugin on
147
148  " Only do this when not done yet for this buffer
149  if exists("b:did_ftplugin")
150    finish
151  endif
152  " Don't set 'b:did_ftplugin = 1' because that is xml.vim's responsability.
153
154  let b:html_mode = 1
155
156  if !exists("*HtmlAttribCallback")
157  function HtmlAttribCallback( xml_tag )
158      if a:xml_tag ==? "table"
159          return "cellpadding=\"0\" cellspacing=\"0\" border=\"0\""
160      elseif a:xml_tag ==? "link"
161          return "href=\"/site.css\" rel=\"StyleSheet\" type=\"text/css\""
162      elseif a:xml_tag ==? "body"
163          return "bgcolor=\"white\""
164      elseif a:xml_tag ==? "frame"
165          return "name=\"NAME\" src=\"/\" scrolling=\"auto\" noresize"
166      elseif a:xml_tag ==? "frameset"
167          return "rows=\"0,*\" cols=\"*,0\" border=\"0\""
168      elseif a:xml_tag ==? "img"
169          return "src=\"\" width=\"0\" height=\"0\" border=\"0\" alt=\"\""
170      elseif a:xml_tag ==? "a"
171          if has("browse")
172              " Look up a file to fill the href. Used in local relative file
173              " links. typeing your own href before closing the tag with `>'
174              " will override this.
175              let cwd = getcwd()
176              let cwd = substitute (cwd, "\\", "/", "g")
177              let href = browse (0, "Link to href...", getcwd(), "")
178              let href = substitute (href, cwd . "/", "", "")
179              let href = substitute (href, " ", "%20", "g")
180          else
181              let href = ""
182          endif
183          return "href=\"" . href . "\""
184      else
185          return 0
186      endif
187  endfunction
188  endif
189
190
191  imap <C-J> <Plug>MarkersJumpF
192  map <C-J> <Plug>MarkersJumpF
193  imap <C-K> <Plug>MarkersJumpB
194  map <C-K> <Plug>MarkersJumpB
195  imap <C-<> <Plug>MarkersMark
196  vmap <C-<> <Plug>MarkersMark
197
198"  ruby require "base64"
199"  map <C-F3> :rubydo $_=Base64.decode64 $_<CR>
200"  imap <C-F3> :rubydo $_=Base64.decode64 $_<CR>
201"  map <C-F4> :rubydo $_=Base64.encode64 $_<CR>
202"  imap <C-F4> :rubydo $_=Base64.encode64 $_<CR>
203
204
205"  unmap! pp
206"  unmap! ps
207"  unmap! pg
208"  unmap! pc
209"  unmap! xx
210"  unmap! xs
211"  unmap! xg
212
213"let g:netrw_ssh_cmd="ssh -p 221"
214
215
216" To enable the saving and restoring of screen positions.
217let g:screen_size_restore_pos = 1
218
219" To save and restore screen for each Vim instance.
220" This is useful if you routinely run more than one Vim instance.
221" For all Vim to use the same settings, change this to 0.
222let g:screen_size_by_vim_instance = 1
223
224
225
226if has("gui_running")
227  function! ScreenFilename()
228    if has('amiga')
229      return "s:.vimsize"
230    elseif has('win32')
231      return $HOME.'\_vimsize'
232    else
233      return $HOME.'/.vimsize'
234    endif
235  endfunction
236
237  function! ScreenRestore()
238    " Restore window size (columns and lines) and position
239    " from values stored in vimsize file.
240    " Must set font first so columns and lines are based on font size.
241    let f = ScreenFilename()
242    if has("gui_running") && g:screen_size_restore_pos && filereadable(f)
243      let vim_instance = (g:screen_size_by_vim_instance==1?(v:servername):'GVIM')
244      for line in readfile(f)
245        let sizepos = split(line)
246        if len(sizepos) == 5 && sizepos[0] == vim_instance
247          silent! execute "set columns=".sizepos[1]." lines=".sizepos[2]
248          silent! execute "winpos ".sizepos[3]." ".sizepos[4]
249          return
250        endif
251      endfor
252    endif
253  endfunction
254
255  function! ScreenSave()
256    " Save window size and position.
257    if has("gui_running") && g:screen_size_restore_pos
258      let vim_instance = (g:screen_size_by_vim_instance==1?(v:servername):'GVIM')
259      let data = vim_instance . ' ' . &columns . ' ' . &lines . ' ' .
260            \ (getwinposx()<0?0:getwinposx()) . ' ' .
261            \ (getwinposy()<0?0:getwinposy())
262      let f = ScreenFilename()
263      if filereadable(f)
264        let lines = readfile(f)
265        call filter(lines, "v:val !~ '^" . vim_instance . "\\>'")
266        call add(lines, data)
267      else
268        let lines = [data]
269      endif
270      call writefile(lines, f)
271    endif
272  endfunction
273
274  if !exists('g:screen_size_restore_pos')
275    let g:screen_size_restore_pos = 1
276  endif
277  if !exists('g:screen_size_by_vim_instance')
278    let g:screen_size_by_vim_instance = 1
279  endif
280  autocmd VimEnter * if g:screen_size_restore_pos == 1 | call ScreenRestore() | endif
281  autocmd VimLeavePre * if g:screen_size_restore_pos == 1 | call ScreenSave() | endif
282endif
283
284
Note: See TracBrowser for help on using the repository browser.