/fvt/ - Friendly Vim Thread

Previously >About Vim
Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. It is included as "vi" with most UNIX systems and with Apple OS X.

>Why Vim
Vim is rock stable and is continuously being developed to become even better. Among its features are:
#persistent, multi-level undo tree
#extensive plugin system
#support for hundreds of programming #languages and file formats
#powerful search and replace
#integrates with many tools.

>I want to use Vim but I don't know the keybindings/Nano is easier
#Learning them is easy and you only actually need a select few: navigation, search, b, i, w, :line, v and a few more
#Install Vim and get started with the built in vim tutor: vimtutor - very easy 7 lessons, takes you 30 minutes and you are there.

>I want to use mouse and click
While you can certainly do them in Vim, you will become too lazy to take your hand off the keyboard once you get comfortable with Vim.

>Vim is just a text editor
True, but you can scale Vim to be the IDE you want it to be: C/C++, Java, C#, Python, Haskell, Javascript - anything you like.


Neovim users and potential new users are also welcome.

Other urls found in this thread:

twinnation.org/articles/How_to_install_YouCompleteMe_for_VIM_using_Pathogen_on_Ubuntu.php
dotshare.it/category/vim/rc/
vim-bootstrap.com/
vim.org/about.php
twitter.com/NSFWRedditVideo

Who else rocking that vim + tmux combo?

install emacs

elisp is kinda hard

sometimes
always on the server though

>most UNIX systems and with Apple OS X.
OS X is the only Unix around faggot

No hate against macOS (I'm on it right now), but it's definitively not the only UNIX around.

>I'm the most ignorant person on Sup Forums
Gotcha

What's the point? I'll never be able to do anything that requires the power of vim. I might as well stick with nano ;_;

I use the power of vim daily at work. Can't write or edit without it now.

Even on my shit work Windows machines. Someone made a pretty comprehensive emulation of vim for Visual Studio. And I use vim itself as a scratchpad. It's replaced notepad++.

- Macros.
- Registers.
- Magic redo last action key . (dot).
- Movement commands.
- Commands paired with movement commands.
- Linewise operations (cut copy and paste entire lines etc.).

Here's how you swap the order of 2 lines on Windows editors.
Home, Shift+End, Ctrl+X, Down, End, Enter, Ctrl+P, oh and go clean up the empty line you left.

Here's how you swap the order of 2 lines in vim.
ddp.

Okay, but that was too easy. What about moving the line to line 85?
dd85GP

No, the only thing I ever do is edit config files. I will never utilize vim properly

My .vimrc is good for beginners imo, since it turns basic shit on like syntax highlighting, autoindenting and line numbering. If tabs instead of spaces or 4-character indents are not your thing, then you can change the set shifwidth and set tabstop values (remove the shiftwidth one in you want spaces, increase both to 8 if you want 8-char tab indents).
syntax enable
set shiftwidth=4
set tabstop=4
set number
set smartindent
colorscheme delek
imap jj

The power of vim lies in editing. Not writing. It's modal, so if you're always editing existing config files, you stay in normal mode 99% of the time. You're not typing new code, so you don't need to be in insert mode. So then every single key on your keyboard is available for jumping around text and manipulating it.

Say you want to replace the text between a bunch of xml tags with the same thing. Get your cursor on the first character you want to change. Hit ct

>colorscheme delek
>imap jj

coloscheme darkblue
imap

The patrician choice.

What are the Vim add-ons that make Sublime Text useless? There is one of "those" types in my school and I want to make him cry.

jj is comfier imo, but holy shit does darkblue look good.

What are the cons of using Evil-mode as opposed to straight Vim?

What terminal emulator do you guys use?

I use termite. Previously I had used urxvt but termite does everything that I needed a ton of plugins for in urxvt out of the box. Furthermore many fonts cause problems in urxvt while is is easy to add any font in termite.

in neovim
function! GetTerm()
999wincmd j
999wincmd l
if &buftype == "terminal"
vs
wincmd l
setlocal wfh
else
botright 20new
999wincmd j
999wincmd l
setlocal wfh
wincmd J
endif
e term://zsh
setlocal nobuflisted
setlocal bufhidden=delete
startinsert
endfunction
nno sh :call GetTerm()

I'm using terminator right now. It seems pretty awesome. Before I was using gnome/mate terminal with multiple tabs.

Please leave.
That shiftwidth will fuck up so many people's Makefiles.

2nding this.

I adore vim modal editing and all it's bindings. But the program itself is a clusterfuck. It's so spaghetti there's still not even an agreed upon way to add extensions, and they're limited in scope by shitty vimscript.

I feel like I might want vim inside the emacs environment. But I've not made the plunge yet.

How? It puts actual tabs into the file, which is what make uses, right?

elflord is the only viable built-in colour scheme

CRITIQUE MY VIMRC
set backspace=2
syntax on
filetype indent on
set autoindent
set number
colorscheme badwolf
set nobackup
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set clipboard=unnamed
set ruler

Post cool .vimrc shit.

set relativenumber "line numbers relative to the current line
set linebreak "when wrapping, don't break words
autocmd bufwritepost $MYVIMRC source $MYVIMRC "when saving .vimrc, reload it

"mappings

"let OO and oo insert blank lines above and below in normal mode
nnoremap OO Ok
nnoremap oo ok

"auto-add matching brace
inoremap{ {}ko

"F2 for bash in vim
noremap :tabe bash:!bash:bd %

"Let j and k behave like other editors on wrapped lines
nnoremap j gj
nnoremap k gk

"Leader + w to write as root
nnoremap W :w !sudo tee > /dev/null %

I use it for console mode.

gvim the contrast is too high, at least on shitty Windows.

> >Vim is just a text editor
>True, but you can scale Vim to be the IDE you want it to be: C/C++, Java, C#, Python, Haskell, Javascript - anything you like.
Stop this awful "Vim as an IDE" meme.

you're missing a few great settings, like
set nocompatible
set wildmenu
set path+=**
set rnu

this is objectively the best color scheme

G moves you to the end of the file nigger

How do I make the cursor move faster? Total noob, btw.

Feels like when I scrolling down by pressing j in edit mode, it takes to damn long to get to the end of the file.

which color scheme is this

jellybeans

I use Spacemacs which is pretty good at implementing vim, I'm just not sure if I'm missing out on something by using evil-mode instead of plain vim

Emacs is a lovely operating system, and finally putting a decent text editor into it feels great

elisp is leagues ahead of vimlang. I think spacemacs is a good combination of emacs and vim, would highly recommend it, been using it for a while now and I don't miss anything from stock vim.

Re-written from memory so may have mistakes.

" I prefer Enter to insert new lines, and the cursor moves with it.
nnoremap o
nnoremap O

" Shift-enter is kinda convenient to exit insert mode. Not the best though. Need to come up with something better.
imap

" Make leader key the spacebar.
let mapleader = " "

" Space followed by yank/delete/paste to go into the MS Windows clipboard. Also pressing Enter with a visual mode selection to copy it (like how you copy using crappy cmd.exe, it's actually kinda convenient).
nmap p "+p
nmap P "+P
nmap y "+y
nmap d "+d
vmap "+y

" Paste in insert mode with Control Enter.
nmap "+p
imap +

" Split a new empty vertical window.
nmap v :vnew
" Bring up vertical file explorer (it's s because I thought it was the classic :Sex command, but that splits it horizontally)
nmap s :Vex
" Open 2 files side by side then hit space d to diff them.
nmap d :diffthisw:diffthisw
" Standard write/quit.
nmap w :w
nmap q :q
nmap x :wq

That's not how you say 'evening'

>G moves you to the end of the file nigger

Well this is a bit embarassing m8.

See also: gg (also in screenshot).

I have Ubuntu, neovim, and can't get youcompleteme to work -_-
>linux noob
what are common noob mistakes

Is it actually hard to install youcompleteme, or will i be able to do it following the github guide step by step?

>you can scale Vim to be the IDE
Neither VIM nor Emacs are any good as an "IDE"

>what are common noob mistakes
Installing ycm is a pretty big one

1. set mouse=a
2. go to a line by :line_number
3. go to the end of line by $

Not at all. See
twinnation.org/articles/How_to_install_YouCompleteMe_for_VIM_using_Pathogen_on_Ubuntu.php

Yeah, I love gruvbox in gVim. When using the plain old linux terminal though (no X) I use elflord.

"moving tabs with a mapping (but you should use buffers)
noremap gt :+tabm
noremap gT :-tabm

"toggle line wrapping
noremap w :set wrap!

"open .vimrc, scroll to the bottom
noremap v :e $MYVIMRCG

"toggle spell checking
noremap s :set spell!

Either press G to go to bottom
Or press #G to go to line #
Or press #j to go down # lines
Or press C-f to page down

Anything you miss from non-stock vim?

Also I love the fact that I can use C-a instead of ^ or 0, ^ and 0 are super clunky imo

Justify this statement

Because it hasn't been posted yet

Im already pretty comfy with vim, but can somebody recommend me some nice plugins? I'll be even more amazed, maybe some for haskell?

termite

not when used like this: G,
then it jumps to line

j
go n lines down
(works with all movement commands , like G or w)

Ctrl+D for down and Ctrl+U for up.

>configs
>plugins
>various versions
>default controls
it's so overwhelming
i feel like i can;t get into it

just do the vimtutor, it's easier than you think

>shit plugins for autocompletion and boilerplate
>have to use a key to do autocompletion at all
>shitloads of learning to do what GUI editors can do with a click
I don't see the point of vim, besides to pretend you're clever on Sup Forums

>>shitloads of learning
>>>/kindergarten/

you were taught vim in kindergraten? I'm sorry about your childhood buddy

How about using _? Same as ^, though not the same as 0.

My two cents: if you have the free time to learn Vim from the ground up, the Vim User Manual blows the fuck out of the Vimtutor, IMHO, and is the logical next step if you want to get more comfortable using Vim.

Can be reached with ":help usr_01.txt", which will teach you the other useful things to know about using the guide (like Ctrl+] and Ctrl+o to switch topics). If you didn't already know, you can use ":only" to make a given window the only one, effectively fullscreening it.

After years using Vim I switched to Visual Studio Code.

Sure, you can type faster with Vim, but I like the Typescript integration better, and turns out typing is not my bottleneck when it comes to programming time. It's thinking.

ty user

alternatives?

Answer me this vim niggers

Which font is this?

few options for moving around a file faster

gg or G for top or bottom of the file

{number}{j|k} for going up or down multiple lines at a time

ctrl+f or ctrl+b for going forward or back a screens worth of the file (if youre a tmux user with the default prefix, might wanna swap it to ctrl+a or something if you dont wanna double tap ctrl+b all the time in vim)

>void
>Usage(void)
>{

No.

mucomplete is just as good and it's not as bloated and doesn't require python

Some GNU/Linux distros do indeed ship with vim instead of vi, because almost no one uses the original vi, and vim is mostly compatible with it.
But if you installed an operating system that's closer to UNIX, you will actually get the original vi.
All the BSDs for example and some minimal linux distros don't have vim by default.

>Vim is rock stable
Fuck no it's not. It's really the only serious reason why I keep looking at emacs, too. In the latest version (8.0 or so), there's a bug where in mouse=a mode, using the mouse can randomly do random actions (randomly insert random characters that are not consistent with escape codes, randomly move around the buffer, etc.).
In the previous version (7.3?), if vim was opened for too long, it would start breaking its undo history. This would cause things like failing to remove a line except while undoing the rest of the changes, making a complete mess of the file. It was not possible to undo that by redoing as the extra line would still be present.

Really the only reason why i haven't moved to emacs are the garbage control scheme and the fact its plugins are more buggy than core vim.

urxvt is a huge meme. Any other terminal emulator will do everything you would use hundreds of plugins for in urxvt, out of the box.

Evil-mode is about 10%, if that, of vim's keybinds. For plain editing a single file, it works reasonably well. If you have more than one buffer, not so much. Additionally, it doesn't play well with most other emacs plugins and has ridiculous amounts of bloat precisely to deal with plugins on a case-by-case basis (even that doesn't work all too well).

Personally I find that it's not good enough at all to use, and when I try to use emacs, I just end up using the emacs keybinds rather than evil's.

It's disgusting, but in the end, I care about the software, not its politics.

This.
It can't into true-color, can't into proper font config, there are so many things it can't do despite things like st (which is 1/8 the size) having no problem with.

Can Vim do this?

This is a screenshot of vim in action with random shit in the last column.

So I can install vim and essentially just use it for programming in python? And then I can change parts of the OS to give have messages?

Does it run on any shell?

>give have
I can't type for shit today, sorry.

Give custom*

source code pro

is there any good guide outside of vimtutor that I can download
already can use it basically and did vimtutor but I cant do anything cool

vim is a text editor man, you can program in smoke signals if you want but some tools are better suited than others. So yes, you can program python in vim. That screenshot is some high res desktop with dot files open and directory listings. if we weren't on Sup Forums, i would think it's irony.

>be me
>be using vim for years
>only just found out a week ago that capital D does d$ and capital C does c$
>JUST

All those key presses wasted over the years...

Is O'Reillys Learning the vi and Vim Editors a good reference for learning Vim?

I just want to be able to point and click on a character, and have the cursor move there!
How to do this?

Give me a recommended vimrc list that has nice autoclose, syntax checker etc without the use of clang for C/C++ development.

see

That literally defeats the purpose of using an immersive text editor. Efficient editing comes with your hands in one position doing all the magic. You might as well ask for how to plug up an Xbox controller.

I just hate counting lines and doing 5j or something.

echo "set mouse=a" >> ~/.vimrc

Well I can use Vim fine, I just want to know if it is a good reference.

>Give me a recommended vimrc list that has nice autoclose

Check it:
dotshare.it/category/vim/rc/

See Want to go to a line?
:

Best IDE for Python? Also, how to make Vim an IDE for Python? Is that just a meme from OP?

>how to make Vim an IDE

you don't
vim is a text editor

Use emacs instead

enable number and relative number
The line you're on has the current line number, every other line number is replaced with the offset amount.

4
3
2
1
184
1
2
3

vim-bootstrap.com/

>What Is Vim?

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Vim is often called a "programmer's editor," and so useful for programming that many consider it an entire IDE. It's not just for programmers, though. Vim is perfect for all kinds of text editing, from composing email to editing configuration files.

Despite what the above comic suggests, Vim can be configured to work in a very simple (Notepad-like) way, called evim or Easy Vim.

>What Vim Is Not?

Vim isn't an editor designed to hold its users' hands. It is a tool, the use of which must be learned.

Vim isn't a word processor. Although it can display text with various forms of highlighting and formatting, it isn't there to provide WYSIWYG editing of typeset documents. (It is great for editing TeX, though.)

>Source
vim.org/about.php

OP here I want NO further comments regarding this

>530 line file for 2 langauges
>loads of remapping
>28 plugins
absolute shit.

OP here stop trying to pretend to be me

Take your butthurt somewhere else, this is a friendly thread.

>I want to disfigure this beautiful woman called vim by forcing her to chug plugins and remaps

>>>/emacs/