Instantly share code, notes, and snippets.

Embed
What would you like to do?
Basic vimrc to level the playing field...
" http://vimdoc.sourceforge.net/htmldoc/starting.html#vimrc
set nocompatible " use vim defaults
set scrolloff=3 " keep 3 lines when scrolling
set ai " set auto-indenting on for programming
set showcmd " display incomplete commands
set nobackup " do not keep a backup file
set number " show line numbers
set ruler " show the current row and column
set hlsearch " highlight searches
set incsearch " do incremental searching
set showmatch " jump to matches when entering regexp
set ignorecase " ignore case when searching
set smartcase " no ignorecase if Uppercase char present
set visualbell t_vb= " turn off error beep/flash
set novisualbell " turn off visual bell
set backspace=indent,eol,start " make that backspace key work the way it should
set runtimepath=$VIMRUNTIME " turn off user scripts, https://github.com/igrigorik/vimgolf/issues/129
syntax on " turn syntax highlighting on by default
filetype on " detect type of file
filetype indent on " load indent file for specific file type
set t_RV= " http://bugs.debian.org/608242, http://groups.google.com/group/vim_dev/browse_thread/thread/9770ea844cec3282
@kana

This comment has been minimized.

Show comment
Hide comment
@kana

kana Dec 30, 2010

28Sfiletype plugin indent on^[ZZ

kana commented Dec 30, 2010

28Sfiletype plugin indent on^[ZZ
@dannydulai

This comment has been minimized.

Show comment
Hide comment
@dannydulai

dannydulai Dec 31, 2010

you need to set tabstop=8 otherwise people set tabstops and then use :retab to turn tabs into non-8 char tabs

dannydulai commented Dec 31, 2010

you need to set tabstop=8 otherwise people set tabstops and then use :retab to turn tabs into non-8 char tabs

@bishboria

This comment has been minimized.

Show comment
Hide comment
@bishboria

bishboria Dec 31, 2010

Replace the 2 filetype lines with:
filetype plugin indent on

Tested and works fine.

bishboria commented Dec 31, 2010

Replace the 2 filetype lines with:
filetype plugin indent on

Tested and works fine.

@vincentisambart

This comment has been minimized.

Show comment
Hide comment
@vincentisambart

vincentisambart Dec 31, 2010

You should also probably force indentation to 2-spaces (on my machine "vimgolf put" has it set to 1-tab)
set shiftwidth=2

vincentisambart commented Dec 31, 2010

You should also probably force indentation to 2-spaces (on my machine "vimgolf put" has it set to 1-tab)
set shiftwidth=2

@bishboria

This comment has been minimized.

Show comment
Hide comment
@bishboria

bishboria Dec 31, 2010

@vincentisambart i don't think you do want to set shiftwidth. With the setting I said, the proper file settings will be picked up from vim.

bishboria commented Dec 31, 2010

@vincentisambart i don't think you do want to set shiftwidth. With the setting I said, the proper file settings will be picked up from vim.

@igrigorik

This comment has been minimized.

Show comment
Hide comment
@igrigorik

igrigorik Dec 31, 2010

@bishboria, @vincentisambart: went back and forth on this earlier and decided to strip out any/all customizations to do with tabbing, spacing, etc. This is a touchy subject for many VIM users, hence opted out for the VIM defaults, to be fair to everyone.

We'll add some extra logic + language to the challenge create page to get the creators of challenges to take this into account.

@bishboria: thanks for tip, will update.

Owner

igrigorik commented Dec 31, 2010

@bishboria, @vincentisambart: went back and forth on this earlier and decided to strip out any/all customizations to do with tabbing, spacing, etc. This is a touchy subject for many VIM users, hence opted out for the VIM defaults, to be fair to everyone.

We'll add some extra logic + language to the challenge create page to get the creators of challenges to take this into account.

@bishboria: thanks for tip, will update.

@bishboria

This comment has been minimized.

Show comment
Hide comment
@bishboria

bishboria Dec 31, 2010

@igrigorik No problem :) Loving vimgolf, so thanks for all your effort!

bishboria commented Dec 31, 2010

@igrigorik No problem :) Loving vimgolf, so thanks for all your effort!

@bishboria

This comment has been minimized.

Show comment
Hide comment
@bishboria

bishboria Jan 3, 2011

Any chance of making those filetype changes soon?

bishboria commented Jan 3, 2011

Any chance of making those filetype changes soon?

@igrigorik

This comment has been minimized.

Show comment
Hide comment
@igrigorik

igrigorik Jan 4, 2011

@bishboria: the config above have been life for a few days now! unless something is not picking up the differences...?

ex: http://vimgolf.com/challenges/4d1a1c36567bac34a9000002.json

Owner

igrigorik commented Jan 4, 2011

@bishboria: the config above have been life for a few days now! unless something is not picking up the differences...?

ex: http://vimgolf.com/challenges/4d1a1c36567bac34a9000002.json

@bishboria

This comment has been minimized.

Show comment
Hide comment
@bishboria

bishboria Jan 5, 2011

Hmm. I'm still not picking up the correct indentation rules... I'll need to investigate my vim setup. Thanks again.

bishboria commented Jan 5, 2011

Hmm. I'm still not picking up the correct indentation rules... I'll need to investigate my vim setup. Thanks again.

@mathiasbynens

This comment has been minimized.

Show comment
Hide comment
@mathiasbynens

mathiasbynens Apr 8, 2011

How about set encoding=utf-8? I needed to type this manually for this golf: http://www.vimgolf.com/challenges/4d1da368de2f897c2a000114 Or am I missing something here?

mathiasbynens commented Apr 8, 2011

How about set encoding=utf-8? I needed to type this manually for this golf: http://www.vimgolf.com/challenges/4d1da368de2f897c2a000114 Or am I missing something here?

@igrigorik

This comment has been minimized.

Show comment
Hide comment
@igrigorik

igrigorik Apr 9, 2011

Hmm, is your shell (whatever you use, bash, etc) set to UTF-8? If so, vim should pick it up automatically.

Owner

igrigorik commented Apr 9, 2011

Hmm, is your shell (whatever you use, bash, etc) set to UTF-8? If so, vim should pick it up automatically.

@mathiasbynens

This comment has been minimized.

Show comment
Hide comment
@mathiasbynens

mathiasbynens Apr 10, 2011

@igrigorik: I’m using iTerm 2 on Mac OS X, and I have ProfilesMy ProfileTerminalCharacter Encoding set to “Unicode (UTF-8)”. Not sure what else I need to do.

Edit: In Terminal.app it works fine. Any ideas?

mathiasbynens commented Apr 10, 2011

@igrigorik: I’m using iTerm 2 on Mac OS X, and I have ProfilesMy ProfileTerminalCharacter Encoding set to “Unicode (UTF-8)”. Not sure what else I need to do.

Edit: In Terminal.app it works fine. Any ideas?

@pletnes

This comment has been minimized.

Show comment
Hide comment
@pletnes

pletnes Aug 21, 2012

set relativenumber is always convenient. I don't think vimgolf is about manual counting, anyways.

pletnes commented Aug 21, 2012

set relativenumber is always convenient. I don't think vimgolf is about manual counting, anyways.

@zulolosi

This comment has been minimized.

Show comment
Hide comment
@zulolosi

zulolosi Jun 29, 2013

Hello,
I think, it would be better not to set ignorecase in vimgolf vimrc. There are challenge like : http://vimgolf.com/challenges/51b4e3b920faf70002000001 when it needs to search o and not O. That have to work like fo keystrokes. I have a solution, this:

   ?o\C<NL>qz0<C-A>nq12@z?r<NL>18@z?i<NL>16@z-<C-A>ZZ 

that needs 2 additional keys, the \ key and C key to specify lowercase for back search ? command to search o and not O
Best regards !

zulolosi commented Jun 29, 2013

Hello,
I think, it would be better not to set ignorecase in vimgolf vimrc. There are challenge like : http://vimgolf.com/challenges/51b4e3b920faf70002000001 when it needs to search o and not O. That have to work like fo keystrokes. I have a solution, this:

   ?o\C<NL>qz0<C-A>nq12@z?r<NL>18@z?i<NL>16@z-<C-A>ZZ 

that needs 2 additional keys, the \ key and C key to specify lowercase for back search ? command to search o and not O
Best regards !

@tpenguinltg

This comment has been minimized.

Show comment
Hide comment
@tpenguinltg

tpenguinltg Jul 19, 2017

Should we set nowrap? Otherwise, I could, for example, resize my terminal window and do 5gj to go down five display lines so I end up in the right column of a line three lines down in three keystrokes where it might otherwise take four.

tpenguinltg commented Jul 19, 2017

Should we set nowrap? Otherwise, I could, for example, resize my terminal window and do 5gj to go down five display lines so I end up in the right column of a line three lines down in three keystrokes where it might otherwise take four.

@elzup

This comment has been minimized.

Show comment
Hide comment
@elzup

elzup Dec 16, 2017

Hacked by Filename Completion.
It will be game break.

set wildignore+=*

" or
inoremap <C-X><C-F> <Nop>

elzup commented Dec 16, 2017

Hacked by Filename Completion.
It will be game break.

set wildignore+=*

" or
inoremap <C-X><C-F> <Nop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment