Comments (12)
@Cyberlane did you set the lsp for go?
from thinkvim.
As I said, I'm new to go... so I have no idea what that is.
I have done brew install go
, set that environment variable and then tried to follow a tutorial for a simple app to go familiar with the language.
from thinkvim.
you should add the gopls into the coc-settings.json
like
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": ["go"]
}
}
then you need install the gopls
from thinkvim.
more about the gopls you should check this link https://github.com/golang/go/wiki/gopls
from thinkvim.
Ah, I assumed all of the coc-settings.json
were pre-configured for both Go and JS :)
I will add that now, and install gopls
and see how it goes...
from thinkvim.
maybe you should to know coc.and how to work, the coc-settings.json
like vscode settings.json. you can add any language lsp into the coc-settings.json
like c go c++ and so on .the js server is coc-tsserver which coc provide it .
this is coc github https://github.com/neoclide/coc.nvim
check this link about lsp. what is lsp
and this my coc-settings.json .
{
"suggest.triggerAfterInsertEnter": false,
"suggest.timeout": 500,
"suggest.noselect": false,
"suggest.detailField":"abbr",
"suggest.snippetIndicator": "🌟",
"suggest.triggerCompletionWait": 100,
"suggest.echodocSupport": true,
"suggest.completionItemKindLabels": {
"keyword": "\uf1de",
"variable": "\ue79b",
"value": "\uf89f",
"operator": "\u03a8",
"function": "\u2A15",
"reference": "\ufa46",
"constant": "\uf8fe",
"method": "\uf09a",
"struct": "\ufb44",
"class": "\uf0e8",
"interface": "\uf417",
"text": "\u2663",
"enum": "\uf435",
"enumMember": "\uf02b",
"module": "\uf530",
"color": "\ue22b",
"property": "\ue624",
"field": "\uf6a6",
"unit": "\uf475",
"event": "\ufacd",
"file": "\uf723",
"folder": "\uf114",
"snippet": "\ue60b",
"typeParameter": "\uf728",
"default": "\uf29c"
},
//diagnostic
"diagnostic.signOffset": 9999999,
"diagnostic.errorSign": "●",
"diagnostic.warningSign": "●",
"diagnostic.displayByAle": false,
"diagnostic.refreshOnInsertMode": true,
//git
"git.enableGutters": true,
"git.addGlameToBufferVar": true,
"git.addGlameToVirtualText": true,
"git.virtualTextPrefix": " ❯❯❯ ",
"git.addedSign.hlGroup": "GitGutterAdd",
"git.changedSign.hlGroup": "GitGutterChange",
"git.removedSign.hlGroup": "GitGutterDelete",
"git.topRemovedSign.hlGroup": "GitGutterDelete",
"git.changeRemovedSign.hlGroup": "GitGutterChangeDelete",
"git.addedSign.text":"▎",
"git.changedSign.text":"▎",
"git.removedSign.text":"▏",
"git.topRemovedSign.text": "▔",
"git.changeRemovedSign.text": "▋",
//Snippet
"coc.preferences.snippetStatusText": "Ⓢ ",
//tslint
"tslint.autoFixOnSave": true,
//prettier
"coc.preferences.formatOnSaveFiletypes": ["css","markdown"],
"prettier.statusItemText": "ⓟ ",
"prettier.eslintIntegration": true,
"prettier.tslintIntegration": true,
"prettier.stylelintIntegration": true,
//emmet
"emmet.includeLanguages": {"vue-html": "html", "javascript": "javascriptreact"},
//python
"python.autoComplete.addBrackets": true,
// eslint
"eslint.filetypes": ["javascript", "javascript.jsx", "javascriptreact"],
"eslint.autoFix": true,
"eslint.autoFixOnSave": true,
//golang
"languageserver": {
"golang": {
"command": "gopls",
"rootPatterns": ["go.mod", ".vim/", ".git/", ".hg/"],
"filetypes": [
"go"
]
},
"dockerfile": {
"command": "docker-langserver",
"filetypes": [
"dockerfile"
],
"args": [
"--stdio"
]
},
"efm": {
"command": "efm-langserver",
"args": [],
"filetypes": [
"vim",
"markdown"
]
}
}
}
from thinkvim.
I briefly started to use CoC about a month ago, prior to that I was using:
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
and prior to that I was using YouCompleteMe
, but it was so slow, so I stopped using it.
I do understand what a language server is in the context of VIM (although, I honestly am not used to seeing it abbreviated to lsp
), so I had assumed you meant it was something specific to Golang :)
It's up and working now, the only errors I get are from gopls
, thanks for the help! :)
from thinkvim.
vim-jsx-imporve
better than that plugins. i have add some feature into this plugin. gopls has som problem .its not stable . gopls has developing.
from thinkvim.
@taigacute I just noticed that when I do indent in Go files, it does tabs instead of spaces. If I do indent in a JS file, it does spaces just fine.
Is there a per-language setting I am missing? I assumed the following were enough:
set tabstop=2
set shiftwidth=2
set expandtab
from thinkvim.
cause go code indented with tabs . it not support space. i have set https://github.com/taigacute/ThinkVim/blob/master/after/ftplugin/go.vim
from thinkvim.
Ah... I assumed it would be like C and not care so much. Thanks for the info!
from thinkvim.
i use this plugin for https://github.com/Yggdroot/indentLine for indented. but this plugin doesnt support the code with tabs.
from thinkvim.
Related Issues (20)
- [Feature Request] Enhance the keymappings and colorscheme config HOT 51
- ThinkVim installation bug. HOT 6
- :bd closes defx HOT 9
- Can't get select default theme selection when execute install.sh HOT 2
- Show definition and references HOT 2
- glutentags /usr/local HOT 4
- Defx file rename & buffer HOT 1
- What is the `generator` binary you are downloading and executing during install? HOT 1
- coc-Rls not found ! HOT 4
- 行59: if &runtimepath !~# $VIM_PATH HOT 2
- coc-marketplace使用后光标消失 HOT 2
- local mapping not getting sourced HOT 1
- If select NONE theme, will get error.
- The 'hardcoreplayers' user is missed.
- go-nvim', 'vim-buffet', 'rust.vim', 'vim-scala', 'sql.vim' 这些插件都404了 HOT 1
- 編輯代碼補全是python3,界面下邊欄也是顯示python3,但是quckrun執行卻是使用python2,請問在哪裏設置成默認python3執行 HOT 1
- Load Plugins keybinds error:Vim(let):E716: Key not present in Dictionary: b.b = 'Buffer List'
- Failed building wheel for pynvim
- leader + i : can not open the outline of cpp file ,just can open the outline of like yaml and python files
- ThinkVim installation failed!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thinkvim.