summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mut/neovim/fnl/conf/pkgs.fnl2
-rw-r--r--mut/neovim/fnl/conf/pkgs/go.fnl35
-rw-r--r--mut/neovim/fnl/conf/pkgs/lint.fnl13
-rw-r--r--mut/neovim/fnl/conf/pkgs/luasnip.fnl6
-rw-r--r--profiles/core/neovim.nix1
5 files changed, 54 insertions, 3 deletions
diff --git a/mut/neovim/fnl/conf/pkgs.fnl b/mut/neovim/fnl/conf/pkgs.fnl
index 70e4805..832f336 100644
--- a/mut/neovim/fnl/conf/pkgs.fnl
+++ b/mut/neovim/fnl/conf/pkgs.fnl
@@ -7,5 +7,7 @@
(require :conf.pkgs.oil)
(require :conf.pkgs.lint)
(require :conf.pkgs.lualine)
+(require :conf.pkgs.go)
+(require :conf.pkgs.luasnip)
;; (require :conf.pkgs.lsp_lines)
;; (require :conf.pkgs.null-ls)
diff --git a/mut/neovim/fnl/conf/pkgs/go.fnl b/mut/neovim/fnl/conf/pkgs/go.fnl
new file mode 100644
index 0000000..6c287e1
--- /dev/null
+++ b/mut/neovim/fnl/conf/pkgs/go.fnl
@@ -0,0 +1,35 @@
+(local go (require :go))
+(go.setup
+ {
+ :goimports false
+ :fillstruct false
+ :gofmt false
+ :max_line_len nil
+ :tag_transform false
+ :test_dir false
+ :comment_placeholder "  "
+ :icons false
+ :verbose false
+ :log_path (.. (vim.fn.expand "$HOME") "/tmp/gonvim.log")
+ :lsp_cfg false
+ :lsp_gofumpt false
+ :lsp_on_attach nil
+ :lsp_keymaps false
+ :lsp_codelens false
+ :diagnostic false
+ :lsp_inlay_hints {:enable false}
+ :gopls_remote_auto false
+ :gocoverage_sign "█"
+ :sign_priority 7
+ :dap_debug false
+ :dap_debug_gui false
+ :dap_debug_keymap false
+ :dap_vt false
+ :textobjects false
+ :gopls_cmd nil
+ :build_tags ""
+ :test_runner "go"
+ :run_in_floaterm false
+ :luasnip true
+ :iferr_vertical_shift 4})
+
diff --git a/mut/neovim/fnl/conf/pkgs/lint.fnl b/mut/neovim/fnl/conf/pkgs/lint.fnl
index 1814025..3d92c8b 100644
--- a/mut/neovim/fnl/conf/pkgs/lint.fnl
+++ b/mut/neovim/fnl/conf/pkgs/lint.fnl
@@ -1,14 +1,21 @@
(local lint (require :lint))
+
+(fn executable? [program]
+ (fn []
+ (= 1 (vim.fn.executable program))))
+
(set
lint.linters_by_ft
- {:markdown [:vale]
- :python [:ruff]
+ {:markdown (if (executable? :vale) [:vale] [])
+ :python (if (executable? :ruff) [:ruff] [])
:sh [:shellcheck]})
+
(local conform (require :conform))
(conform.setup
{:formatters_by_ft
- {:python [:ruff_format :isort]}
+ {:python [:ruff_format :isort]
+ :go [:goimports]}
:format_on_save
{:timeout_ms 500
:lsp_fallback false}})
diff --git a/mut/neovim/fnl/conf/pkgs/luasnip.fnl b/mut/neovim/fnl/conf/pkgs/luasnip.fnl
new file mode 100644
index 0000000..221c4ea
--- /dev/null
+++ b/mut/neovim/fnl/conf/pkgs/luasnip.fnl
@@ -0,0 +1,6 @@
+(local ls (require :luasnip))
+
+(vim.keymap.set ["i"] "<C-K>" #(ls.expand) {:silent true})
+(vim.keymap.set ["i" "s"] "<C-L>" #(ls.jump 1) {:silent true})
+(vim.keymap.set ["i" "s"] "<C-J>" #(ls.jump -1) {:silent true})
+(vim.keymap.set ["i" "s"] "<C-E>" #(if (ls.choice_active) (ls.change_choice 1)) {:silent true})
diff --git a/profiles/core/neovim.nix b/profiles/core/neovim.nix
index b73986c..a6ccd63 100644
--- a/profiles/core/neovim.nix
+++ b/profiles/core/neovim.nix
@@ -65,6 +65,7 @@
gv-vim
zoxide-vim
obsidian-nvim
+ go-nvim
# Coding
fzf-lua