make this repo compatible with plugin managers

This commit is contained in:
2017-12-02 12:37:55 +01:00
parent 27d32c6549
commit 00485841df
7 changed files with 74 additions and 89 deletions

36
.vimrc_template Normal file
View File

@@ -0,0 +1,36 @@
set nocompatible
"Vundle stuff
"{{{
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
Plugin 'vim-scripts/indentpython.vim'
"Plugin 'vim-airline/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'majutsushi/tagbar'
"Plugin 'jmcantrell/vim-virtualenv'
Plugin 'petRUShka/vim-opencl'
call vundle#end()
"}}}
"Path variables for Plugins
"{{{
let g:tagbar_ctags_bin = '/usr/local/bin/ctags'
let g:ycm_global_ycm_extra_conf = '~/.ycm_global_extra_config.py'
let g:ycm_python_binary_path = '/usr/local/bin/python'
let g:syntastic_python_python_exec = '/usr/local/bin/python'
"}}}
"Local settings
"{{{
set guifont=Consolas:h12
"}}}

View File

@@ -2,19 +2,22 @@
## Usage ## Usage
If you find yourself wanting to use these settings, do the following: If you find yourself wanting to use these settings, `git clone` this repository,
and copy or link the following directories:
``` ```
./colors -> ~/.vim/colors colors -> ~/.vim/colors
./ftplugin -> ~/.vim/ftplugin ftplugin -> ~/.vim/ftplugin
./.vimrc -> ~/.vimrc plugin -> ~/.vim/plugin
``` ```
Also create two files `~/.vimplugin` and `~/.vimlocal`. The first one contains In `plugin/settings.vim` are settings that you can use on every workstation.
commands for your plugin manager. The idea is that you might need a different You can put into `~/.vimrc` settings that are local to the machine (such as
set of plugins on different machines. Some plugins require paths to programs, plugins, settings for plugins, font settings, etc.). Some reasonable default
which can differ from machine to machine too. local settings can be found in `.vimrc_template`.
In `.vimlocal` you should should put settings that are local to the machine.
You might use `plugin_template.vim` and `locals_template.vim` for reference. If you are on UNIX and haven't configured VIM yet, you could just
Alternatively, if you are on UNIX and haven't configured VIM yet, you could just run `setup.sh`, which will create links from the repository to the `~/.vim`
run `setup.sh`, which will do everything for you. folder and install plugin manager Vundle. Because of links, you shouldn't move
or remove the directory in which you cloned this repo. The benefit is that you
can get updates to the settings with just `git pull`.

View File

@@ -1 +0,0 @@
set guifont=Consolas:h12

View File

@@ -1,16 +1,3 @@
set nocompatible
"Plugin stuff
"{{{
if has("win32")
source $HOME/_vimplugin
source $HOME/_vimlocal
else
source $HOME/.vimplugin
source $HOME/.vimlocal
endif
"}}}
"Syntax "Syntax
"{{{ "{{{
filetype plugin indent on filetype plugin indent on

View File

@@ -11,20 +11,20 @@ function! GetGitStatus()
endfunction endfunction
set statusline= set statusline=
set statusline+=%w%q%h set statusline+=%w%q%h "Is it help/preview/loclist?
set statusline+=%{GetGitStatus()} set statusline+=%{GetGitStatus()} "Is it git?
set statusline+=\ set statusline+=\
set statusline+=%f set statusline+=%f "What's the filename?
set statusline+=%m%r set statusline+=%m%r "Is it modifiable/readonly?
set statusline+=%= set statusline+=%= "Go to the right ---->
set statusline+=\ set statusline+=\
set statusline+=%< set statusline+=%< "Trim here
set statusline+=%{&fileencoding?&fileencoding:&encoding} set statusline+=%{&fileencoding?&fileencoding:&encoding}
set statusline+=\|%{&fileformat} set statusline+=\|%{&fileformat} "Unix/Win?
set statusline+=\ set statusline+=\
set statusline+=%y set statusline+=%y "What's the type of the file?
set statusline+=\ set statusline+=\
set statusline+=<x%02B> set statusline+=<x%02B> "Character under cursor
set statusline+=\ set statusline+=\
set statusline+=(%2c:%l)/%L set statusline+=(%2c:%l)/%L "(col:line)/total lines
set statusline+=\ set statusline+=\

View File

@@ -1,31 +0,0 @@
"Vundle stuff
"{{{
filetype off
"Unix
set rtp+=$HOME/.vim/bundle/Vundle.vim
call vundle#begin()
"Win
"set rtp+=$HOME/vimfiles/bundle/Vundle.vim
"call vundle#begin('$HOME/vimfiles/bundle/')
Plugin 'VundleVim/Vundle.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/syntastic'
Plugin 'vim-scripts/indentpython.vim'
"Plugin 'vim-airline/vim-airline'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-fugitive'
Plugin 'majutsushi/tagbar'
"Plugin 'jmcantrell/vim-virtualenv'
"Plugin 'petRUShka/vim-opencl'
call vundle#end()
"}}}
"let g:tagbar_ctags_bin = ''
"let g:ycm_global_ycm_extra_conf = ''
"let g:ycm_python_binary_path = ''
"let g:syntastic_python_python_exec = ''

View File

@@ -1,40 +1,31 @@
#!/usr/bin/env bash #!/usr/bin/env bash
read -p "---WARNING---
This script will brutally delete your .vimrc file,
if such exists in your home directory.
Are you sure you want to proceed? [y/n]: " responce
[[ "$responce" = "y" ]] || { echo "Abort!" >&2; exit 1; }
echo "Proceeding..."
repo="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" repo="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
[ -f "$HOME/.vimrc" ] && rm "$HOME/.vimrc" read -p "Would you like to use template from this repository
ln -s "$repo/.vimrc" "$HOME/.vimrc" as your .vimrc? WARNING: if you do, the existing ~/.vimrc
echo "Created link to .vimrc" will be deleted! [y/n]: " responce
[[ "$responce" = "y" ]] \
&& { [ -f "$HOME/.vimrc" ] && rm "$HOME/.vimrc"; \
cp "$repo/.vimrc_template" "$HOME/.vimrc"; \
echo "Created ~/.vimrc from template"; } \
|| echo "Not creating ~/.vimrc from template"
[ -d "$HOME/.vim" ] || { mkdir "$HOME/.vim"; \ [ -d "$HOME/.vim" ] || { mkdir "$HOME/.vim"; \
echo "Created .vim directory in your HOME"; } echo "Created .vim directory in your HOME"; }
[ -d "$HOME/.vim/colors" ] \ [ -d "$HOME/.vim/colors" ] \
&& echo "colors dir already exists, deal with it manually" \ && echo "~/.vim/colors already exists, deal with it manually" \
|| ln -s "$repo/colors" "$HOME/.vim/colors" || ln -s "$repo/colors" "$HOME/.vim/colors"
[ -d "$HOME/.vim/plugin" ] \ [ -d "$HOME/.vim/plugin" ] \
&& echo "plugin dir already exists, deal with it manually" \ && echo "~/.vim/plugin already exists, deal with it manually" \
|| ln -s "$repo/plugin" "$HOME/.vim/plugin" || ln -s "$repo/plugin" "$HOME/.vim/plugin"
[ -d "$HOME/.vim/ftplugin" ] \ [ -d "$HOME/.vim/ftplugin" ] \
&& echo "ftplugin already exists, deal with it manually" \ && echo "~/.vim/ftplugin already exists, deal with it manually" \
|| ln -s "$repo/ftplugin" "$HOME/.vim/ftplugin" || ln -s "$repo/ftplugin" "$HOME/.vim/ftplugin"
[ -f "$HOME/.vimplugin" ] \
&& echo "not creating ~/.vimplugin, it exists already" \
|| cp "$repo/plugin_template.vim" "$HOME/.vimplugin"
[ -f "$HOME/.vimlocal" ] \
&& echo "not creating ~/.vimlocal, it exists already" \
|| cp "$repo/local_template.vim" "$HOME/.vimlocal"
[ -d "$HOME/.vim/bundle" ] \ [ -d "$HOME/.vim/bundle" ] \
&& echo "You seem to already have some plugin manager" \ && echo "You seem to already have some plugin manager" \
|| { mkdir "$HOME/.vim/bundle"; \ || { mkdir "$HOME/.vim/bundle"; \