[mirror] Make your go dev experience better github.com/olexsmir/gopher.nvim
neovim golang
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

at 57b5dbf62e7d01d4eb9597f6df4ce11b463c97be 95 lines 2.7 kB view raw
1---@toc_entry Configuration 2---@tag gopher.nvim-config 3---@text config it is the place where you can configure the plugin. 4--- also this is optional is you're ok with default settings. 5--- You can look at default options |gopher.nvim-config-defaults| 6 7---@type gopher.Config 8---@private 9local config = {} 10 11---@tag gopher.nvim-config.ConfigGoTagTransform 12---@text Possible values for |gopher.Config|.gotag.transform: 13--- 14---@private 15---@alias gopher.ConfigGoTagTransform 16---| "snakecase" "GopherUser" -> "gopher_user" 17---| "camelcase" "GopherUser" -> "gopherUser" 18---| "lispcase" "GopherUser" -> "gopher-user" 19---| "pascalcase" "GopherUser" -> "GopherUser" 20---| "titlecase" "GopherUser" -> "Gopher User" 21---| "keep" keeps the original field name 22 23--minidoc_replace_start { 24 25---@tag gopher.nvim-config-defaults 26---@eval return MiniDoc.afterlines_to_code(MiniDoc.current.eval_section) 27--- 28---@class gopher.Config 29local default_config = { 30 --minidoc_replace_end 31 32 -- log level, you might consider using DEBUG or TRACE for debugging the plugin 33 ---@type number 34 log_level = vim.log.levels.INFO, 35 36 -- timeout for running commands 37 ---@type number 38 timeout = 2000, 39 40 -- user specified paths to binaries 41 ---@class gopher.ConfigCommand 42 commands = { 43 go = "go", 44 gomodifytags = "gomodifytags", 45 gotests = "gotests", 46 impl = "impl", 47 iferr = "iferr", 48 dlv = "dlv", 49 }, 50 ---@class gopher.ConfigGotests 51 gotests = { 52 -- gotests doesn't have template named "default" so this plugin uses "default" to set the default template 53 template = "default", 54 -- path to a directory containing custom test code templates 55 ---@type string|nil 56 template_dir = nil, 57 -- switch table tests from using slice to map (with test name for the key) 58 -- works only with gotests installed from develop branch 59 named = false, 60 }, 61 ---@class gopher.ConfigGoTag 62 gotag = { 63 ---@type gopher.ConfigGoTagTransform 64 transform = "snakecase", 65 66 -- default tags to add to struct fields 67 default_tag = "json", 68 }, 69} 70--minidoc_afterlines_end 71 72---@type gopher.Config 73---@private 74local _config = default_config 75 76-- I am kinda secret so don't tell anyone about me even dont use me 77-- 78-- if you don't believe me that i am secret see 79-- the line below it says @private 80---@private 81_config.___plugin_name = "gopher.nvim" ---@diagnostic disable-line: inject-field 82 83---@param user_config? gopher.Config 84---@private 85function config.setup(user_config) 86 _config = vim.tbl_deep_extend("force", default_config, user_config or {}) 87end 88 89setmetatable(config, { 90 __index = function(_, key) 91 return _config[key] 92 end, 93}) 94 95return config