Adds ALE, LanguageClient, and clang
This commit is contained in:
parent
c257164aee
commit
f49657495b
3 changed files with 44 additions and 12 deletions
|
|
@ -34,3 +34,5 @@
|
||||||
default = current
|
default = current
|
||||||
[rerere]
|
[rerere]
|
||||||
enabled = true
|
enabled = true
|
||||||
|
[url "git@github.com:"]
|
||||||
|
insteadOf = https://github.com/
|
||||||
|
|
|
||||||
|
|
@ -605,7 +605,7 @@ function! plug#helptags()
|
||||||
return s:err('plug#begin was not called')
|
return s:err('plug#begin was not called')
|
||||||
endif
|
endif
|
||||||
for spec in values(g:plugs)
|
for spec in values(g:plugs)
|
||||||
let docd = join([spec.dir, 'doc'], '/')
|
let docd = join([s:rtp(spec), 'doc'], '/')
|
||||||
if isdirectory(docd)
|
if isdirectory(docd)
|
||||||
silent! execute 'helptags' s:esc(docd)
|
silent! execute 'helptags' s:esc(docd)
|
||||||
endif
|
endif
|
||||||
|
|
@ -799,7 +799,7 @@ function! s:bang(cmd, ...)
|
||||||
let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
let cmd = a:0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
||||||
if s:is_win
|
if s:is_win
|
||||||
let batchfile = tempname().'.bat'
|
let batchfile = tempname().'.bat'
|
||||||
call writefile(['@echo off', cmd], batchfile)
|
call writefile(["@echo off\r", cmd . "\r"], batchfile)
|
||||||
let cmd = batchfile
|
let cmd = batchfile
|
||||||
endif
|
endif
|
||||||
let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%')
|
let g:_plug_bang = (s:is_win && has('gui_running') ? 'silent ' : '').'!'.escape(cmd, '#!%')
|
||||||
|
|
@ -908,7 +908,7 @@ function! s:finish(pull)
|
||||||
call add(msgs, "Press 'R' to retry.")
|
call add(msgs, "Press 'R' to retry.")
|
||||||
endif
|
endif
|
||||||
if a:pull && len(s:update.new) < len(filter(getline(5, '$'),
|
if a:pull && len(s:update.new) < len(filter(getline(5, '$'),
|
||||||
\ "v:val =~ '^- ' && stridx(v:val, 'Already up-to-date') < 0"))
|
\ "v:val =~ '^- ' && v:val !~# 'Already up.to.date'"))
|
||||||
call add(msgs, "Press 'D' to see the updated changes.")
|
call add(msgs, "Press 'D' to see the updated changes.")
|
||||||
endif
|
endif
|
||||||
echo join(msgs, ' ')
|
echo join(msgs, ' ')
|
||||||
|
|
@ -1196,7 +1196,7 @@ function! s:spawn(name, cmd, opts)
|
||||||
let s:jobs[a:name] = job
|
let s:jobs[a:name] = job
|
||||||
let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd
|
let cmd = has_key(a:opts, 'dir') ? s:with_cd(a:cmd, a:opts.dir) : a:cmd
|
||||||
if !empty(job.batchfile)
|
if !empty(job.batchfile)
|
||||||
call writefile(['@echo off', cmd], job.batchfile)
|
call writefile(["@echo off\r", cmd . "\r"], job.batchfile)
|
||||||
let cmd = job.batchfile
|
let cmd = job.batchfile
|
||||||
endif
|
endif
|
||||||
let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd)
|
let argv = add(s:is_win ? ['cmd', '/c'] : ['sh', '-c'], cmd)
|
||||||
|
|
@ -2023,7 +2023,7 @@ function! s:system(cmd, ...)
|
||||||
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
let cmd = a:0 > 0 ? s:with_cd(a:cmd, a:1) : a:cmd
|
||||||
if s:is_win
|
if s:is_win
|
||||||
let batchfile = tempname().'.bat'
|
let batchfile = tempname().'.bat'
|
||||||
call writefile(['@echo off', cmd], batchfile)
|
call writefile(["@echo off\r", cmd . "\r"], batchfile)
|
||||||
let cmd = batchfile
|
let cmd = batchfile
|
||||||
endif
|
endif
|
||||||
return system(s:is_win ? '('.cmd.')' : cmd)
|
return system(s:is_win ? '('.cmd.')' : cmd)
|
||||||
|
|
@ -2246,15 +2246,16 @@ function! s:status()
|
||||||
let unloaded = 0
|
let unloaded = 0
|
||||||
let [cnt, total] = [0, len(g:plugs)]
|
let [cnt, total] = [0, len(g:plugs)]
|
||||||
for [name, spec] in items(g:plugs)
|
for [name, spec] in items(g:plugs)
|
||||||
|
let is_dir = isdirectory(spec.dir)
|
||||||
if has_key(spec, 'uri')
|
if has_key(spec, 'uri')
|
||||||
if isdirectory(spec.dir)
|
if is_dir
|
||||||
let [err, _] = s:git_validate(spec, 1)
|
let [err, _] = s:git_validate(spec, 1)
|
||||||
let [valid, msg] = [empty(err), empty(err) ? 'OK' : err]
|
let [valid, msg] = [empty(err), empty(err) ? 'OK' : err]
|
||||||
else
|
else
|
||||||
let [valid, msg] = [0, 'Not found. Try PlugInstall.']
|
let [valid, msg] = [0, 'Not found. Try PlugInstall.']
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
if isdirectory(spec.dir)
|
if is_dir
|
||||||
let [valid, msg] = [1, 'OK']
|
let [valid, msg] = [1, 'OK']
|
||||||
else
|
else
|
||||||
let [valid, msg] = [0, 'Not found.']
|
let [valid, msg] = [0, 'Not found.']
|
||||||
|
|
@ -2263,7 +2264,7 @@ function! s:status()
|
||||||
let cnt += 1
|
let cnt += 1
|
||||||
let ecnt += !valid
|
let ecnt += !valid
|
||||||
" `s:loaded` entry can be missing if PlugUpgraded
|
" `s:loaded` entry can be missing if PlugUpgraded
|
||||||
if valid && get(s:loaded, name, -1) == 0
|
if is_dir && get(s:loaded, name, -1) == 0
|
||||||
let unloaded = 1
|
let unloaded = 1
|
||||||
let msg .= ' (not loaded)'
|
let msg .= ' (not loaded)'
|
||||||
endif
|
endif
|
||||||
|
|
@ -2356,7 +2357,7 @@ function! s:preview_commit()
|
||||||
let cmd = 'cd '.s:shellesc(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
|
let cmd = 'cd '.s:shellesc(g:plugs[name].dir).' && git show --no-color --pretty=medium '.sha
|
||||||
if s:is_win
|
if s:is_win
|
||||||
let batchfile = tempname().'.bat'
|
let batchfile = tempname().'.bat'
|
||||||
call writefile(['@echo off', cmd], batchfile)
|
call writefile(["@echo off\r", cmd . "\r"], batchfile)
|
||||||
let cmd = batchfile
|
let cmd = batchfile
|
||||||
endif
|
endif
|
||||||
execute 'silent %!' cmd
|
execute 'silent %!' cmd
|
||||||
|
|
@ -2406,7 +2407,7 @@ function! s:diff()
|
||||||
call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:')
|
call s:append_ul(2, origin ? 'Pending updates:' : 'Last update:')
|
||||||
for [k, v] in plugs
|
for [k, v] in plugs
|
||||||
let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..'
|
let range = origin ? '..origin/'.v.branch : 'HEAD@{1}..'
|
||||||
let diff = s:system_chomp('git log --graph --color=never --pretty=format:"%x01%h%x01%d%x01%s%x01%cr" '.s:shellesc(range), v.dir)
|
let diff = s:system_chomp('git log --graph --color=never '.join(map(['--pretty=format:%x01%h%x01%d%x01%s%x01%cr', range], 's:shellesc(v:val)')), v.dir)
|
||||||
if !empty(diff)
|
if !empty(diff)
|
||||||
let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : ''
|
let ref = has_key(v, 'tag') ? (' (tag: '.v.tag.')') : has_key(v, 'commit') ? (' '.v.commit) : ''
|
||||||
call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)')))
|
call append(5, extend(['', '- '.k.':'.ref], map(s:lines(diff), 's:format_git_log(v:val)')))
|
||||||
|
|
|
||||||
31
.vimrc
31
.vimrc
|
|
@ -87,7 +87,8 @@ Plug 'sjbach/lusty'
|
||||||
Plug 'scrooloose/nerdcommenter'
|
Plug 'scrooloose/nerdcommenter'
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
Plug 'rstacruz/sparkup'
|
Plug 'rstacruz/sparkup'
|
||||||
Plug 'scrooloose/syntastic'
|
"Plug 'scrooloose/syntastic'
|
||||||
|
Plug 'w0rp/ale'
|
||||||
Plug 'tpope/vim-fugitive'
|
Plug 'tpope/vim-fugitive'
|
||||||
Plug 'airblade/vim-gitgutter'
|
Plug 'airblade/vim-gitgutter'
|
||||||
Plug 'lunaru/vim-less'
|
Plug 'lunaru/vim-less'
|
||||||
|
|
@ -95,6 +96,7 @@ Plug 'lunaru/vim-less'
|
||||||
Plug 'tpope/vim-unimpaired'
|
Plug 'tpope/vim-unimpaired'
|
||||||
"Plug 'Valloric/YouCompleteMe'
|
"Plug 'Valloric/YouCompleteMe'
|
||||||
Plug 'Shougo/deoplete.nvim'
|
Plug 'Shougo/deoplete.nvim'
|
||||||
|
Plug 'zchee/deoplete-clang'
|
||||||
Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
|
Plug 'zchee/deoplete-go', {'build': {'unix': 'make'}}
|
||||||
Plug 'zchee/deoplete-jedi'
|
Plug 'zchee/deoplete-jedi'
|
||||||
Plug 'b4winckler/vim-angry'
|
Plug 'b4winckler/vim-angry'
|
||||||
|
|
@ -139,6 +141,10 @@ Plug 'Shougo/denite.nvim'
|
||||||
Plug 'tpope/vim-fireplace'
|
Plug 'tpope/vim-fireplace'
|
||||||
Plug 'junegunn/vim-easy-align'
|
Plug 'junegunn/vim-easy-align'
|
||||||
Plug 'idris-hackers/idris-vim'
|
Plug 'idris-hackers/idris-vim'
|
||||||
|
Plug 'autozimu/LanguageClient-neovim', {
|
||||||
|
\ 'branch': 'next',
|
||||||
|
\ 'do': 'bash install.sh',
|
||||||
|
\ }
|
||||||
|
|
||||||
Plug 'ambv/black'
|
Plug 'ambv/black'
|
||||||
|
|
||||||
|
|
@ -199,6 +205,13 @@ setlocal cursorline
|
||||||
|
|
||||||
" ** PLUGIN CONFIGURATION **
|
" ** PLUGIN CONFIGURATION **
|
||||||
"
|
"
|
||||||
|
" Change the source rank
|
||||||
|
call deoplete#custom#option('sources', {
|
||||||
|
\ 'python': ['LanguageClient'],
|
||||||
|
\})
|
||||||
|
call deoplete#custom#source('buffer', 'rank', 1)
|
||||||
|
let g:deoplete#sources#clang#libclang_path = '/usr/lib/llvm-6.0/lib/libclang.so'
|
||||||
|
let g:deoplete#sources#clang#clang_header = '/usr/lib/llvm-6.0/lib/clang'
|
||||||
let g:deoplete#enable_at_startup = 1
|
let g:deoplete#enable_at_startup = 1
|
||||||
" * Vim general/Unknown
|
" * Vim general/Unknown
|
||||||
let python_highlight_all = 1
|
let python_highlight_all = 1
|
||||||
|
|
@ -216,6 +229,22 @@ let g:syntastic_always_populate_loc_list = 1
|
||||||
let g:syntastic_auto_loc_list = 2
|
let g:syntastic_auto_loc_list = 2
|
||||||
let g:syntastic_loc_list_height = 10
|
let g:syntastic_loc_list_height = 10
|
||||||
" E111 = Spaces should be multiples of 4. I use 2.
|
" E111 = Spaces should be multiples of 4. I use 2.
|
||||||
|
"
|
||||||
|
|
||||||
|
" * ALE
|
||||||
|
let g:airline#extensions#ale#enabled = 1
|
||||||
|
let g:ale_set_highlights = 0
|
||||||
|
|
||||||
|
" * LanguageServer
|
||||||
|
let g:LanguageClient_serverCommands = {
|
||||||
|
\ 'python': ['pyls'],
|
||||||
|
\ }
|
||||||
|
let g:LanguageClient_diagnosticsDisplay = {
|
||||||
|
\1: {'name': 'Error', 'texthl': 'ALEError', 'signText': 'E>', 'signTexthl': 'ALEErrorSign',},
|
||||||
|
\2: {"name": "Warning", "texthl": "ALEWarning", "signText": "W>", "signTexthl": "ALEWarningSign",},
|
||||||
|
\3: {"name": "Information", "texthl": "ALEInfo", "signText": "i-", "signTexthl": "ALEInfoSign",},
|
||||||
|
\4: {"name": "Hint", "texthl": "ALEInfo", "signText": "--", "signTexthl": "ALEInfoSign",},
|
||||||
|
\}
|
||||||
|
|
||||||
" * Configure browser for haskell_doc.vim
|
" * Configure browser for haskell_doc.vim
|
||||||
let g:haddock_browser = "open"
|
let g:haddock_browser = "open"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue