forked from alourie/myvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
133 lines (112 loc) · 4.62 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
set nocompatible
set encoding=utf-8
set t_Co=16
colorscheme mustang
" general stuff
set incsearch
set ignorecase
set smartcase
set history=100
set shiftwidth=4
set tabstop=4
set expandtab
set hidden
set nobackup
set noswapfile
" initialise formatting
set number
set autoindent smartindent
syntax on
" Other stuff
set showmode
set showcmd
set autoread
set smarttab
filetype on
filetype indent on
filetype plugin on
" Enable python omnicompletion (Requires PYSMELLTAGS)
autocmd FileType python setlocal omnifunc=pysmell#Complete
set completeopt=menuone,longest,preview
" Some mappings
nnoremap <M-Right> :bnext<CR>
nnoremap <M-Left> :bprev<CR>
nnoremap <C-M-d> :bdel<CR>
nnoremap <C-M-t> :TlistToggle<CR>
nnoremap <M-o> :CommandT<CR>
nnoremap <M-l> :MRU<CR>
nnoremap <M-q> :mksession!<CR>:qall
nnoremap <F8> :PyLint<CR>
" ---------------------------------------------------------------------------
" status line
set laststatus=2
if has('statusline')
function! SetStatusLineStyle()
let &stl="%f %y " .
\"%([%R%M]%)" .
\"%#StatusLineNC#%{&ff=='unix'?'':&ff.'\ format'}%*" .
\"%{'$'[!&list]}" .
\"%{'~'[&pm=='']}" .
\"%=" .
\"#%n %l/%L,%c%V " .
\""
endfunc
call SetStatusLineStyle()
if has('title')
set titlestring=%t%(\ [%R%M]%)
endif
endif
" MiniBufExpl setup
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplModSelTarget = 1
" Gain focus on class browser on open
let Tlist_GainFocus_On_ToggleOpen = 1
" Powerline fancy
" "let g:Powerline_symbols = 'fancy'
" Don't run pylint on each save
let g:pymode_lint_write = 0
let g:pymode_options_fold = 0
" Session Settings
let g:session_autosave = 1
let g:session_autoload = 1
" Vam setup
fun! SetupVAM()
" YES, you can customize this vam_install_path path and everything still works!
let vam_install_path = expand('$HOME') . '/.vim/vim-addons'
exec 'set runtimepath+='.vam_install_path.'/vim-addon-manager'
" * unix based os users may want to use this code checking out VAM
" * windows users want to use http://mawercer.de/~marc/vam/index.php
" to fetch VAM, VAM-known-repositories and the listed plugins
" without having to install curl, unzip, git tool chain first
" -> BUG [4] (git-less installation)
if !filereadable(vam_install_path.'/vim-addon-manager/.git/config') && 1 == confirm("git clone VAM into ".vam_install_path."?","&Y\n&N")
" I'm sorry having to add this reminder. Eventually it'll pay off.
call confirm("Remind yourself that most plugins ship with documentation (README*, doc/*.txt). Its your first source of knowledge. If you can't find the info you're looking for in reasonable time ask maintainers to improve documentation")
exec '!p='.shellescape(vam_install_path).'; mkdir -p "$p" && cd "$p" && git clone --depth 1 git://github.com/MarcWeber/vim-addon-manager.git'
" VAM run helptags automatically if you install or update plugins
exec 'helptags '.fnameescape(vam_install_path.'/vim-addon-manager/doc')
endif
" Example drop git sources unless git is in PATH. Same plugins can
" be installed form www.vim.org. Lookup MergeSources to get more control
" let g:vim_addon_manager['drop_git_sources'] = !executable('git')
call vam#ActivateAddons(['snipmate-snippets',
\ 'github:tpope/vim-surround',
\ 'github:Lokaltog/vim-powerline',
\ 'github:jiangmiao/auto-pairs',
\ 'github:scrooloose/syntastic',
\ 'github:klen/python-mode',
\ 'github:xolox/vim-session',
\ 'github:altercation/vim-colors-solarized',
\ 'github:tpope/vim-fugitive',
\ ], {'auto_install' : 0})
" sample: call vam#ActivateAddons(['pluginA','pluginB', ...], {'auto_install' : 0})
" - look up source from pool (<c-x><c-p> complete plugin names):
" ActivateAddons(["foo", ..
" - name rewritings:
" ..ActivateAddons(["github:foo", .. => github://foo/vim-addon-foo
" ..ActivateAddons(["github:user/repo", .. => github://user/repo
" Also see section "2.2. names of addons and addon sources" in VAM's documentation
endfun
call SetupVAM()