From 6a1506671f1cae0f519f918b4599213306231546 Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Mon, 19 Aug 2024 20:05:49 +0700 Subject: [PATCH] neovim: update readme --- README.md | 41 +++++++++++++++++++++++++++++++++++++- lazy-lock.json | 2 ++ lua/config/lazy.lua | 1 + lua/plugins/lsp-lazy.lua | 4 +++- lua/plugins/markdown.lua | 41 ++++++++++++++++++++++++++++++++------ lua/plugins/toggleterm.lua | 22 -------------------- 6 files changed, 81 insertions(+), 30 deletions(-) delete mode 100644 lua/plugins/toggleterm.lua diff --git a/README.md b/README.md index b4c3968..6e663a2 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,41 @@ -# nvim +# Neovim + Neovim Configuration + +![Screenshot] + +This repository contains my Neovim configuration. + +This Neovim configuration stay close to my [NixOS config] to keep up the dependencies used. + +## Features (Configured for) + +### Basic + +- Syntax Highlighting via [Treesitter] +- Autocompletion and Git integration in the number column. + +![Auto-Completion] + +- LSP Integration + +![Hover Window] + +### Golang + +- Auto detect implementation by [Gomplements] plugin. + +![Gomplements-Pic] + +- Generate stub implementation by searching the definition. + +![Impl-Gif] + +[NixOS config]: https://git.tigor.web.id/tigor/NixOS +[Treesitter]: https://github.com/nvim-treesitter/nvim-treesitter +[Hover Window]: https://public.tigor.web.id/git/images/neovim/hover.png +[Screenshot]: https://public.tigor.web.id/git/images/neovim/screenshot.png +[Auto-Completion]: https://public.tigor.web.id/git/images/neovim/autocomplete.png +[Gomplements]: https://github.com/maxandron/goplements.nvim +[Gomplements-Pic]: https://public.tigor.web.id/git/images/neovim/gomplements.png +[Impl-Gif]: https://public.tigor.web.id/git/images/neovim/impl.gif diff --git a/lazy-lock.json b/lazy-lock.json index 439e078..2f1a528 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -48,6 +48,7 @@ "mini.icons": { "branch": "main", "commit": "fe63fe080e76d80713557e5f0c65bc15b14b152d" }, "mini.nvim": { "branch": "main", "commit": "7c00ea1a6b35332746e1a2fa768e26c5fa9c3589" }, "mini.pairs": { "branch": "main", "commit": "927d19cbdd0e752ab1c7eed87072e71d2cd6ff51" }, + "mini.surround": { "branch": "main", "commit": "d8913ed23be0a1a4585ae34414821cc343a46174" }, "neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" }, "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-golang": { "branch": "main", "commit": "cfaf82eeb198651dffabc6cf17b019a117147957" }, @@ -72,6 +73,7 @@ "nvim-treesitter-textobjects": { "branch": "master", "commit": "ca93cb2c34b67ab22d01976fc90bc95627a3317f" }, "nvim-ts-autotag": { "branch": "main", "commit": "dc5e1687ab76ee02e0f11c5ce137f530b36e98b3" }, "one-small-step-for-vimkind": { "branch": "main", "commit": "0f0d5bc67786c36edc2cb6fb5faa5c09dd1a6e10" }, + "peek.nvim": { "branch": "master", "commit": "5820d937d5414baea5f586dc2a3d912a74636e5b" }, "persistence.nvim": { "branch": "main", "commit": "f6aad7dde7fcf54148ccfc5f622c6d5badd0cc3d" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 8413f8a..9fd994d 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -16,6 +16,7 @@ require("lazy").setup { { import = "lazyvim.plugins.extras.coding.copilot" }, { import = "lazyvim.plugins.extras.coding.yanky" }, { import = "lazyvim.plugins.extras.coding.luasnip" }, + { import = "lazyvim.plugins.extras.coding.mini-surround" }, { import = "lazyvim.plugins.extras.formatting.prettier" }, { import = "lazyvim.plugins.extras.dap.core" }, diff --git a/lua/plugins/lsp-lazy.lua b/lua/plugins/lsp-lazy.lua index c419356..050b886 100644 --- a/lua/plugins/lsp-lazy.lua +++ b/lua/plugins/lsp-lazy.lua @@ -5,9 +5,10 @@ return { prefer_local = true, excluded_servers = { "gopls", -- gopls likes to be double attached if enabled here. - "postgres_lsp", }, preferred_servers = { + gitcommit = {}, + sql = {}, nix = { "nil_ls", }, @@ -15,6 +16,7 @@ return { "buf-language-server", }, sh = {}, + markdown = {}, }, }, -- enabled = false, diff --git a/lua/plugins/markdown.lua b/lua/plugins/markdown.lua index b7416e1..19171d1 100644 --- a/lua/plugins/markdown.lua +++ b/lua/plugins/markdown.lua @@ -1,8 +1,37 @@ return { - "MeanderingProgrammer/markdown.nvim", - name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim - dependencies = { "nvim-treesitter/nvim-treesitter" }, - config = function() - require("render-markdown").setup {} - end, + { + "MeanderingProgrammer/markdown.nvim", + name = "render-markdown", -- Only needed if you have another plugin named markdown.nvim + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = function() + require("render-markdown").setup {} + end, + }, + { + "toppair/peek.nvim", + ft = { "markdown" }, + cmd = { "Peek" }, + build = "deno task --quiet build:fast", + opts = function() + vim.api.nvim_create_autocmd("FileType", { + desc = "Create peek command on markdown ft", + pattern = "markdown", + callback = function(ev) + vim.api.nvim_buf_create_user_command(ev.buf, "Peek", function(ctx) + local peek = require "peek" + if peek.is_open() then + if ctx.bang then + peek.close() + end + return + end + peek.open() + end, { bang = true }) + end, + }) + return { + app = { "chromium", "--new-window" }, + } + end, + }, } diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua deleted file mode 100644 index 762721d..0000000 --- a/lua/plugins/toggleterm.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - enabled = false, - "akinsho/toggleterm.nvim", - keys = { - { "", "Open Toggleterm" }, - }, - cmd = { "ToggleTerm" }, - version = "*", - opts = { - size = function(term) - if term.direction == "horizontal" then - if vim.o.lines < 60 then - return 12 - end - return 20 - elseif term.direction == "vertical" then - return vim.o.columns * 0.3 - end - end, - open_mapping = [[]], - }, -}