Skip to content

Instantly share code, notes, and snippets.

@frncmx
Created October 17, 2015 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frncmx/e9603d97cf69d790a114 to your computer and use it in GitHub Desktop.
Save frncmx/e9603d97cf69d790a114 to your computer and use it in GitHub Desktop.
My vim configuration.
set nocompatible
execute pathogen#infect()
filetype plugin indent on
syntax on
set hidden
" Better command-line completion
set wildmenu
" Show partial commands in the last line of the screen
set showcmd
set hlsearch
" Use case insensitive search, except when using capital letters
set ignorecase
set smartcase
" Allow backspacing over autoindent, line breaks and start of insert action
set backspace=indent,eol,start
" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set autoindent
" Stop certain movements from always going to the first character of a line.
" While this behaviour deviates from that of Vi, it does what most users
" coming from other editors would expect.
set nostartofline
" Display the cursor position on the last line of the screen or in the status
" line of a window
set ruler
" Always display the status line, even if only one window is displayed
set laststatus=2
" Instead of failing a command because of unsaved changes, instead raise a
" dialogue asking if you wish to save changed files.
set confirm
" set the command window height to 2 lines, to avoid many cases of having to
" "press <Enter> to continue"
set cmdheight=2
" Display line numbers on the left
set number
" Quickly time out on keycodes, but never time out on mappings
set notimeout ttimeout ttimeoutlen=200
autocmd FileType * set softtabstop=2|set shiftwidth=2|set expandtab
autocmd FileType make setlocal noexpandtab
autocmd FileType python set tabstop=4|set shiftwidth=4|set expandtab
" set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< list
" Map <C-L> to also turn off search highlighting until the next search
nnoremap <C-L> :nohl<CR><C-L>
" IDE like completion
set completeopt=longest,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
inoremap <expr> <NUL> pumvisible() ? '<C-n>' :
\ '<C-n><C-r>=pumvisible() ? "\<lt>Down>" : ""<CR>'
" Show red line at 80 chars
set colorcolumn=80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment