Skip to content

Commit 460cb44

Browse files
committed
Adding support for GO language
1 parent 3338d39 commit 460cb44

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

init.lua

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
102102
vim.o.number = true
103103
-- You can also add relative line numbers, to help with jumping.
104104
-- Experiment for yourself to see if you like it!
105-
-- vim.o.relativenumber = true
105+
vim.o.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108108
vim.o.mouse = 'a'
@@ -672,7 +672,19 @@ require('lazy').setup({
672672
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
673673
local servers = {
674674
-- clangd = {},
675-
-- gopls = {},
675+
gopls = {
676+
cmd = { 'gopls' },
677+
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
678+
settings = {
679+
gopls = {
680+
completedUnimported = true,
681+
usePlaceholders = true,
682+
analyses = {
683+
unusedparams = true,
684+
},
685+
},
686+
},
687+
},
676688
-- pyright = {},
677689
-- rust_analyzer = {},
678690
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
@@ -944,7 +956,7 @@ require('lazy').setup({
944956
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
945957
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
946958
opts = {
947-
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
959+
ensure_installed = { 'bash', 'go', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
948960
-- Autoinstall languages that are not installed
949961
auto_install = true,
950962
highlight = {
@@ -973,11 +985,11 @@ require('lazy').setup({
973985
-- Here are some example plugins that I've included in the Kickstart repository.
974986
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
975987
--
976-
-- require 'kickstart.plugins.debug',
988+
require 'kickstart.plugins.debug',
977989
-- require 'kickstart.plugins.indent_line',
978990
-- require 'kickstart.plugins.lint',
979-
-- require 'kickstart.plugins.autopairs',
980-
-- require 'kickstart.plugins.neo-tree',
991+
require 'kickstart.plugins.autopairs',
992+
require 'kickstart.plugins.neo-tree',
981993
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
982994

983995
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`

lua/custom/plugins/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
-- I promise not to create any merge conflicts in this directory :)
33
--
44
-- See the kickstart.nvim README for more information
5-
return {}
5+
local M = {}
6+
M.plugins = 'custom.plagins'
7+
return M

lua/custom/plugins/plagins.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
local plugins = {
2+
{
3+
'williamboman/mason.nvim',
4+
opts = {
5+
ensure_installed = {
6+
'gopls',
7+
},
8+
},
9+
},
10+
}
11+
return plugins

0 commit comments

Comments
 (0)