-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
138 lines (110 loc) · 3.94 KB
/
vimrc
File metadata and controls
138 lines (110 loc) · 3.94 KB
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
" basics
set nocompatible
" ============================================================================
" pathogen
" ============================================================================
filetype off
let g:pathogen_disabled = [ ]
call pathogen#infect()
call pathogen#helptags()
filetype indent plugin on
" ============================================================================
" common settings
" ============================================================================
" localleader
nnoremap <SPACE> <Nop>
let mapleader=" "
" editing
syntax on
set encoding=utf-8
set tabstop=4
set shiftwidth=4
set autoindent
"set list
set listchars=tab:▸\ ,eol:¬
" editor
set ruler
set number
set cursorline
set visualbell
set scrolloff=5
set laststatus=2
set statusline=%t\ [%c,%l\/%L]%=%{&fileencoding}\ %{&ff}\ %y\
set showcmd
" search
set hlsearch
set incsearch
set ignorecase
set smartcase
" vimrc handling
nmap <Leader>ev :e $MYVIMRC<CR>
nmap <Leader>sv :so $MYVIMRC<CR>
" ============================================================================
" filetype specific settings
" ============================================================================
" autocomplete funcs and identifiers for languages
set nowrap " @todo for .php, .css, .js, .html
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
" ============================================================================
" plugin specific stuff
" ============================================================================
" ###### Markdown ######
"
nmap <leader>md :%!Markdown.pl --html4tags <cr>
" ###### netrw ######
" set tree as default liststyle
" let g:netrw_liststyle = 3 " seems to cause strange problems on closing vim
" use previous window when opening new file via <cr>
" let g:netrw_browse_split = 4
" open new window to the right
" let g:netrw_altv = 1
" size of the opened window is 80% of the netrw's current
" let g:netrw_winsize = 80
" ###### powerline ######
"
"let g:Powerline_symbols = 'fancy'
" ###### gpg ######
" http://www.cipherdyne.org/blog/2008/02/interfacing-vim-with-gnupg-encrypted-files.html
"
" Transparent editing of gpg encrypted files.
" By Wouter Hanegraaff <wouter@blub.net>
augroup encrypted
au!
" First make sure nothing is written to ~/.viminfo while editing
" an encrypted file.
autocmd BufReadPre,FileReadPre *.gpg set viminfo=
" We don't want a swap file, as it writes unencrypted data to disk
autocmd BufReadPre,FileReadPre *.gpg set noswapfile
" Switch to binary mode to read the encrypted file
autocmd BufReadPre,FileReadPre *.gpg set bin
autocmd BufReadPre,FileReadPre *.gpg let ch_save = &ch|set ch=2
autocmd BufReadPost,FileReadPost *.gpg '[,']!gpg2 --decrypt 2> /dev/null
" Switch to normal mode for editing
autocmd BufReadPost,FileReadPost *.gpg set nobin
autocmd BufReadPost,FileReadPost *.gpg let &ch = ch_save|unlet ch_save
autocmd BufReadPost,FileReadPost *.gpg execute ":doautocmd BufReadPost " . expand("%:r")
" Convert all text to encrypted text before writing
autocmd BufWritePre,FileWritePre *.gpg '[,']!gpg2 --default-recipient-self -ae 2>/dev/null
" Undo the encryption so we are back in the normal text, directly
" after the file has been written.
autocmd BufWritePost,FileWritePost *.gpg u
" ============================================================================
" GUI specific stuff
" ============================================================================
if has('gui_running')
" editor
set lines=40
set columns=140
" colorscheme & font
set background=dark
colorscheme molokai
set guifont=Monaco:h12
"set guifont=Menlo\ Regular\ for\ Powerline:h12
set guioptions-=T
endif