Today I decided to give Vim a try, as it is praised as something godlike here and in many programming communities...

Today I decided to give Vim a try, as it is praised as something godlike here and in many programming communities. I didn't go for it for the popularity thing, but because I think it could help me out more than Sublime which I've been using for 2 years now. I'm into full stack development, I work as one and I do front and back end and even some mobile apps. I also use Windows because I can't care less to change to Linux because I'm used to Windows, I like Photoshop and Illustrator (I know Wine is a thing nowadays) and I play some games from time to time. It has been three fucking hours as I installed Vim and I didn't even manage to put in a "proper" theme because all of those that come with Vim are awful.

How and why the fuck did you start using Vim? Should I just give this shit up and go back to Sublime, probably miss out on some saved time which will build up way more than it will take me to get a grip of Vim? Why the fuck are there no proper tutorials or guides regarding how to use it? I've been trying to install a theme (colorscheme) for 3 hours because I can't access the vim folder and none of those "~./vim" and similar paths don't work and why is my $HOME set to C:\Users\user and how do I change it to be able to access the vim folder with cd $HOME?

Seriously, I'm so close to giving up on this because I'm wasting my time with it and not even moving anywhere with it.

Other urls found in this thread:

forum.sublimetext.com/t/rfc-default-package-control-channel-and-package-telemetry/30157
en.wikipedia.org/wiki/Visual_Studio_Code
youtube.com/watch?v=wlR5gYd6um0
youtube.com/watch?v=3TX3kV3TICU
youtube.com/watch?v=XA2WjJbmmoM
learnvimscriptthehardway.stevelosh.com/
vim.org/scripts/script.php?script_id=273
sublimetext.com/docs/3/vintage.html
coderoncode.com/tools/2017/04/16/vim-the-perfect-ide.html
youtube.com/watch?v=_NUO4JEtkDw
twitter.com/SFWRedditGifs

I just use nano.
You have to understand that vim predates most commonly used keyboard shortcut idioms like ctrl+s to save, ctrl+o to open, meta key shortcuts, even arrow keys didn't exist around the time vi was written, so you had hjkl to take their place.
Unless you want to really commit to learning the ins and outs of your text editor, just use something you're more comfortable with.

you can find proper themes online, as well as proper vimrcs
First you should go through vimtutor though, its actually quite helpful and gives you the solid basics

Ah, vimtutor comes with vim usually, try running vimtutor from the commandline, if it doesnt work look for the vimtutor file somewhere in you vim install folder and open it

I'm fine with not having those idioms actually, I fiddle a lot with cmd so just adding a command here and there instead of a keyboard shortcut is fine with me.

I found a theme, themes to be more precise. 16-bit seem nice for me, I could swap between few of them for day/night usage. The thing is I want to install them without clicking the folder and just doing it that way. Also, I'm kind of just going through the commands Vim has, probably it will take me by the end of the week before I try and edit a project with Vim.

Sure, I'll give it a go now.

sed:>> sed 's/old/new/'
bash_history:>> !!:s/old/new/
vim:>> :s/old/new

Why are you programming on Windows? Might as well shoot yourself at that point

>I also use Windows because I can't care less to change to Linux

This right here tells me you will hate vim and not gain anything from it. Here's a clue. The whole point of vim is that it's different, hard, modal, efficient.

You put in work, and gain 10x the reward in efficiency back, but you have to be openminded to learning a new input method in the first place.

>theme because all of those that come with Vim are awful.

Incorrect. I used "darkblue" everyday at work for a year before I got bored of it and switched. "desert" is also sworn by by a lot of people (and I admit it is very easy and nice on the eyes, like a less shit zenburn). Dracula is my current theme of choice (not default).

>Why the fuck are there no proper tutorials or guides regarding how to use it?

There's literally a beginners guide built into your installation. Google vimtutor (its a little harder to find on Windows but its a .bat file in the install location).

>I've been trying to install a theme (colorscheme) for 3 hours because I can't access the vim folder and none of those "~./vim" and similar paths don't work

Those are Linux paths. Vim for Windows is easy. You can put a folder called "vimfiles" in $HOME and a folder in there called "colors" and shove themes in there. It will find them. You can put your _vimrc in there too. Or you can put your _vimrc straight into $HOME and it will find it there too. You can also put colors folder with themes and _vimrc into its default install location straight in ProgramFiles and it will find them (not recommended though). There's probably already a default _vimrc in the install location its using

Tl;dr: Fucking google it. There are easy answers to all your questions. You're just fucking it up. Search "vim windows" with everything, Linux advice will not be quite the same.

>Why the fuck are there no proper tutorials or guides regarding how to use it?

Also apart from vimtutor there's an extensive help system built into vim.

You can type :h [any key or command] and get a documentation pane right there.

>vim on Windows
>WINDOWS!
found your problem

...

>probably it will take me by the end of the week before I try and edit a project with Vim.

You need to know almost nothing to do that. Best way to learn is by doing.

Move cursor around with hjkl (not the arrow keys, you'll thank me after a month)
Jump forward a word with w
Insert some text by pressing i [text to write] ESC
Press u to undo

Press colon (:) to type commands in the bottom bar
Save existing file with :w ENTER
Create and save a file that doesn't exist yet with :w [filename] ENTER
Quit with :q ENTER
Do both at the same time with :wq [optional filename] ENTER

Congrats you now know enough to do basic editing. That's all I knew at first. Now just google everything you do to find the more efficient way.

If you press something by mistake and/or stuff changes, press ESC a bunch to cancel a command in progress and return to normal mode, then press u to undo whatever you did.

Here's a bonus to whet your appetite.
Press dd to delete the line you're on
Press p to insert the deleted line below the line you're on (P to insert above)

So you wanna move a line down by one? Press ddp. Simple as that. How about down 2? ddjp. Easy. Down 5? dd4jp.
You know d deletes, and w moves forward a word. What do you think dw does? Try it then press u. Now press p.
You can combine things in infinitely many ways. What do you think d3w does? How about 5dd or d5d. Try those too.

Just continue using Sublime.
I tried both and I prefer Sublime, it's just about what you're most comfortable with.

I learnt vim on my work Win 10 machine.

Why?

I was fuckin bored out of my mind and needed to make it interesting. Vim works fine on windows.

With a good terminal emulator that has git and bash for windows you can use vim with your git workflow like you would on linux.

If you have Windows 10 then just turn on the Linux subsystem... no reason to install some shitty bash emulator

But he already has problems and is probably because directories are different on Windows. All is twice as hard on that OS.

You must be mentally impaired to be comfortable with a proprietary text editor.

>muh FOSS
Fuck off, nobody gives a shit.

BTFO nigger

...

it's a text editor, it's not going to plug your computer into the botnet.

This predated the Linux subsystem.

And desu I still haven't got around to getting that yet because I delayed updates, and my coworker installed it and found that it lives in its own sandbox with no access to your windows files or had some similar issue I don't remember exactly what it was. I saw no gain.

Directories are different but all he has to do is google "Windows Vim [thing he's trying to do]".

Like I said in my post I'm pretty sure the Windows equivalent to ~/.vim/ is $HOME\vimfiles. I tweaked it until it worked and then I left it alone and access my _vimrc through $MYVIMRC so I don't remember where it is (sitting in $HOME next to vimfiles\ I think).

Neovim desu senpai

Though I use vim because its less buggy on Windows atm (ironically)

The Vault 7 Vim guides were pretty ok

forum.sublimetext.com/t/rfc-default-package-control-channel-and-package-telemetry/30157

>viable alternatives exist
>use proprietary trash regardless
Imagine being this mentally retarded.
en.wikipedia.org/wiki/Visual_Studio_Code
>Visual Studio Code collects usage data and sends it to Microsoft, although this telemetry reporting can be disabled.[20] The data is shared among Microsoft-controlled affiliates and subsidiaries and with law enforcement per the privacy statement.
forum.sublimetext.com/t/rfc-default-package-control-channel-and-package-telemetry/30157
>Recently @gerry pointed out that it appears the third most popular package in the Package Control default channel is apparently sending data to the startup Kite
And in response to why this is there:
>the truth is we didn't remember. This was done the better part of a year ago and we haven't looked at it in a while
Etc, etc, every single major proprietary piece of software or platform.

I making you a favour OP, first entry level videos, watch in this order and ignore titles, is for beginners:
Mastering the Vim Language youtube.com/watch?v=wlR5gYd6um0
Let Vim Do the Typing youtube.com/watch?v=3TX3kV3TICU
How to Do 90% of What Plugins Do (With Just Vim) youtube.com/watch?v=XA2WjJbmmoM

Finally to master vim (useful even if you don't want to learn vimscript) learnvimscriptthehardway.stevelosh.com/

Btw I also use this plugin (see pic) vim.org/scripts/script.php?script_id=273
Install EXUBERANT Ctags to use it.

Also try learning Linux as a proper programming environment.

>>viable alternatives
It's about personal preference you utter mongoloid.
>muh privacy
Fucking hell. You must be very productive.

The fuck you say retard, take your sub standard bullshit and put it in your ass.

>It's about personal preference
See

That's the thing, you don't have to know the entirety of vim to make good use of it. I get by with most of the basics and some regex and that's good enough. Some plugins fill in the gaps for some features I want and I'm gold.

>being this mad over software
Keep eating your foot cheese
>stop liking what I don't like
Fucking neckbeards, I swear.

You're not the type of person who will like vim. Vim is convenient for people who do a lot of ssh and low level programming.

You are the first to take an ad hominem against libre software. If you don't like vim stay the fuck out a let other people do the talking.

>You are the first to take an ad hominem against libre software
Nope. Simply told OP to use what he was most comfortable with, but of course some autist had to interject for a moment in as soon as Sublime was mentioned.

:r somefile.txt
> reads the contents of somefile.txt into your vim file
:r! somecommand
> reads output of `somecommand` into your vim file

Nigger I only see you shitting on this thread. I don't care about the other guy take your autism away.

>your autism
I'm not the one ranting about the proprietary software boogeyman, m8.

k

> Uses to sublime text
> switches to vim
> doesn't know about vintage mode in sublimetext
> doesn't realize most good text editors have a vi mode

sublimetext.com/docs/3/vintage.html
Read it, plebian. You don't have to switch shit.

Practice is the best teacher when it comes to vi. Occasionally take breaks to look up useful commands. Learn by doing. You will thank yourself later.

Get rid of Sublime, is buggy and unsafe. Vim can do everything and you don't need to buy shit. Damn, even NetBeans is better than Sublime.

>Simply told OP to use what he was most comfortable with
Retard piece of shit fuckface.
>BRO DON'T EVER LEARNING ANYTHING NEW, MUH LE COMFORT BRO LMAO

Even Gedit is better than Sublime.

>waste your time learning something that does the exact same shit as what you're used to just to please Sup Forums, bro
Kill yourself, neckbeard.

Practical Vim - read it. Then install emacs and use Evil. Congrats, you made it.

Don't fall for the FOSS meme, it's shit.

As someone that works on Linux server for a living, vim is great and accomplishes it's goals. I've found (or vi) on every server I've worked on. It had sane defaults and let's me move around very quickly. I can edit multiple lines at once. No other editor had the benefits of both efficient editing and being on nearly any Unix system. Nano is baby mode.

Sure it's not the best, and I love developing software on my personal riced out vimrc setup, but you can't beat it.

If you want to learn it, what I'd recommend is to just switch to using it as your daily driver and disabling the arrow keys. As you want to accomplish things (how do I insert "static" before all these 5 lines, how do I add line numbers, how do I insert the result of a shell command in the buffer, etc) use the help function first then Google.

Now if you never use a unix based operating system and only use winblows, don't bother learning vim and just use sublime like the gamer you are.

>nearly any

Vi is POSIX that's why its on every linux system.

>only use winblows, don't bother

1) You can use vim on windows
2) As others already stated, every text browser worth using in 2017 has a vim compatible or vim plugin mode.

>Why the fuck are there no proper tutorials or guides regarding how to use it?

>open terminal
>type vimtutor
>oh look a proper tutorial on how to use it

There are proper IDEs to try. Going from sublime to vim is a shock to hipsters

>in infinitely many ways
>the universe is finite
modern high schoolers, everyone

coderoncode.com/tools/2017/04/16/vim-the-perfect-ide.html

There are plug-gins for literally everything. Try to learn from the vimtutor first.

>normie webdev try vim
>>hurdurrr dis is 2 difficult XDD
>shitpost about it on Sup Forums and leddit
here is my advice: install gentoo

Vim is really only as good as you set it up to be. I don't really use vim on Windows, but I'm assuming gvim is the way to go for that platform if you were to. If I'm on Windows, I'm probably using Visual Studio to do development that should be available on Linux anyway (thanks M$).

Step 1:
Read the vim instruction manual. Go through the start guide several times until you think you have a decent grip on the basic functionality of vim.

Step 2:
Download a vim plugin manager. I used vim-plug, but any of them (vundle, etc) will work. These are going to help you easily download and install the plugins that make modern vim better than sublime/atom/vs code. I then installed plugins for code completion and everything else that I used with sublime/atom. Chances are that a vim plugin exists for all but a few sublime plugins.

Step 3:
Use it. Use it for everything. The only way to get better and fully understand it is if you practice with it.

Ultimately, I left sublime for atom because of its extensibility (and muh open source). I ended up leaving atom for vim because of speed and to use less system resources. I'm glad I did.

i have vim muscle memory, but theres no way I would learn anything beyond the absolute basics if I were starting out today

vim is the gentoo of text editors

just use nano you turd

There is literally no reason to use a CLI on windows let alone Vim. What, are you retarded? I mean I get that you maybe like Unix-like environment so you installed cygwin + vim and there's nothing wrong with that. But you said you never used Linux and don't want to use it. So what the fuck are you doing? Just stop. Keep using sublime or an IDE if you like and don't fucking bother with CLI on Windows. Jesus christ.

>How and why the fuck did you start using Vim?
I'll tell you why and it's pretty simple. It looks good on my multi-terminal tiling window manager (pic related). On windows, a CLI window does not look good. It's an eye sore. (christ I just imagined CMD over madobe background).
I'll also tell you how I started using it. In Arch linux you're in the terminal 90% of the time so it comes convenient to have a terminal text editor too. Bonus convenience is that vim works over ssh and it's also really powerful. No reason not to use it if you use Linux really. I love those shortcuts too and I have VimFx installed in Firefox so I never really need to lift my hands from the keyboard or use the mouse. This is what makes my computer experience really comfy. I learned basic commands pretty quickly (w i dd yy p "+p ^ $ gg zz G etc.) then I just put more and more shit in .vimrc to make everything more convenient and I :h'd everything I wanted to know.

I rarely use Windows but when I do I never use the CLI (jesus) because that's fucking retarded. Windows is designed to be GUI-orientated and Linux is designed to be CLI-orientated (fuck Ubuntu). All OS's have their way of being used and I hate when people don't use them properly. Imagine Windows, PC, keyboard, mouse but this PEBKAC idiot started touching the monitor with his fingers like it's a phone. That's the level of retardation we're talking about here.

I'm not going to bother to read this thread
but vi has made my life significantly easier
and is one of the top ten programs written in
the last 40 years.

>-u (--undo)
>Enable experimental generic-purpose undo code.
Wow great editor guys! An undo feature! Such cutting edge technology. Much technological innovation.

Meanwhile vim supports undo branches.

>n-not like you needed an undo feature lol
You're better of using Notepad.

thanks user i might try vim now! or should i try emacs?

I tried to get into it since 2012. Then in late 2016 I read pic related and now I use Vim as my go to causal text editor and don't even touch the mouse in eclipse anymore because I use a vim plugin. is so much fucking faster and comfy than reaching to the end pos key, it's not even funny. I don't even know how to touch type and I am in love with Vim.

I've read practical vim and absolutely loved it. Best programming book I've ever read. Is there a similar book for emacs? I want to try the non modal emacs way too and then decide which one I like more.

im gonna give it an actual try, i always avoided it thinking it was some stupid shit people just cling on to

but it seems to actually save time and speed me up

>i always avoided it thinking it was some stupid shit people just cling on to
There is a lot of tryhards who just use vim to be a cool ricer faggot, but it has it's actual uses. For instance: In normal mode you can press to jump the the nearest number and increment it by one. You can execute command up to n times if you type the number beforehand. So by pressing 100 followed by crtl+a (under the condition that you are in fact, in normal mode), you will add 100 to the nearest number or the one your cursor currently rests on. With n you can jump to the next search regex pattern result and with the dot you can repeat the last command. So you just spam n.n.n.n.n.n until you are done. This is extremely helpful when editing time-codes of an XML for subtitle data that's out of sync. Typing and calculating it by hand would make you go nuts and writing a script for such a one off thing is overkill and a waste of time. This is where vim comes in. Of course you can do more complex arithmetic than just adding, but the point is that you can do a LOT of shit you would otherwise tab out into other tools for. You can even take the current selection, pipe it into a unix command or custom c program like sort or grep and pipe the output back into vim, replacing the contents of your selection. Vim is a powerhouse and there is a reason all the real autistic nerds swear by it.

>windows
Found the problem.

I have used vim and nothing else for about five years. I wouldn't trade it for anything. But if I had to use windows I would use sublime (or I'd probably try VS Code because I hear good things). The ecosystem on windows is way too much of a mess for vim to work well. As long as you're on windows you should just use a GUI (though I hear windows has strong bash emulation now?).

>>The ecosystem on windows is way too much of a mess for vim to work well.
>what is msys
>what is cygwin
>what is fucking WSL on windows 10
>what is ssh into an actual linux machine

how about just regular programming?

If you're going that far, why not just install linux?

>So you just spam n.n.n.n.n.n until you are done
how about this nigga
qq.nq@q

learning to figure out very quickly compose macros like that has been the single best improvement in my flow since i found out about text objects

>doesn't appreciate the aesthetics of pressing two near keys repeatedly.

Vimtutor,Vim on YouTube and the stupid game onlineq

Jr. Admin here, seconding this. Visual Block mode has come in handy many many times.

>1. Squash Commits:
Ctrl-V, select to bottom of commits, Shift+I, s, Ctrl-[ (simulates Esc), :x

>2. Editing configuration management files (in this case, Chef)
G to go to bottom of file, jump to resource block, find resource, go into quote, execute ct' (change till next '), change resource, :x done

>3. Editing config files
/ to find string, :nohl to turn off highlight other occurrences, cw (change word) to change string,
Y to yank entire line, p to paste copy of line in different part of the file, :x (depending on what it is)

So many uses. and learning it you just get faster and faster at it. It's great.

Also, use Ctrl+[ instead of Escape to switch modes. It's faster and you'll thank yourself later.

This.
GUI people shouldn't be using vim in the first place, I do use gvim on windows but just because thet lack of better alternatives.

>I like Photoshop and Illustrator (I know Wine is a thing nowadays)
Wine has trouble with Photoshop. Use a vm with passthru or dual boot if you REALLY want to use photoshop and illustrator.

But desu, if you are into full stack development, you should give up the Adobe stuff and focus on your coding.

> I play some games from time to time.
Mesa+AMD for native linux games is getting to 100% of windows performance. QEMU+KVM / Libvirt for everything else.

> It has been three fucking hours as I installed Vim and I didn't even manage to put in a "proper" theme because all of those that come with Vim are awful.

Stop trying to rice your vim. Save the ricing for when you realize the fuck that is Windows and switch to Linux full time.


To learn vim, wrap your head around the fact that its a modal editor. figure out what the modes are, some basic motions and commands, how to compose behavior with different commands and you'll be way more productive than you've ever been in Sublime.

Later on you can learn macros and things like Vimscript, but you certainly dont need that to boot

>it is praised as something godlike

does anybody really say that? i feel 9 times out of 10, the justification for using vim/vi is just that so many machines have it available so its best to know it if you need to remote in to a machine

I recommend watching this.
youtube.com/watch?v=_NUO4JEtkDw

>full stack
stopped reading there

Nailed it.

wowo cool blog post! do you have an rss feed??

rare quality post 2bh

Just use an IDE, mate. Don't waste your time with elitist text editors. They're good for shit and nobody who works on a serious project uses them.

>black background
>angry fruit salad

I approve. Just wish you weren't working in Java.

You had to ruin your informative post with "but wingay is gay amirite"

butthurt winbaby

>How and why the fuck did you start using Vim?
Boredom mixed with necessity (Linux admin in need of a command line editor) mixed with a tiny bit of peer pressure to not use shit like nano or pico.

>Should I just give this shit up and go back to Sublime, probably miss out on some saved time which will build up way more than it will take me to get a grip of Vim?

I've never used Vim on Windows, but I've heard the feature set in gvim, which is what I'm guessing you're using, is pretty much the same.

Personally, I love it.

It's really a question of whether you want to put in the time to learn it. If you do commit yourself, it's a great text editor when you don't have a graphical environment handy. Being that you're on Windows and staying there, there are probably some great graphical alternatives but I don't recall of hearing of anything with as rich of a set of keyboard commands (I'm admittedly kinda talking outta my ass here).

If you do decide to roll with it, find and use vimtutor repeatedly to beat the basics into your head. Everything else can be picked up and learned as you find you need it.

That's fucking nothing you mongoloid, it's a package people can download and install. It's not built-in or anything

i ran thorugh vimtutor, then started using vim like a normal text editor, ignored hotkey commands entirely.

then, i learn as i go. every time i hit a "there has to be a better way to do this" moment, i look up the solution, and start using it

learning vim is easiest when it's a slow process