From 489be2d4d47180b47d7b078552ce3e99977cd104 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Fri, 16 Aug 2024 10:21:14 +0200 Subject: feat: Sync --- Makefile | 14 ++++++++++++++ init.lua | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 Makefile create mode 100644 init.lua diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3f18e25 --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +PREFIX?=$(HOME)/.config/nvim +FENNEL?=fennel +SOURCES := $(shell find . -name '*.lua') + +install: + for name in $(SOURCES); do\ + install -m644 $${name} $(PREFIX)/$${name}; \ + done + +format: + mkdir -p $(PREFIX)/lua/gabrielgio/ + for name in $(SOURCES); do\ + lua-format -i $${name}; \ + done diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..46b308d --- /dev/null +++ b/init.lua @@ -0,0 +1,53 @@ +-- Clone 'mini.nvim' manually in a way that it gets managed by 'mini.deps' +local path_package = vim.fn.stdpath('data') .. '/site/' +local mini_path = path_package .. 'pack/deps/start/mini.nvim' +if not vim.loop.fs_stat(mini_path) then + vim.cmd('echo "Installing `mini.nvim`" | redraw') + local clone_cmd = { + 'git', 'clone', '--filter=blob:none', + 'https://github.com/echasnovski/mini.nvim', mini_path + } + vim.fn.system(clone_cmd) + vim.cmd('packadd mini.nvim | helptags ALL') + vim.cmd('echo "Installed `mini.nvim`" | redraw') +end + + +local mini_deps = require('mini.deps') +mini_deps.setup({ path = { package = path_package } }) +local add = mini_deps.add + +-- deps +add("echasnovski/mini.nvim") -- provide many things +add("neovim/nvim-lspconfig") -- lsp support +add({ + source = "nvim-treesitter/nvim-treesitter", + hooks = { post_checkout = function() vim.cmd('TSUpdate') end }, +}) + +-- misc +require("mini.statusline").setup() + +-- treesitter +local tree_sitter = require("nvim-treesitter.configs") + +tree_sitter.setup({ + ensure_installed = {"go"}, + highlight = {enable = true} +}) + +-- completion +require("mini.completion").setup() + +local lsp_config = require("lspconfig") + +lsp_config.gopls.setup({ + capabilities = capabilities, + cmd_env = {GOFLAGS = "-tags=unit,integration,e2e"}, + on_attach = on_attach +}) + + + + + -- cgit v1.2.3