From 43df368ec15830d7b07344d3166901ea37bbbcc0 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Wed, 20 Sep 2023 08:27:14 +0300 Subject: [PATCH] chore(nvim): configuration and plugin updates --- config/nvim/lazy-lock.json | 5 ++- config/nvim/lua/config/keymaps.lua | 16 ++++++++ config/nvim/lua/config/lazy.lua | 2 +- config/nvim/lua/plugins/coding.lua | 2 +- config/nvim/lua/plugins/lang-php.lua | 47 ++++++++++++++++++++++ config/nvim/lua/plugins/nvim-lspconfig.lua | 5 ++- config/nvim/lua/plugins/tools.lua | 9 +++++ 7 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 config/nvim/lua/plugins/lang-php.lua create mode 100644 config/nvim/lua/plugins/tools.lua diff --git a/config/nvim/lazy-lock.json b/config/nvim/lazy-lock.json index 72c864c..e710add 100644 --- a/config/nvim/lazy-lock.json +++ b/config/nvim/lazy-lock.json @@ -5,7 +5,7 @@ "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, "animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" }, "bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" }, - "bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" }, + "bufferline.nvim": { "branch": "main", "commit": "81cd04fe7c914d020d331cea1e707da5f14c2665" }, "catppuccin": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, @@ -43,7 +43,7 @@ "nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" }, "nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" }, "nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" }, - "nvim-treesitter": { "branch": "master", "commit": "b4f6dd72980607a9821d24502b0ca7ee826376af" }, + "nvim-treesitter": { "branch": "master", "commit": "940916074833159bf7b8cbb4bf5e59161461fa5a" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" }, "nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" }, @@ -53,6 +53,7 @@ "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" }, "telescope.nvim": { "branch": "master", "commit": "b543aaa2c9cf8123ed2fe7dbb6c211a9cd415124" }, "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, + "toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" }, "tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" }, "trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" }, "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, diff --git a/config/nvim/lua/config/keymaps.lua b/config/nvim/lua/config/keymaps.lua index 2c134f7..38d2d7b 100644 --- a/config/nvim/lua/config/keymaps.lua +++ b/config/nvim/lua/config/keymaps.lua @@ -1,3 +1,19 @@ -- Keymaps are automatically loaded on the VeryLazy event -- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua -- Add any additional keymaps here + +local keymap = vim.keymap.set + +-- ╭──────────────────────────────────────────────────────────╮ +-- │ Comment box │ +-- ╰──────────────────────────────────────────────────────────╯ +local cb = require("comment-box") + +-- left aligned fixed size box with left aligned text +keymap({ "n", "v" }, "bcb", cb.lbox, { desc = "Comment: Left aligned" }) +-- centered adapted box with centered text +keymap({ "n", "v" }, "bcc", cb.ccbox, { desc = "Comment: Centered" }) + +-- centered line +keymap("n", "bcl", cb.cline, { desc = "Comment: Centered line" }) +keymap("i", "", cb.cline, { desc = "Comment: Centered line" }) diff --git a/config/nvim/lua/config/lazy.lua b/config/nvim/lua/config/lazy.lua index d70e3d1..f43e821 100644 --- a/config/nvim/lua/config/lazy.lua +++ b/config/nvim/lua/config/lazy.lua @@ -40,7 +40,7 @@ require("lazy").setup({ version = false, -- always use the latest git commit -- version = "*", -- try installing the latest stable version for plugins that support semver }, - install = { colorscheme = { "catppuccin", "tokyonight", "habamax" } }, + install = { colorscheme = { "catppuccin" } }, checker = { enabled = true }, -- automatically check for plugin updates performance = { rtp = { diff --git a/config/nvim/lua/plugins/coding.lua b/config/nvim/lua/plugins/coding.lua index 177376a..0950c28 100644 --- a/config/nvim/lua/plugins/coding.lua +++ b/config/nvim/lua/plugins/coding.lua @@ -80,7 +80,7 @@ return { cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" }, event = "User", opts = { - accept_keymap = "", + accept_keymap = "", dismiss_keymap = "", }, }, diff --git a/config/nvim/lua/plugins/lang-php.lua b/config/nvim/lua/plugins/lang-php.lua new file mode 100644 index 0000000..07e8deb --- /dev/null +++ b/config/nvim/lua/plugins/lang-php.lua @@ -0,0 +1,47 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { + "php", + }) + end, + }, + { + "williamboman/mason.nvim", + opts = function(_, opts) + vim.list_extend(opts.ensure_installed, { + "phpactor", + }) + end, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + phpactor = {}, + }, + }, + }, + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = { + "williamboman/mason.nvim", + opts = function(_, opts) + if type(opts.ensure_installed) == "table" then + table.insert(opts.ensure_installed, "php-debug-adapter") + end + end, + }, + opts = function() + local dap = require("dap") + local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path() + dap.adapters.php = { + type = "executable", + command = "node", + args = { path .. "/extension/out/phpDebug.js" }, + } + end, + }, +} diff --git a/config/nvim/lua/plugins/nvim-lspconfig.lua b/config/nvim/lua/plugins/nvim-lspconfig.lua index 4600a87..7c8b127 100644 --- a/config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,7 +1,10 @@ return { "neovim/nvim-lspconfig", opts = { - servers = { eslint = {} }, + servers = { + eslint = {}, + tflint = {}, + }, setup = { eslint = function() require("lazyvim.util").on_attach(function(client) diff --git a/config/nvim/lua/plugins/tools.lua b/config/nvim/lua/plugins/tools.lua new file mode 100644 index 0000000..d8d50f4 --- /dev/null +++ b/config/nvim/lua/plugins/tools.lua @@ -0,0 +1,9 @@ +return { + -- A neovim lua plugin to help easily manage multiple terminal windows + -- https://github.com/akinsho/toggleterm.nvim + { + "akinsho/toggleterm.nvim", + version = "*", + config = true, + }, +}