← Back to Upcase

Vim Initial Setup


(Aggarwalneerajk) #1

I am new to VIM. I have just started with ‘Indenting’ in ‘Art of VIM’ course. I started with a simple file

class Foo
def m1
return true
end
end

And followed the instructions from video. But nothing is working as expected.

Am I missing some basic configurations which is required for the ‘Art of VIM’ course ?

I am using Ubuntu 14.04 LTS on 64 bits.

Thanks,


(khundawg) #2

I need to go back and re-watch those videos myself. A couple questions:

Are you using the preinstalled vim.tiny or have you installed the full version of vim? (http://youtu.be/ReTvvIPmS34)
What specific commands are you attempting to use?
Have you installed any plugins or done any dotfile configuration?


(Aggarwalneerajk) #3

I have full version of vim installed

ubuntu@devel:~$ dpkg -l vim
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  vim            2:7.4.052-1u amd64        Vi IMproved - enhanced vi editor

I am trying to indent an un indented ruby file by using ‘==’ command on each line. The lines are not getting indented as shown in the tutorial.

I have not installed any plugins or dot file.

In fact I didn’t find any tutorial or instructions in the course to setup vim.

Thanks & Regards


(Geoff Harcourt) #4

Can you post the contents of your ~/.vimrc to a gist?

I suspect that you either have = mapped incorrectly or your tabstop/shiftwidth/etc settings are off, so Vim doesn’t know how to indent.


(Joe Ferris) #5

If you want syntax highlighting and indentation, here are the minimal commands you’ll need in your .vimrc:

" Allow extensions made to Vi by Vim
set nocompatible

" Use syntax-based color highlighting
syntax on

" Enable plugins based on file type, including indentation
filetype plugin indent on

Vim has a considerable number of options you can play with. You can learn about a lot of the options we consider useful by reading the thoughtbot .vimrc: https://github.com/thoughtbot/dotfiles/blob/master/vimrc

If you want to jump-start your Vim environment, you can always copy our dotfiles for yourself. Install instructions: https://github.com/thoughtbot/dotfiles#install