I really try to limit my smugness in the workplace whenever one of my long time coworkers that has been using various IDEs tries out Vim and they run back to me squeeling like little girls on their first slumber party.
Enjoy.
Any questions?
Adam James
NO. FUCKING. SHIT.
Tyler Peterson
Other good vim plugins:
scrooloose/nerdtree vim-airline vim-autoformat
Nicholas Long
Some other good suggestions:
vim-dispatch vim-sneak vim-surround vim-exchange unite codi.vim lightline.vim
Eli Johnson
Holy trips confirm best editor of all time
Joseph Flores
...
Leo Peterson
It's good you are enjoying Vim OP. Vim is a great editor as you discovered yourself.
But since you are new be careful not to fall in the unnecessary (and often plain bad) plugins trap
For example vim plugins that automatically close brackets, quotes, etc (like the one you mentioned) tend to break horribly basic Vim behaviours (like undo/redo). So be careful with them and try to avoid them or at least use Vim for a sufficient time without them to see you don't really need an auto-closing brackets plugin that will do more harm in the long run.
Also avoid advice like and . They suggest to use statusline plugins which is the worst advice you can give when you can easily and more quickly customize the statusline without any shitty bloated plugin. The rest of their suggestion are not good either. Keep you Vim as stock and lean as possible and use or write a plugin (it's very easy, vimscript is really intuitive) only if you are experienced enough to know you can do something faster and more efficient than the default way.
Also keep away from /r/vim (it's a fucking dumpster), youtube-vim-ricers-and-posers and neovim shills.
Caleb Morales
>Keep you Vim as stock and lean as possible
What fucking for?
One of the reasons why Vim can be so comfy is precisely because you can me it do what you want the way you want.
The only reason to keep vim in pretty much stock format is if you are a sysadmin and you jump between machines a lot.
But even then if you are half competent you can add an easy script to ssh so you get your configs, including vim one, whenever you connect to a machine.
Also, Vimscript is utter trash, the fact that yo think it's "intuitive" shows what you know.
Jackson Collins
Yeah I actually have a question. Whenever I save a file it keeps creating another file with a ~ symbol at the end. What's it for? And how do I get rid of it?
Thank you in advance
Christopher Campbell
I only use the neovim configuration. Plugin fags gtfo.
Josiah Peterson
Those are backup files, also swapfiles.
Also, :h swapfile also :h backup.
Swap files are cool if your vim crashes or something but if you use git and commit regularly they are kinda useless.
You can use set backup and set directory to keep them someplace else:
If you need plugins to be productive and you think they are necessary you just don't know Vim good enough
John Howard
Does anyone else here want to fucking die when you see someone programming in Atom/Sublime?
Ian Cox
i want a font thats not 30px wide or bitmap
Ian Bennett
Oh nigger please.
If you are using vim and not using some kind of fuzzy search, fugitive, or some autocompletion plugin you are essentially wasting time and making vim less comfy than it can be.
But to each their own.
Not die, but I do feel bad for them.
I've got 99 tasks to complete but dealing with a shitty IDE aint one.
Daniel Walker
>return console.log(err); You're doing it wrong. console.log returns undefined, so whatever error you would return gets discarded.
Also, there are methods like console.warn and console.error to use in cases when you want to return error messages.
As for fonts, you'd have to change them in your terminal (or in .vimrc if you're using gvim.)
Josiah Long
Personally don't use any vim plugins.
Don't know what a fugitive plugin is, explain?
Also, is there an autocomplete that isn't shit? When I use autocomplete with Eclipse or Notepad++, it's shit. Is there a vim plugin that will only do autocomplete when I actually fucking want it to, as opposed to the autocomplete from hell?
Leo White
i dont follow
Lucas Perez
>fuzzy search Disgusting! Fuzzy search plugins are right there with statusline plugins in the shitiness factor Learn to use ** and *, :grep, :args, :argdo or use an inferior editor
>fugitive To each their own but I prefer to use git in a terminal instead of trying to fit git inside vim But I can see why someone could like fugitive
>autocompletion Some are good, clang_complete is amazing, javacomplete2 is neat for small programs, vim-jedi is quite good for python, etc But youcompleteme is awful and there are so many that were tricked to install it and had to suffer with a broken vim.
Still the best autocomplete that Vim has is the built-in CTRL-N, CTRL-X_CTRL-N The simple and general solutions are the best and the true Vim way
Tyler Myers
Fugitive is a great plugin written bye The Pope himself for using git through vim:
It works well enough with Python and Node.js. I prefer not to type out long function/variable names just to not waste time on building code which then fails due to typos.
Though the part that I really couldn't live without is fuzzy filesearching:
I feel like I've never really needed anything more than copy-paste, auto completion, color coding, and other standard features you find in text editors. I don't know, maybe I'm a shitty coder but my brain works so much slower than my ability to edit text that I could code by drawing on a fucking tablet and I probably wouldn't slow down.
Isaac Williams
make it output a sensible value pls
Jonathan Gonzalez
Sup Forums is autistic but I'm glad I fell for the vim/emacs pill. The only problem is that I can't hide my powerlevel from my eclipse-loving coworkers though.
Nolan Kelly
I'm trying to show one user that it returns undefined instead of what is passed to console.log().
Gavin Wright
The redpill on vim is that it has it's own language for doing text editing, which once you learn it well enough becomes instinctive and you can just do edits you want without thinking how to do them.
Here's some basics:
# Vim Grammar
**Modal nature** - Insert mode is not the default mode
* Verbs - Operations you can run on the text * Nouns - Text objects that you can target * Modifiers - Specify how far the change should go * Adverbs - Repeat actions with counts and selection * Macros - Recordable and modifiable sequences of actions * Commands - Including whole scripting language inside vim
# Verbs
* `i/I` - Insert here / Insert at the beginning of line * `o/O` - Open after / Open line before * `d/D` - Delete / Delete till the end of line * `y/Y` - Yank(copy) / Yank till the end of line * `c/C` - Change / Change till the end of line * `s/S` - Substitute / Substitute whole line * `p/P` - Paste after / Paste before * `r/R` - Replace char / Replace mode * `~` - Toggle case * `>>` / `
Ayden Ortiz
>Why if I can... You can and you do but that's not the point
Vim's power comes from very simple tools and commands that can be combined quickly in very powerful solutions for any problem. That's why *, **, :args, :argdo, :grep, etc are so powerful
But you like overengineered, convoluted solutions that solve only one problem that can't be combined and quickly modified to solve another problem. That's the Emacs way and as a result you are bloating Vim with unnecessary plugin (like fuzzy search) and overcomplicating thing by having to memorize complex binding (like the fugitive bindings you posted).
You can do it, but please don't make a new user follow you to this lunacy. Vim works better and you can learn it only when you keep things simple and stock. At least give him the chance to decide for himself instead of bombarding him with Emacs-like byzantine configurations.
William White
Cont:
# Modifiers (and motions)
* `w/W` - word * `e/E` - word back * `a` - around * `i` - inside * `t` - till * `f` - find * `0` - beginning of line * `$` - end of line * `gg` - beginning of file * `G` - end of file
# Adverbs
* Directions: - arrow keys (BAD!) - `hjkl` (Stay in home row!) * Counts: - number keys before actions * Visual selection: - `v` - regular selection - `V` - line selection - `` - block selection * Search: - `/` forward regex search - `?` backward regex search
Jack Lopez
Dude, but args/argdo are not for finding files, the are for running a command on multiple files at the same time.
Which is cool if you want to rename some variable or some shit, but has nothing to do with file searching.
Julian Howard
I know how to use argdo, I just need it once a week, sometimes less often, and I use my fuzzy file search every 30 seconds or so.
Your argument is essentially: "you shouldn't use advanced features of a system if you can use the basic ones to do the same thing"
But that's kinda the point of the system, that it can do those advanced things for it's users because it has those basic flexible fundamentals.
I agree people should know things like argdo, because it's very convenient when you do need it, but most of the time you don't.
Chase Cruz
So it pretty much just does stuff with the keyboard whereas I would use my mouse?
Idk, doesn't really seem worth it to me, I don't really mind using my mouse. Maybe when I get a full time coding job I'll come around.
Daniel Reyes
:grep is for finding file contents (unlike fuzzy shit plugins)
And ** and * provide all the file expansion tricks you may need
They can be combined with :args and :grep to populate the arglist or the quickfix window
And with a simple memorable keybinding you can cycle inside the arglist or the quickfix windo and use the usual built-in vim tools
You can open a file with :find ~/bar/**/foo*.c (that's fuzzy search without plugins) and the same with :args
Just read the help on * and **
Dylan Miller
The point is, that language is like a programming language. So then you can do cool things like:
# Repeating & Macros
**The most powerful action in Vim grammar is `.` (dot).**
Repeat any sentence constructed using Vim grammar with one key press.
* Repeat support for plugins:
### Macros
* `q` - start and end recording macro in register, end with `q` * `@` - run recorded macro
All macros are recorded in regular registers, like any cut or copied text, and can be pasted and modified.
* `"ap` - paste contents of register a here * `"ayy` - copy current line to register a
# Commands
* Regex Substitution: * `:%s/\v(\d+)//g` - enclose all digits in file in `` brackets * `:%s//thing/g` - replace all instances of last search with `thing` * `:%s##thing#g` - use different dividers: `@`, `$`, any non-alphanumeric char * `:help substitute`
* Global Commands: * `:g/^TEXT/m $` - move all lines mathcing `/^TEXT/` to the end of file * `:g/^TEXT/c 't` - copy all lines mathcing `/^TEXT/` to the `'t` mark * `:g/^TEXT/normal "Ayy` - append every line matching`/^TEXT/` into `A` register * `:help global`
* Buffer Commands: * `:bufdo %s/TEXT//g` - remove all occurences of **TEXT** from all open buffers * `:argdo g/TEXT/y R` - append all lines matching **TEXT** into register `r` from all buffers in the `args` list
Easton Garcia
>Just read the help on * and **
I have, It's shit compare to unite-vim.
Sorry, it's utter shit.
Jackson Johnson
Nice trips but unite-vim is utter shit
Carson Richardson
It's a bit convoluted, I agree. But I got it set-up just right so it's perfect.
FZF alternative is decent enough for new users and much better than the ** bullshit.
I don't remember paths, I remember filenames usually, so I just want to kinda maybe remember part of a path and part of a filename and then get the rest.
Especially since I work on about 50~ different repos each day.
Robert Myers
Many thanks for this man. I have learned a few more commands from your posts, and I'll be saving this thread.
Jaxson Perry
I agree with the analysis of powerline and ycm Solarized can also maybe be seen as intrusive by having to set terminal colors, but it is more bearable, since most terminal colors are shit, and if I want my vim colors to work well with my terminal, might as well go solarized. Maybe if I could find a good alternative colorscheme, since I don't want to waste time making my own. I have nothing against vim-airline, it's basically a powerline with no headache. I use supertab for my autocomplete and is also no headache.
Aaron Rodriguez
>** bullshit You don't what you are talking about. ** is one of the greatest features of Vim and how it can seamlessly be combined with other commands is genius in it's simplicity
>vi-improved.org/recommendations/ Read the section on bufexplorer, ctrl-p, gtfo, minibufexpl, nerdtree & vinegar and if you still don't get the brilliance of ** you are too deep in you complex setup and in the use of unnecessary plugins. If it suits you though, fine.
Owen Ortiz
Here's the whole presentation, maybe you'll find something else:
I've been using vim for more than 10 years, I know how ** works. I don't think it's that convenient.
Caleb Rodriguez
Forgot to add. ** doesn't work in command-line-window, which makes it almost useless for me.
Tyler Parker
>I remember filenames usually, so I just want to kinda maybe remember part of a path and part of a filename :find ~/projects/dir_i_remember/**/file_part_i_remember*.c
What more do fuzzy file search plugins do?
And if you set the path variable accordingly the command gets even simpler
Zero bloat, zero maintenance cost
Levi Allen
Uninstall vim. Get neovim.
Logan Howard
>neovim Fuck off shill
Justin Martinez
As I said, doesn't work in command-line-window.
But ** and * isn't useless, it's a great feature if you don't want to set up anything more fancy.
But after years of using vim my unite setup is just much much faster and comfier.
My pathway to a file is usually:
{part_of_folder_name}{part_of_filename}
And I'm done, sometimes I have to use a few times or refine the search.
It's requires much less thinking so it doesn't require me to break concentration.
But as I said before, to each their own.
If you have a need for the features that neovim adds. I use it but it's not THAT revolutionary. Vim does most of what a user might need, and it's easier to get.
Parker Johnson
enable mouse so you can easily resize splits and highlight text
remap ; to :w
remap space to :
remap tab and shift tab to cycle through open splits
if has("mouse_sgr") set ttymouse=sgr set mouse=a else set ttymouse=xterm2 set mouse=a end
nmap ; :w nmap : nmap w nmap W
Essential plugins for Golang, webdev, and C (IMO):
>ssh with password, not pub/priv keys >cancarous colorscheme >nerd-tree >java
Now I just feel sad...
Adam Moore
also, learn to use tmux (or byobu)
There is no java
Austin Ward
Ah, JavaScript, it looked like Java at first glance.
Still, get some better auth for your ssh dude.
Ryan Brooks
Are you using Tmux in your bottom window?
Henry Robinson
...
Parker Flores
>not using acme
Matthew Morgan
Ah, it's obvious now. Should have read the whole thread.
Nathaniel Rodriguez
No, All programs run inside a tmux split/window
You can move the tmux status bar to top or bottom.
Josiah Clark
>Not using nano
Aaron Stewart
actually that ones not running inside tmux
This one is running byobu (a more user-friendly tmux)
Carter Kelly
>2017 >still programming in a terminal based text editor retard, get an IDE with decent UI like Atom or IntelliJ and save yourself 10 years of studying something you don't need. Those two are not bloaty either. Fucking autists still using Emacs and vim, blows my mind.
Joshua Long
what distro?
Landon Martin
is there a feature which lets your rename all instances of a variable at once?
Adam Peterson
Fedora 25 with GNOME 3 on wayland
Liam Hernandez
>tfw VIM works horribly on non QWERTY keyboards
Blake Gray
Yes but it depends on the language, some languages make thi nearly impossible.
Obviously you can just use find and replace (but it's not smart enough on its own).
Most people use a language specific plugin. For example, I use vim go, which comes with the command :GoRename which allows you to place your cursor over the variable you want to rename, call the command, and rename the var.
Doesn't work in every context though.
Daniel Harris
It's not vim, it's you.
Parker Turner
You can kinda make it work by combining argdo/bufdo with substitution command with the [c]onfirm s_flag so you can have your say in what is replaced and what is not.
Jayden Bell
It's ok. We all use sublime text at work anyway.
Austin Jones
tmux doesn't recognize my nvim config. What do I do
Connor Bennett
The thing about vim, is that it's a great editor, but it's not an ide. Don't try to turn vim into an ide, use emacs with evil for that, or my personal favorite, spacemacs.
I use vim when doing quick editing, and emacs/spacemacs for when I need more.
Oliver Sanders
go to function, v } :%s/\%Vx/y/g ?
Nathaniel Cook
>remap space to : I'd rather not.
Blake Rogers
The thing is, Vim works perfectly fine as an IDE.
There is no reason to use another editor unless you're jut a purist/ideologue. There is no objectively good reason not to use vim as an IDE, it all comes down to "vim wasn't meant for that" and if that were true, then Vim wouldn't be extendable.
The only good argument against Vim as an IDE is excessive plugin usage, but plugins on their own don't slow vim down at all. Only plugins that are programmed poorly cause vim to have issues.
Eli Sanders
why?
Chase Foster
Works fine for me using a dvorak keyboard. hjkl is not grouped together, but it's not too inconvenient. I'm used to it by now.
Justin Garcia
>2017 >Not using Emacs
Jeremiah Garcia
I have a .vimrc very well documented you might like " BASIC SETUP: " enter the new millenium set nocompatible " enable plugins filetype plugin on
" PERSONAL MAPPINGS: " save file nnoremap :w inoremap :wi " exit nnoremap :q inoremap :q " leader let mapleader = "¿" " localleader let maplocalleader = "\\" " edit vimrc file nnoremap ev :vsplit $MYVIMRC " source vimrc file nnoremap sv :source $MYVIMRC
" TEXT AUTOCORRECTION AND EXPANSIONS: iabbrev teh the iabbrev waht what iabbrev aslo also iabbrev @@ [email protected]
" TEXT SNIPPETS: " Read an HTML template and move cursor to title nnoremap html :-1read $HOME/.vim/snippets/skeleton.html3jwf>a " NOW WE CAN: " - html for HTML snippet " - can be used to create more snippets
" COSMETIC CHANGES: " enable syntax highlightening syntax enable " colorscheme colorscheme basal " background color "set background=dark " toolbar set ruler " line wrap set wrap " when wrapping, don't break words set linebreak " indent using previously indented line as example set autoindent " indent C-like syntax set smartindent " set line number for current line and relative number to the rest "set number relativenumber
" TAB COMPLETION: " enable spellchecking "set spell " match dictionary words for completion set complete+=kspell
" FINDING FILES: " Search down into subfolders " Provides tab-completion for all file-related tasks set path+=** " Display all matching files when we tab complete set wildmenu " NOW WE CAN: " - Hit tab to :find by partial match " - use * to make it fuzzy " - :b lets you autocomplete any buffer
" TAG JUMPING: " - This doesn't help if you want a visual list of tags " Create the 'tags' file (may need to install ctags first) command! MakeTags !ctags -R . " NOW WE CAN: " - Use ^] to jump to tag under cursor " - Use g^] for ambiguous tags " - Use ^t to jump back up the tag stack
next
Kevin Butler
cont. " AUTOCOMPLETE: " Already set with the tags file " The good stuff is documented in |ins-completion|
" HIGHLIGHTS: " - ^x^n for JUST this file " - ^x^f for filenames (woks with our path trick!) " - ^x^] for tags only " - ^n for anything specified by the 'complete' option " - Use ^n and ^p to go back and forth in the suggestion list
" ELEMENT INSPECTOR: " Show syntax highlighting groups for word under cursor " Use ctrl-shift-p to reveal the syntax groups to which the element belongs nmap :call SynStack() function! SynStack() if !exists("*synstack") return endif echo map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")') endfunc
" FILE BROWSING: " Tweaks for browsing let g:netrw_banner=0 " disable annoying banner let g:netrw_browse_split=4 " open in prior window let g:netrw_altv=1 " open splits to the right let g:netrw_liststyle=3 " tree view let g:netrw_list_hide=netrw_gitignore#Hide() let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+' " NOW WE CAN: " - :edit a folder to open a file browser " - /c/t to open in an h-split/v-split/tab " - check |netrw-browse-maps| for more mappings
Juan Butler
why hide
Dominic Mitchell
>Why is Vim sooo comfy guys? Because you have low standards.
>Why nobody bothered to tell me that I would literally fall in LOVE with a 80s text editor? Because a) Everyone here is thinks they're l33t and will shit on tools for the sake of shitting b) This pretty much will trigger a vim vs X argument c) Anyone doing serious dev either don't care to shill for vim or is using something else.
Enjoy your endless config sessions down the line
Oliver Powell
I don't like it since I started using colemak, it isn't comfy at all.
Jacob Bell
Very nice, thanks for sharing.
Brayden Adams
>tfw too smart for IDE's
Jonathan Walker
>tfw too smart to care about what you think
Christian Gray
Who are you trying to convince, them or yourself?
Lucas Hernandez
convince who about what?
Carter Ortiz
Hey guys, trying to make a simple search and replace mapping, can you help " Search and replace vimgrep pattern **/* cfdo %s/pattern/replaced_pattern/gc
James Richardson
>tfw too smart to think that you aren't triggered
Kevin Young
Triggered by what?
Aiden Miller
>tfw too clever to not notice the damage control
James Carter
Hethens and theirs dubs... I'll show them... I'll show them one day...
Charles Foster
I don't even know what I'm replying to, so I'll just stop
Tyler Edwards
>playing dumb in the first place lol
Benjamin Russell
Kek, I just posted and out of no fucking where there was all this faggotry about not giving a shit about IDEs, which as I previously stated, I don't care about whatever you you think