Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/vim plug #1056

Open
wants to merge 14 commits into
base: 3.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .vim_plug.unplug
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function! s:deregister(repo)
let repo = substitute(a:repo, '[\/]\+$', '', '')
let name = fnamemodify(repo, ':t:s?\.git$??')

try
call remove(g:plugs, name)
call remove(g:plugs_order, index(g:plugs_order, name))
catch /^Vim\%((\a\+)\)\=:E716/ " Key Not present in Dictionary
"echom name . ' already removed'
endtry

endfunction

command! -nargs=1 -bar UnPlug call s:deregister(<args>)
73 changes: 41 additions & 32 deletions .vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@

" }

" Load Vim Plug - UnPlug Function {
if filereadable(expand("~/.spf13-vim-3/.vim_plug.unplug"))
source ~/.spf13-vim-3/.vim_plug.unplug"
endif
" }


" Use before config if available {
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
Expand Down Expand Up @@ -207,7 +214,7 @@
" Broken down into easily includeable segments
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
if !exists('g:override_spf13_bundles')
if !exists('g:override_spf13_bundles') && exists('*fugitive#statusline')
set statusline+=%{fugitive#statusline()} " Git Hotness
endif
set statusline+=\ [%{&ff}/%Y] " Filetype
Expand Down Expand Up @@ -589,6 +596,11 @@
endif
" }

" NerdCommenter {
" Add space when comment
let NERDSpaceDelims=1
" }

" Tabularize {
if isdirectory(expand("~/.vim/bundle/tabular"))
nmap <Leader>a& :Tabularize /&<CR>
Expand Down Expand Up @@ -751,28 +763,28 @@
endif
" }

" neocomplete {
if count(g:spf13_bundle_groups, 'neocomplete')
" deoplete {
if count(g:spf13_bundle_groups, 'deoplete')
let g:acp_enableAtStartup = 0
let g:neocomplete#enable_at_startup = 1
let g:neocomplete#enable_smart_case = 1
let g:neocomplete#enable_auto_delimiter = 1
let g:neocomplete#max_list = 15
let g:neocomplete#force_overwrite_completefunc = 1
let g:deoplete#enable_at_startup = 1
let g:deoplete#enable_smart_case = 1
let g:deoplete#enable_auto_delimiter = 1
let g:deoplete#max_list = 15
let g:deoplete#force_overwrite_completefunc = 1


" Define dictionary.
let g:neocomplete#sources#dictionary#dictionaries = {
let g:deoplete#sources#dictionary#dictionaries = {
\ 'default' : '',
\ 'vimshell' : $HOME.'/.vimshell_hist',
\ 'scheme' : $HOME.'/.gosh_completions'
\ }

" Define keyword.
if !exists('g:neocomplete#keyword_patterns')
let g:neocomplete#keyword_patterns = {}
if !exists('g:deoplete#keyword_patterns')
let g:deoplete#keyword_patterns = {}
endif
let g:neocomplete#keyword_patterns['default'] = '\h\w*'
let g:deoplete#keyword_patterns['default'] = '\h\w*'

" Plugin key-mappings {
" These two lines conflict with the default digraph mapping of <C-K>
Expand Down Expand Up @@ -800,21 +812,21 @@
\ "\<C-e>" : "\<Plug>(neosnippet_expand_or_jump)")
smap <TAB> <Right><Plug>(neosnippet_jump_or_expand)

inoremap <expr><C-g> neocomplete#undo_completion()
inoremap <expr><C-l> neocomplete#complete_common_string()
"inoremap <expr><CR> neocomplete#complete_common_string()
inoremap <expr><C-g> deoplete#undo_completion()
inoremap <expr><C-l> deoplete#complete_common_string()
"inoremap <expr><CR> deoplete#complete_common_string()

" <CR>: close popup
" <s-CR>: close popup and save indent.
inoremap <expr><s-CR> pumvisible() ? neocomplete#smart_close_popup()."\<CR>" : "\<CR>"
inoremap <expr><s-CR> pumvisible() ? deoplete#smart_close_popup()."\<CR>" : "\<CR>"

function! CleverCr()
if pumvisible()
if neosnippet#expandable()
let exp = "\<Plug>(neosnippet_expand)"
return exp . neocomplete#smart_close_popup()
return exp . deoplete#smart_close_popup()
else
return neocomplete#smart_close_popup()
return deoplete#smart_close_popup()
endif
else
return "\<CR>"
Expand All @@ -824,8 +836,8 @@
" <CR> close popup and save indent or expand snippet
imap <expr> <CR> CleverCr()
" <C-h>, <BS>: close popup and delete backword char.
inoremap <expr><BS> neocomplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> neocomplete#smart_close_popup()
inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>"
inoremap <expr><C-y> deoplete#smart_close_popup()
endif
" <TAB>: completion.
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
Expand All @@ -847,7 +859,7 @@
if neosnippet#expandable_or_jumpable()
return "\<Plug>(neosnippet_expand_or_jump)"
else
return neocomplete#start_manual_complete()
return deoplete#start_manual_complete()
endif
endif
endfunction
Expand All @@ -856,14 +868,14 @@
" }

" Enable heavy omni completion.
if !exists('g:neocomplete#sources#omni#input_patterns')
let g:neocomplete#sources#omni#input_patterns = {}
if !exists('g:deoplete#sources#omni#input_patterns')
let g:deoplete#sources#omni#input_patterns = {}
endif
let g:neocomplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:neocomplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
let g:neocomplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:neocomplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:neocomplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
let g:deoplete#sources#omni#input_patterns.php = '[^. \t]->\h\w*\|\h\w*::'
let g:deoplete#sources#omni#input_patterns.perl = '\h\w*->\h\w*\|\h\w*::'
let g:deoplete#sources#omni#input_patterns.c = '[^.[:digit:] *\t]\%(\.\|->\)'
let g:deoplete#sources#omni#input_patterns.cpp = '[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:deoplete#sources#omni#input_patterns.ruby = '[^. *\t]\.\h\w*\|\h\w*::'
" }
" neocomplcache {
elseif count(g:spf13_bundle_groups, 'neocomplcache')
Expand Down Expand Up @@ -983,7 +995,7 @@

" Snippets {
if count(g:spf13_bundle_groups, 'neocomplcache') ||
\ count(g:spf13_bundle_groups, 'neocomplete')
\ count(g:spf13_bundle_groups, 'deoplete')

" Use honza's snippets.
let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets'
Expand Down Expand Up @@ -1061,9 +1073,6 @@
endif
endif
" }



" }

" GUI Settings {
Expand Down
2 changes: 1 addition & 1 deletion .vimrc.before
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
" Mappings for editing/applying spf13 config
" let g:spf13_edit_config_mapping='<leader>ev'
" let g:spf13_apply_config_mapping='<leader>sv'

" }

" Use fork before if available {
Expand Down
Loading