Skip to content

Instantly share code, notes, and snippets.

@josephcode773
Created March 5, 2019 17:46
Show Gist options
  • Save josephcode773/8baa9c5c8c9cf4e482992bb05120b600 to your computer and use it in GitHub Desktop.
Save josephcode773/8baa9c5c8c9cf4e482992bb05120b600 to your computer and use it in GitHub Desktop.
Windows 10 Vim _vimrc file
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin
set diffexpr=MyDiff()
function MyDiff()
let opt = '-a --binary '
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
let arg1 = v:fname_in
if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
let arg2 = v:fname_new
if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
let arg3 = v:fname_out
if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
let eq = ''
if $VIMRUNTIME =~ ' '
if &sh =~ '\<cmd'
let cmd = '""' . $VIMRUNTIME . '\diff"'
let eq = '"'
else
let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
endif
else
let cmd = $VIMRUNTIME . '\diff'
endif
silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
filetype off
execute pathogen#infect()
syntax on
filetype plugin indent on
colorscheme kolor
set guifont=Consolas:h10
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
set rtp+=/usr/local/lib/python2.7/dist-packages/powerline/bindings/vim/
set laststatus=2
set t_Co=256
set showtabline=2
set noshowmode
inoremap jk <ESC>
let mapleader = "\<Space>"
" December 10, 2015 Additions:
set nocompatible
" Colors {{{
syntax enable " enable syntax processing
" }}}
" Misc {{{
set ttyfast " faster redraw
set backspace=indent,eol,start
" }}}
" Spaces & Tabs {{{
set tabstop=2 " 4 space tab
set expandtab " use spaces for tabs
set softtabstop=2 " 4 space tab
set shiftwidth=2
set modelines=1
filetype indent on
filetype plugin on
set autoindent
" }}}
" UI Layout {{{
set number " show line numbers
set relativenumber
" set showcmd " show command in bottom bar
set nocursorline " highlight current line
set wildmenu
" set lazyredraw
set showmatch " higlight matching parenthesis
set wrap linebreak nolist
" }}}
" Searching {{{
nnoremap / /\v
vnoremap / /\v
set ignorecase " ignore case when searching
set incsearch " search as characters are entered
set hlsearch " highlight all matches
set showmatch
set smartcase
nnoremap <leader><space> :noh<cr>
" }}}
" Line Shortcuts {{{
nnoremap j gj
nnoremap k gk
nnoremap B ^
nnoremap E $
" nnoremap $ <nop>
" nnoremap ^ <nop>
nnoremap gV `[v`]
" }}}
nnoremap <leader>1 :set number!<CR>
nnoremap <leader>2 :set wrap linebreak nolist<CR>
nnoremap <leader>w :w<CR>
nnoremap ; :
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment