Development environment

This page lists a few options to set up a productive development environment for working on Forgejo.


VSCodium is an open source version of the Visual Studio Code IDE. The Go integration for Visual Studio Code works with VSCodium and is a viable tool to work on Forgejo.

First, run cp -r contrib/ide/vscode .vscode to create new directory .vscode with the contents of folder contrib/ide/vscode at the root of the repository. Then, open the project directory in VSCodium.

You can now use Ctrl+Shift+B to build the gitea executable and F5 to run it in debug mode.

Tests can be run by clicking on the run test or debug test button above their declaration.

Go code is formatted automatically when saved.


Emacs has a Go mode that can likely be used to work on Forgejo’s code base. Do you know how to configure it properly? Why not document that here?


Vim has a Go plugin that can likely be used to work on Forgejo’s code base. Do you know how to configure it properly? Why not document that here?


Here’s a minimal example that configures gopls and golangci_lint_ls using the Lazy.nvim plugin manager.

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.uv.fs_stat(lazypath) then
		"--branch=stable", -- latest stable release

		branch = "0.1.x",
		dependencies = {
				build = "make",
				cond = vim.fn.executable("make") == 1,

vim.g.mapleader = " "
vim.g.maplocalleader = " "

local on_attach = function(client, bufno)
	-- depricated since neovim 0.10
	-- vim.api.nvim_buf_set_option(bufno, "omnifunc", "v:lua.vim.lsp.omnifunc")
	vim.api.nvim_set_option_value("omnifunc", "v:lua.vim.lsp.omnifunc", { buf = bufno })

	local ts = require("telescope.builtin")
	local opts = { buffer = bufno }

	vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float)
	vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
	vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts)
	vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts)
	vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
	vim.keymap.set("n", "gtd", vim.lsp.buf.type_definition, opts)
	vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts)
	vim.keymap.set("n", "gu", ts.lsp_references, opts)
	vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, opts)
	vim.keymap.set("n", "<leader>cl",, opts)
	vim.keymap.set("n", "<leader>r", vim.lsp.buf.rename, opts)
	vim.keymap.set("n", "<leader>f", function()
		vim.lsp.buf.format({ async = true })
	end, opts)

local capabilities = vim.lsp.protocol.make_client_capabilities()

	capabilities = capabilities,
	settings = {},
	on_attach = on_attach,

	capabilities = capabilities,
	settings = {},
	on_attach = on_attach,