-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.vimrc
147 lines (145 loc) · 4.44 KB
/
.vimrc
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
"{{{ Basics
syntax on " enable syntax highlighting
set showmatch " show matching brackets (),{},[]
set number
set nocompatible
set bs=2
set background=dark
set encoding=utf-8
set termencoding=utf-8
set shell=/bin/zsh
set noswapfile
filetype on
set complete=k " global autocompletion
set completeopt+=longest
"}}}
"{{{ Indenting, Folding
set tabstop=4 " numbers of spaces of tab character
set shiftwidth=4 " numbers of spaces to (auto)indent
set softtabstop=4 " counts n spaces when DELETE or BCKSPCE is used
set expandtab " insert spaces instead of tab chars
set autoindent " always set autoindenting on
set nosmartindent " intelligent indenting -- DEPRECATED by cindent
set nocindent " set C style indenting off
set foldenable
set foldmethod=marker
"}}}
"{{{ Searching
set hlsearch " highlight all search results
set incsearch " increment search
set ignorecase " case-insensitive search
set smartcase " upper-case sensitive search
set laststatus=2 " occasions to show status line, 2=always.
"set cmdheight=1 " command line height
set ruler " ruler display in status line
set showmode " show mode at bottom of screen
"set previewheight=5
"}}}
"{{{ Set Taglist Plugin Options
let Tlist_Use_Right_Window = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Enable_Fold_Column = 0
let Tlist_Compact_Format = 1
let Tlist_File_Fold_Auto_Close = 0
let Tlist_Inc_Winwidth = 1
"}}}
"{{{ Toggle Taglist Script
map <F7> :Tlist<CR>
"}}}
"{{{ VTreeExplorer
map <F12> :VSTreeExplore <CR>
let g:treeExplVertical=1
let g:treeExplWinSize=35
let g:treeExplDirSort=1
"}}}
"{{{ Common Save Shortcuts
" inoremap <C-s> <esc>:w<cr>a
" nnoremap <C-s> :w<cr>
"}}}
"{{{ Set Bracket Matching And Comment Formats
set matchpairs+=<:>
set comments-=s1:/*,mb:*,ex:*/
set comments+=s:/*,mb:**,ex:*/
set comments+=fb:*
set comments+=b:\"
set comments+=n::
"}}}
"{{{ Fix Filetype Detection
au BufNewFile,BufRead .torsmorc* set filetype=rc
au BufNewFile,BufRead *.inc set filetype=php
au BufNewFile,BufRead *.sys set filetype=php
au BufNewFile,BufRead grub.conf set filetype=grub
au BufNewFile,BufRead *.dentry set filetype=dentry
au BufNewFile,BufRead *.blog set filetype=blog
"}}}
"{{{ C File Specific Options
au FileType c,cpp set cindent
au FileType c,cpp set formatoptions+=ro
"}}}
"{{{ HTML Abbreviations
au FileType html,xhtml,php,eruby imap bbb <br />
au FileType html,xhtml,php,eruby imap aaa <a href=""><left><left>
au FileType html,xhtml,php,eruby imap iii <img src="" /><left><left><left><left>
au FileType html,xhtml,php,eruby imap ddd <div class=""><left><left>
"}}}
"{{{ Session Settings
set sessionoptions=blank,buffers,curdir,folds,help,resize,tabpages,winsize
map <c-q> :mksession! ~/.vim/.session <cr>
map <c-s> :source ~/.vim/.session <cr>
"}}}
"{{{ Set Up The Status Line
fun! <SID>SetStatusLine()
let l:s1="%-3.3n\\ %f\\ %h%m%r%w"
let l:s2="[%{strlen(&filetype)?&filetype:'?'},%{&encoding},%{&fileformat}]"
let l:s3="%=\\ 0x%-8B\\ \\ %-14.(%l,%c%V%)\\ %<%P"
execute "set statusline=" . l:s1 . l:s2 . l:s3
endfun
set laststatus=2
call <SID>SetStatusLine()
"}}}
"{{{ Colorscheme
if has('gui_running')
let &guicursor = &guicursor . ",a:blinkon0"
colorscheme colored
set guifont=Tamsyn\ 9
set guioptions-=T
"set guioptions+=g
"set guioptions-=t
"set guioptions-=m
set guioptions-=m "remove menu bar
set guioptions-=r "remove right-hand scroll bar
set guioptions-=L
set guioptions-=l
set guioptions-=R
set guitablabel=%t " set label for tab to just file name
" Toogle widgtes
nnoremap <C-F1> :if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>
nnoremap <C-F2> :if &go=~#'T'<Bar>set go-=T<Bar>else<Bar>set go+=T<Bar>endif<CR>
nnoremap <C-F3> :if &go=~#'r'<Bar>set go-=r<Bar>else<Bar>set go+=r<Bar>endif<CR>
"
set anti " Antialias font
"set transparency=0
elseif (&term =~ 'linux')
set t_Co=256
set termencoding=utf-8
set nocursorline
colorscheme colored
else
set t_Co=256
set mouse=a
colorscheme colored
set termencoding=utf-8
endif
"}}}
"{{{ Other Settings
" Turn off blinking
"set visualbell
" Turn off beep
"set noerrorbells
set vb " don't beep
set t_vb= " ^
" highlight redundant whitespaces and tabs.
" highlight RedundantSpaces ctermbg=red guibg=red
" match RedundantSpaces /\s\+$\| \+\ze\t\|\t/
au BufRead /tmp/mutt-* set tw=72
"}}}