Thanks for the great video! For those you want to avoid pressing `i` when entering the floating terminal you can add this line to the `toggle_terminal` function `vim.cmd("normal i")` like in here: ``` local toggle_terminal = function() if not vim.api.nvim_win_is_valid(state.floating.win) then state.floating = create_floating_window { buffer = state.floating.buffer } if vim.bo[state.floating.buffer].buftype ~= 'terminal' then vim.cmd.terminal() end else vim.api.nvim_win_hide(state.floating.win) end vim.cmd('normal i') end ```
That's really neat how it works off the difference between how a :normal command is treated in a regular buffer and a terminal buffer. At first I was totally confused why it wasn't dumping me into normal mode when switching back to the regular file buffer.
This may be the most exciting video of the series! It’s mind boggling how simple this was with such a powerful result. Endless possibilities 🎉. Thanks man!
always learn a lot from you, appreciate it, as much as a i like hacking away at difficult problems when it comes to config i always feel like theres a wall in my way before diving in so ive always use default neovim + a few settings. But seeing how you do it makes it feel a lot less "icky" for a lack of a better word, and you're so smooth with all this. thanks buddy
Just an idea. Maybe a video about your setup. Like color scheme on neovim, terminal you use, window manager etc. For people that are curious. Also love the videos, learn a lot. Thanks.
I understand. Can I still ask what your neovim color scheme is though? I typed the telescope lua out and it formatted it out right except the find files part isn’t colored.
Good video. This gives me some ideas, like having easily accessible "scratch" buffers for different languages, e.g. a scratch buffer for python, js, latex, or md/plain text with an option to render/run? Seems like a fun challenge :)
Your series has been so inspiring to me! Earlier today I decided to start making a "Recent sessions" feature. Trying to replicate the "Open recent folder" menu in other editors. My plan is to save session files of my projects into a common directory, and then pick a session using telescope file_files on that common dir. But telescope's find_files would open the session file as a buffer, so I'm trying to figure out how to source it instead.
I am literally clinged to this series. There is so much to learn. Thanks a lot for that TJ. Looking forward to the AI integration into neovim with project context sharing.
I'm so grateful for this advent of neovim, TJ! Your kickstart.nvim already got me to make the final move to neovim on something that felt stable but not overwhelming, and this series is just showing how easy and not scary at all it is to implement this sort of thing and make the editor truly mine. Thank you for your work!
In case anyone had the same problem with the fuzzy match, you can go to the source (or inside opts in the lazy request) and make force-version="v0.10.0" or to the lastest release of the future, i dunno, search
This looks interesting. The first time I heard about the neovim terminal was 2 or 3 videos ago. It's tempting to integrate it into my workflow. But somehow it's hard to fit it in the current tmux workflow I use. I don't know. maybe it will be helpful for one off commands.
I highly recommend your retitle your videos by prefixing them with Advent of Neovim Day 1...25. In this season, I am very sure it will bring in many more views.
I also saw the other terminal video in the Advent of Neovim series, and I didn't realize I had to enter insert mode to be able to start using it. Took me a while. So I now have this in the scripts for the terminals so it automatically enters insert mode inside the terminal buffer after showing the window. vim.api.nvim_command('startinsert')
7:25 why does vim.cmd.terimal() know in which buffer to create the terminal, but the vim.bo.buftype thing in the line above it needs to be told the buffer id?
if i were to guess it's because `terminal` cmd makes a terminal instance in the active buffer. (which would be the buffer we just set in `create_floating_window > nvim_open_win`). However there isn't a cmd (I don't think) to get the buftype of the active buffer so we must look it up in `vim.bo`.
First of all thank you for these very informative videos . I have a question please what is your settings / layout of the status bar i rlly like how simplistic it is
Long time fan of your content. It's fantastic. I saw that you are starting to integrate LLM's into your dev flow. They are super useful, eh? I've been using vim for over ten years, and switched to neovim a few years ago. I'm super deep into my config and I love it, but I've recently started using Cursor, because it takes AI assisted coding to the next level. I'm curious what your thoughts are regarding this and the future of ai-assisted coding in neovim.
haha a bit too long of thoughts to write in a comment, but I have tried cursor to get a good opinion of it. I think LLMs can be quite helpful (or very harmful haha depends on the day). Maybe I will make something with a larger conglomeration of my thoughts in the new year
Can anyone help me with this: I want the terminal to open in the directory of the file I am working on and then automatically run commands when I press the keymap that runs floaterminal.
Great video So far we've been using existing plugins, what is the thought process behind doing terminal from scratch rather than using one of the many plugins, thanks!
This but it lets me attach to any tmux window/pane would be *chefs kiss* for my workflow!!!! Guess it’s good I’m on vacation I got time to figure out how tf to make that shit work!!!!
Hey, bro amazing content, thank you so much! Although when I start neovim, then press " space + tt " to raise floaterminal, well if I exit " Ctrl + d " then an empty floating window remains. Therefore I have to press " space +tt " again to hide it. However, this happens only the first time after open nvim.
i don't see why i would need a plugin for something i can write in 50ish lines (and then customize more for exactly how i want to use it, never breaks, never changes unless i do, etc)
Floating terminal is working but I get this message when I open neovim: Invalid spec module: `plugins.floaterminal` Expected a `table` of specs, but a `nil` was returned instead Anyone can help me?
Maybe you put it in your lazy plugins directory instead of the root level ‘plugin’ dir And lazy is expecting your module to return a table, but this one returns nothing but sets a keymap in the end
Is there a setting out maybe an easy autocommand that can set up that whenever you enter a terminal buffer in Neovim it automatically goes into insert mode? It would be an awesome quality of life upgrade. Lol.
There is multiple ways to do it, but in the `toggle_window` function, directly under the "if ...end " expression that calls `vim.cmd.term()`, add the line `vim.cmd("startinsert")`. This will make it enter insert mode automatically every time the window is shown.
Thanks for the great video!
For those you want to avoid pressing `i` when entering the floating terminal you can add this line to the `toggle_terminal` function `vim.cmd("normal i")` like in here:
```
local toggle_terminal = function()
if not vim.api.nvim_win_is_valid(state.floating.win) then
state.floating = create_floating_window { buffer = state.floating.buffer }
if vim.bo[state.floating.buffer].buftype ~= 'terminal' then
vim.cmd.terminal()
end
else
vim.api.nvim_win_hide(state.floating.win)
end
vim.cmd('normal i')
end
```
Amazing, thank you
That's really neat how it works off the difference between how a :normal command is treated in a regular buffer and a terminal buffer. At first I was totally confused why it wasn't dumping me into normal mode when switching back to the regular file buffer.
Thank you very much Teej! I've been using nvim without knowing a lot of things for such a long time. All these recent videos helped me a lot!
So glad to hear you're liking it and enjoying it
Pure wizardy! I watch these more to be impressed than to learn because there are too many gaps in my neovim knowledge and you go super duper fast.
haha thanks for all the comments :) and glad you are enjoying the videos
This may be the most exciting video of the series! It’s mind boggling how simple this was with such a powerful result. Endless possibilities 🎉. Thanks man!
I`m now a fellow Floaterminal enjoyer! And I have tons of ideas what I want to float next. I love these kinds of videos, thank you!
Amazing video teej and thank you so much for helping bring light to a very important cause! 😊
always learn a lot from you, appreciate it, as much as a i like hacking away at difficult problems when it comes to config i always feel like theres a wall in my way before diving in so ive always use default neovim + a few settings. But seeing how you do it makes it feel a lot less "icky" for a lack of a better word, and you're so smooth with all this. thanks buddy
Just an idea. Maybe a video about your setup. Like color scheme on neovim, terminal you use, window manager etc. For people that are curious. Also love the videos, learn a lot. Thanks.
Don't forget to say which editor you use, btw.
ya, maybe in the new year, but it's not very exciting stuff haha
I understand. Can I still ask what your neovim color scheme is though? I typed the telescope lua out and it formatted it out right except the find files part isn’t colored.
@@jeffbit8620 that looks like tokyonight
@@jeffbit8620It looks like tokyonight
Dang bruh, more videos than I can consume. love it. 😍
hahaha i am tryin!
This is really cool, it makes everything more approachable. Thnks.
This nvim series is a banger.
Teej's comment section is getting hit hard - bros making good content!
haha what do you mean?
Good video. This gives me some ideas, like having easily accessible "scratch" buffers for different languages, e.g. a scratch buffer for python, js, latex, or md/plain text with an option to render/run? Seems like a fun challenge :)
that's the best part! you can make it just the way you like for you!
Amazing resource for getting started with plugin development! Can’t wait to see what else we build in this series!
thanks :) ya, we'll start doing a bit more exploring as we go on in the series!
Loving these videos. The rest of the family have chocolate advent calendars but I have Advent of Neovim. This is sooooo much better and healthier :D
my gippity defaulted to rounded borders, you made it a fan
That's so good! Thanks for sharing.
my pleasure!
damn i am feeling like i am gonna take my neovim config to the next level with this videos, i hope there is more coming, thanks for the video!
i just learned vim motions and i'm loving it, don't think i need somthing like neovim. But i love watching you customizing the hell out of it XD
Your content is GOLD!! ❤
your comments are gold!! ;)
Your series has been so inspiring to me! Earlier today I decided to start making a "Recent sessions" feature. Trying to replicate the "Open recent folder" menu in other editors.
My plan is to save session files of my projects into a common directory, and then pick a session using telescope file_files on that common dir.
But telescope's find_files would open the session file as a buffer, so I'm trying to figure out how to source it instead.
You make nvim more fun for me 😄
awe, thank you! that's a really nice compliment!
This was helpful. I hope all the big money flowing in from the sponsors isn't going to affect the great content.
hahaha yes, adopt a reply guy truly going to bring in the big bucks
the good people at adopt a reply guy would never exert creative control
I am literally clinged to this series. There is so much to learn. Thanks a lot for that TJ.
Looking forward to the AI integration into neovim with project context sharing.
8:40 I wouldn't set it to terminal mode because of the small delay when pressing , maybe tt on normal and on terminal. Just my opinion though.
As long as the next word doesn't start with `tt` (not that common at least in english), you can keep writing, don't need to wait after the ``
ya, super reasonable.
I absolutely LOVE these videos
I'm so grateful for this advent of neovim, TJ! Your kickstart.nvim already got me to make the final move to neovim on something that felt stable but not overwhelming, and this series is just showing how easy and not scary at all it is to implement this sort of thing and make the editor truly mine. Thank you for your work!
Amazing content-please keep it coming!
This is a great one, learnt alot.
love these nvim lua videos
In case anyone had the same problem with the fuzzy match, you can go to the source (or inside opts in the lazy request) and make force-version="v0.10.0"
or to the lastest release of the future, i dunno, search
I have spent a LONG time learning vim motions and neovim. And I realize how very little I know when zi watch your videos.
hahaha thank you! i appreciate :)
OK, now I'm in love with neovim. Thanks TJ!
same ;)
this is so good
appreciate it :)
Your videos are great as always but HOLY MOLY this hoody is GOLD
Nice, I have been floating vim fugitive, and it became 10 times easier to use.
Such a great idea!
This looks interesting. The first time I heard about the neovim terminal was 2 or 3 videos ago. It's tempting to integrate it into my workflow.
But somehow it's hard to fit it in the current tmux workflow I use. I don't know. maybe it will be helpful for one off commands.
how do i open file from the terminal inside nvim?
I highly recommend your retitle your videos by prefixing them with Advent of Neovim Day 1...25. In this season, I am very sure it will bring in many more views.
in general, i've found putting the series title tanks the views haha but i appreciate the suggestion. they are all on a playlist though!
I usually just use ctrl-z or spaan another terminal, but this is interesting too
I loved this trick ❤
thank you haha
I also saw the other terminal video in the Advent of Neovim series, and I didn't realize I had to enter insert mode to be able to start using it. Took me a while.
So I now have this in the scripts for the terminals so it automatically enters insert mode inside the terminal buffer after showing the window.
vim.api.nvim_command('startinsert')
Could you share it?
@@matheusmoraes8157 see the last line in my original comment. Add that after the line which opens the window.
7:25 why does vim.cmd.terimal() know in which buffer to create the terminal, but the vim.bo.buftype thing in the line above it needs to be told the buffer id?
if i were to guess it's because `terminal` cmd makes a terminal instance in the active buffer. (which would be the buffer we just set in `create_floating_window > nvim_open_win`). However there isn't a cmd (I don't think) to get the buftype of the active buffer so we must look it up in `vim.bo`.
love it👌
Man, your tutorials are awesome! It's a shame you don't have a transparent terminal with a waifu background image, but it's okay. You are gold.
my waifu is real 3d girl - so instead i just use default awesomewm desktop background LOL
From now on every single new plugin has a floating window
Can you explain about make command. And how to like jump from errors from terminal to error location
First of all thank you for these very informative videos . I have a question please what is your settings / layout of the status bar i rlly like how simplistic it is
Long time fan of your content. It's fantastic.
I saw that you are starting to integrate LLM's into your dev flow. They are super useful, eh?
I've been using vim for over ten years, and switched to neovim a few years ago. I'm super deep into my config and I love it, but
I've recently started using Cursor, because it takes AI assisted coding to the next level. I'm curious what your thoughts are regarding this and the future of ai-assisted coding in neovim.
haha a bit too long of thoughts to write in a comment, but I have tried cursor to get a good opinion of it. I think LLMs can be quite helpful (or very harmful haha depends on the day). Maybe I will make something with a larger conglomeration of my thoughts in the new year
Can anyone help me with this: I want the terminal to open in the directory of the file I am working on and then automatically run commands when I press the keymap that runs floaterminal.
Help : Can't get it to work once I place it inside lua/plugins
Great video
So far we've been using existing plugins, what is the thought process behind doing terminal from scratch rather than using one of the many plugins, thanks!
terminal from scratch takes like 50 lines, writing a custom autocompletion plugin takes a few thousand haha
HOW AM I SUPPOSED TO RTFM IF WE HAVE THIS PLAYLIST BETTER. WOWW TEEJ, YOU'RE ON FIRE AND THANKS FOR EVERYTHING !!! ❤🔥❤🔥❤🔥
This but it lets me attach to any tmux window/pane would be *chefs kiss* for my workflow!!!!
Guess it’s good I’m on vacation I got time to figure out how tf to make that shit work!!!!
ya, sorry - i don't use tmux so i can't really help ya with this one
Hey, bro amazing content, thank you so much! Although when I start neovim, then press " space + tt " to raise floaterminal, well if I exit " Ctrl + d " then an empty floating window remains. Therefore I have to press " space +tt " again to hide it. However, this happens only the first time after open nvim.
Ohh Yeee!!! 💜
TJ, can you update git repo, please?
yup! just pushed an update - sorry for forgetting to do that haha
@@teej_dv Thanks!
Mines called flerminal.
Mine is called floaminal
floating window!
Hey what font are you using?
berkeley mono
Why not just use toggleterm?
because you don't have vim motions in toogleterm, i often struggle for yanking text in toggle term
i don't see why i would need a plugin for something i can write in 50ish lines (and then customize more for exactly how i want to use it, never breaks, never changes unless i do, etc)
Anyone know what font tj is using?
berkeley mono
@teej_dv Thank you! Amazing video as always
Why a semi colon for your prompt? Im sure you have some smart reason why.
you can copy it and the command will run :)
I believe this is the starship cross-shell prompt or some kind of prompt customization. 😉
Floating terminal is working but I get this message when I open neovim:
Invalid spec module: `plugins.floaterminal`
Expected a `table` of specs, but a `nil` was returned instead
Anyone can help me?
Maybe you put it in your lazy plugins directory instead of the root level ‘plugin’ dir
And lazy is expecting your module to return a table, but this one returns nothing but sets a keymap in the end
@@csam9170 I tried this too but same happen, but I'll check again asap, thanks :)
You don't want it in nvim/lua/config/plugins, but instead just nvim/plugin
@@teej_dv Thanks teej, I'll check tomorrow at work, thanks for the videos and greetings from Brazil
@@teej_dv Working great, I think I had some issues with my dotfiles sync app, tnaks again!
Isn't vim.print(_) the same as print(vim.inspect(_))?
ya, old habits die hard though haha
Is there a setting out maybe an easy autocommand that can set up that whenever you enter a terminal buffer in Neovim it automatically goes into insert mode? It would be an awesome quality of life upgrade. Lol.
Yup! It's in the help for :terminal btw ;)
autocmd TermOpen * startinsert
There is multiple ways to do it, but in the `toggle_window` function, directly under the "if ...end " expression that calls `vim.cmd.term()`, add the line `vim.cmd("startinsert")`.
This will make it enter insert mode automatically every time the window is shown.
@@teej_dv Awesome! Thank you so much!
Can you post this code? Your notes git repo doesn't have it. Also at the top you have "Package Mgr" below you call it "Plugin Mgr" Thanks
Just updated the git repo, thanks for the reminder!
@@teej_dv Thanks but the floating terminal code still isn't there.
Where is the code?
sorry, it's updated here now github.com/tjdevries/advent-of-nvim
I just got buf buf buf buf buf
buf buf buf buf
Based
based
Or just use floaterm
sure - but this is like almost no code and teaches you a lot of things. it's ok to take time to learn!
Not bad, but I think floater is a better name
hahah i ain't doin that
Floaterm is hilar...😂
First
first reply
One comment in one minute. Dead channel
He ain't know how to post videos in order. Oil vid mentions this one. 😭
HAHA i forgot that I mentioned it here.
nice
nice
vim-floaterm is been around for 5 years