Commit 5c1dd068 authored by Murukesh Mohanan's avatar Murukesh Mohanan

switch to vim-plug

parent 510c95e0
[submodule "bundle/diffchar.vim"]
path = bundle/diffchar.vim
url = https://github.com/vim-scripts/diffchar.vim
ignore = dirty
[submodule "bundle/eregex.vim"] [submodule "bundle/eregex.vim"]
path = bundle/eregex.vim path = bundle/eregex.vim
url = https://github.com/othree/eregex.vim.git url = https://github.com/othree/eregex.vim.git
ignore = dirty ignore = dirty
[submodule "bundle/nerdtree"]
path = bundle/nerdtree
url = https://github.com/scrooloose/nerdtree.git
ignore = dirty
[submodule "bundle/supertab"]
path = bundle/supertab
url = https://github.com/ervandew/supertab.git
ignore = dirty
[submodule "bundle/syntastic"]
path = bundle/syntastic
url = https://github.com/scrooloose/syntastic.git
ignore = dirty
[submodule "bundle/vim2hs"]
path = bundle/vim2hs
url = https://github.com/dag/vim2hs
ignore = dirty
[submodule "bundle/vim-surround"]
path = bundle/vim-surround
url = https://github.com/tpope/vim-surround.git
ignore = dirty
[submodule "bundle/LaTeX-Box"] [submodule "bundle/LaTeX-Box"]
path = bundle/LaTeX-Box path = bundle/LaTeX-Box
url = https://github.com/LaTeX-Box-Team/LaTeX-Box.git url = https://github.com/LaTeX-Box-Team/LaTeX-Box.git
...@@ -34,37 +10,6 @@ ...@@ -34,37 +10,6 @@
path = bundle/ctrlp path = bundle/ctrlp
url = https://github.com/kien/ctrlp.vim url = https://github.com/kien/ctrlp.vim
ignore = dirty ignore = dirty
[submodule "bundle/airline"]
path = bundle/airline
url = https://github.com/bling/vim-airline
ignore = dirty
[submodule "bundle/vim-fugitive"]
path = bundle/vim-fugitive
url = https://github.com/tpope/vim-fugitive.git
[submodule "bundle/AnsiEsc.vim"] [submodule "bundle/AnsiEsc.vim"]
path = bundle/AnsiEsc.vim path = bundle/AnsiEsc.vim
url = https://github.com/vim-scripts/AnsiEsc.vim url = https://github.com/vim-scripts/AnsiEsc.vim
[submodule "bundle/vimtex"]
path = bundle/vimtex
url = https://github.com/lervag/vimtex
[submodule "bundle/molokai"]
path = bundle/molokai
url = https://github.com/tomasr/molokai.git
[submodule "bundle/ctrlp.vim"]
path = bundle/ctrlp.vim
url = https://github.com/ctrlpvim/ctrlp.vim.git
[submodule "bundle/vim-markdown"]
path = bundle/vim-markdown
url = https://github.com/gabrielelana/vim-markdown
[submodule "bundle/tagbar"]
path = bundle/tagbar
url = https://github.com/majutsushi/tagbar.git
[submodule "bundle/vim-go"]
path = bundle/vim-go
url = https://github.com/fatih/vim-go.git
[submodule "bundle/YouCompleteMe"]
path = bundle/YouCompleteMe
url = https://github.com/Valloric/YouCompleteMe.git
[submodule "bundle/tabular"]
path = bundle/tabular
url = https://github.com/godlygeek/tabular.git
" Vim autoload file for browsing debian package.
" copyright (C) 2007-2008, arno renevier <arenevier@fdn.fr>
" Distributed under the GNU General Public License (version 2 or above)
" Last Change: 2008 april 1
"
" Inspired by autoload/tar.vim by Charles E Campbell
"
" Latest version of that file can be found at
" http://www.fdn.fr/~arenevier/vim/autoload/deb.vim
" It should also be available at
" http://www.vim.org/scripts/script.php?script_id=1970
if &cp || exists("g:loaded_deb") || v:version < 700
finish
endif
let g:loaded_deb= "v1.4"
fun! deb#read(debfile, member)
" checks if ar and tar are installed
if !s:hascmd("ar") || !s:hascmd("tar")
return
endif
let l:target = a:member
let l:archmember = s:dataFileName(a:debfile) " default archive member to extract
if l:archmember == ""
echohl WarningMsg | echo "***error*** (deb#read) no valid data file found in debian archive"
return
elseif l:archmember == "data.tar.gz"
let l:unpcmp = "tar zxfO "
elseif l:archmember == "data.tar.bz2"
let l:unpcmp = "tar jxfO "
elseif l:archmember == "data.tar.lzma"
if !s:hascmd("lzma")
return
endif
let l:unpcmp = "lzma -d | tar xfO "
elseif l:archmember == "data.tar"
let l:unpcmp = "tar xfO "
endif
if a:member =~ '^\* ' " information control file
let l:archmember = "control.tar.gz"
let l:target = substitute(l:target, "^\* ", "", "")
let l:unpcmp = "tar zxfO "
elseif a:member =~ ' -> ' " symbolic link
let l:target = split(a:member,' -> ')[0]
let l:linkname = split(a:member,' -> ')[1]
if l:linkname =~ "^\/" " direct symlink: path is already absolute
let l:target = ".".l:linkname
else
" transform relative path to absolute path
" first, get basename for target
let l:target = substitute(l:target, "\/[^/]*$", "", "")
" while it begins with ../
while l:linkname =~ "^\.\.\/"
" removes one level of ../ in linkname
let l:linkname = substitute(l:linkname, "^\.\.\/", "", "")
" go one directory up in target
let l:target = substitute(l:target, "\/[^/]*$", "", "")
endwhile
let l:target = l:target."/".l:linkname
endif
endif
" we may preprocess some files (such as man pages, or changelogs)
let l:preproccmd = ""
"
" unzip man pages
"
if l:target =~ "\.\/usr\/share\/man\/.*\.gz$"
" try to fail gracefully if a command is not available
if !s:hascmd("gzip")
return
elseif !s:hascmd("nroff")
let l:preproccmd = "| gzip -cd"
elseif !s:hascmd("col")
let l:preproccmd = "| gzip -cd | nroff -mandoc"
else
let l:preproccmd = "| gzip -cd | nroff -mandoc | col -b"
endif
"
" unzip other .gz files
"
elseif l:target =~ '.*\.gz$'
if !s:hascmd("gzip")
return
endif
let l:preproccmd = "| gzip -cd"
endif
" read content
exe "silent r! ar p " . s:QuoteFile(a:debfile) . " " . s:QuoteFile(l:archmember) . " | " . l:unpcmp . " - " . s:QuoteFile(l:target) . l:preproccmd
" error will be treated in calling function
if v:shell_error != 0
return
endif
exe "file deb:".l:target
0d
setlocal nomodifiable nomodified readonly
endfun
fun! deb#browse(file)
" checks if necessary utils are installed
if !s:hascmd("dpkg") || !s:hascmd("ar") || !s:hascmd("tar")
return
endif
" checks if file is readable
if !filereadable(a:file)
return
endif
if a:file =~ "'"
echohl WarningMsg | echo "***error*** (deb#Browse) filename cannot contain quote character (" . a:file . ")"
return
endif
let keepmagic = &magic
set magic
" set filetype to "deb"
set ft=deb
setlocal modifiable noreadonly
" set header
exe "$put ='".'\"'." deb.vim version ".g:loaded_deb."'"
exe "$put ='".'\"'." Browsing debian package ".a:file."'"
$put=''
" package info
"exe "silent read! dpkg -I ".a:file
"$put=''
" display information control files
let l:infopos = line(".")
exe "silent read! ar p " . s:QuoteFile(a:file) . " control.tar.gz | tar zt"
$put=''
" display data files
let l:listpos = line(".")
exe "silent read! dpkg -c ". s:QuoteFile(a:file)
" format information control list
" removes '* ./' line
exe (l:infopos + 1). 'd'
" add a star before each line
exe "silent " . (l:infopos + 1). ',' . (l:listpos - 2) . 's/^/\* /'
" format data list
exe "silent " . l:listpos . ',$s/^.*\s\(\.\/\(\S\|\).*\)$/\1/'
if v:shell_error != 0
echohl WarningMsg | echo "***warning*** (deb#Browse) error when listing content of " . a:file
let &magic = keepmagic
return
endif
0d
setlocal nomodifiable readonly
noremap <silent> <buffer> <cr> :call <SID>DebBrowseSelect()<cr>
let &magic = keepmagic
endfun
fun! s:DebBrowseSelect()
let l:fname= getline(".")
" sanity check
if (l:fname !~ '^\.\/') && (l:fname !~ '^\* \.\/')
return
endif
if l:fname =~ "'"
echohl WarningMsg | echo "***error*** (DebBrowseSelect) filename cannot contain quote character (" . l:fname . ")"
return
endif
" do nothing on directories
" TODO: find a way to detect symlinks to directories, to be able not to
" open them
if (l:fname =~ '\/$')
return
endif
" need to get it now since a new window will open
let l:curfile= expand("%")
" open new window
new
wincmd _
call deb#read(l:curfile, l:fname)
if v:shell_error != 0
echohl WarningMsg | echo "***warning*** (DebBrowseSelect) error when reading " . l:fname
return
endif
filetype detect
" zipped files, are unziped in deb#read, but filetype may not
" automatically work.
if l:fname =~ "\.\/usr\/share\/man\/.*\.gz$"
set filetype=man
elseif l:fname =~ "\.\/usr\/share\/doc\/.*\/changelog.Debian.gz$"
set filetype=debchangelog
endif
endfun
" return data file name for debian package. This can be either data.tar.gz,
" data.tar.bz2 or data.tar.lzma
fun s:dataFileName(deb)
for fn in ["data.tar.gz", "data.tar.bz2", "data.tar.lzma", "data.tar"]
" [0:-2] is to remove trailing null character from command output
if (system("ar t " . "'" . a:deb . "'" . " " . fn))[0:-2] == fn
return fn
endif
endfor
return "" " no debian data format in this archive
endfun
fun s:QuoteFile(file)
" we need to escape %, #, <, and >
" see :help cmdline-specialk
return "'" . substitute(a:file, '\([%#<>]\)', '\\\1', 'g') . "'"
endfun
" return 1 if cmd exists
" display error message and return 0 otherwise
fun s:hascmd(cmd)
if executable(a:cmd)
return 1
else
echohl Error | echo "***error*** " . a:cmd . " not available on your system"
return 0
else
endfu
This diff is collapsed.
This diff is collapsed.
YouCompleteMe @ 8ad40442
Subproject commit 8ad4044203b9f0a64f238445734fb874936fdc80
airline @ d0652caf
Subproject commit d0652caf69bf5f7da84b52ec4d5cf12984ba56b0
ctrlp.vim @ 7f74368d
Subproject commit 7f74368d85bb521951dd58123349ce66b947d058
diffchar.vim @ ebd650c7
Subproject commit ebd650c720418efa1dab48b158c33b018d3f74e6
molokai @ c67bdfcd
Subproject commit c67bdfcdb31415aa0ade7f8c003261700a885476
nerdtree @ 4ebbb533
Subproject commit 4ebbb533c3faf2c480211db2b547972bb3b60f2b
supertab @ 66511772
Subproject commit 66511772a430a5eaad7f7d03dbb02e8f33c4a641
syntastic @ 8f97e64c
Subproject commit 8f97e64c78e9ade6cf09fc5d5446f5d2a8deaa35
tabular @ 60f25648
Subproject commit 60f25648814f0695eeb6c1040d97adca93c4e0bb
tagbar @ 7b36c46d
Subproject commit 7b36c46d17d57db34fdb0adac9ba6382d0bb5e66
vim-fugitive @ 9835920a
Subproject commit 9835920a3c91236021fc8c88cc4157304e24356b
vim-go @ 065d7146
Subproject commit 065d71460df091eca4ed54056fdc075f0dd5dbf3
vim-markdown @ 38788ac3
Subproject commit 38788ac3019c624def78c2d6d7db861ea17c9fea
vim-surround @ 2d05440a
Subproject commit 2d05440ad23f97a7874ebd9b5de3a0e65d25d85c
vim2hs @ f2afd557
Subproject commit f2afd55704bfe0a2d66e6b270d247e9b8a7b1664
vimtex @ 86719efb
Subproject commit 86719efbdc0f5f222995bc2e47a5b49ed6bf2ae9
" debPlugin.vim -- a Vim plugin for browsing debian packages
" copyright (C) 2007, arno renevier <arenevier@fdn.fr>
" Distributed under the GNU General Public License (version 2 or above)
" Last Change: 2007 December 07
"
" This file only sets the autocommands. Functions are in autoload/deb.vim.
"
" Latest version of that file can be found at
" http://www.fdn.fr/~arenevier/vim/plugin/debPlugin.vim
" It should also be available at
" http://www.vim.org/scripts/script.php?script_id=1970
"
if &cp || exists("g:loaded_debPlugin") || !has("unix") || v:version < 700
finish
endif
let g:loaded_debPlugin = 1
autocmd BufReadCmd *.deb call deb#browse(expand("<amatch>"))
...@@ -93,8 +93,32 @@ inoremap <Up> <C-o>gk ...@@ -93,8 +93,32 @@ inoremap <Up> <C-o>gk
nnoremap <Down> gj nnoremap <Down> gj
nnoremap <Up> gk nnoremap <Up> gk
let g:loaded_nerd_tree = 1 "execute pathogen#infect()
execute pathogen#infect() call plug#begin('~/.vim/plugged')
Plug 'vim-scripts/diffchar.vim'
Plug 'scrooloose/nerdtree'
Plug 'ervandew/supertab'
Plug 'scrooloose/syntastic'
Plug 'dag/vim2hs'
Plug 'tpope/vim-surround'
Plug 'bling/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'lervag/vimtex'
Plug 'tomasr/molokai'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'gabrielelana/vim-markdown', {'for': 'markdown'}
Plug 'majutsushi/tagbar'
Plug 'fatih/vim-go', {'for': 'go'}
" YCM command lifted from vim-plug readme
Plug 'Valloric/YouCompleteMe', { 'do': 'python2 ./install.py --clang-completer --gocode-completer --tern-completer', 'for': ['cpp', 'c', 'go', 'sh', 'js'] }
autocmd! User YouCompleteMe if !has('vim_starting') | call youcompleteme#Enable() | endif
Plug 'godlygeek/tabular'
Plug 'vim-scripts/deb.vim'
call plug#end()
colorscheme molokai colorscheme molokai
highlight Normal ctermbg=none highlight Normal ctermbg=none
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment