Code Monkey home page Code Monkey logo

Comments (3)

tarunaksha avatar tarunaksha commented on June 10, 2024 1

So I wanted to get the results as shown here:

toggletermgif

I looked for this configuration in several platforms like reddit,youtube,stackexchange etc. but didn't find the proper solution. After brainstorming(as I am new to vim) for hours I finally figured it for my usecase.

i am using lazy-vim currently.

Here are my setups to achieve this...

init.lua

require("config.lazy")

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable",
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  {
    "akinsho/toggleterm.nvim",
    config = function()
      require("toggleterm").setup()
    end,
  },
})

lua/plugins/toggleterm.lua

return {
  "akinsho/toggleterm.nvim",
  version = "*",
  config = true,
  opts = {
    size = 12,
    open_mapping = [[<c-\>]],
    shade_filetypes = {},
    shade_terminals = true,
    shading_factor = 1,
    start_in_insert = true,
    persist_size = true,
    close_on_exit = true,
    direction = "horizontal",
  },
}

Pretty straight-forward and default setup. I use ctrl+\ for opening the terminal horizontally and open another terminal by pressing 2+ctrl+\. For 3rd 3+.... and so on (who needs more than 3). To hide them press ctrl+\ again. To exit them simply type "exit". For giving input in terminal press "i" and press "esc" two times to revert to normal mode. Switching between them is also similar like normal vim mode.

Here is my result:
Screenshot from 2024-01-28 18-14-36

from toggleterm.nvim.

blurskye avatar blurskye commented on June 10, 2024

i would highly recomend using something like tmux or a alternative to it for terminal multiplexing....

from toggleterm.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.