From 7020523a193b756fbd1e49aefbd8d23718e4a913 Mon Sep 17 00:00:00 2001 From: Hiroki Sakuraba Date: Mon, 10 Jul 2023 12:08:08 +0900 Subject: [PATCH 1/2] Update --- home/features/git.nix | 2 ++ home/features/neovim/lua/plugins/coding.lua | 5 +++++ home/features/neovim/lua/plugins/editor.lua | 2 +- .../neovim/lua/plugins/treesitter.lua | 22 +++++++++++-------- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/home/features/git.nix b/home/features/git.nix index c451780c..387fddf5 100644 --- a/home/features/git.nix +++ b/home/features/git.nix @@ -6,6 +6,8 @@ userName = "Hiroki Sakuraba"; extraConfig = { + credential."https://github.com".helper = "!gh auth git-credential"; + core = { editor = "nvim"; diff --git a/home/features/neovim/lua/plugins/coding.lua b/home/features/neovim/lua/plugins/coding.lua index cf1cfb7e..2db2822e 100644 --- a/home/features/neovim/lua/plugins/coding.lua +++ b/home/features/neovim/lua/plugins/coding.lua @@ -242,4 +242,9 @@ return { }, }, }, + { + "NeogitOrg/neogit", + cmd = "Neogit", + dependencies = "nvim-lua/plenary.nvim", + }, } diff --git a/home/features/neovim/lua/plugins/editor.lua b/home/features/neovim/lua/plugins/editor.lua index 8f2763e8..306ba4d6 100644 --- a/home/features/neovim/lua/plugins/editor.lua +++ b/home/features/neovim/lua/plugins/editor.lua @@ -29,7 +29,7 @@ return { }, { "lewis6991/gitsigns.nvim", - event = "BufReadPre", + event = "VeryLazy", config = true, }, { diff --git a/home/features/neovim/lua/plugins/treesitter.lua b/home/features/neovim/lua/plugins/treesitter.lua index ec568ead..698da089 100644 --- a/home/features/neovim/lua/plugins/treesitter.lua +++ b/home/features/neovim/lua/plugins/treesitter.lua @@ -2,15 +2,8 @@ return { "nvim-treesitter/nvim-treesitter", version = false, build = ":TSUpdate", - event = "BufReadPost", - dependencies = { - "nvim-treesitter/nvim-treesitter-context", - config = function() - require("treesitter-context").setup({ - enable = true, - }) - end, - }, + event = "VeryLazy", + dependencies = {}, opts = { highlight = { enable = true }, indent = { enable = true }, @@ -74,4 +67,15 @@ return { desc = "Decremental selection for node", }, }, + { + "nvim-treesitter/nvim-treesitter-context", + name = "treesitter-context", + event = "VeryLazy", + dependencies = { + "nvim-treesitter/nvim-treesitter", + }, + opts = { + enable = true, + }, + }, } From 4754ef1a5fe5fcbbf1e0b7b39ef5cfbbaeffdb75 Mon Sep 17 00:00:00 2001 From: Hiroki Sakuraba Date: Mon, 10 Jul 2023 17:45:52 +0900 Subject: [PATCH 2/2] Update --- home/features/cli.nix | 1 + home/features/neovim/lua/plugins/lsp.lua | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/home/features/cli.nix b/home/features/cli.nix index 4637fea9..16280aa4 100644 --- a/home/features/cli.nix +++ b/home/features/cli.nix @@ -66,6 +66,7 @@ outputs.packages.${pkgs.system}.devenv nil gobang + efm-langserver ]; }; diff --git a/home/features/neovim/lua/plugins/lsp.lua b/home/features/neovim/lua/plugins/lsp.lua index eeea512b..49b412cc 100644 --- a/home/features/neovim/lua/plugins/lsp.lua +++ b/home/features/neovim/lua/plugins/lsp.lua @@ -23,6 +23,17 @@ return { opts = function() return { servers = { + efm = { + init_options = { documentFormatting = true }, + settings = { + rootMarkers = { ".git/" }, + languages = { + lua = { + { formatCommand = "stylua -", formatStdin = true }, + }, + }, + }, + }, bashls = {}, bufls = {}, clojure_lsp = {}, @@ -153,7 +164,6 @@ return { null_ls.setup({ -- on_attach = require("lsp-format").on_attach, sources = { - null_ls.builtins.formatting.stylua, null_ls.builtins.formatting.alejandra, null_ls.builtins.formatting.buildifier, null_ls.builtins.formatting.cljstyle,