-
Notifications
You must be signed in to change notification settings - Fork 3
/
editing
87 lines (69 loc) · 3.2 KB
/
editing
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
"EDITING OPTIONS
syntax on
set number " line numbers
set showbreak=+ " display a + at the beginning of a wrapped line
set showmatch " flash the matching bracket on inserting a )]} etc
set encoding=utf-8 nobomb
" Remember more command history
set history=1000
" Automatically read files that have changed on the FS but not in Vim.
set autoread
set completeopt=menuone,preview
" omni completion settings
set ofu=syntaxcomplete#Complete
let g:rubycomplete_buffer_loading = 0
let g:rubycomplete_classes_in_global = 1
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set textwidth=80 " wrap at 80 characters
set nowrap " Text wrapping should be done manually
set softtabstop=2 " most of the time, we want a softtabstop of 2
set tabstop=2 " show tabs with 2 spaces
set shiftwidth=2 " shift by 2 spaces when using >> and <<, etc
set expandtab " no tabs
" Using autocmd for this allows it to be reset every time you open a
" file, which keeps overrides from being persistent
autocmd FileType * set softtabstop=2 shiftwidth=2 tabstop=2 expandtab
set list " show whitespace
set listchars=tab:»·,trail:· " show tabs and trailing spaces
set listchars+=extends:» " show a » when a line goes off the right edge of the screen
set listchars+=precedes:« " show a « when a line goes off the left edge of the screen
set scrolloff=5 " minimum lines to show around cursor
set sidescrolloff=5 " min characters to show sideways
set colorcolumn=+1 " Highlight the last column
set formatoptions+=n1 " help fo-table
" defaults: tcq
" t: auto-wrap text using text-width
" c: auto-wrap comments also
" q: auto-format comments with 'gq'
" n: recognize numbered lists
" 1: don't break after 1-char word
set formatprg="par -qe" " use par for 'gq':
" http://www.nicemice.net/par/par-doc.var
" e: superfluous lines removed
" q: separate quote levels with newlines
"FOLDING OPTIONS
set foldmethod=indent " really the only way that makes sense
set foldlevelstart=99 " open all folds by default
set foldignore= " don't try to be clever
"SEARCH OPTIONS
set ignorecase " makes search patterns case-insensitive by default
set smartcase " overrides ignorecase when the pattern contains upper-case characters
set incsearch
"SWAP & UNDO OPTIONS
" global swapfile directory
set directory=~/.vim/swapfiles,/var/tmp,/tmp,.
" persistent undo
if has("persistent_undo")
set undofile
set undodir=~/.vim/undofiles,/var/tmp,/tmp,.
endif
" Backups (or lack thereof)
set nobackup " do not keep backups after close
set nowritebackup " do not keep backups while working
set noswapfile " don't keep swap files either
"No Bells
set noeb vb t_vb=
" ctags-related
set tags+=../tags,../../tags,../../../tags,../../../../tags,tmp/tags
map <silent> <Leader>r :!/usr/local/bin/ctags -f tags -R *<CR><CR>