Neovim - Treesitter Syntax Highlighting

  Рет қаралды 79,855

chris@machine

chris@machine

Күн бұрын

Repo: github.com/Lun...
Treesitter repo: github.com/nvi...
Rainbow parens: github.com/p00...
TSPlayground: github.com/nvi...
SUPPORT THE CHANNEL
💳 Patreon: / chrisatmachine
💰 Paypal: paypal.me/chri...
👕 Merch: shop.spreadshi...
SOCIAL MEDIA
🕸️ Website: www.chrisatmac...
🐦 Twitter: / chrisatmachine
💻 Github: github.com/Chr...
📺 Odysee: odysee.com/$/i...
💬 Matrix: matrix.to/#/+a...
📡 Twitch: / chrisatmachine
🔌 Discord: / discord
GET INTO CRYPTO AND SUPPORT THE CHANNEL
🏦 Blockfi: blockfi.com/?r...
💰 Celcius: celsiusnetwork...
🪙 Coinbase: www.coinbase.c...
💱 BinanceUS: accounts.binan...
💸 Voyager: voyager.onelin...
📈 OKCoin: www.okcoin.com...
₿ DONATE CRYPTO
Bitcoin: bc1qlw9t04evwvvlgkwkxf3cm9mfk6zgmy09sp4uja
Ethereum: 0x31202eF4Ce3d03c1B5111Bc388f937e7b17dd164
Litecoin: ltc1qmhxvmr9h3hpc226aeqj9sadwjn3gl0nh5qsvkf
Polkadot: 12pxctmVV3HBKqfpnPbgqznKHdpFbihVENH2VJU6Z5HsaD1S
Chainlink: 0x31202eF4Ce3d03c1B5111Bc388f937e7b17dd164
Bitcoin Cash: qqz56dl270wx04z4x8y42aft39ptpksjuggmel0hz6
XRP: raUaxdWMst1Eb96nACTvJTRWgtmsRQpwHk
Stellar: GD7PCULOCC4DLRJN6TJSWFTETDWL4D6URHXEBFX4B4RJQN4B5T7XZ5AU

Пікірлер: 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 Жыл бұрын
Imo nvim with tree-sitter has best syntax hightlighting
@ernststravoblofeld
@ernststravoblofeld Жыл бұрын
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 2 жыл бұрын
Thank you for the series!
@kalvinpearce
@kalvinpearce 2 жыл бұрын
Loving the series. Just followed through all of them while updating my config. Definitely a big help for getting nvim-cmp figured out
@HarshKumar-qw5ou
@HarshKumar-qw5ou 2 жыл бұрын
It is not a series but a course.
@isAif47
@isAif47 2 жыл бұрын
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!
@jjernigan1065
@jjernigan1065 2 жыл бұрын
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 2 жыл бұрын
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.
@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
@stoicfloor
@stoicfloor 2 жыл бұрын
Christmas came early!
@mohammadreza.beygifard
@mohammadreza.beygifard 2 жыл бұрын
I wish I could give this video three four or five likes, thank you, man!
@rubempacelli6815
@rubempacelli6815 2 жыл бұрын
Thank you very much!
@santiagogonzalez6338
@santiagogonzalez6338 2 жыл бұрын
To fix indentation at 10:12 you could press = and it will fix it for you.
@chrisatmachine
@chrisatmachine 2 жыл бұрын
I've had mixed results with doing formatting that way, in this case I think you're right tho.
@ricardorien
@ricardorien 2 жыл бұрын
Thanks! amazing
@g-luu
@g-luu 9 ай бұрын
Great video. Please do a colorscheme from scratch tutorial
@nestormorales868
@nestormorales868 2 жыл бұрын
Hey! Loved your video, great content What do you use for autocomplete in python? (The suggestions of functions etc) thanks 🙌
@tomosmallpond9306
@tomosmallpond9306 2 жыл бұрын
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 2 жыл бұрын
Great Idea! It would be helpful! Chris, thank you for your awesome work!!!
@tony-ma
@tony-ma 2 жыл бұрын
Hi Chris, can you please do a dedicated video on the code formatting in nvim? thanks
@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.
@djcardwellai
@djcardwellai 2 жыл бұрын
Is there an easy way to save files and also format on save with the way you have neovim setup?
@Rhxrrrr
@Rhxrrrr 5 ай бұрын
dude how did u get that colour scheme im gonna cry
@jrdicoll
@jrdicoll 2 жыл бұрын
If you get an error try this instead: ensure_installed = {maintained},
@swastikacharyya
@swastikacharyya 2 жыл бұрын
Merry Christmas ☃️💓 And one question , how are you highlighting the words under the cursor ?
@chrisatmachine
@chrisatmachine 2 жыл бұрын
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 2 жыл бұрын
@@chrisatmachine Thanks for the quick reply , bingin' the playlist rn :)
@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!!
@kristofferkristensen9142
@kristofferkristensen9142 Жыл бұрын
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.
@MudassirKhan-sx9jy
@MudassirKhan-sx9jy 2 жыл бұрын
In my case it gives error tree-sitter executable not found
@MudassirKhan-sx9jy
@MudassirKhan-sx9jy 2 жыл бұрын
It's fixed now : installing npm tree-sitter-cli fixed it
@fooked1
@fooked1 2 жыл бұрын
What's the weird white underscrore line that appears occasionally?
@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
@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 Жыл бұрын
I am getting a treesitter error as well as a word search error can you answer my issue in the git repo please :)
@gonzalooviedo5435
@gonzalooviedo5435 2 жыл бұрын
And treesitter with the configuration that you gave doesnt work as you presented in React .jsx files.
@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?
@mujiburrehmanansari5671
@mujiburrehmanansari5671 Жыл бұрын
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 Жыл бұрын
Did you TS install javascript?
@thatoneguy5191
@thatoneguy5191 Жыл бұрын
I get an error saying no C complier found, and none of my syntax hilighing works, any tips on what I could do?
@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
@wisniewski3939
@wisniewski3939 2 жыл бұрын
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
@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.
@gonzalooviedo5435
@gonzalooviedo5435 2 жыл бұрын
TSHighLightUnderCursor is not present, what I'm doing wrong?
@dopamine9176
@dopamine9176 2 жыл бұрын
How to make ejs highlight? In treesitter dont have syntax highlight for ejs
@helloquico
@helloquico 2 жыл бұрын
what is that setting that highlights equal words? I thought it was treesitter, but it was still on when you disabled it..
@helloquico
@helloquico 2 жыл бұрын
is that 'hlsearch'??
@chrisatmachine
@chrisatmachine 2 жыл бұрын
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 2 жыл бұрын
@@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.
@Danielo515
@Danielo515 2 жыл бұрын
Is that highlight information part of the default install?
@trangcongthanh
@trangcongthanh 2 жыл бұрын
Has anyone got an issue with indent for React? It's so annoying but I don't know how to fix :(
@mkamp
@mkamp Жыл бұрын
Does anybody know what Chris is using to show the key strokes?
@beyond9thousand
@beyond9thousand 2 жыл бұрын
all / maintained does not work
@艾曦-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
@4ndymcfly
@4ndymcfly Жыл бұрын
Is it only for Lua or is there a version for Packer? Thanks
@chrisatmachine
@chrisatmachine Жыл бұрын
not sure I understand your question
@nearest-river
@nearest-river 7 ай бұрын
your color scheme?
@vitormelo22
@vitormelo22 2 жыл бұрын
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 2 жыл бұрын
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.
@julianomoraisbarbosa
@julianomoraisbarbosa 2 жыл бұрын
#til
@gonzalooviedo5435
@gonzalooviedo5435 2 жыл бұрын
Very good, except that you don't expalin how T..F...Hell you load the f... treesitter.lua
Why I Cant Stand IDE's After Using VIM | Prime Reacts
17:51
ThePrimeTime
Рет қаралды 316 М.
когда не обедаешь в школе // EVA mash
00:51
EVA mash
Рет қаралды 3,9 МЛН
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
Neovim - From Scratch Q&A
17:39
chris@machine
Рет қаралды 16 М.
Neovim - ~25 Custom Keymaps set with Lua
15:36
chris@machine
Рет қаралды 76 М.
"Parse and analyze source codes with Tree-sitter" by Maxime Mouchet
51:59
0 to LSP : Neovim RC From Scratch
30:47
ThePrimeagen
Рет қаралды 1,3 МЛН
Why Neovim nerds are so obsessed with the terminal
6:44
Joshua Morony
Рет қаралды 96 М.
The Struggle To Write a Treesitter Plugin for Neovim
43:34
If Coding Were Natural
Рет қаралды 4,7 М.
Ok I tried Tree-sitter! Here is what I think about it...
1:56:47
Tsoding Daily
Рет қаралды 57 М.
A Powerful Way To Make Editing Code In Neovim Even Better
17:48
Josean Martinez
Рет қаралды 124 М.
3 Levels of Vim Refactoring
7:48
typecraft
Рет қаралды 40 М.
tree-sitter explained
15:00
TJ DeVries
Рет қаралды 86 М.