From 6e910eaaff628cf0fbefb6ade781d1482a1e9556 Mon Sep 17 00:00:00 2001 From: Tovi Jaeschke-Rogers Date: Fri, 31 May 2024 08:12:06 +0930 Subject: [PATCH] feat: change the things --- .config/nvim/lua/tovi/core/remaps.lua | 18 +++++++------- .config/nvim/lua/tovi/plugins/flash.lua | 6 ++++- .config/nvim/lua/tovi/plugins/nvim-cmp.lua | 29 ++++++++++++++++++---- .zshrc | 4 +++ 4 files changed, 42 insertions(+), 15 deletions(-) diff --git a/.config/nvim/lua/tovi/core/remaps.lua b/.config/nvim/lua/tovi/core/remaps.lua index c698714..023188c 100644 --- a/.config/nvim/lua/tovi/core/remaps.lua +++ b/.config/nvim/lua/tovi/core/remaps.lua @@ -23,15 +23,15 @@ vim.keymap.set("v", "<", "", ">gv", { desc = "Keep highlight when indenting" }) -- Easily navigate tabs -vim.keymap.set("n", "", "1gt", { desc = "Navigate to tab 2" }) -vim.keymap.set("n", "", "2gt", { desc = "Navigate to tab 3" }) -vim.keymap.set("n", "", "3gt", { desc = "Navigate to tab 4" }) -vim.keymap.set("n", "", "4gt", { desc = "Navigate to tab 5" }) -vim.keymap.set("n", "", "5gt", { desc = "Navigate to tab 6" }) -vim.keymap.set("n", "", "6gt", { desc = "Navigate to tab 7" }) -vim.keymap.set("n", "", "7gt", { desc = "Navigate to tab 8" }) -vim.keymap.set("n", "", "8gt", { desc = "Navigate to tab 9" }) -vim.keymap.set("n", "", "9gt", { desc = "Navigate to tab 10" }) +-- vim.keymap.set("n", "", "1gt", { desc = "Navigate to tab 2" }) +-- vim.keymap.set("n", "", "2gt", { desc = "Navigate to tab 3" }) +-- vim.keymap.set("n", "", "3gt", { desc = "Navigate to tab 4" }) +-- vim.keymap.set("n", "", "4gt", { desc = "Navigate to tab 5" }) +-- vim.keymap.set("n", "", "5gt", { desc = "Navigate to tab 6" }) +-- vim.keymap.set("n", "", "6gt", { desc = "Navigate to tab 7" }) +-- vim.keymap.set("n", "", "7gt", { desc = "Navigate to tab 8" }) +-- vim.keymap.set("n", "", "8gt", { desc = "Navigate to tab 9" }) +-- vim.keymap.set("n", "", "9gt", { desc = "Navigate to tab 10" }) vim.keymap.set("n", "tN", "tabnew", { desc = "New tab" }) vim.keymap.set("n", "tn", "tabnext", { desc = "Next tab" }) diff --git a/.config/nvim/lua/tovi/plugins/flash.lua b/.config/nvim/lua/tovi/plugins/flash.lua index e707ee9..3e1cd85 100644 --- a/.config/nvim/lua/tovi/plugins/flash.lua +++ b/.config/nvim/lua/tovi/plugins/flash.lua @@ -2,7 +2,11 @@ return { "folke/flash.nvim", event = "VeryLazy", ---@type Flash.Config - opts = {}, + opts = { + char = { + enabled = false, + } + }, -- stylua: ignore keys = { { "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" }, diff --git a/.config/nvim/lua/tovi/plugins/nvim-cmp.lua b/.config/nvim/lua/tovi/plugins/nvim-cmp.lua index a8296f0..4d658b6 100644 --- a/.config/nvim/lua/tovi/plugins/nvim-cmp.lua +++ b/.config/nvim/lua/tovi/plugins/nvim-cmp.lua @@ -8,6 +8,7 @@ return { "saadparwaiz1/cmp_luasnip", -- for autocompletion "rafamadriz/friendly-snippets", -- useful snippets "onsails/lspkind.nvim", -- vs-code like pictograms + "kristijanhusak/vim-dadbod-completion", }, config = function() local cmp = require("cmp") @@ -75,17 +76,35 @@ return { -- sources for autocompletion sources = cmp.config.sources({ { name = "nvim_lsp" }, - { name = "luasnip" }, -- snippets - { name = "buffer" }, -- text within current buffer - { name = "path" }, -- file system paths + { name = "luasnip" }, + { name = "buffer" }, + { name = "path" }, + { name = "vim-dadbod-completion" }, }), -- configure lspkind for vs-code like pictograms in completion menu formatting = { format = lspkind.cmp_format({ - maxwidth = 50, - ellipsis_char = "...", + mode = "symbol_text", + -- with_text = true, + menu = { + nvim_lua = "[api]", + nvim_lsp = "[LSP]", + luasnip = "[snip]", + vim_dadbod_completion = "[DB]", + path = "[path]", + buffer = "[Buffer]", + }, }), }, + event = { + on = { + CompleteChanged = function(data) + if data.entry then + vim.lsp.buf.hover() + end + end, + }, + }, }) end, } diff --git a/.zshrc b/.zshrc index d158e68..5f3fb6d 100644 --- a/.zshrc +++ b/.zshrc @@ -104,3 +104,7 @@ if [[ $(uname) == 'Darwin' ]]; then fi source <(fzf --zsh) + +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion