add go support
This commit is contained in:
8
flake.lock
generated
8
flake.lock
generated
@@ -77,16 +77,16 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1686059680,
|
"lastModified": 1687193290,
|
||||||
"narHash": "sha256-sp0WlCIeVczzB0G8f8iyRg3IYW7KG31mI66z7HIZwrI=",
|
"narHash": "sha256-3bknptEbd9LLlCiFRFkMwmciHB+QXET41gH/RX+Nr1A=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a558f7ac29f50c4b937fb5c102f587678ae1c9fb",
|
"rev": "ad157fe26e74211e7dde0456cb3fd9ab78b6e552",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "release-23.05",
|
"ref": "nixos-23.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
description = "NVIM Configuration";
|
description = "NVIM Configuration";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/release-23.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
groovyls.url = "github:miknikif/groovyls";
|
groovyls.url = "github:miknikif/groovyls";
|
||||||
groovyls.inputs.nixpkgs.follows = "nixpkgs";
|
groovyls.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -65,6 +65,10 @@
|
|||||||
jdk11 # for groovy
|
jdk11 # for groovy
|
||||||
groovy
|
groovy
|
||||||
pkgs.groovyls # groovy lsp
|
pkgs.groovyls # groovy lsp
|
||||||
|
go # go itself
|
||||||
|
golangci-lint # go lint
|
||||||
|
golangci-lint-langserver # go lint
|
||||||
|
gopls # google go lsp
|
||||||
];
|
];
|
||||||
neovim-augmented = recursiveMerge [
|
neovim-augmented = recursiveMerge [
|
||||||
pkgs.neovim-unwrapped
|
pkgs.neovim-unwrapped
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ M.config = function()
|
|||||||
callback = function() require('pwnvim.filetypes').groovy() end,
|
callback = function() require('pwnvim.filetypes').groovy() end,
|
||||||
group = filetypes
|
group = filetypes
|
||||||
})
|
})
|
||||||
|
autocmd("FileType",
|
||||||
|
{
|
||||||
|
pattern = { "go", "gomod", "gowork", "gotmpl" },
|
||||||
|
callback = function() require('pwnvim.filetypes').go() end,
|
||||||
|
group = filetypes
|
||||||
|
})
|
||||||
autocmd("FileType",
|
autocmd("FileType",
|
||||||
{
|
{
|
||||||
pattern = { "md", "markdown", "vimwiki" },
|
pattern = { "md", "markdown", "vimwiki" },
|
||||||
@@ -103,6 +109,11 @@ M.groovy = function()
|
|||||||
require('pwnvim.options').fourspaceindent()
|
require('pwnvim.options').fourspaceindent()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
M.go = function()
|
||||||
|
require('pwnvim.options').programming()
|
||||||
|
require('pwnvim.options').fourspaceindent()
|
||||||
|
end
|
||||||
|
|
||||||
M.page = function()
|
M.page = function()
|
||||||
-- disable status bar -- handled in config
|
-- disable status bar -- handled in config
|
||||||
-- map space to ctrl-f
|
-- map space to ctrl-f
|
||||||
|
|||||||
@@ -352,10 +352,12 @@ M.diagnostics = function(groovyls_cmd, groovy_lsp_settings)
|
|||||||
},
|
},
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
}
|
||||||
lspconfig.terraformls.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
lspconfig.terraformls.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
||||||
lspconfig.tflint.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
lspconfig.tflint.setup { on_attach = attached, capabilities = capabilities } -- terraform lsp
|
||||||
lspconfig.groovyls.setup { on_attach = attached, capabilities = capabilities, cmd = groovyls_cmd, settings =
|
lspconfig.groovyls.setup { on_attach = attached, capabilities = capabilities, cmd = groovyls_cmd, settings =
|
||||||
groovy_lsp_settings } -- groovy lsp
|
groovy_lsp_settings } -- groovy lsp
|
||||||
|
lspconfig.golangci_lint_ls.setup { capabilities = capabilities, on_attach = attached } -- go support
|
||||||
|
lspconfig.gopls.setup { capabilities = capabilities, on_attach = attached } -- go support
|
||||||
|
|
||||||
require 'lspsaga'.init_lsp_saga({
|
require 'lspsaga'.init_lsp_saga({
|
||||||
use_saga_diagnostic_sign = not SimpleUI,
|
use_saga_diagnostic_sign = not SimpleUI,
|
||||||
|
|||||||
Reference in New Issue
Block a user