From 0a1a107a9f5f01032f6c1e2e43d7c462535890c2 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Tue, 7 Nov 2023 14:48:58 -0600 Subject: [PATCH] added toggleterm scratch terminal. --- neovim/.config/nvim/init.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/neovim/.config/nvim/init.lua b/neovim/.config/nvim/init.lua index d72cfd8..804d022 100644 --- a/neovim/.config/nvim/init.lua +++ b/neovim/.config/nvim/init.lua @@ -106,7 +106,7 @@ local function optsWithDesc(desc) return {silent=true, desc=desc} end --toggle spell check -map('n', 'sp', ':setlocal spell!', optsWithDesc("toggle spell check")) +map('n', 'cs', ':setlocal spell!', optsWithDesc("toggle spell check")) --buffer stuff (gt and gT are prev/next tab in stock vim) map('n', 'gf', ':bnext', optsWithDesc("next buffer")) map('n', 'gF', ':bprevious', optsWithDesc("prev buffer")) @@ -142,13 +142,19 @@ map('n', 'fz', ':Telescope current_buffer_fuzzy_find', optsWithDesc( map('n', 'fgc', ':Telescope git_commits', optsWithDesc("search git commits")) map('n', 'fgb', ':Telescope git_branches', optsWithDesc("search git branches")) map('n', 'fgs', ':Telescope git_stash', optsWithDesc("search git stash")) -map('n', 'fto', ':TodoTelescope', optsWithDesc("search todos")) +map('n', 'fto', ':TodoTelescope', optsWithDesc("search todos")) map('n', 'ft', ':Telescope treesitter', optsWithDesc("search treesitter")) --Treesitter context -map('n', 'c', ':TSContextToggle', optsWithDesc("toggle ts context")) +map('n', 'co', ':TSContextToggle', optsWithDesc("toggle ts context")) --gitsigns -map('n', 'bl', ':Gitsigns toggle_current_line_blame', optsWithDesc("toggle inline git blame")) +map('n', 'gb', ':Gitsigns toggle_current_line_blame', optsWithDesc("toggle inline git blame")) -- toggle keymappings for venn using v -map('n', 'v', ":lua Toggle_venn()", optsWithDesc("toggle venn.nvim")) +map('n', 'v', ":lua Toggle_venn()", optsWithDesc("toggle venn.nvim")) -- treesj map('n', 'j', ':TSJToggle', optsWithDesc("treesitter split/join")) +-- a dedicated floating scratch terminal, seperate from the normal toggleterm terminals. +local Terminal = require('toggleterm.terminal').Terminal +Floatingterm = Terminal:new({ hidden = true, +direction="float"}) + +vim.api.nvim_set_keymap("n", "s", ':lua Floatingterm:toggle()', optsWithDesc("open scratch terminal"))