/VIG/ Vim general

Vim general is a discussion thread about vim and how vim is the best modal text editor

Other urls found in this thread:

youtube.com/watch?v=wlR5gYd6um0
youtube.com/watch?v=XA2WjJbmmoM
youtube.com/watch?v=3TX3kV3TICU
learnvimscriptthehardway.stevelosh.com/
vimcasts.org/blog/2013/11/the-copypaste-series-a-retrospective/
vim.wikia.com/wiki/Go_to_definition_using_g
vim.wikia.com/wiki/Displaying_a_variable/macro_definition
youtube.com/watch?v=iWXebEeGwn0
twitter.com/SFWRedditGifs

what is the best mode? insert, or normal?

I've gotten pretty good at vim now. To be critical though I doubt that it really is that much better than using a mouse.

>knows h, j, k, l
>knows to to enter and exit insert mode
>"I've gotten pretty good at vim now"

I would think that all the modes have there uses

i don't think so

why would you say that i think that the only mode that is kinda useless is probably replace but even then replace mode is useful when you have a syntax error in the middle of a line of code and you just want to fix it

How do you guys browse through long files?

It's a bit shameful, but instead of using ctrl-d and ctrl-u, I've bound normal mode shift-j and shift-k to move ten lines down or up at a time.

Who are you quoting? Don't make stuff up. Some features like `` O and J are super neat.

>Some features like `` O and J are super neat.
Oh. Sorry. I didn't know you were a vim pro

>I've gotten pretty good at vim now.
>I doubt it really is much better than using a mouse.

t. Someone not pretty good at vim

I just guestimate and then smash two number keys in the number row. The beginning for "a bit down" center for "a bit more down" or end for "a bit more-er down" and then j.

That's just for general use, obviously there are many ways to get around in vim.

I like nano

just search for word you're loking for.
but i do the same with 5. its the most efficient

what kind of completion do you guys use
I really wanted to avoid the 400mb 'youcompleteme' thing
I found mucomplete (which extends the builtin completion framework and adds 'supertab' type functionality) combined with clang_complete which completes methods and namespaces and stuff and can do syntax checking pretty good lightweight soloution

IDE + vim plugin
trying to turn vim into an IDE is a waste of time

i find it really convenient and nice to work in a terminal though

I do agree that adding humongous plugins that to try and mangle vim into an ide is bad
but vim already has some autocomplete by default, and even 'jump to definition' so you can't say that the lightweight ones I added here are really mangling vim into an ide

i'm jusst saying I've tryed YCM and it's garbage compared to an IDE.
ide plugins vary in quality, but i've found its much better than vim plugins trying to do the same thing.

and IDE cuts my vimrc in 1/4th because I was just trying to replicate IDE functionality

You can try using a lsp plugin. C++ lsp isn't quite complete though.

I don't know much about ex mode, hell I don't know much about regex, where do I start?

Have you tried vimcompleteme?

Get emacs and use evil mode.

Don't use spacemacs. It's bloated shit.

>IDE cuts my vimrc in 1/4th because I was just trying to replicate IDE functionality
This. Now using vim for quick edits, configs and stuff, and an IDE for everything else. And I fell in love with jetbrains' vim modes.
Something something stuff that belongs to Caesar.

I've been using Vim for years, and I'm still learning new things about it. The best thing about Vim is its keys and movement, I really haven't seen better. Also it loads fast and so it's handy for opening a terminal and getting things done quickly.

That said, I've lately started experimenting with other editors, in particular Emacs and Atom (using evil-mode and vim-mode-plus respectively). I've found Atom to work pretty well, and it's really not as laggy as people make it out to be.

Vim does have major limitations, such as copy-pasting outside of the terminal (I know about the + register, but I can't for the life of me get it to work on Linux). Also you're limited to terminal fonts, whereas GUI applications handle this more gracefully (even GNU Emacs, which is an old-school C program emulating a 1980s Symbolics Lisp Machine emulating an old-fashioned Motif-style Xt toolkit emulating a 1970s text terminal emulating a 1960s teletype... somehow manages to do a better job). Oh, and Bram Moolenaar has a shockingly cavalier attitude to what should happen to Vim if he dies (his solution is "keep me alive" *rage*).

I'll always love Vim, even if it's not actually Vim I'm using.

>Vim for years
and still don't know about Gvim ! are you retarded ? it solves all your "major" problems

AutoComplPop

Doesn't do everything but it's extremely lightweight and its basically omnicomplete automatic mode highly recommend if your editing basic files

Atom doesn't even works on my 2 gigs of ram.

>hjkl instead of jkl;
>keys to move left on right hand
>keys to more right on left hand
>4 variants for every movement - before, after, to normal and to insert
>mod keys allergy
why vimtards like this?

Here is the list of Youtube videos that took me from knowing nothing to being so comfortable as to installing a vim plugin on my browser. Ignore titles these videos are great for beginners, just watch them in this exact sequence:
Mastering the Vim Language youtube.com/watch?v=wlR5gYd6um0
How to Do 90% of What Plugins Do (With Just Vim) youtube.com/watch?v=XA2WjJbmmoM
Let Vim Do the Typing youtube.com/watch?v=3TX3kV3TICU

To move beyond that read Learn Vimscript the Hard Way by Steve Losh learnvimscriptthehardway.stevelosh.com/

>mod keys
Enjoy your carpel tunnels

you won't get carpal tunnel from pressing Meta key with thumb and Vim wants Ctrl mods on weird occasions anyway

Don't listen to them user, we have to be patient with our friends who are socially inept.

I know about gvim, but I like my terminals, and I need more than what gvim offers to go gui.

how do i use buffers and how do i use the system clipboard
this is the one thing i cant do properly in vim

Granted IJKL makes more sense than HJKL (although I remapped my vim that way and discovered I was too stuck with the old way, and I use other keys like WB(){}fFtT to navigate far more).

The iIaAoOcCrR keys are great though, why type more when the key to do the thing I want is already there?

Checkmate atheists.

vimcasts.org/blog/2013/11/the-copypaste-series-a-retrospective/

Episodes 51, 52, 53, 54, 55, 58, and 59 are all on the topic of copy and paste in Vim.

The * or + register works if you've got +xclipboard compiled in (e.g. "+yy). Otherwise some shift right click copy or something monstrosity. It's not ideal, but it works.

As for buffers (or tabs, which I prefer), just :badd …, :bn(ext), :bp(rev), :bdel. Map them to your F5-F8 keys and it's dead easy.

you can run gvim in a terminal with gvim -v

Depends on the editor / IDE. I find Atom and Sublime do vim keybinds really well, while vscode's vim plugin is a complete shitshow.

Wowzers?

Don't use vim for this. Grep it out and go from there.

Vim keybindings in another editor is the masterrace

>7 episodes to talk about how to copy and paste to clipboard for vim
should i just learn emacs if i'm interested in lisp?

Kakoune is the best modal text editor

>Improvement on Vim’s modal semantics
>Most convenient plugin functionality built-in
>If you still want plugins, they’re commands that pull text data through Unix piping

Nothing is better.

Use Ctrl-e and Ctrl-y to scroll up and down ten lines, never use j or k to scroll.

I just use a combination of Ctrl-N/Ctrl-P, my brain, and fast typing. Completion is useless.

what about for reminding you what methods a class has
or what values are in a namespace

>+ register
Your linux setup is probably stupid. Have you tried the * register?
>limited to terminal fonts
Who uses a text editor without a monospace font?
>Bram
Obsoleted by neovim.

Just vimtutor and vimcasts.org.

That's what my brain's for. That and documentation. If I'm not using something enough to remember it, checking documentation isn't a hassle.

That and
vim.wikia.com/wiki/Go_to_definition_using_g
vim.wikia.com/wiki/Displaying_a_variable/macro_definition

>Your linux setup is probably stupid. Have you tried the * register?

Linux Mint, I tried a couple of different Vim versions but no success. It works on my work Mac.

>Who uses a text editor without a monospace font?

I don't know, not me. I meant better colours and funky things like subscripts (when using LaTeX).

>Obsoleted by neovim.

Not available in LM yet (and I only heard about it when reading about Emacs). I've heard good things, although isn't it still incomplete?

I either search for the word I want or use ctags (usually with denite). It's great.

>isn't it still incomplete?
I don't understand your question. It's as incomplete as Vim. It's just a fork.

>Not available in LM
Holy cow how old are the packages? Neovim has existed for more than three years now, they should really do something about it.

>TIL today: just as regular programmers have editor wars, blind programmers have braille displays vs voice synthesis wars
>inb4 - yes, there are blind, employed programmers

I thought braille displays died with the terminal.

is vim worth it if i'm using windows and only program in java?

...which is exactly what they say about vim

Nope, but you should really try using another operating system and another language. Expand your mind brah.

Fair point.

nano fag here, why should i switch to vim?

>Nope, but you should really try using another operating system and another language. Expand your mind brah
fuck off sperg, don't tell me what I should do

There are braille displays like picrel, but they are expensive as fuck (google says the price range is 3500$-15000$) so most blind programmers use voice synthesis because it's comparable to displays and might be even better if you get used to high speed voice. Which doesn't mean you can't use both at the same time; I imagine a display like that would help while debugging.
You can see how it works here:
youtube.com/watch?v=iWXebEeGwn0
To not give you a wrong idea, blind programmers don't rely just on visual studio, some use eclipse, many prefer command line and more classical editors. I didn't hear of anyone using Vim though.

You won't believe how comfy is vim until you get the gist of it, but nano is lacking features and finger feel.

font?

I could install from source, but I really can't be arsed.

Extra powers.

>blind programming
Hell is real

Does vim have a functioning org mode?

Why use vim over emacs + viper?

ctrl+f you fucking mongs

>actually using h

How do I into Vim?

first of all i dont want disabled emacs hands and viper is for gay hipsters

I use standard vim autocomplete

Vimtutor and suppliment it with YouTube videos

learning things from youtube videos is extremely low brain

You listen to a guy talk about a thing, and he teaches you how to do that thing in 5 different ways, and then you use each of those ways as much as you can in the next week whenever you can. Seems like a good way to learn

viper has no reason to exist, it's so bad.
evil mode is legit, though.

Say whatever you want, but it works!

I installed the vim extension for VScode and now force myself to use and learn it.

test

Was about to post this.