From ee0e04842b3dc69192c7b0138e8c603ddbf80870 Mon Sep 17 00:00:00 2001 From: afranco Date: Sat, 28 Dec 2024 22:14:20 +0000 Subject: [PATCH] chore(nvim): few tweaks --- .config/nvim/lua/core/keymaps.lua | 14 ++++++++++---- .config/nvim/lua/plugins/cmp.lua | 2 +- .config/nvim/lua/plugins/lsp.lua | 3 ++- .config/nvim/lua/plugins/misc.lua | 9 ++++++++- .config/nvim/lua/plugins/ui.lua | 12 ++++++++---- 5 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.config/nvim/lua/core/keymaps.lua b/.config/nvim/lua/core/keymaps.lua index be96bd2..df882e7 100644 --- a/.config/nvim/lua/core/keymaps.lua +++ b/.config/nvim/lua/core/keymaps.lua @@ -8,7 +8,7 @@ vim.keymap.set("n", "", "cnextzz") vim.keymap.set("n", "", "bp") vim.keymap.set("n", "", "bn") --jk as escape -vim.keymap.set("i", "jk","") +vim.keymap.set("i", "jk", "") -- Copy to system clipboard vim.keymap.set({ 'n', 'x' }, 'gy', '"+y', { desc = 'Copy to system clipboard' }) -- Paste from system clipboard in normal mode @@ -16,10 +16,16 @@ vim.keymap.set('n', 'gp', '"+p', { desc = 'Paste from system clipboard' }) -- Paste from system clipboard in visual mode without overwriting the clipboard vim.keymap.set('x', 'gp', '"+P', { desc = 'Paste from system clipboard' }) --Center screen after some motions -vim.keymap.set("n", "", "zz", {desc = "Center cursor after moving down half-page"}) -vim.keymap.set("n", "", "zz", {desc = "Center cursor after moving down half-page"}) -vim.keymap.set("n", "G", "Gzz", {desc = "Center cursor after moving down half-page"}) +vim.keymap.set("n", "", "zz", { desc = "Center cursor after moving down half-page" }) +vim.keymap.set("n", "", "zz", { desc = "Center cursor after moving down half-page" }) +vim.keymap.set("n", "G", "Gzz", { desc = "Center cursor after moving down half-page" }) --Run lua stuff (ty teej) vim.keymap.set("n", "x", "source %") vim.keymap.set("n", "x", ":.lua") vim.keymap.set("v", "x", ":lua") +--Merge lines in visual mode +vim.keymap.set("v", "J", function() + for _ = 1, vim.fn.getpos("'>")[2] - vim.fn.getpos("'<")[2] - 1 do + vim.api.nvim_command("normal! J") + end +end) diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua index 518d0b1..fd61445 100644 --- a/.config/nvim/lua/plugins/cmp.lua +++ b/.config/nvim/lua/plugins/cmp.lua @@ -3,7 +3,7 @@ return { 'saghen/blink.cmp', lazy = false, dependencies = 'rafamadriz/friendly-snippets', - build = 'cargo build --release', + version = "*", opts = { keymap = { preset = 'default', diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 5940247..066291b 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -181,7 +181,8 @@ return { markdown = { "mdformat" }, rust = { "rustfmt" }, go = { "gofmt" }, - json = { "jq" } + json = { "jq" }, + bash = { "shfmt" } } }) end, diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua index 4e09576..3115bc5 100644 --- a/.config/nvim/lua/plugins/misc.lua +++ b/.config/nvim/lua/plugins/misc.lua @@ -47,5 +47,12 @@ return { require("blame").setup() end }, - "tpope/vim-fugitive" + "tpope/vim-fugitive", + -- { + -- "nvzone/typr", + -- dependencies = { + -- "nvzone/volt" + -- }, + -- opts = {} + -- } } diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index eb8a371..d60abea 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -84,13 +84,17 @@ return { table.insert(newVirtText, { suffix, 'MoreMsg' }) return newVirtText end - - -- global handler - -- `handler` is the 2nd parameter of `setFoldVirtTextHandler`, - -- check out `./lua/ufo.lua` and search `setFoldVirtTextHandler` for detail. require('ufo').setup({ fold_virt_text_handler = handler }) end + }, + { + "OXY2DEV/markview.nvim", + ft = "markdown", + dependencies = { + "nvim-treesitter/nvim-treesitter", + "nvim-tree/nvim-web-devicons" + } } }