Completely and utter newfag on vim here. It feels like I'm missing out on a lot of things by not having a good vimrc. I only have: set expandtab
set smarttab
set shiftwidth=4 set tabstop=4
set autoindent
syntax enable
What would you recommend? You could just post yours and say why you have a certain thing enabled. I'd love for it to have autocompletion on language dictionaries and my own written functions from the file. Aside from that, it's a very neat editor after going through vimtutor.
syntax on (not "enable") filetype plugin indent on
For now, don't worry about manually setting up autoindent and stuff like that. It's okay to have defaults but you'll probably end up with settings specific to each language. Some of that will be set up by the language plugin, and other parts can go in your after/indent/lang.vim scripts.
The next thing is to set up a plugin that manages your other plugins, so you don't have to fuck around with installing things by hand. I like Vundle. I'll let you google that. I'll make a couple more posts about the plugins I use and what they do.
Owen Ortiz
dude, just use emacs lmao
Carter Sullivan
Neat. I'll be on the lookout then.
Easton Jackson
set hlsearch set incsearch
I find these useful, the first highlights all instances of what you're searching for, the second activates incremental searching, so you start getting results as soon as you type
Lucas King
"disablle compatibility with Vi set nocompatible
"Make tabs work as expected (and be proper tabs!) set tabstop=4 "width of a tab in spaces set softtabstop=0 "when this is non-zero, the tab key inserts a combination of spaces and tabs set shiftwidth=4 "the width of the < and > commands set noexpandtab "don't convert tabs to spaces
"Enable some fancy indenting set autoindent set smartindent
"Enable line numbers set number
"Line wrap set wrap "enable line wrap set linebreak "don't break lines in the middle of a word
"Let the open brace key automatically insert a closing brace after hitting enter inoremap { {}ko
"In normal mode, oo inserts a newline below, and OO inserts a newline above nmap oo ok nmap OO Oj
if has("gui_running") "in gVim, disable the menu bar, toolbar and scrollbars set guioptions-=m "menu bar set guioptions-=T "toolbar set guioptions -=r "right scroll bar set guioptions-=L "left scroll bar endif
"let the F4 key toggle between the .h and .cpp file map :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,
When you type a left parenthesis, this automatically inserts a right parenthesis after the cursor. Same thing for square brackets, curly braces, and quotes. Then you can "type over" the closing character, so you don't really have to change your typing habits. Some people don't like it. I'm pretty fond of it. Give it a shot.
Plugin 'tpope/vim-surround'
Extends Vim's text object manipulation with various ways of addressing matching pairs (so it goes hand in hand with the above plugin). For example, if the cursor is between two square brackets and you need to change them to curly braces, you can type cs]} and it'll do that in one edit. Also works on angle brackets, quotes, even HTML tags.
Matthew Cooper
Who /GNUemacs/ here?
Austin Lopez
Plugin 'Shougo/neocomplete.vim'
Better autocompletion, including complete-as-you-type. It's a minor pain in the ass to set up, mostly because you have to do it for each language, but once it's working it's pretty great.
Plugin 'reedes/vim-thematic'
If you find yourself changing certain settings at the same time, like switching to a certain color scheme and changing the font (in the GUI version) then this lets you automate some of that. Not actually useful, just convenient.
Plugin 'godlygeek/csapprox'
Makes GUI color schemes work in the terminal. (If you're on Windows, this is useless, but whatever.)
Plugin 'itchyny/lightline.vim'
There are like 15 different plugins for changing the look of the tab bar and status bar. This is one of them. I like it because it actually works and doesn't have any crazy dependencies.
Easton Cox
>because you have to do it for each language Do I need a dictionary for each language then? Also, what about user defined functions?
Grayson Gonzalez
Emacs getting a new graphical browser in emacs 25 is going to be pretty cool.
Daniel Reed
didn't know that
hopefully it's more useful than listing the phases of the moon
Leo Diaz
If you're going to add that many plugins, you're better off using Emacs.
This lets you run multiple predefined wikis and switch them using ws
Camden Peterson
just use atom with vim bindings
Benjamin Myers
Atom isn't even on my non-free repos. I could build it, but I don't want botnet.
Henry Thompson
>i don't like VIM because my .vimrc is wrong!!! no
you're using vim wrong
you start off with the most minimal install you can, then piecemeal identify features you wish vim had, then add them.
you dont start off with a starter pack of changes that someone else drops in your lap, because then you dont understand why they're helpful and why you should use them
What the fuck is your shitposting supposed to mean?
Brayden Green
Only if you're shilling Emacs. If, on the other hand, you don't use Emacs as your designated shitting editor, it is very easy to specifically define.
Lincoln Howard
What does the clump of four lines do? I found that in my vimrc the other day because I snatched it from somewhere a while ago but I still don't know what this does.
Christian Cook
I'm retarded. I'm referring to the second clump of four lines.
Samuel Young
Okay, kid.
John Harris
Some plugins you might want vundle (plugin manager) tabular (alignment) fugitive (git) ultisnips (snippets) syntastic (syntax errors) youcompleteme (autocomplete)
Ryan Torres
Emacs is the systemd of text editors. It tries to do everything, even things that are not needed and ends up bloated.
Robert Ward
Sup Forums definitely does not have the attention span for emacs... which is fine, because emacs can get next level. emacs is great if you can program in ELISP and want to use emacs to run your entire personal life and stem career, but most people will never get there
you guys can have fun writing hello world and editing zshrc in nano/vim/sublime text (so productive)
Zachary Adams
At least make the bait funny, it's just asinine.
Jackson Nelson
>he can't program worth shit >he googled what is the best text editor >he thought it was vim
how do you comment a block of code in Vim, again? Don't you have to change the mode three times? Isn't it minimum six steps?
Levi Parker
>how do you comment a block of code in Vim, again You bind a key or a user command to it in your vimrc, just like any other action you find yourself doing often. And no, you don't even have to change modes once, you could do the whole thing in one regex. If you really wanted to record a macro for it, you could.
Anthony Scott
For example, bloat is like compiling a spell checker into your text editor when *NIX already has spell checkers like aspell and hunspell, or compiling fucking grep into your text editor.