Neovim - Treesitter Syntax Highlighting

  Рет қаралды 81,739

chris@machine

chris@machine

Күн бұрын

Пікірлер: 75
@ShivanS
@ShivanS 2 жыл бұрын
Excellent tutorial series. This got me up and running with neovim fast! Sadly 3:53, `ensure_installed = "maintained"` got deprecated (March 2022) and it has to be set to `"all"`, with the unmaintained language and formats added to `ignore_install`. Hopefully, this helps anyone who is stuck!
@JeremyIglehart
@JeremyIglehart 2 жыл бұрын
This should get pinned! Thanks for the help Shivan!
@ShivanS
@ShivanS 2 жыл бұрын
@@JeremyIglehart no worries. enjoy neovim!
@andrescondezomonge5198
@andrescondezomonge5198 2 жыл бұрын
Thanks for the advice!!!
@vaisakh_km
@vaisakh_km 2 жыл бұрын
really thanks
@petrpechkurov3095
@petrpechkurov3095 2 жыл бұрын
Thank you! Also we can set it to the list of required languages e.g. { "typescript", "javascript" }
@hamm8934
@hamm8934 2 жыл бұрын
Sometimes it really feels like the vim community is finding reasons to not get actual work done lol it’s 2022 and we’re still excited about syntax highlighting
@mndtr0
@mndtr0 2 жыл бұрын
Imo nvim with tree-sitter has best syntax hightlighting
@ernststravoblofeld
@ernststravoblofeld 2 жыл бұрын
Maybe we've been getting actual work done instead of looking at pretty colors all that time.
@KyleSmithNH
@KyleSmithNH 2 жыл бұрын
You can use the '=' motion to reformat a file, presumably you have the lua filetype baked in so `=G` would have fixed all that indentation for you.
@filipeteixeira7839
@filipeteixeira7839 3 жыл бұрын
Thank you for the series!
@kalvinpearce
@kalvinpearce 3 жыл бұрын
Loving the series. Just followed through all of them while updating my config. Definitely a big help for getting nvim-cmp figured out
@jervx829
@jervx829 2 жыл бұрын
It only works for Nvim 0.7+. Thank you so much, I don't really have experience about vim & I'm trying to get out from vscode which is my comfort place to code. Now I love coding in terminal because of this. Thank You, I'll practice more vim
@isAif47
@isAif47 3 жыл бұрын
I would like to suggest increasing the font size while recording videos. I think most of the viewers are using small screen for watching videos, this will be helpful.
@vlota
@vlota 2 жыл бұрын
Yes. And it would also be nice if you'd stop manically scrolling up and down inside every window, while speaking about it. It's the screengrab equivalent of those people who can't stop swinging their camera from side to side to point at each thing they're talking about. There's a reason most professional film-makers use tripods and/or keep the camera still. It's so that your viewers don't have to take a sea-sickness pill before watching!
@HarshKumar-qw5ou
@HarshKumar-qw5ou 3 жыл бұрын
It is not a series but a course.
@jjernigan1065
@jjernigan1065 3 жыл бұрын
Thanks so much for this series!! I can't wait for the rest of your videos. At some point, could you make a video for setting up nvim-jdtls for java? I've been trying to figure it out but it's super complicated...
@Prashant.thomas
@Prashant.thomas 3 жыл бұрын
This was a great series. I've been putting off from upgrading nvim, but your videos inspired me to make the jump. It was not only fascinating but also entertaining. I hope you continue to put up more videos. Could you put up some videos on using lunar vim as a text editor. I prefer VIM to editing text and creative writing. Thanks so much for your time and hard work.
@santiagogonzalez6338
@santiagogonzalez6338 3 жыл бұрын
To fix indentation at 10:12 you could press = and it will fix it for you.
@chrisatmachine
@chrisatmachine 3 жыл бұрын
I've had mixed results with doing formatting that way, in this case I think you're right tho.
@djcardwellai
@djcardwellai 3 жыл бұрын
Is there an easy way to save files and also format on save with the way you have neovim setup?
@stoicfloor
@stoicfloor 3 жыл бұрын
Christmas came early!
@fitfulpanda2960
@fitfulpanda2960 2 жыл бұрын
After section 08-treesitter, when I open 09-autopairs I keep getting the error message : "/.config/nvim/lua/user/lsp/settings/jsonls.lua:172: bad argument #1 to 'ipairs' (table expected, got nil). I've tried 3 times and it keeps happening. I've tried Googling but the results make sense to a noob. What am I doing wrong?
@thatoneguy5191
@thatoneguy5191 2 жыл бұрын
I get an error saying no C complier found, and none of my syntax hilighing works, any tips on what I could do?
@emmanuels.emokor3783
@emmanuels.emokor3783 2 жыл бұрын
I get the error vim/shared.lua:262: after the second argument: expected table, got boolean. How can I clear this error? It doesn't break my Neovim but it's annoying!!
@WeAreTeamNovus
@WeAreTeamNovus 2 жыл бұрын
How would I go about changing the parentheses color from the ts-rainbow plugin from red to something else?
@chrisatmachine
@chrisatmachine 2 жыл бұрын
github.com/ChristianChiarulli/nvim/blob/935cfbc9e310710b4e2ce521e9c8be770703130b/lua/user/treesitter.lua#L39
@kristofferkristensen9142
@kristofferkristensen9142 2 жыл бұрын
Does anyone know how he's repeating the same key so fast? I'm using a mac, and have set the key-repeat to the fastest, but it's nowhere near as fast as his navigating.
@fooked1
@fooked1 2 жыл бұрын
What's the weird white underscrore line that appears occasionally?
@pawekwasny7108
@pawekwasny7108 2 жыл бұрын
Any idea why tree-sitter confilicts with which-key? I cloned your repo and it does not work. I mean I can explicitly call ":WhichKey" but it doesn't bing the usual popup menu and moreover I cannot do it with leader key as usually.
@JeremyIglehart
@JeremyIglehart 2 жыл бұрын
Hey Chris, heads up - the branch for this video seems to be broken and doesn't start with the code that you have in the video. Maybe worth taking a look at.
@nestormorales868
@nestormorales868 3 жыл бұрын
Hey! Loved your video, great content What do you use for autocomplete in python? (The suggestions of functions etc) thanks 🙌
@tony-ma
@tony-ma 3 жыл бұрын
Hi Chris, can you please do a dedicated video on the code formatting in nvim? thanks
@tomosmallpond9306
@tomosmallpond9306 3 жыл бұрын
Hi! I love your series. Could you do one for DAP with nice configurations including nvim-dap, nvim-dap-ui, nvim-dap-virtual-text, telescope-dap.nvim, and vim-ulttest? I'd like some advice to improve my config for DAP.
@claudioribeiro7299
@claudioribeiro7299 3 жыл бұрын
Great Idea! It would be helpful! Chris, thank you for your awesome work!!!
@gonzalooviedo5435
@gonzalooviedo5435 2 жыл бұрын
TSHighLightUnderCursor is not present, what I'm doing wrong?
@g-luu
@g-luu Жыл бұрын
Great video. Please do a colorscheme from scratch tutorial
@mohammadreza.beygifard
@mohammadreza.beygifard 2 жыл бұрын
I wish I could give this video three four or five likes, thank you, man!
@mkamp
@mkamp 2 жыл бұрын
Does anybody know what Chris is using to show the key strokes?
@swastikacharyya
@swastikacharyya 3 жыл бұрын
Merry Christmas ☃️💓 And one question , how are you highlighting the words under the cursor ?
@chrisatmachine
@chrisatmachine 3 жыл бұрын
Your looking for document highlight which is provided by your language server, you can pass this behavior on_attach, checkout my video in the playlist for LSP, Merry Christmas
@swastikacharyya
@swastikacharyya 3 жыл бұрын
@@chrisatmachine Thanks for the quick reply , bingin' the playlist rn :)
@rubempacelli6815
@rubempacelli6815 2 жыл бұрын
Thank you very much!
@Danielo515
@Danielo515 2 жыл бұрын
Is that highlight information part of the default install?
@helloquico
@helloquico 3 жыл бұрын
what is that setting that highlights equal words? I thought it was treesitter, but it was still on when you disabled it..
@helloquico
@helloquico 3 жыл бұрын
is that 'hlsearch'??
@chrisatmachine
@chrisatmachine 3 жыл бұрын
it's an autocommand in the handlers.lua file. I think I explained it in the LSP video. Basically its and autocommand on cursorhold that highlights symbols and refreshes on cursor move. The command that does the highlighting is provided by your language server.
@helloquico
@helloquico 3 жыл бұрын
@@chrisatmachine Ok, thanks, I knew I heard mention it somewhere. Thanks, you're doing such a great job introducing neovim. I had been putting it off, until I decided to try LSP in vim. I got it working but its no pretty. It felt hackish at best.
@Rhxrrrr
@Rhxrrrr 8 ай бұрын
dude how did u get that colour scheme im gonna cry
@bva0
@bva0 2 жыл бұрын
Wait! Does the highlighting come from treesitter? I might have configured something incorrectly... I had to do it through nvim-cmp.
@chrisatmachine
@chrisatmachine 2 жыл бұрын
highlighting comes from treesitter, completion comes from cmp.
@bva0
@bva0 2 жыл бұрын
​@@chrisatmachine Thank you for the reply! I started using Neovim for python development about a week ago and didn't know anything! Binged watched your videos (and liked them, of course) and learned a lot. Something that still irks me though is... how to avoid plugin conflicts? For example, I use pyright LSP for python completion. But pyright does not offer signature completion! I initially thought the issue was with nvim-cmp... So then I installed `ray-x/lsp_signature` and everything works. But what if I had used a different LSP for python, one that provides signature help? Would this conflict with lsp_signature? I should test this...
@wayneswildworld
@wayneswildworld 2 жыл бұрын
I am getting a treesitter error as well as a word search error can you answer my issue in the git repo please :)
@dopamine9176
@dopamine9176 2 жыл бұрын
How to make ejs highlight? In treesitter dont have syntax highlight for ejs
@gonzalooviedo5435
@gonzalooviedo5435 2 жыл бұрын
And treesitter with the configuration that you gave doesnt work as you presented in React .jsx files.
@MudassirKhan-sx9jy
@MudassirKhan-sx9jy 3 жыл бұрын
In my case it gives error tree-sitter executable not found
@MudassirKhan-sx9jy
@MudassirKhan-sx9jy 3 жыл бұрын
It's fixed now : installing npm tree-sitter-cli fixed it
@艾曦-e4g
@艾曦-e4g 2 жыл бұрын
Hℹ, I update to neovim 0.7 release version and the highlight tree-sitter just stop working properly. I set the highlight enable=true, but, I have to use the command to enable highlight, otherwise, it just has no color at all. Does it relate to my terminal or my tmux, I just wonder that. But, I try the ubuntu default terminal instead of my alatertty, and without tmux, I got the same results. Has ever you guys encountered this before and how did you solve it.
@user-xd5gb2rf6k
@user-xd5gb2rf6k Жыл бұрын
were you able to solve this to work with Tmux? i just noticed it today
@trangcongthanh
@trangcongthanh 3 жыл бұрын
Has anyone got an issue with indent for React? It's so annoying but I don't know how to fix :(
@mujiburrehmanansari5671
@mujiburrehmanansari5671 2 жыл бұрын
I followed entire playlist till now multiple time (precisely 7 time ;) ), but still treesitter not working for me, I am using windows 10 OC with vim installed version 9.0 and nvim version 0.8 .. no issue/bugs/messages from nvim but still no highlight for my react file.. :( ... I also ran TSEnable highlight nothing solved
@chrisatmachine
@chrisatmachine 2 жыл бұрын
Did you TS install javascript?
@ricardorien
@ricardorien 3 жыл бұрын
Thanks! amazing
@oriumi
@oriumi 2 жыл бұрын
I can't use treesitter because I always have this error regardless of the language I ask it to install, can anyone help me? 😢 nvim-treesitter[lua]: Error during tarball extraction. /usr/bin/gzip: 1: ^?ELF^B^A^A^C: not found /usr/bin/gzip: 3: ^C^C^A: not found /usr/bin/gzip: 4: Syntax error: "(" unexpected tar: Child returned status 2 tar: Error is not recoverable: exiting now
@jrdicoll
@jrdicoll 2 жыл бұрын
If you get an error try this instead: ensure_installed = {maintained},
@wisniewski3939
@wisniewski3939 3 жыл бұрын
Hi, I really appreciate your work. I have thought about a vim setup for Markdown and latex writing, but I'm not jet capable of doing it by myself. Would you mind making a guide about that?
@krishshah3974
@krishshah3974 2 жыл бұрын
I think Evan Chen has some stuff about that. idk tho
@darkmanker
@darkmanker 2 жыл бұрын
Is it only for Lua or is there a version for Packer? Thanks
@chrisatmachine
@chrisatmachine 2 жыл бұрын
not sure I understand your question
@vitormelo22
@vitormelo22 3 жыл бұрын
How do I update the configuration files? Previously in vim script I used the command below, but in lua I never got it. nnoremap r :w \| :so $MYVIMRC :echo 'Reload'
@chrisatmachine
@chrisatmachine 3 жыл бұрын
you could use dofile init.lua, but the require statement actually caches modules, so even if you make a change in the module it won't reflect until you relaunch Neovim. I have a module I'm working on called hot reload in my personal config you can checkout.
@nearest-river
@nearest-river 10 ай бұрын
your color scheme?
@beyond9thousand
@beyond9thousand 2 жыл бұрын
all / maintained does not work
@julianomoraisbarbosa
@julianomoraisbarbosa 3 жыл бұрын
#til
@gonzalooviedo5435
@gonzalooviedo5435 2 жыл бұрын
Very good, except that you don't expalin how T..F...Hell you load the f... treesitter.lua
Neovim - From Scratch Q&A
17:39
chris@machine
Рет қаралды 17 М.
Sigma girl VS Sigma Error girl 2  #shorts #sigma
0:27
Jin and Hattie
Рет қаралды 124 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
Tree-sitter for Dummies
31:20
Spooky Software
Рет қаралды 37 М.
Neovim - LSP Setup Tutorial (Built in LSP 100% Lua)
37:09
chris@machine
Рет қаралды 150 М.
Treesitter Basics and Installation
13:50
TJ DeVries
Рет қаралды 24 М.
Neovim - Telescope: a highly extendable fuzzy finder
13:57
chris@machine
Рет қаралды 75 М.
Understanding Neovim #4 - Treesitter
16:59
Vhyrro
Рет қаралды 20 М.
Neovim - ~25 Custom Keymaps set with Lua
15:36
chris@machine
Рет қаралды 78 М.
Which is Better Flash.nvim OR Leap.nvim?
11:35
Andrew Courter
Рет қаралды 13 М.
The Struggle To Write a Treesitter Plugin for Neovim
43:34
If Coding Were Natural
Рет қаралды 6 М.
LSP: Building a Language Server From Scratch
1:09:08
Jeffrey Chupp
Рет қаралды 48 М.