-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
120 lines (95 loc) · 3.54 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
set nocompatible " use vim defaults
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM UI
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" This setting will cause the cursor to very briefly jump to a
" brace/parenthese/bracket's 'match' whenever you type a closing or opening
" brace/parenthese/bracket
set showmatch
" do incremental searching
set incsearch
" show a ruler
set ruler
" Nice statusbar
set laststatus=2
set statusline=
set statusline+=%f\ " file name
set statusline+=%h%1*%m%r%w%0* " flags
set statusline+=%= " right align
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
" No annoying sound on errors
set noerrorbells
" Zapnutí číslování řádků. Pro vypnutí nastavte "set nonu"
set nu
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" have syntax highlighting in terminals which can display colours:
if has('syntax') && ((&t_Co > 2) || has('gui_runing'))
syntax on
" Zvýrazňování výsledků hledání
set hls
endif
" Set utf8 as standard encoding and en_US as the standard language
set encoding=utf8
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Use Pathogen:
execute pathogen#infect()
set autoindent
set expandtab
set shiftwidth=4
set softtabstop=4
" Python indentation
autocmd FileType python setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 textwidth=79
" Linebreak on 500 characters
set lbr
set tw=500
" Highlight character on 81-th column
highlight ColorColumn ctermbg=red
call matchadd('ColorColumn', '\%81v', 100)
" Omni completion
autocmd FileType python set omnifunc=pythoncomplete#Complete
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" REQUIRED. This makes vim invoke Latex-Suite when you open a tex file.
filetype plugin indent on
" Autocomplete for CSS files
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd BufNewFile,BufRead *.scss set ft=scss.css
" When editing a file, always jump to the last known cursor position.
" " Don't do it when the position is invalid or when inside an event handler
" " (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
endif " has("autocmd")
command! Q q " Bind :Q to :q
" Pasting raw text without indending, etc.
set pastetoggle=<F2>
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Editing mappings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
vmap <expr> <S-LEFT> DVB_Drag('left')
vmap <expr> <S-RIGHT> DVB_Drag('right')
vmap <expr> <S-DOWN> DVB_Drag('down')
vmap <expr> <S-UP> DVB_Drag('up')
vmap <expr> D DVB_Duplicate()
" Delete trailing white space on save, useful for Python and CoffeeScript ;)
func! DeleteTrailingWS()
exe "normal mz"
%s/\s\+$//ge
exe "normal `z"
endfunc
autocmd BufWrite *.py :call DeleteTrailingWS()
autocmd BufWrite *.coffee :call DeleteTrailingWS()
" Addons
set runtimepath+=~/.vim/vim-addon-manager
call vam#ActivateAddons(["vim-twig", "surround", "The_NERD_tree"])
VAMActivate tlib matchit.zip