Vim - with Joseph Woodward

Durée: 38m59s

Date de sortie: 27/11/2022

In this episode, I was joined again by Joseph Woodward to geek out on Vim! Joe joined us on the last episode to talk about the Go programming language - and as we’re both huge fans of Vim, we decided to stay on and record a second episode chatting about it!In it, we talk about both the Vim way of using the keyboard (Vim keybindings), and also Vim the editor and its plugin ecosystem.Joseph is a Software Engineer at Form3, speaker, and open-source contributor. Lover of Go, OSS, Neovim and distr...

Hey, everyone, welcome to the Unhandled Exception podcast.
I'm Dan Clark and this is episode number 46.
And today is kind of a part two-ish.
It's a different topic, but in the last episode I was joined by Joseph Woodward to chat about
le langage de Golan.
Et on a fait un épisode de la vidéo d'une fois à deux minutes.
Mais on a été vraiment très grands fans de Vim.
Et alors que je n'aurais pas normalement pas eu le même guest sur les épisodes de Back to Back,
je veux vraiment parler de Vim parce que c'est génial.
Je vais donc mettre les règles et on va faire un autre épisode sur Vim.
Alors, bienvenue à Joe, une très longue journée.
C'est très nautique, Dan, mettre les règles de Back to Back.
C'est mon règles, ça, c'est bien.
Donc je sais que vous avez déjà introduit vous-même dans l'an dernier,
ce qui pour nous était un an plus tard.
Mais comme ce soit un épisode différent,
pouvez-vous vous introduire à l'an dernier ?
Oui, sûr, parce que c'est l'an dernier qui a parlé beaucoup de Go.
Mais vous savez, tout le monde est intéressant de Go.
Certaines personnes peuvent être plus intéressantes de Vim.
Donc, nous avons un autre audience ici.
Oui, je suis Joe Woodward.
Je vivis dans le sud-ouest de l'Union européenne.
Je suis un professeur, software, développeur, slash, enginéreur.
Je ne sais pas si le développeur est enginéreur.
Il y a beaucoup de contention autour d'un enginéreur.
Je trouve l'un des zones très intéressantes.
Et il sera intéressant de voir où ça va.
Mais je suis agressif.
Je suis un développeur de software
pour probablement 15 ans maintenant.
Et je pense que, en tant que plus tard,
j'ai décidé de changer de Vim en plein temps.
Et de parler de l'expérience de ce que je fais,
de Vim en général.
Oui, j'ai vraiment été en train de voir ce que je fais.
Il devrait être intéressant.
Mais avant de parler de Vim,
je vais juste faire ce que je vais vous parler de l'expérience.
Et celui-ci est un tweet par Houston Haynes.
Et il a tweeté,
« Hattip off to Dracon
for a nice garden path intro to Docker
for.net devs.
He navigues the primitives
whilst also unpacking how the ecosystem
can be leveraged in a.net workflow.
»
Il est en train de parler de l'épisode 43,
where I did a solo episode
attempting to demystify Docker.
Donc, merci Houston
for the very kind words.
Et si vous voulez être mentionné sur le show,
juste send a tweet using hashtag
unhandledexception.
All feedback is greatly appreciated
and I'm Dracon on Twitter.
And don't forget that the podcast
now has its own Slack channel.
If you head over to the website
unhandledexceptionpodcast.com
you'll see a Slack link there.
And lastly a quick reminder
that the podcast is sponsored by Everstack,
which is my own company,
providing software development
and consultation services.
For more information visit everstack.com.
Ok, now's the time.
We can talk about Vim.
Although it feels like we need to
somehow shower our screens
because you can customize Vim so much.
I'm quite interested to see your setup.
But obviously that's quite hard
in an audio podcast.
So if we do that later,
then maybe we just have to articulate
what we're seeing.

Yes.
Think about the best way of doing this.
Do you think it's worse blessing out
because you've got the concept
with Vim of how you interact
with the keyboard
and the different modes and everything.
And the Vim editor itself.
Is it worth talking about
just the Vim way of doing things
before we talk about the editor?
Yeah, I suppose it would be good
to cover the foundations of Vim,
what it is.
People may have heard of it,
may not have heard of it.
And then maybe some of the offshoots
feel like near Vim.
And then just Vim bindings
and how popular they've become
outside of Vim.
So that might be an option.
And then maybe talk about
some of the features of why people
want to use, you know,
what is a terminal based editor
over a fully fledged IDE.
Yeah, definitely.
It's supposed to context,
just so the listeners are aware.
A lot of ideas that aren't Vim,
editors, most of them have extensions
that allow you to interact with the keyboard
and work in a Vim way of doing things
which we'll explain throughout this episode
what that actually means.
But just because using the Vim
key bindings to use that term
doesn't mean that you have to use the editor.
Just like you, I've kind of like started
trying to use Vim again,
the actual editor.
But for many years,
I've used Vim in whatever IDE on editor
I've been using at the time.
So VS Code has got an extension.
Ryder's got an extension.
Visual Studio's got an extension.
Link Paddy's used quite heavily.
That's got a checkbox to turn on Vim mode.
So these key bindings are everywhere.
So it's just very, very popular.
Yeah, I think that's kind of one of the
successes of Vim.
And it's had this really common way
to navigate,
not just code,
but navigate text in general.
And it seems to have broadened its horizon,
become quite popular in almost every IDE.
I use Obsidian for taking notes
and that has Vim bindings.
I use VS Code for doing things
and that also has Vim bindings.
And I think one of the powerful things
from my experience,
just committing myself to learning those bindings,
because there is a bit of a hurdle
to learning them.
A bit of a steep on ramp
to get into grips with them.
But once you do,
the powerful thing I found
about learning Vim bindings
is they can be very easily translated
from one IDE to another.
So whereas sometimes,
you might find yourself struggling
going from one IDE to another,
with these common set of bindings
and shortcuts that you can start to use
to manipulate text or code,
in our case.
It makes that transition a little bit easier.
And then eventually,
you might venture into the territory
of thinking actually,
maybe I'll just see what using Vim
for everything is like.
And that's a different challenge
in itself.
But certainly,
Vim bindings can be very powerful
and you can get a lot of the way there
and reap a lot of the power
of the speed you get with Vim
by just learning the bindings.
And you start to see them everywhere.
Later on, we'll talk about K9S
and they exist in there.
And it's great being able to
add a new editor.
It's got Vim bindings, great.
I can use all the same muscle memory
that I'm used to using.
And you're off.
Yeah, definitely.
You've mentioned one word then,
which might create
part 3
of our poker series.
Obsidian.
Oh, my goodness me,
that's amazing.
Yeah, I've got Vim turned on there
as well, but it's such a great note
taking up.
That's the thing is that
sometimes you,
intentionally or unintentionally,
you start building this muscle memory.
And I think that's what I found
quite valuable.
Learning Vim
is that muscle memory exists.
I can easily,
you know,
get comfortable using the same muscle
memory across different ideas.
And you do commit to learning it
and it does pay,
pay back in the long run.
I suppose,
there's always that question as to,
you know,
how productive,
you know,
ignoring productivity versus effectiveness,
discussions,
you know, productivities about producing
something, but it isn't always the right thing.
Like how productive does
learning shortcuts make you?
And, you know,
I suppose in a grand scheme of things,
it's not going to make you complete
your work 10 times faster.
But some people,
myself included,
I just have this fascination with just,
you know,
continuously refining
my workflows.
And Vim tips that box for me,
for some reason, you know,
not necessarily saying that learning Vim
all of a sudden you'll be able to finish
pull requests 10 times faster,
or your bosses will notice how much faster you are.
But at the same time,
there's something quite nice that I like
about becoming an expert of the tools I use.
And Vim is definitely one of those areas
that I feel really happy when I'm,
you know,
I'm not context-switching,
I'm jumping between things in Vim seamlessly.
And then also when you're pairing with somebody,
and they see you using Vim,
it's also, you feel quite sort of happy
when, you know, they're like,
whoa, you know, what are you doing?
You know, I kind of get warm,
and the first is like, I'm using Vim.
I saw a tweet a long time ago,
and it said,
how do you know if someone uses Vim?
They'll tell you.
Yeah,
there's definitely,
there's definitely something there.
It is, it is very impressive to watch somebody
who's proficient in Vim,
as how,
just that the sheer command
they have over the text that they're manipulating,
it is, you know, it's insane how quick.
And also,
there's a bit of a culture around this, isn't there?
If you're into Vim,
there's definitely a bit of a Vim culture.
And there are some great YouTubers out there,
ThePrimeAgent is one,
and he's just immensely fast in Vim.
And you watch him edit in,
and it's just mind-blowing.
And yeah,
I suppose some people just, you know,
enjoy that side of things as well.
Yeah.
It was taking a step back,
and for listeners that have no idea,
what it is,
I'm actually trying to explain how it works,
and from a,
how it benefits me point of view,
we're talking about productivity,
and you mentioned about shortcuts.
I think, you're right,
I don't feel that I get a huge productivity boost
from using Vim,
in the same ways,
if I'm using an IDE,
and I've got a shortcut that can do
a bulk refactor across my entire solution,
you're getting like,
a hundred times productivity
by pressing a keyboard shortcut.
You don't get that with Vim,
it's not that kind of thing.
But for me,
it's kind of,
I've got my hands in the touch typing position.
I don't need to move my hands
to the cursor key,
back again,
to the mouse,
back again,
doing that all day long.
Your right hand
constantly moving backwards and forwards,
even just the cursor keys,
which aren't very far away,
but then you've got to find
the touch typing position back again.
In Vim,
you never have to move
from the touch typing position.
I think that's one extremely powerful thing.
Yeah,
the context switching is definitely
a big one, isn't it?
You do feel that you don't have to
continuously switch context
to the mouse and back again,
or sometimes even switching
IDs or tools.
But yeah, maybe, like you said,
we should go back and give a bit more context
on what Vim is.
A lot of the times,
here we're referring to VIM bindings
as opposed to VIM itself.
So maybe for some of the listeners,
we could go back and give them
a bit of context on what VIM is
and how to quit it.
Oh, can you tell me that?
That's where I'm using Vim still
because I can't get out.
Oh, this is where I can use
one of these sound effects on the...
Which one is it?
There we are.
Can you hear that through?
Yeah, I can.
I'll have to edit that.
So I found, coincidentally,
enough yesterday,
this is quite a few years ago,
I did a YouTube video,
it was a talk, but I made it
into a YouTube video on Vim.
And you can tell it's before I got
all this decent setup
because the audio is awful.
But I will include it in the show notes
because I go through basically showing
how it works and breaking it down
and all the different commands
that you can very quickly navigate around.
So I'll include that in the show notes.
That's the best way of describing this now.
I guess one core concept is
where you've got your keyboard
and you press keys normally in an editor.
If I type for each or if or whatever,
then those words would be typed
into the editor.
And that would happen when using Vim,
when you're in something called insert mode.
When you press escape,
you can then switch to something called command mode.
In command mode,
then all the keys on the keyboard
do different actions.
And it's almost like your keyboard,
when you're in command mode becomes
kind of like a gamepad where
you've got some different combinations
of keys to press in different combinations
which do different things.
So your whole keyboard just becomes
a command palette.
And that's kind of where the power comes in.
But all of this without having to move
your fingers away from the touch typing position.
Yes.
Yeah, as you say,
you've got the two different modes there.
And I think a lot of the power
from Vimbinding comes from the command mode
that you speak of.
Generally when you're in insert mode,
you can edit the text and that's it.
You can insert the text.
But with the command mode,
that's where a lot of the fun comes from, doesn't it?
Yeah, definitely.
The one way you're in this command mode,
some places I read call it command mode,
some places call it normal mode.
But that's kind of like the default mode.
Quite often I go into
insert mode to type something
and then instinctively I press escape.
And I would by default be back in command mode.
And that's kind of where my idle,
when I'm idle I'm in command mode.
And your cursor is like
almost like a block when you're in command mode.
Or when you go into insert mode pressing
I, the I key puts you in insert mode
but there's lots of other ways to get into an insert mode.
And that's when you can just
start typing as you normally would code.
And then there is another mode
called visual mode, which just allows you
to do like block selections
and that kind of thing.
But the two main modes are these command modes
and insert mode.
Or actually there is another mode as well
called command line mode, where if you press
colon you get like a
text box at the very bottom
in the status bar, where you can type
extra commands.
But maybe that's going a step too far
with an audio podcast, because we can't show it.
But as you can see there's these different modes.
But let's focus on this command mode.
And
ah, there's so many different commands.
I think the, it's probably a good way
to separate the different commands out
into
two different categories, like navigation
and actions doing stuff.
Yes, yeah, I think generally
when you watch tutorials
or videos on using Vim, they generally
have a section on
editing via insert mode
or navigating
horizontally and vertically
because there are different mechanisms
for being able to, you know, navigate
across the x, y axis. Sometimes you might want to go to the end of the line.
And other times you might want to go 10 lines down
or 5 lines down.
But you're right, earlier you said, you mentioned
about how you spend a lot of your time, you know,
the default mode is usually
in that command mode.
And a lot of the actions you will use
will get you into the insert mode.
So you might be able to jump forward
and then edit or
delete the current, you know, in a word.
And these are sort of the commands that you can start to use
that will then end up with you
being in insert mode for you to carry on
typing.
Yeah, definitely.
There's one command I really like, which
I probably need to step back a bit
and explain the individual
commands before describing
the whole thing.
So, like, some of the action commands,
for example, like D is delete,
short for delete.
Some of the navigation commands,
for example, like W,
W just jumps to the next word.
If you press it multiple times, it keeps on jumping
one word at a time.
If you put those together, you can do
DW, delete word, that deletes
the next word.
But you can then say, you can combine them
and then do delete
and then any navigation command.
So if I wanted capital G
D is bottom of the file, I could do
D capital G and that would do delete
to the bottom of the file.
So you can kind of combine all these
different navigation and verb commands
into different things.
And that one I really, really like,
this is probably one of my favourite
that I use all the time, is if I'm inside,
if the cursor is inside something,
so it might be inside two quotes in a string,
it might be inside some braces,
an entire method or something,
then if it's inside that I can do,
like, for example, I'll mention about
delete, if I do
DI
QUOTE
then that's like, delete inside
QUOTE
and then that'll delete everything inside the quote.
Or if I do CI,
change inside QUOTE
that does exactly the same, but
like you mentioned before, it then drops you
into insert mode.
So if my cursor is somewhere in the middle
of a string, it might be a long string,
I can do CI QUOTE
immediately everything inside that
all that string is gone
and I can start typing what I want to replace it with.
And just the way you can combine
these different commands
together in different ways,
it becomes actually so, so powerful.
Yeah, it really doesn't.
It's things like, I don't know,
say you have a function for instance
and you want to change the arguments of that function,
just the ability to jump to inside
that function and change everything between
the brackets to delete everything
within it to then, you know, you start writing
your syntax that you want to rename
in functions, you know, you sort of change
in a word and it will delete that whole function
if it doesn't have white space in.
And then being able to just effectively
navigate around both
vertically and horizontally
around text,
being aware of the syntax of the text
such as white space and brackets
and the fact that it takes
out in comparison.
And then being able to compose those commands
into editing.
So as once you get into those habits and you build
that muscle memory, you're very
efficiently able to navigate
a code file and also
using some plugins or
using some of the existing features
within VM, multiple code files
as well. You can very quickly
yeah, find yourself
flowing through
the code as you change it
without the context of shifting from
mouse to keyboard and back again.
I think that's one of the things I love about it,
just the fact that you mention about when it
becomes muscle memory, when it does
become muscle memory, it's
it's like you're
thinking things to happen and the code
just morphs as you're thinking about it.
And I think that's the key bit, it sounds
really complicated and when you first learning it
you're going to hate it. You've got to get
past that point where it's muscle memory
and it's just intrinsic in your mind and you're not
thinking about it. But once you do
then the code
kind of morphs as you think
it to happen, it's quite magical really.
Yeah, you can almost
edit the code or
the text in the
speed you're thinking about it.
And yeah, it just
it just
starts to feel natural and like you say
it does require that bit of upfront investment
to learn, just the basics of the
a lot of those VIM bindings.
But when you do
develop that muscle memory, it starts
to become quite rewarding. And then
you can start to incrementally
learn the next set.
Or you might notice something that takes a little
while to do and you know, when I say a little
while I mean in VIM time.
That is maybe feels a bit awkward to do
and generally you'll find there's
a different way you can do it using fewer
keystrokes. And again, it just kind of
fits into your whole workflow there.
The whole
experience of editing code just becomes
really rewarding and fluent
because there's so much less context
switching. Yeah, definitely.
I'm learning new things all. I've used it
for like, you know, 15, 20
years and I'm still just learning
stuff because there's just so
many different ways you can you can use
things in combination and little tips
along the way. So it's so, so powerful.
Yeah, I think
for me personally, having
now moved full time to using
VIM as an editor
it kind of adds another layer
on top of that because where you're used to flowing through
your code base or a file using
VIM bindings, the same applies
but on a wider project
level now. And then
earlier on, you mentioned about the
interactive command line. You can press your
colon, you get your command line down the bottom.
You can use that to execute shell commands.
So to execute tests
and it has a buffer to remember the last ones
you used so you can easily jump to it, press up
and then you have your history there as well.
So for instance, a common workflow
whereas normally if you wanted to
make some modification around the test, you'd
have to move over to the left, find the test, right click
and run. With
something like VIM, you can
modify the text and then
quickly run the command to run the tests
and it all feels very fluid and that
can also apply to the idea
and the navigation between windows and
panes and different files as a whole.
Yeah, that's probably a good way
to talking about the VIM, like the editor
and plugins and stuff. Just a couple more
little points I'd like to mention about
the editing, some which make it really
powerful, that I think is worth pointing out, is
just little things like
you mentioned before, that if you want to jump down 10 lines
any of these VIM commands I mentioned before
you can just type a number
before you do the command and it will do it
that number of times.
So for example, like J to go down
if I press 10 or 100
J, it will jump down 10 or 100 lines.
If I mentioned
DW for delete word, if I
type 10
DW, it will do that 10 times.
There's another concept called macros
where you can, I won't put too much into it, but you can
record a macro,
a quick shortcut, do a whole bunch
of commands or whatever, move around type
stuff, write some code, stop the macro
and then replay it.
And one thing I quite often do is say I'm editing
I don't do this so much with code
but if it's like a data file, which I
just want to go and, Jason
I just want to go and repeat lots of times,
I would record a macro of whatever I'm editing
for that line or a few lines
and then I can
replay it, I can do like 100
replay and it just goes
and do this macro 100 times
and it is incredible.
Oh, and there's also the
period shortcut, which just repeats the last
action performed. So if you did
DW, which
as we said, delete word
then you can hit period to repeat
that action or
DD, which deletes the current line,
you can hit period to repeat that
or if you go into insert
mode and type some text and then
hit escape to go back to the command
mode, hitting period will repeat
whatever you typed in insert
mode. Or
if you run a macro, which we just mentioned
period will repeat that too.
So there's lots of shortcuts which
can just save you so much time.
Yeah, in terms
of its extensibility, you know, we'll move
on to plugins in a moment, but in terms of
everything it does, it does
feel like it's evolved
with a modern workflow as well
like say being able to create macros
and create repeated commands.
You know, it's not the kind of thing that you'll sit down
and learn in one go, it is a lifetime
or a multi-year thing
of learning your basic commands starting
there and then just starting to build on top of it.
But as you start to peel back those layers
you realize how powerful it can
it can become.
Shall we
talk about the editor now, the Vim editor
because we've kind of like so far been talking about
how you interact with the keyboard
in the Vim way of doing things
but you can do that in with extensions
and everything. But the editor
itself, we mentioned about plugins, as far as
communities you mentioned.
What is a good reason that
like you've said you've recently switched using Vim?
What, like if you
Why?
Why did you go from this fully
fledged, you know, graphical
ID to a text-based editor?
Yeah, I don't know really. It looks cool.
No.
I suppose I didn't really have any
intention to do it but I started
where I work now and there's a number of people
that are Linux people that use Vim
and you sit there and you pair with them and you watch them
and you just watch how effortlessly they
sort of float between a code base
and there's no
context switching and I suppose
I just go for Con and I was talking to
somebody who had a bit of experience with it
and they were talking about how their
their experience is switching
and kind of gave me some tips. I thought, I'll try it.
And I think because Vim
is so customizable as an
editor as well, you have lots of different plugins
and it's got a really, you know,
great community around, you know,
Vim enthusiasts that have made it a great
development environment for people.
You can generally find, you can
create the same workflows that you have.
Normally, in Vim
they either exist within Vim by default
or there's a plugin to allow you to do it.
And for me, I took a look
at what's called Neo Vim, which is kind of
a modern version of Vim.
I mean, Vim as an editor
is quite old. I think it goes back to sort of
the 70s.
And Neo Vim is a reimagination
a modern version of that.
And it also includes an LSP,
which, you know, to some of your listeners
that don't know, LSP stands
for Language Server Protocol,
which was released as part of
Visual Studio Code, it was published by Microsoft.
And basically what it is, is it's an RPC
based specification, I think it's Jason,
Jason RPC based
specification
that allows
a language server to communicate with an editor.
And it was, it was a really good,
you know, it's a fantastic idea of Microsoft
to standardise on a way to allow editors
to communicate with language servers
or some means of a language server.
And they published it alongside
VS Code as specification
and Neo Vim was somebody to
quickly jump on board.
Because before this LSP came out,
all these different editors
before VS Code,
they would all have their own different implementations
as to how they would integrate with languages.
And the LSP kind of
was a specification that language servers
could follow and IDs could follow
to make them all interoperable.
And Neo Vim does that. So you have
VS Code-like, IntelliSense
and functionality language support
inside of Neo Vim, which
you know, it's kind of one of the
core features of Neo Vim along with
Lua as plugins
to create these really sort of fast
performant plugins.
So you're able to create text-based
versions of an ID that you might
be used to with file trees
on your left-hand side, or being able
to search for code via the syntax
or the symbols. So it wasn't a big jump
for me. I suppose I was quite keen
to continue my Vim journey
and go from bindings to actually
using it as a fully-fledged ID.
And I think that's kind of what
drove me to it. And it didn't take me long
to adapt it to the workflow I was most
common with, in my case, in GoLand.
So I've recently, the bindings
extensions in whatever
editor I've used, I've used for many years.
But I've not used, at the
period many years ago I've used in Vim the editor.
And now I've actually just started using it
again. And when
I'm doing .NET development, I'm still in Ryder.
I tend to use Vim where I would
have used VS Code. And one of the things
I like about it is, I do a lot of stuff
on the command line. So I just
navigate the files on the command line.
I use KNINES, which we mentioned before.
I use SmartGit as a GUI.
But I also do a lot of Git on the command line.
And a lot of these tools
bring up your default editor.
So, for example, if I'm in Git,
when I'm doing a commit message,
it's popping up my default editor
so I can type the commit message.
If I'm doing an interactive rebase, it's
popping up my default editor.
If I'm in KNINES, I'm doing some Kubernetes stuff.
If I press E, when I'm on
a resource, it can edit that resource.
And it's YAML based.
Resource and Kubernetes are YAML based.
So if I do that, it opens up my default editor.
So,
a lot of these command line tools
for it to open up my default editor,
which I've customised and made super powerful
and has all of VIM bindings
in the same terminal.
So I use Windows Terminal for Windows
and it's all in the same place.
Then, it's just
a really, as you mentioned before,
it's a really nice workflow
where you're not jumping around, you're staying
in the same place. And that works really well.
But it's not really replacing Rider
for .NET development because I would miss
all the power, the intelligence
you get, which is very, very language
specific, probably way more so than the LSP's.
But I do use it for everything else now.
I suppose it depends a lot
on the language as well.
You're right, things like Rider
they do have visual coders
visual studio.
They do have fantastic
language support because
they've got this years of experience
with building these and really fine
tuning it to that language. So you do
I did find in terms of
my editor's knowledge of
the language structure
switching to NeoVim,
it did lack that, but it made up
in other areas.
For Go for instance, they have
what's called DELVE, which is a debugger
which works via command line, so integration
there is good. And then Go has
an LSP itself
the one they use for visual studio code.
And again, it's definitely
no Go land, but
as you mentioned earlier, you can
again in this mode when you're in your editor
if you're comfortable using a terminal
and you're using a couple of programs with it.
The great thing with something like NeoVim
or using Vim as an editor
is it allows you to stay in that
and that's worth something and sometimes you're happy
to take those small hits
in the fact that you lose this
little bit of ID knowledge around
particular part of the language
you can make up for that in other ways.
So yeah, it is a kind of
some languages you'll have better support
than others. Rust for instance has great
Vim support and when the developers
develop Rust, kind of one of the things
that they said they wanted to do is make
you know, some of those popular
Vim Editors, first-class citizens
but some, you know, some other languages
the language support isn't so great
there, so you do have to make that decision
as to, you know, whether you can
give up the idea in that case.
And I do find myself going back to Go land
in some cases when I'm trying to debug
something, but it's become far fewer
and, you know, not so much
anymore now that I'm used to
using Delve, which is a command
line debugger, which, you know, has some
integrations with Vim.
So we've said that there's so many
different plugins and everything.
What's your favourite plugin?
Oh, put me on the spot now.
There's a
quite a common popular one
that, you know, is used by a lot of people
called Telescope.
Essentially what it is
is, you know, in some editors
such as Rider, I think
ReSharp will probably have something similar in
Visual Studio, but it's just a
terminal you type anything into
and it will figure out what you're typing.
It'll either grep what you're typing
or it'll find the file or find the test.
And it's kind of like that. It becomes this
central means of navigating to anything.
So if I go into a codebase, say Go codebase
and I'm looking for a particular
file, there's a simple
two command shortcut
there to pop up a window.
Start typing, in real time it'll filter
through exactly what you're looking for.
And it can become syntax aware
and you can build plugins for it as well.
It's got a really big ecosystem
that allows to search through Git commits
anything you want really, because Vim
is so extensible.
You can literally find extensions to search
through anything you want. And that would probably be
the most used one simply
because you drop into a codebase
or a document and you can easily find
where you want to get to really quickly.
You can find bookmarks, anything
if the list goes on.
I use that quite a lot as well
and there's
an open source
library called RIP grep
and that's the cross platform
so it probably is the same not just windows.
But I've used that for quite a while
it's like a command line grep tool
and I believe this uses that
so it is very, very quick to do the grepping.
But as you say it plugs into the
bookmark, dof
you can just search for lots of different things
it's really nice. And there's so many different plugins built on top of it.
Yeah, I mean
it itself has its own healthy ecosystem
of plugins and plugin authors.
You're right though it does use RIP grep
under the hood and it's really fast
as a set.
Yeah, I'm just looking through my...
So I've got a git repository
I'm afraid it's not public because
it's got all my configuration. I did write a blog post
about it which I can include in the show notes
I like how I've set this up.
But I've just got all my things like
Chocotie, Git, K9S we mentioned before
NeoVim, so I use NeoVim
for that flavour as well
All my Posh, PowerShell, Windows, Terminal
all those configurations I've got
in the same git repository.
And so I'm just looking
at that now, at that setup.
And I'm just looking at all my plugins.
And so another nice one is EnvimTree
which is kind of like gives you
typically what you would normally get
in an editor where you've got the sidebar
and you get that. But you
still get all of them shortcuts
in the sidebar
file explorer kind of thing
Yeah, exactly. I use the same tool
and it's really helpful
when you're switching between
say JavaScript or
another language that requires a separate editor
when you're in the case of using
Envim as an editor, you're still using the same
tooling there so you have exactly the same
workflow
for every language
and naturally some IDs do have
good support for other types of
source code and code files.
But it just creates that nice
continuous workflow doesn't it?
It sort of flows quite nicely.
You mentioned about Lua before
which is kind of like the scripting language behind it all
you can configure. But you can also do your
config files as just VIM files.
And I know there's like different people of different preferences
whether they have their main config
everything's a Lua or whether
you're just using these VIM files.
For me, I'm just using the VIM file
and I need to explore whether Lua
would make my setup more powerful.
Do you have a preference of the two?
I can't say I do really.
I mean, like you, I have
a repository of my dot files
and I think that's one of the nice setups
you can also include.
Where you have a repository to get your machine
back to the state it was in.
You're used to working on this so I can run
my make file, it'll install my brew dependencies
and then it'll install NeoVim
and it'll install my plugin manager
for NeoVim and then it'll install all the plugins
et c'est un peu bon.
Mais beaucoup de l'extension
de NeoVim sont Lua-powered
donc, généralement,
tu te dégages un peu de lua codes
mais pas de vrais préférements
personnellement.
Je sais qu'il y a des extensions
et la chose que je utilise
c'est le VIM plug.
Et ça est moins de Lua
parce que tu mets dans les commands VIM
et tu fais juste plug. C'est intéressant
parce que ça montre
comment l'open source
et la communauté est-ce.
C'est comme si tu as un github repository
pour le plugin que tu fais.
Si tu prends le github.com
et tu mets
le username
sur le repository de la URL
c'est ce que tu mets dans ton config.
Donc tu mets le plug
en quotes,
et puis VIM
automatiquement
sait
quel github repository
a ce code.
Donc tu peux regarder
les codes, tu sais ce que c'est installé.
Mais c'est juste si vite pour installer ces plugins
basé sur ces projects open source.
Oui, oui.
En cas que je n'ai pas utilisé quelque chose de paca,
et tu te rends un paca sync
et tu les dégages d'un autre,
tu peux enlever des plugins que tu n'as pas besoin.
Et puis tu les compiles en un grand file Lua
et tu sais, il n'y a pas
beaucoup de plugins,
il n'y a pas d'impact en performance.
Mais tu sais, ça fait une extensibilité
très bien, especially quand tu commences
à utiliser ces plugins.
Oui, c'est certain.
Je sais que tu as un hard stop
dans deux minutes, donc on va probablement
très rapidement râper.
Nous n'avons pas déjà fait un de ces plugins,
parce que c'est le deuxième épisode de aujourd'hui.
Je l'ai fait un très fort,
je l'ai mentionné avant,
ou je l'ai hinté avant,
que je peux maître
mon capsoc
à mon outil d'escape.
Et c'est parce que généralement,
quand tu as utilisé VIM,
tu te presses l'escape tout le temps
pour aller au mode command.
Et avec un keyboard modern,
généralement, l'escape est
assez haut sur le haut-à-leib
du keyboard, donc tu te presses
tout le temps, donc c'est assez un reach.
Maintenant, qui utilise ta
capsoc? C'est juste le perfect place
pour ta petite finger
d'être pressée tout le temps.
Je suis un utilisateur de Windows, je suis sûr,
Mac et Linux sont similaires.
Il y a un outil appelé Sharp Keys,
ce qui est un outil que je peux
inclure dans les show notes.
Et ça juste vous remap des différents
clés à un niveau bas.
Et maintenant, sur mon computer,
la capsoc est à l'escape.
Et ça fait que VIM est beaucoup plus facile.
C'est un des belles choses
que j'aime beaucoup de VIM,
c'est quand les gens,
un autre chose commun,
c'est de te dire que tu as un dotfile,
tu as des dotfiles,
et les gens ont de leur part de leur dotfile.
Et tu peux voir leurs configurations
dans les jeux.
Et tu peux apprendre
des nouveaux plugins
et les clés qu'ils utilisent.
Et ça vous ouvre
des choses que tu peux
vous faire perdre.
Et c'est assez enjoyable
de regarder
ces clés que les gens
utilisent, les clés qu'ils utilisent.
Et tu as suggéré
de utiliser
la capsoc
pour l'escape.
Et je suis élevé
la même chose.
Et ton spot-on
a fait une différence.
Donc mon tip de dev
dans le spirit de VIM,
comme je l'ai appris
dans le premier place
comme il y a longtemps,
il y a un grand site
qui s'appelle VIM-Adventures.
Et c'est un jeu simple
qui vous introduit
pour des commandes basic
de VIM
dans le contexte
de la 3e scroll,
3e personne,
le top-down
de l'un des personnages
qui a besoin d'envoyer
ces worlds
et de la pique des rocs
ou de la maise
qui est utilisée
par des commandes
des commandes communes.
Vous allez commencer
à se faire reconnaître
quand vous utilisez VIM.
Donc si vous êtes intéressés
en voir
ce que la VIM est
et en essayant de comprendre
pourquoi les gens
parlent aussi fondament
de ça,
donc,
n'hésitez pas
à regarder les adventures VIM.
J'ai joué
avec ça
pas d'un peu d'anime,
mais je n'ai pas
eu un grand temps,
donc je vais regarder
ça et voir
si je peux apprendre
quelque chose
de plus fort que je peux
faire dans le jeu.
Oui, c'est le truc,
c'est que
vous pouvez trouver
votre VIM-Wave
pour faire des choses
et vous avez trouvé
d'autres manières.
Et puis,
il y a une challenge
de réprogrammer votre VIM-Memory.
C'est génial.
Je sais que vous devez
faire des choses,
donc,
avant de passer,
les listeners
pour vous réveiller,
vous avez mentionné
Twitter la dernière fois?
Oui,
probablement,
c'est le meilleur place.
D'encore,
Joseph Woodward,
vous avez probablement
inclusé dans les notes de la show,
mais si vous êtes intéressés
en parler plus de VIM,
j'aime parler de VIM.
Donc, je vais profiter
de VIM-Stuff.
Nous devons juste
se battre,
je sais que vous n'avez pas de temps,
mais de partager les screens,
parce que je suis en train
de faire votre setup.
Je suis content
de mon setup,
donc,
je peux faire des notes.
Oui,
vous devez vraiment faire ça,
je suis en train de le faire.
Bien,
c'est le meilleur place,
mais merci
beaucoup pour ça.
Merci,
tout le monde,
je vous remercie
que ce podcast est responsable
d'Everstack,
qui est mon propre company,
à propos de la développement
et des services de consultation,
pour plus d'informations,
visite everstack.com.
Et si vous aimez le podcast,
s'il vous plait,
me l'aie aidé à mettre
les mots sur les réseaux sociaux.
Je n'ai pas utilisé le hashtag
UnhandledException,
et je peux être trouvé
sur Twitter,
app,
d-r-a-c-a-n,
et mes d-m-s
sont en train de se faire.
Mon blog,
d-n-c-l-a-c-a-n,
a des liens à tous mes services sociaux.
Nous allons inclurent les liens
à tout le truc qu'on a mentionné
aujourd'hui dans les notes de la show,
qui peuvent être trouvé
sur
UnhandledException.com.
...

Les infos glanées

Je suis une fonctionnalité encore en dévelopement

Signaler une erreur

TheUnhandledExceptionPodcast

Tags
Card title

Lien du podcast

[{'term': 'Technology', 'label': None, 'scheme': 'http://www.itunes.com/'}]

Go somewhere