From eeebba1ce37cdff0b58be9695d9be3db1ea7d92b Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sat, 1 Jun 2024 17:43:52 -0500 Subject: [PATCH] vim lsp settings --- vim/ftplugin/python.vim | 2 +- vimrc | 70 ++++++++++++++++++++++++++++++++++------- 2 files changed, 60 insertions(+), 12 deletions(-) diff --git a/vim/ftplugin/python.vim b/vim/ftplugin/python.vim index 32ff22d..09764e5 100644 --- a/vim/ftplugin/python.vim +++ b/vim/ftplugin/python.vim @@ -1,4 +1,4 @@ set expandtab set shiftwidth=2 set tabstop=2 -set omnifunc=ale#completion#OmniFunc +" set omnifunc=ale#completion#OmniFunc diff --git a/vimrc b/vimrc index 56c05c7..fdc0953 100644 --- a/vimrc +++ b/vimrc @@ -39,6 +39,8 @@ call plug#begin() Plug 'jparise/vim-graphql' call plug#end() +packadd lsp + " enable the filetype plugin filetype plugin indent on " ---------------------------------------------------------------------------}}} @@ -215,7 +217,6 @@ if has("autocmd") autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags autocmd FileType php set omnifunc=phpcomplete#CompletePHP - autocmd FileType python set omnifunc=ale#completion#OmniFunc autocmd FileType css set omnifunc=csscomplete#CompleteCSS autocmd FileType rust set omnifunc=ale#completion#OmniFunc endif @@ -392,7 +393,6 @@ tnoremap :bnext! nnoremap :term ++curwin nnoremap :belo term - let g:terminal_ansi_colors = [ \ '#929292', \ '#e27373', @@ -473,17 +473,65 @@ let g:SuperTabClosePreviewOnPopupClose = 1 " ---------------------------------------------------------------------------}}} " lsp -----------------------------------------------------------------------{{{ +call LspOptionsSet(#{ + \ aleSupport: v:false, + \ autoComplete: v:false, + \ autoHighlight: v:false, + \ autoHighlightDiags: v:true, + \ autoPopulateDiags: v:false, + \ completionMatcher: 'case', + \ completionMatcherValue: 1, + \ diagSignErrorText: 'E>', + \ diagSignHintText: 'H>', + \ diagSignInfoText: 'I>', + \ diagSignWarningText: 'W>', + \ echoSignature: v:false, + \ hideDisabledCodeActions: v:false, + \ highlightDiagInline: v:true, + \ hoverInPreview: v:false, + \ ignoreMissingServer: v:false, + \ keepFocusInDiags: v:true, + \ keepFocusInReferences: v:true, + \ completionTextEdit: v:true, + \ diagVirtualTextAlign: 'above', + \ diagVirtualTextWrap: 'default', + \ noNewlineInCompletion: v:false, + \ omniComplete: v:null, + \ outlineOnRight: v:false, + \ outlineWinSize: 20, + \ semanticHighlight: v:true, + \ showDiagInBalloon: v:true, + \ showDiagInPopup: v:true, + \ showDiagOnStatusLine: v:false, + \ showDiagWithSign: v:true, + \ showDiagWithVirtualText: v:false, + \ showInlayHints: v:false, + \ showSignature: v:true, + \ snippetSupport: v:false, + \ ultisnipsSupport: v:false, + \ useBufferCompletion: v:false, + \ usePopupInCodeAction: v:false, + \ useQuickfixForLocations: v:false, + \ vsnipSupport: v:false, + \ bufferCompletionTimeout: 100, + \ customCompletionKinds: v:false, + \ completionKinds: {}, + \ filterCompletionDuplicates: v:false, + \ }) " this is not portable at all and I hate it and dunno how to fix it yet -" call LspAddServer([#{name: 'pyright', -" \ filetype: 'python', -" \ path: '/Users/jordan.orelli/.nix-profile/bin/pyright-langserver', -" \ args: ['--stdio'], -" \ workspaceConfig: #{ -" \ python: #{ -" \ pythonPath: '/usr/local/bin/python3' -" \ }} -" \ }]) +call LspAddServer([#{name: 'pyright', + \ filetype: 'python', + \ path: '/Users/jordan.orelli/.nix-profile/bin/pyright-langserver', + \ args: ['--stdio'], + \ workspaceConfig: #{ + \ python: #{ + \ pythonPath: '/usr/local/bin/python3' + \ }} + \ }]) +nmap :LspGotoDefinition +nmap :LspHover +nmap :LspDiagCurrent " ---------------------------------------------------------------------------}}} " ALE -----------------------------------------------------------------------{{{