Giter VIP home page Giter VIP logo

Comments (1)

ptendulk-intel avatar ptendulk-intel commented on July 19, 2024

I resolved this issue. Pasting code for reference below if anyone needs it.

 -- Map F5 key to copy and paste in the terminal and set no paste mode.

  -- Elements of array
  -- [0] : if paste toggle was enabled
  -- [1] : if tagbar was open
  -- [2] : if line numbers were enabled
  -- [3] : if NvimTree was opened
  _setpaste = {false, false, false, false}

  function setpastetoggle()

    local has_nvim_tree,view = pcall(require,'nvim-tree.view')

    if _setpaste[0] then
      _setpaste[0] = false

      vim.api.nvim_command(':IndentBlanklineEnable')
      vim.wo.number = _setpaste[2]
      if _setpaste[1]==1 then
        vim.api.nvim_command(':TagbarOpen')
      end
      if _setpaste[3] then
        vim.cmd("NvimTreeOpen")
      end

    else

      -- Store the state
      _setpaste[0] = true
      _setpaste[1] = vim.fn['tagbar#IsOpen']()
      _setpaste[2] = vim.wo.number
      _setpaste[3] = false

      -- Check if NVIM tree is open
      if has_nvim_tree then
        _setpaste[3] = view.is_visible()
        if view.is_visible() then
          vim.cmd("NvimTreeClose")
        end
      end

      vim.api.nvim_command(':IndentBlanklineDisable')
      vim.fn['tagbar#CloseWindow']()
      vim.wo.number = false
    end
  end

from vapournvim.

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.