Skip to content

Instantly share code, notes, and snippets.

@ArthurSonzogni
Created November 25, 2014 12:37
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 ArthurSonzogni/18157515f0470ea349be to your computer and use it in GitHub Desktop.
Save ArthurSonzogni/18157515f0470ea349be to your computer and use it in GitHub Desktop.
minimal acceptable vim
set nocompatible
" map jj to escape
imap jj <Esc>
" activate mouse control
set mouse=a
" display line number
set number
" auto indent
filetype plugin on
filetype indent on
" Set 7 lines to the cursor - when moving vertically using j/k
set so=7
" Turn on the WiLd menu
set wildmenu
" Ignore compiled files
set wildignore=*.o,*~
" Always show current position
set ruler
" don't annoy with case
set ignorecase
set smartcase
" Highlight search results
set hlsearch
" Makes search act like search in modern browsers
set incsearch
" For regular expressions turn magic on
set magic
" Show matching brackets when text indicator is over them
set showmatch
" No annoying sound on errors
set noerrorbells
set novisualbell
set t_vb=
set tm=500
" syntax highlighting
syntax on
" setmart when using tabs ;)
set smarttab
" 1 tab == 4 spaces
set expandtab
set shiftwidth=4
set tabstop=4
autocmd FileType make setlocal noexpandtab
" Linebreak on 500 characters
"set lbr
"set tw=500
set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines
set laststatus=2
" Configure backspace so it acts as it should act
set backspace=eol,start,indent
set whichwrap+=<,>,h,l
" Treat long lines as break lines (useful when moving around in them)
map j gj
map k gk
" Smart way to move between windows
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" don't use swap file and backup file
set nobackup
set noswapfile
" draw the command
set showcmd
set fileencoding=utf8
" copy and paste from the system clipboard
nmap <leader>y "+y
nmap <leader>p "+p
" visual shifting
vnoremap < <gv
vnoremap > >gv
" reload vimrc
nmap <Leader>s :source $MYVIMRC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment