forked from sfc-gh-eraigosa/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc_editor.vim
49 lines (42 loc) · 1.79 KB
/
.vimrc_editor.vim
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
"Autocommand goodness (still slightly beta :) ).
if has ("autocmd")
" Show lines longer than 80 characters
au BufWinEnter * let w:m1=matchadd('Search', '\%<80v.\%>77v', -1)
au BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>79v.\+', -1)
"Use default filetype settings. Overriding as necessary below.
filetype plugin indent on
"Autocommands to set up tab widths for c, c++ and java
augroup C_code
autocmd FileType c,cpp,java set shiftwidth=2 softtabstop=2
autocmd FileType c,cpp,java set expandtab autoindent
augroup END
"Autocommands to set up tab widths for python
augroup python_code
autocmd FileType python set shiftwidth=4 softtabstop=4
autocmd FileType python set expandtab autoindent
augroup END
"Autocommands to set the all important tab width for ruby. Also begins
"new ruby files with the bang and saves it as executable.
augroup ruby
autocmd BufNewFile *.rb 0put ='#!/usr/bin/env ruby'
autocmd FileType ruby set shiftwidth=2 softtabstop=2
autocmd FileType ruby set expandtab autoindent
autocmd BufWritePost *.rb !chmod 744 %
augroup END
"Shell stuff sets autoindention details, the bang line, and saves the
"file as an executable.
augroup shell
autocmd BufNewFile *.sh 0put ='#!/bin/sh'
autocmd FileType sh set shiftwidth=4 softtabstop=4
autocmd FileType sh set expandtab autoindent
"autocmd BufWritePost *.sh !chmod 744 %
augroup END
"When editing text documents I dont need the line numbers and text
"should wrap around 80 characters.
augroup text
autocmd BufRead,BufNewFile *.txt set nonumber
autocmd BufRead,BufNewFile *.txt set textwidth=80
augroup END
endif
" needs work
"source ~/.vimrc_vundle.vim