Comments (4)
Oh, i finally create a custom solution.
local lastTermIdUsed = 1
map({ "n" }, "<leader>t", function()
require("nvchad.term").toggle({ pos = "float", id = lastTermIdUsed })
end, { desc = "Terminal Toggle Floating" })
for id = 1, 9 do
map({ "n" }, id .. "<leader>t", function()
require("nvchad.term").toggle({ pos = "float", id = id })
lastTermIdUsed = id
end, { desc = "Terminal Toggle to " .. id })
end
Finally the feature request could simply be a method that could return the last used terminal id number. (Maybe usefull for other case external to keymaps)
from nvchad.
@TirtharajPramanik you can do this yourself, just make an autocmd
vim.api.nvim_create_autocmd({ "TermOpen" }, {
callback = function(args)
local buf = args.buf
-- now do your stuff here
end
})
from nvchad.
It's currently not possible to open the last open terminal if we don't know his ID.
nvchad.term needs an id at least... or else how would you toggle? or just loop through vim.g.nvchad_terms
table, it has info of all terminals with their opts & buf etc. and then get info of each buf upto your matching & toggle it by sending its opts as arg
from nvchad.
@siduck Would it be a nice and simple idea to keep track of the last active term id?
With something like vim.g.nvchad_active_term_id
I would contribute that simple change, but I don't find the NvChad's terminal module O.o
OR
Maybe simply paste my example in the Doc to help others that would want to do that. (At least I added something in the help channel in discord with the resolve tag and my solution)
from nvchad.
Related Issues (20)
- CursorLine high light override not working after migrate to v2.5 HOT 2
- UltiSnipsJumpForwardTrigger isn't working HOT 2
- ftplugin overriding custom/init.lua HOT 8
- The bg for cursor line doesn't work for v2.5 HOT 1
- Cannot unmap some default keymaps in v2.5 HOT 8
- Unable to use my custom folder HOT 1
- Theme Toggle Overrides both themes to the same one in chadrc. HOT 1
- Unable to install nvchad to root user HOT 1
- Wrong (weird) theme colors on startup using v2.5 with starter repo HOT 13
- error message when switching theme HOT 1
- Nvim-tree not left-aligned HOT 4
- Unknown function: TbTbKillBuf when trying to close buffer tab HOT 1
- Please support Catppuccin Latte theme HOT 1
- Installation is broken for branch 2.5 HOT 1
- Which-key does not show mappings for <leader> in visual mode HOT 5
- Bug Report: Exiting Terminal on ESC in LazyGit within NvChad HOT 5
- v2.5 failed to pass cmd to LSP HOT 8
- Add instruction in the installation paga to remove .git file
- Bufferline-like options in tabufline, or theme toggling support for bufferline.nvim HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvchad.