systemd,vimrc: add,use gopls daemon
This commit is contained in:
parent
3db9f3b83d
commit
6f75f4e339
31
.config/systemd/user/gopls.service
Normal file
31
.config/systemd/user/gopls.service
Normal file
@ -0,0 +1,31 @@
|
||||
[Unit]
|
||||
Description = Go language server.
|
||||
|
||||
[Service]
|
||||
ExecStartPre=bash -c "rm -v -f /tmp/.gopls-daemon.sock || true"
|
||||
ExecStart=%h/utils/go/bin/gopls -listen="unix;/tmp/.gopls-daemon.sock"
|
||||
ExecStopPost=bash -c "rm -v -f /tmp/.gopls-daemon.sock || true"
|
||||
; -remote.listen.timeout
|
||||
Restart=on-failure
|
||||
RestartSec=1m
|
||||
|
||||
SystemCallFilter=~@reboot @obsolete
|
||||
|
||||
ProtectProc=invisible
|
||||
ProcSubset=pid
|
||||
ProtectHome=true
|
||||
|
||||
RestrictNamespaces=true
|
||||
|
||||
NoNewPrivileges=yes
|
||||
ProtectSystem=strict
|
||||
DevicePolicy=closed
|
||||
LockPersonality=true
|
||||
MemoryDenyWriteExecute=true
|
||||
RestrictAddressFamilies=AF_UNIX
|
||||
RestrictRealtime=true
|
||||
RestrictSUIDSGID=true
|
||||
SystemCallArchitectures=native
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
@ -498,6 +498,8 @@ let g:go_fmt_command='gopls'
|
||||
let g:go_fmt_autosave = 1
|
||||
" go install mvdan.cc/gofumpt@latest
|
||||
let g:go_gopls_gofumpt=1
|
||||
" let lsp handle connecting to gopls
|
||||
let g:go_gopls_enabled = 0
|
||||
|
||||
augroup vimgo
|
||||
au!
|
||||
@ -681,7 +683,7 @@ if executable('gopls')
|
||||
autocmd!
|
||||
autocmd User lsp_setup call lsp#register_server({
|
||||
\ 'name': 'gopls',
|
||||
\ 'cmd': ['gopls'],
|
||||
\ 'cmd': ['gopls', '-remote=unix;/tmp/.gopls-daemon.sock'],
|
||||
\ 'allowlist': ['go', 'gomod', 'gosum','gotexttmpl','gohtmltmpl'],
|
||||
\ 'gofumpt': 'true',
|
||||
\ })
|
||||
|
Loading…
Reference in New Issue
Block a user