zbirenbaum / nvterm

NvChad's Official Terminal Plugin ( Unmaintained but still usable and stable), wait for v3.0
GNU General Public License v3.0
181 stars 20 forks source link

Attempt to index global terminal (nil value) #3

Closed siduck closed 2 years ago

siduck commented 2 years ago

image

doesnt work :c

siduck commented 2 years ago

@zbirenbaum image

siduck commented 2 years ago

the user has to define terminal var outside the setup of nvterm, Not a good idea imo. you could instead run the terminal function outside the setup ig

soo:

   mappings = {
      toggle = {
         { "<A-i>", "float" },
         { "<A-h>", "horizontal" },
         { "<A-v>", "vertical" },
      },
      new = {  
         { "<C-i", "float" },
         { "<C-h>", "horizontal" },
         { "<C-x>", "vertical" },
      }
   },

Once this is implemented, I'll add it in the re-custom branch

zbirenbaum commented 2 years ago

the user has to define terminal var outside the setup of nvterm, Not a good idea imo. you could instead run the terminal function outside the setup ig

soo:

   mappings = {
      toggle = {
         { "<A-i>", "float" },
         { "<A-h>", "horizontal" },
         { "<A-v>", "vertical" },
      },
      new = {  
         { "<C-i", "float" },
         { "<C-h>", "horizontal" },
         { "<C-x>", "vertical" },
      }
   },

Once this is implemented, I'll add it in the re-custom branch

Ok I did this, but the new float isn't going in there. People aren't going to open floats directly on top of eachother lmao.

Also, no one I've met utilizes multiple terminals the way you do, so while I respect the individuality, I'm going to make creating the 'new' mappings an opt-in flag, with defaults, so that the plugin doesn't overwrite hotkeys people are using for other stuff.

All you'll have to do is pass { enable_new_mappings = true } to the setup config table.

siduck commented 2 years ago

oh yea , totally forgot about multiple floats lol!

siduck commented 2 years ago

image LIke this?

siduck commented 2 years ago

doesnt work :c

zbirenbaum commented 2 years ago

Its still on my dev branch. I was adding some shortcuts to the config.

zbirenbaum commented 2 years ago

@siduck ok its merged to main. I gotta go to sleep, but theres a new function for easily setting up new mappings, and shortcuts for configuration detailed in the readme.

I didn't update readme with the new function cuz its late, but I can tomorrow.

siduck commented 2 years ago

Alright!

zbirenbaum commented 2 years ago

wait I lied enable new mappings is broke, one sec.

siduck commented 2 years ago

image

This is confusing imo

siduck commented 2 years ago

It would be better to just adhere to the structure of default setup table, like all plugins do

zbirenbaum commented 2 years ago

ok commit amended, its working now.

The docs do need work, I'll do that in the morning.

I forgot to implement same-size terminal splits with new so I'll have to do that. Right now its not gonna split too well with the new stuff. I need to think about how to best implement it in the current structure.

zbirenbaum commented 2 years ago

It would be better to just adhere to the structure of default setup table, like all plugins do

default table has lots of nested stuff (for good reason) making it a pain to set just one hotkey or something. We can just include the table with shortcuts in the readme, users don't need to know the internal defaults. I've seen stuff in other plugins and I think even the neovim source that does the same.

siduck commented 2 years ago

unable to pick new terminals! It just shows image

siduck commented 2 years ago

leader +x => hide file buffers and terminal buffers

Ctrl + q => close file buffers and terminal buffers (bd!)

leader + W => pick term buffers ( already implemented ) leader + B => pick file buffers

ig it'd be a good to have feature to be able to hide/restore file buffers in v2.0 gigachad as it gets quite annoying when we have way too many files in a project and many opened (splits or in bufferline) so it gets very crowded

zbirenbaum commented 2 years ago

ig it'd be a good to have feature to be able to hide/restore file buffers in v2.0 gigachad as it gets quite annoying when we have way too many files in a project and many opened (splits or in bufferline) so it gets very crowded

This is already the whole idea behind buffers. Just type :buffers and it will show all of them. :bp or :bn cycles then like bufferline does. If you try :b \<tab> it will give you a list of the buffers you can open.

That said, I swear to god bufferline and its derivatives are the worst plugin ever made. 90% of the issues you and every other bufferline user have are solved perfectly with vim tabs. Crowding and needing to restore isn't a thing when your editor tabs are whole views of splits rather than a single file.

@siduck I'll cut you a deal. If you try out vim tabs and still think that the buffer restore is necessary, I'll implement it for 2.0

Here's a 1 page guide https://webdevetc.com/blog/tabs-in-vim/

siduck commented 2 years ago

@zbirenbaum ik tabs are useful, its cool to have different layouts ( of different file buffers ) on each tab. i use it this way it gets very crowded when there are like 10+ buffers in bufferline ;(

https://user-images.githubusercontent.com/59060246/165468412-08f2acc9-1af7-458a-bd46-40d61b783a85.mp4

Also it'd be nice to implement the file buffer restore thing in v2.0 itself , as the new custom implementation is ready and i need to add some themes as well. Also make base16 highlights compatible to v0.7 or you can do this part as you've already got it ready

zbirenbaum commented 2 years ago

@zbirenbaum ik tabs are useful, its cool to have different layouts ( of different file buffers ) on each tab. i use it this way it gets very crowded when there are like 10+ buffers in bufferline ;(

https://user-images.githubusercontent.com/59060246/165468412-08f2acc9-1af7-458a-bd46-40d61b783a85.mp4

Also it'd be nice to implement the file buffer restore thing in v2.0 itself , as the new custom implementation is ready and i need to add some themes as well. Also make base16 highlights compatible to v0.7 or you can do this part as you've already got it ready

That video is exactly why bufferline is bad. In normal vim you would have just two tabs, one for each tab. Bufferline is what's causing the crowding. Remove it and try that again and you will see what I mean. There are other plugins to make tabs look attractive that keep the tabs as tabs and not buffers.

Currently I don't have a plugin to make them look pretty and just use the vanilla tabs, but I think I used luatab.nvim in the past and it was good.

I think I opened a PR to our base16 repo with everything done. I can supply the NvChad code highlights replacement or you can see it in the colors dir of my NvCustom repo.

siduck commented 2 years ago

i dont see your PR image