Use vim-lsp

This commit is contained in:
Julian Ospald 2020-10-11 17:55:02 +02:00
parent 6f5ba10aa6
commit efc29ec3b9
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
5 changed files with 301 additions and 2864 deletions

View File

@ -182,3 +182,13 @@ let g:tagbar_type_haskell = {
let g:vista_ctags_cmd = {
\ 'haskell': 'hasktags -x -o - -c',
\ }
" vim-lsp
if executable('haskell-language-server-wrapper')
au User lsp_setup call lsp#register_server({
\ 'name': 'hls',
\ 'cmd': {server_info->['haskell-language-server-wrapper', '--lsp']},
\ 'allowlist': ['haskell'],
\ })
endif

View File

@ -178,9 +178,39 @@ autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in
let g:EditorConfig_max_line_indicator = 'none'
" let g:EditorConfig_preserve_formatoptions = 1
" vim current word
let g:vim_current_word#highlight_current_word = 0
hi default link CurrentWordTwins CursorColumn
" vista
let g:vista#renderer#enable_icon = 0
" vim-lsp
function! s:on_lsp_buffer_enabled() abort
setlocal omnifunc=lsp#complete
setlocal signcolumn=yes
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
nmap <buffer> gd <plug>(lsp-definition)
nmap <buffer> gr <plug>(lsp-references)
nmap <buffer> gi <plug>(lsp-implementation)
nmap <buffer> gt <plug>(lsp-type-definition)
nmap <buffer> <leader>rn <plug>(lsp-rename)
nmap <buffer> [g <Plug>(lsp-previous-diagnostic)
nmap <buffer> ]g <Plug>(lsp-next-diagnostic)
nmap <buffer> K <plug>(lsp-hover)
" refer to doc to add more commands
endfunction
augroup lsp_install
au!
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
augroup END
let g:lsp_auto_enable = 0
command -nargs=0 LspStart call lsp#activate()

File diff suppressed because it is too large Load Diff

241
plugins.toml Normal file
View File

@ -0,0 +1,241 @@
[[plugins]]
repo = 'mileszs/ack.vim'
[[plugins]]
repo = 'vim-scripts/cmdalias.vim'
[[plugins]]
repo = 'Raimondi/delimitMate'
[[plugins]]
repo = 'vim-scripts/genindent.vim'
[[plugins]]
repo = 'scrooloose/nerdcommenter'
[[plugins]]
repo = 'scrooloose/nerdtree'
on_cmd = 'NERDTreeToggle'
[[plugins]]
repo = 'Xuyuanp/nerdtree-git-plugin'
on_cmd = 'NERDTreeToggle'
[[plugins]]
repo = 'xolox/vim-easytags'
[[plugins]]
repo = 'xolox/vim-misc'
[[plugins]]
repo = 'nathanaelkane/vim-indent-guides'
[[plugins]]
repo = 'Shougo/vimproc.vim'
build = 'make'
[[plugins]]
repo = 'sjbach/lusty'
[[plugins]]
repo = 'nixprime/cpsm'
build = 'sh -c "PY3=ON ./install.sh"'
[[plugins]]
repo = 'liuchengxu/vista.vim'
[[plugins]]
repo = 'sbdchd/neoformat'
[[plugins]]
repo = 'AndrewRadev/bufferize.vim'
[[plugins]]
repo = 'vmchale/dhall-vim'
[[plugins]]
repo = 'Shougo/echodoc.vim'
[[plugins]]
repo = 'tpope/vim-scriptease'
[[plugins]]
repo = 'Konfekt/FastFold'
[[plugins]]
repo = 'editorconfig/editorconfig-vim'
[[plugins]]
repo = 'hasufell/ghcup.vim'
[[plugins]]
repo = 'junegunn/vim-easy-align'
[[plugins]]
repo = 'dominikduda/vim_current_word'
#[[plugins]]
# repo = 'vim-airline/vim-airline'
#[[plugins]]
# repo = 'vim-airline/vim-airline-themes'
[[plugins]]
repo = 'mkitt/tabline.vim'
# finder
[[plugins]]
repo = 'liuchengxu/vim-clap'
build = 'make'
# scm
[[plugins]]
repo = 'tpope/vim-fugitive'
[[plugins]]
repo = 'tpope/vim-rhubarb'
[[plugins]]
repo = 'tommcdo/vim-fubitive'
[[plugins]]
repo = 'airblade/vim-gitgutter'
# local vimrc
[[plugins]]
repo = 'LucHermitte/lh-vim-lib'
[[plugins]]
repo = 'LucHermitte/local_vimrc'
# completion
[[plugins]]
repo = 'Valloric/YouCompleteMe'
build = './install.py --clang-completer --go-completer --rust-completer --system-boost --system-libclang'
on_ft = ['c', 'go', 'clojure']
[[plugins]]
repo = 'Shougo/deoplete.nvim'
[[plugins]]
repo = 'roxma/nvim-yarp'
on_if = '!has("nvim")'
[[plugins]]
repo = 'roxma/vim-hug-neovim-rpc'
on_if = '!has("nvim")'
# linting/compilation
[[plugins]]
repo = 'w0rp/ale'
build = 'bash -c "cp -R ~/.vim/ale_linters ."'
on_ft = ['sh', 'vim']
# LSP
#[[plugins]]
#repo = 'autozimu/LanguageClient-neovim'
#rev = 'next'
#build = 'bash ./install.sh'
[[plugins]]
repo = 'prabirshrestha/vim-lsp'
# snippets
#[[plugins]]
#repo = 'Shougo/neosnippet.vim'
#[[plugins]]
#repo = 'honza/vim-snippets'
# multi language
[[plugins]]
repo = 'luochen1990/rainbow'
on_ft = ['clojure', 'haskell', 'python']
# haskell
[[plugins]]
repo = 'neovimhaskell/haskell-vim'
on_ft = ['haskell', 'cabal']
[[plugins]]
repo = 'Twinside/vim-hoogle'
on_ft = ['haskell']
[[plugins]]
repo = 'alx741/vim-stylishask'
on_ft = ['haskell']
[[plugins]]
repo = 'fatih/vim-go'
on_ft = ['go']
hook_post_source = 'GoInstallBinaries'
# rust
[[plugins]]
repo = 'rust-lang/rust.vim'
on_ft = ['rust']
# javascript
[[plugins]]
repo = 'pangloss/vim-javascript'
on_ft = ['javascript']
# python
[[plugins]]
repo = 'python-mode/python-mode'
on_ft = ['python']
#[[plugins]]
# repo = 'zchee/deoplete-jedi'
# on_ft = ['python']
#[[plugins]]
# repo = 'davidhalter/jedi-vim'
# on_ft = ['python']
[[plugins]]
repo = 'manicmaniac/coconut.vim'
on_ft = ['python']
[[plugins]]
repo = 'alfredodeza/pytest.vim'
on_ft = ['python']
[[plugins]]
repo = 'idanarye/vim-vebugger'
on_ft = ['python']
# scala
[[plugins]]
repo = 'derekwyatt/vim-scala'
on_ft = ['scala']
# typescript
[[plugins]]
repo = 'leafgarland/typescript-vim'
on_ft = ['typescript']
[[plugins]]
repo = 'Quramy/tsuquyomi'
on_ft = ['typescript']
# color and beauty
# [[plugins]]
# repo = 'tomasiser/vim-code-dark'
# [[plugins]]
# repo = 'romainl/Apprentice'
# [[plugins]]
# repo = 'chriskempson/base16-vim'
# [[plugins]]
# repo = 'fneu/breezy'
# [[plugins]]
# repo = 'romainl/Disciple'
# [[plugins]]
# repo = 'wimstefan/Lightning'
# [[plugins]]
# repo = 'NLKNguyen/papercolor-theme'
# [[plugins]]
# repo = 'flazz/vim-colorschemes'
[[plugins]]
repo = 'altercation/vim-colors-solarized'
# repo = 'reedes/vim-colors-pencil'
# [[plugins]]
# repo = 'whatyouhide/vim-gotham'
# [[plugins]]
# repo = 'noahfrederick/vim-hemisu'
# [[plugins]]
# repo = 'morhetz/gruvbox'
# unmanaged
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'L9'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'ScrollColor'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'bufonly'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'colorschemedegrade'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'exheres-syntax-20160116'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'fontzoom'
on_if = '!has("nvim")'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'fuzzyfinder'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'log'
#[[plugins]]
#repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
#rtp = 'paredit'
#[[plugins]]
#repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
#rtp = 'tslime'
[[plugins]]
repo = 'https://gogs.hasufell.de/hasufell/vim-unmanaged.git'
rtp = 'txtfmt'

185
vimrc
View File

@ -13,180 +13,31 @@ set cmdheight=1
set wildmenu
" set wildmode=longest,list,full
" vim-plug settings (Plugin declaration)
call plug#begin('~/.vim/plugged')
Plug 'mileszs/ack.vim'
Plug 'vim-scripts/cmdalias.vim'
Plug 'Raimondi/delimitMate'
Plug 'vim-scripts/genindent.vim'
" Plug 'sjl/gundo.vim'
" Plug 'idris-hackers/idris-vim'
"Plug 'yegappan/mru'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } |
\ Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' }
"Plug 'vim-scripts/promela.vim'
"Plug 'AndrewRadev/simple_bookmarks.vim'
"Plug 'Keithbsmiley/swift.vim'
" Plug 'majutsushi/tagbar'
"Plug 'ternjs/tern_for_vim'
Plug 'xolox/vim-easytags'
Plug 'xolox/vim-misc'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'Shougo/vimproc.vim', {'do' : 'make'}
Plug 'sjbach/lusty'
" Plug 'vim-airline/vim-airline'
" Plug 'vim-airline/vim-airline-themes'
Plug 'nixprime/cpsm', { 'do': 'PY3=ON ./install.sh' }
Plug 'liuchengxu/vista.vim'
Plug 'sbdchd/neoformat'
Plug 'AndrewRadev/bufferize.vim'
" Plug 'vimwiki/vimwiki'
Plug 'vmchale/dhall-vim'
Plug 'Shougo/echodoc.vim'
Plug 'tpope/vim-scriptease'
Plug 'Konfekt/FastFold'
" Plug 'lambdalisue/vim-fullscreen'
Plug 'editorconfig/editorconfig-vim'
" Plug 'iberianpig/tig-explorer.vim'
Plug 'hasufell/ghcup.vim'
Plug 'junegunn/vim-easy-align'
Plug 'dominikduda/vim_current_word'
" finder
Plug 'liuchengxu/vim-clap', { 'do': { -> clap#installer#force_download() } }
" scm
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-rhubarb'
Plug 'tommcdo/vim-fubitive'
Plug 'airblade/vim-gitgutter'
" local_vimrc
Plug 'LucHermitte/lh-vim-lib'
Plug 'LucHermitte/local_vimrc'
" completion
Plug 'Valloric/YouCompleteMe', { 'do': './install.py --clang-completer --go-completer --rust-completer --system-boost --system-libclang',
\ 'for': ['c', 'go', 'clojure'],
\ }
" deoplete for haskell
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins',
\ }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
" plugins
if &compatible
set nocompatible " Be iMproved
endif
" snippets
"Plug 'Shougo/neosnippet.vim'
"Plug 'honza/vim-snippets'
" Required:
set runtimepath+=/home/jule/.cache/dein/repos/github.com/Shougo/dein.vim
" LSP
" setting this per-language breaks "let g:LanguageClient_autoStart = 1",
" Use release branch (Recommend)
Plug 'autozimu/LanguageClient-neovim', {
\ 'branch': 'next',
\ 'do': 'bash ./install.sh'
\ }
let s:toml = '/home/jule/.vim/plugins.toml'
" Required:
if dein#load_state('/home/jule/.cache/dein')
call dein#begin('/home/jule/.cache/dein', ['/home/jule/.vim/vimrc', '/home/jule/.vim/plugins.toml'])
" linting/compilation
Plug 'w0rp/ale', {
\ 'do': 'bash -c \"cp -R ~/.vim/ale_linters .\"',
\ 'for': ['sh', 'vim'],
\ }
call dein#load_toml(s:toml)
" haskell
" if has("nvim")
" Plug 'parsonsmatt/intero-neovim'
" endif
" Plug 'eagletmt/ghcmod-vim', { 'for': 'haskell' }
" completion based on ghc-mod, not LSP
" Plug 'eagletmt/neco-ghc', { 'for': 'haskell' }
" Plug 'lukerandall/haskellmode-vim', { 'for': 'haskell' }
" Plug 'axelf4/vim-haskell'
Plug 'neovimhaskell/haskell-vim', { 'for': ['haskell', 'cabal']}
" Plug 'ucsd-progsys/liquid-types.vim', { 'for': 'haskell' }
Plug 'bitc/lushtags', {
\ 'do': 'bash -c \"stack install\"',
\ 'for': 'haskell',
\ }
" Plug 'timmytofu/vim-cabal-context', { 'for': 'haskell' }
" Plug 'itchyny/vim-haskell-indent', { 'for': 'haskell' }
" Plug 'dan-t/vim-hsimport', { 'for': 'haskell' }
Plug 'Twinside/vim-hoogle', { 'for': 'haskell' }
" Plug 'alx741/vim-hindent', { 'for': 'haskell' }
Plug 'alx741/vim-stylishask', { 'for': 'haskell' }
" Let dein manage dein
" Required:
call dein#add('/home/jule/.cache/dein/repos/github.com/Shougo/dein.vim')
Plug 'luochen1990/rainbow', { 'for': ['clojure', 'haskell', 'python'] }
" go
" Plug 'garyburd/go-explorer', { 'for': 'go' }
Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries', 'for': 'go' }
" rust
" Plug 'rhysd/rust-doc.vim', { 'for': 'rust' }
Plug 'rust-lang/rust.vim', { 'for': 'rust' }
" javascript
" Plug 'moll/vim-node', { 'for': 'javascript' }
Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
" python
Plug 'icedwater/vimpython', { 'for': 'python' }
" Plug 'zchee/deoplete-jedi', { 'for': 'python' }
" Plug 'davidhalter/jedi-vim', { 'for': 'python' }
Plug 'manicmaniac/coconut.vim'
Plug 'alfredodeza/pytest.vim'
Plug 'idanarye/vim-vebugger', { 'for': 'python' }
" scala
Plug 'derekwyatt/vim-scala', { 'for': 'scala' }
" typescript
Plug 'leafgarland/typescript-vim', { 'for': 'typescript' }
Plug 'Quramy/tsuquyomi', { 'for': 'typescript' }
" color and beauty
" Plug 'tomasiser/vim-code-dark'
" Plug 'romainl/Apprentice'
" Plug 'chriskempson/base16-vim'
" Plug 'fneu/breezy'
" Plug 'romainl/Disciple'
" Plug 'wimstefan/Lightning'
" Plug 'NLKNguyen/papercolor-theme'
" Plug 'flazz/vim-colorschemes'
Plug 'altercation/vim-colors-solarized'
" Plug 'reedes/vim-colors-pencil'
" Plug 'whatyouhide/vim-gotham'
if has('nvim')
Plug 'iCyMind/NeoSolarized'
endif
" Plug 'noahfrederick/vim-hemisu'
" Plug 'morhetz/gruvbox'
" unmanaged
Plug '~/.vim/unmanaged-vim-plug/bufonly'
Plug '~/.vim/unmanaged-vim-plug/colorschemedegrade'
Plug '~/.vim/unmanaged-vim-plug/fuzzyfinder'
Plug '~/.vim/unmanaged-vim-plug/L9'
Plug '~/.vim/unmanaged-vim-plug/log'
Plug '~/.vim/unmanaged-vim-plug/ScrollColor'
Plug '~/.vim/unmanaged-vim-plug/txtfmt'
Plug '~/.vim/unmanaged-vim-plug/exheres-syntax-20160115'
if !has('nvim')
Plug '~/.vim/unmanaged-vim-plug/fontzoom'
" Required:
call dein#end()
call dein#save_state()
endif
" Initialize plugin system
call plug#end()
" ===== further plugin initialization and default config =====
so ~/.vim/plugged/cmdalias.vim/plugin/cmdalias.vim
@ -216,6 +67,10 @@ call CmdAlias('LS', 'LanguageClientStart')
" global settings
if has('gui_running')
set guioptions -=T
" disable gvim tab
set guioptions-=e
set winaltkeys=no
set guiheadroom=0
else