Commit 82ac4fb8 authored by Murukesh Mohanan's avatar Murukesh Mohanan

trialling neocomplete

parent 9c5d304e
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
" " Using a non-master branch " " Using a non-master branch
" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' } " Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
" "
" " Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
" Plug 'fatih/vim-go', { 'tag': '*' }
"
" " Plugin options " " Plugin options
" Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' } " Plug 'nsf/gocode', { 'tag': 'v.20150303', 'rtp': 'vim' }
" "
...@@ -128,7 +131,7 @@ function! plug#begin(...) ...@@ -128,7 +131,7 @@ function! plug#begin(...)
endfunction endfunction
function! s:define_commands() function! s:define_commands()
command! -nargs=+ -bar Plug call s:Plug(<args>) command! -nargs=+ -bar Plug call plug#(<args>)
if !executable('git') if !executable('git')
return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.') return s:err('`git` executable not found. Most commands will not be available. To suppress this message, prepend `silent!` to `call plug#begin(...)`.')
endif endif
...@@ -222,7 +225,9 @@ function! plug#end() ...@@ -222,7 +225,9 @@ function! plug#end()
if has_key(plug, 'for') if has_key(plug, 'for')
let types = s:to_a(plug.for) let types = s:to_a(plug.for)
if !empty(types) if !empty(types)
augroup filetypedetect
call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim') call s:source(s:rtp(plug), 'ftdetect/**/*.vim', 'after/ftdetect/**/*.vim')
augroup END
endif endif
for type in types for type in types
call s:assoc(lod.ft, type, name) call s:assoc(lod.ft, type, name)
...@@ -484,7 +489,7 @@ function! s:lod_map(map, names, prefix) ...@@ -484,7 +489,7 @@ function! s:lod_map(map, names, prefix)
call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra) call feedkeys(a:prefix . substitute(a:map, '^<Plug>', "\<Plug>", '') . extra)
endfunction endfunction
function! s:Plug(repo, ...) function! plug#(repo, ...)
if a:0 > 1 if a:0 > 1
return s:err('Invalid number of arguments (1..2)') return s:err('Invalid number of arguments (1..2)')
endif endif
...@@ -964,8 +969,17 @@ function! s:update_finish() ...@@ -964,8 +969,17 @@ function! s:update_finish()
call s:log4(name, 'Checking out '.spec.commit) call s:log4(name, 'Checking out '.spec.commit)
let out = s:checkout(spec) let out = s:checkout(spec)
elseif has_key(spec, 'tag') elseif has_key(spec, 'tag')
call s:log4(name, 'Checking out '.spec.tag) let tag = spec.tag
let out = s:system('git checkout -q '.s:esc(spec.tag).' 2>&1', spec.dir) if tag =~ '\*'
let tags = s:lines(s:system('git tag --list '.string(tag).' --sort -version:refname 2>&1', spec.dir))
if !v:shell_error && !empty(tags)
let tag = tags[0]
call s:log4(name, printf('Latest tag for %s -> %s', spec.tag, tag))
call append(3, '')
endif
endif
call s:log4(name, 'Checking out '.tag)
let out = s:system('git checkout -q '.s:esc(tag).' 2>&1', spec.dir)
else else
let branch = s:esc(get(spec, 'branch', 'master')) let branch = s:esc(get(spec, 'branch', 'master'))
call s:log4(name, 'Merging origin/'.branch) call s:log4(name, 'Merging origin/'.branch)
...@@ -2225,4 +2239,3 @@ endif ...@@ -2225,4 +2239,3 @@ endif
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
...@@ -4,6 +4,8 @@ let g:go_highlight_structs = 1 ...@@ -4,6 +4,8 @@ let g:go_highlight_structs = 1
let g:go_highlight_operators = 1 let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1 let g:go_highlight_build_constraints = 1
let g:go_auto_type_info = 1
let g:go_fmt_command = "goimports" let g:go_fmt_command = "goimports"
let g:tagbar_type_go = { let g:tagbar_type_go = {
...@@ -38,3 +40,9 @@ nnoremap <buffer> <leader>r :GoRun<cr> ...@@ -38,3 +40,9 @@ nnoremap <buffer> <leader>r :GoRun<cr>
nnoremap <buffer> <leader>pc :pc<cr> nnoremap <buffer> <leader>pc :pc<cr>
nnoremap <buffer> <leader>d :GoRun % --debug<cr> nnoremap <buffer> <leader>d :GoRun % --debug<cr>
nnoremap <buffer> <leader>t :GoTest -v -cpu=8<cr> nnoremap <buffer> <leader>t :GoTest -v -cpu=8<cr>
set completeopt-=longest
set completeopt-=preview
let g:echodoc_enable_at_startup = 1
"let g:syntastic_go_checkers = ['golint', 'govet', 'errcheck']
"let g:syntastic_mode_map = { 'mode': 'active', 'passive_filetypes': ['go'] }
...@@ -108,9 +108,9 @@ function! YCMInstallCmd() ...@@ -108,9 +108,9 @@ function! YCMInstallCmd()
if executable('c++') if executable('c++')
let l:ycm_cmd .= ' --clang-completer' let l:ycm_cmd .= ' --clang-completer'
endif endif
if executable('go') "if executable('go')
let l:ycm_cmd .= ' --gocode-completer' " let l:ycm_cmd .= ' --gocode-completer'
endif "endif
if executable('npm') if executable('npm')
let l:ycm_cmd .= ' --tern-completer' let l:ycm_cmd .= ' --tern-completer'
endif endif
...@@ -135,11 +135,14 @@ Plug 'godlygeek/tabular' ...@@ -135,11 +135,14 @@ Plug 'godlygeek/tabular'
if executable('cmake') if executable('cmake')
" YCM command lifted from vim-plug readme " YCM command lifted from vim-plug readme
Plug 'Valloric/YouCompleteMe', { 'do': YCMInstallCmd(), 'for': ['cpp', 'c', 'go', 'sh', 'js', 'vim'] } Plug 'Valloric/YouCompleteMe', { 'do': YCMInstallCmd(), 'for': ['cpp', 'c', 'sh', 'js', 'vim'] }
autocmd! User YouCompleteMe if !has('vim_starting') | call youcompleteme#Enable() | endif autocmd! User YouCompleteMe if !has('vim_starting') | call youcompleteme#Enable() | endif
endif endif
if executable('go') if executable('go')
Plug 'fatih/vim-go', {'for': 'go'} Plug 'fatih/vim-go', {'for': 'go'}
Plug 'Shougo/neocomplete.vim', {'for': 'go'}
Plug 'Shougo/vimproc.vim', {'do': 'make'}
Plug 'Shougo/echodoc.vim'
endif endif
if executable('latex') if executable('latex')
Plug 'lervag/vimtex', {'for': 'tex'} Plug 'lervag/vimtex', {'for': 'tex'}
...@@ -176,7 +179,7 @@ autocmd BufWritePost *.sh,*.py if get(b:, 'is_new', 0) | silent execute '!chmod ...@@ -176,7 +179,7 @@ autocmd BufWritePost *.sh,*.py if get(b:, 'is_new', 0) | silent execute '!chmod
let g:SuperTabDefaultCompletionType = "context" let g:SuperTabDefaultCompletionType = "context"
let g:SuperTabClosePreviewOnPopupClose = 1 let g:SuperTabClosePreviewOnPopupClose = 1
set omnifunc=syntaxcomplete#Complete "set omnifunc=syntaxcomplete#Complete
set foldmethod=syntax set foldmethod=syntax
set foldlevelstart=3 set foldlevelstart=3
let g:syntastic_cpp_compiler_options = ' -std=c++11' let g:syntastic_cpp_compiler_options = ' -std=c++11'
...@@ -205,6 +208,11 @@ let g:ycm_autoclose_preview_window_after_insertion = 1 ...@@ -205,6 +208,11 @@ let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_collect_identifiers_from_tags_files = 1 let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_seed_identifiers_with_syntax = 1 let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_python_binary_path = '/usr/bin/python3' let g:ycm_python_binary_path = '/usr/bin/python3'
let g:neocomplete#enable_at_startup = 1
" Use smartcase.
let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
let g:neocomplete#sources#syntax#min_keyword_length = 3
if empty($MAN_PN) && @% == "" && getcwd() == "/tmp" if empty($MAN_PN) && @% == "" && getcwd() == "/tmp"
" From http://vi.stackexchange.com/questions/239/ " From http://vi.stackexchange.com/questions/239/
......
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