]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Start example code at column 1 in README
authorAndreas Louv <andreas@louv.dk>
Sun, 2 Apr 2023 22:12:31 +0000 (00:12 +0200)
committerAndreas Louv <andreas@louv.dk>
Sun, 2 Apr 2023 22:21:35 +0000 (00:21 +0200)
README.md

index 728d046170c3893f7f67e7b0299660692138e1f1..d5d428a7d61bb490bffcff151abb45031403970b 100644 (file)
--- a/README.md
+++ b/README.md
@@ -49,66 +49,66 @@ To use the plugin features with a particular file type(s), you need to first reg
 
 To register a LSP server, add the following lines to your .vimrc file (use only the LSP servers that you need from the below list).  If you used [vim-plug](https://github.com/junegunn/vim-plug) to install the LSP plugin, the steps are described later in this section.
 ```viml
-   function! TypeScriptCustomNotificationHandler(lspserver, reply) abort
-     echom printf("TypeScript Version = %s", a:reply.params.version)
-   endfunction
-   let lspServers = [
-               \     #{
-               \        filetype: ['c', 'cpp'],
-               \        path: '/usr/local/bin/clangd',
-               \        args: ['--background-index']
-               \      },
-               \     #{
-               \        filetype: ['javascript', 'typescript'],
-               \        path: '/usr/local/bin/typescript-language-server',
-               \        args: ['--stdio'],
-               \        customNotificationHandlers: {
-               \          '$/typescriptVersion': function('TypeScriptCustomNotificationHandler')
-               \        }
-               \      },
-               \     #{
-               \        filetype: 'sh',
-               \        path: '/usr/local/bin/bash-language-server',
-               \        args: ['start']
-               \      },
-               \     #{
-               \        filetype: 'vim',
-               \        path: '/usr/local/bin/vim-language-server',
-               \        args: ['--stdio']
-               \      },
-               \     #{
-               \        filetype: ['go', 'gomod'],
-               \        path: '/usr/local/bin/gopls',
-               \        args: ['serve'],
-                \        syncInit: v:true
-               \      },
-               \     #{
-               \        filetype: ['rust'],
-               \        path: '/usr/local/bin/rust-analyzer',
-               \        args: [],
-                \        syncInit: v:true
-               \      },
-               \     #{
-               \        filetype: ['python'],
-               \        path: '/usr/local/bin/pyls',
-               \        args: []
-               \      },
-               \     #{
-               \        filetype: ['fortran'],
-               \        path: '/usr/local/bin/fortls',
-               \        args: ['--nthreads=1', '--use_signature_help', '--hover_signature']
-               \      },
-               \     #{
-               \        filetype: ['php'],
-               \        path: '/usr/local/bin/intelephense',
-               \        args: ['--stdio'],
-               \        syncInit: v:true,
-               \        initializationOptions: #{
-               \          licenceKey: 'absolute path to file with key or key itself'
-               \        }
-               \      }
-               \   ]
-   call LspAddServer(lspServers)
+function! TypeScriptCustomNotificationHandler(lspserver, reply) abort
+       echom printf("TypeScript Version = %s", a:reply.params.version)
+endfunction
+let lspServers = [
+       \     #{
+       \        filetype: ['c', 'cpp'],
+       \        path: '/usr/local/bin/clangd',
+       \        args: ['--background-index']
+       \      },
+       \     #{
+       \        filetype: ['javascript', 'typescript'],
+       \        path: '/usr/local/bin/typescript-language-server',
+       \        args: ['--stdio'],
+       \        customNotificationHandlers: {
+       \          '$/typescriptVersion': function('TypeScriptCustomNotificationHandler')
+       \        }
+       \      },
+       \     #{
+       \        filetype: 'sh',
+       \        path: '/usr/local/bin/bash-language-server',
+       \        args: ['start']
+       \      },
+       \     #{
+       \        filetype: 'vim',
+       \        path: '/usr/local/bin/vim-language-server',
+       \        args: ['--stdio']
+       \      },
+       \     #{
+       \        filetype: ['go', 'gomod'],
+       \        path: '/usr/local/bin/gopls',
+       \        args: ['serve'],
+       \        syncInit: v:true
+       \      },
+       \     #{
+       \        filetype: ['rust'],
+       \        path: '/usr/local/bin/rust-analyzer',
+       \        args: [],
+       \        syncInit: v:true
+       \      },
+       \     #{
+       \        filetype: ['python'],
+       \        path: '/usr/local/bin/pyls',
+       \        args: []
+       \      },
+       \     #{
+       \        filetype: ['fortran'],
+       \        path: '/usr/local/bin/fortls',
+       \        args: ['--nthreads=1', '--use_signature_help', '--hover_signature']
+       \      },
+       \     #{
+       \        filetype: ['php'],
+       \        path: '/usr/local/bin/intelephense',
+       \        args: ['--stdio'],
+       \        syncInit: v:true,
+       \        initializationOptions: #{
+       \          licenceKey: 'absolute path to file with key or key itself'
+       \        }
+       \      }
+       \   ]
+call LspAddServer(lspServers)
 ```
 
 The above lines add the LSP servers for C, C++, Javascript, Typescript, Shell script, Vim script, Go, Rust, Python, Fortran and PHP file types.  In addition to the above listed file types, this plugin also supports other file types.
@@ -127,17 +127,17 @@ The LSP servers are added using the LspAddServer() function. This function accep
 
 If you used [vim-plug](https://github.com/junegunn/vim-plug) to install the LSP plugin, then you need to use the VimEnter autocmd to initialize the LSP server and to set the LSP server options.  For example:
 ```viml
-    let lspServers = [
-               \     #{
-               \        filetype: ['c', 'cpp'],
-               \        path: '/usr/local/bin/clangd',
-               \        args: ['--background-index']
-               \      }
-               \   ]
-    autocmd VimEnter * call LspAddServer(lspServers)
-
-    let lspOpts = {'autoHighlightDiags': v:true}
-    autocmd VimEnter * call LspOptionsSet(lspOpts)
+let lspServers = [
+       \     #{
+       \        filetype: ['c', 'cpp'],
+       \        path: '/usr/local/bin/clangd',
+       \        args: ['--background-index']
+       \      }
+       \   ]
+autocmd VimEnter * call LspAddServer(lspServers)
+
+let lspOpts = {'autoHighlightDiags': v:true}
+autocmd VimEnter * call LspOptionsSet(lspOpts)
 ```
 
 ## Supported Commands