Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
My personal Windows vimrc. Requires Plugged to be installed manually first.
set guioptions-=M
set nocompatible
set background=dark
syntax enable
filetype plugin indent on
set spelllang=en_gb
syntax spell toplevel
setglobal fileencoding=utf-8
set nobomb
set expandtab
set tabstop=2
set shiftwidth=2
set softtabstop=2
set backspace=indent,eol,start
set backupdir=~/.vim/backup/
set backup
set backupcopy=yes
set writebackup
set directory=~/.vim/swap/
set undodir=~/.vim/undo/
set undoreload=1000
set undolevels=1000
set undofile
set history=1000
set clipboard+=unnamed
set hidden
set lazyredraw
set updatetime=750
set hlsearch
set wrapscan
set wildmenu
set splitbelow
set ignorecase
set smartcase
set autochdir
set path+=**
set wildignore+=*/bin/*,*/.meteor/*,*/node_modules/*
set autoindent
set breakindent
set nostartofline
set laststatus=2
set cmdheight=1
set showcmd
set noshowmode
set number
set relativenumber
set cursorline
set wrap
set ruler
set showmatch
set matchtime=2
set ttimeout
set ttimeoutlen=50
set notimeout
set conceallevel=1
set concealcursor=nvic
set noerrorbells
set visualbell
set t_vb=
set shell=powershell
set shellcmdflag=-command
runtime macros/matchit.vim
if !has("gui_running")
set termguicolors
set term=xterm
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
else
set guioptions=+c
set guioptions=-T
set guioptions=-L
set guioptions=-R
set guioptions=-l
set guioptions=-r
set guioptions=-b
set guioptions=-h
set guicursor+=a:blinkon0
set guifont=Hasklig:h16
nnoremap <leader>wf :call libcallnr("gvimfullscreen.dll", "ToggleFullScreen", 0)
endif
map <space> <leader>
nnoremap <space><space> :
nnoremap ; :
nnoremap : ;
noremap H g^
noremap L g$
nnoremap <expr> k v:count ? (v:count > 3 ? "m'" . v:count : '') . 'gk' : 'gk'
nnoremap <expr> j v:count ? (v:count > 3 ? "m'" . v:count : '') . 'gj' : 'gj'
noremap 0 g0
noremap ^ g^
noremap $ g$
nnoremap <c-k> <c-w>k
nnoremap <c-j> <c-w>j
nnoremap <c-h> <c-w>h
nnoremap <c-l> <c-w>l
nnoremap <up> <c-w>k
nnoremap <down> <c-w>j
nnoremap <left> <c-w>h
nnoremap <right> <c-w>l
"nnoremap <c-d> <c-d>zzzv
"nnoremap <c-u> <c-u>zzzv
"nnoremap n nzzzv
"nnoremap N Nzzzv
nnoremap <c-p> :put<cr>
nnoremap =p o<esc>p==
nnoremap =P O<esc>p==
nnoremap gf :split wincmd f<cr>
nnoremap <leader>eh :Sexplore *
nnoremap <leader>ev :Vexplore *
nnoremap <leader>fh :split *
nnoremap <leader>fv :vsplit *
nnoremap <leader>fr :browse oldfiles<cr>
nnoremap <leader>fn :edit<c-r>=expand('%:p:h').'/'<cr>
nnoremap <leader>fc :!mkdir -p %:h
nnoremap <leader>rb "_
nnoremap <leader>rs "+
nnoremap <leader>rl :registers<cr>
nnoremap <leader>ml :marks<cr>:normal `
nnoremap <leader>jj <c-o>zz
nnoremap <leader>jJ <c-i>zz
nnoremap <leader>jc g;zz
nnoremap <leader>jC g,zz
nnoremap <leader>jp `.zz
nnoremap <leader>ji `^zz
nnoremap <leader>jl ``zz
nnoremap <leader>jvv gvzz
nnoremap <leader>jys `]zz
nnoremap <leader>jyf `[zz
nnoremap <leader>jvs `<zz
nnoremap <leader>jvf `>zz
nnoremap <leader>bl :buffers<cr>:buffer<space>
nnoremap <leader>bL :buffers!<cr>:buffer<space>
nnoremap <leader>bp :b#<cr>
nnoremap <leader>bo :only<cr>
nnoremap <leader>bd :bdelete<cr>
nnoremap <leader>bw :bwipeout<cr>
nnoremap <leader>bi :% normal ==<cr>:w
nnoremap <leader>bc :%s/\s\+$//<cr>:w
nnoremap <leader>ws <c-w>s
nnoremap <leader>wv <c-w>v
nnoremap <leader>wt <c-w>T
nnoremap <leader>w= <c-w>=
nnoremap <leader>w_ <c-w>_
nnoremap <leader>w<bar> <c-w><bar>
nnoremap <leader>wk <c-w>K
nnoremap <leader>wj <c-w>J
nnoremap <leader>wh <c-w>H
nnoremap <leader>wl <c-w>L
nnoremap <leader>wr <c-w>r
nnoremap <leader>wx <c-w>x
nnoremap <leader>wc :lcd %:p:h<cr>
nnoremap <leader>wo :only<cr>
nnoremap <leader>wd :close<cr>
nnoremap <leader>tl :tabs<cr>:normal gt
nnoremap <leader>tp :tabprevious<cr>
nnoremap <leader>td :tabclose<cr>
nnoremap <leader>vl gvzz
nnoremap <leader>/t :nohlsearch<cr>
nnoremap <leader>/h q/
nnoremap <leader>/s :s/
nnoremap <leader>// :%s/
nnoremap <leader>q q: i
nnoremap <leader>ve :edit $MYVIMRC<cr>
nnoremap <leader>vr :source $MYVIMRC<cr>
nnoremap <leader>cs :setlocal spell!<cr>
nnoremap <leader>cr @:
function! NumberToggle()
if (&number == 1)
set number!
set relativenumber
else
set norelativenumber
set number
endif
endfunction
command! NumberToggle :call NumberToggle()
nnoremap <leader>n :call NumberToggle()<cr>
function! OpenChangedFiles()
only
let status = system('git status -s | grep "^ \?\(M\|A\)" | cut -d " " -f 3')
let filenames = split(status, "\n")
if len(filenames) > 0
exec "edit " . filenames[0]
for filename in filenames[1:]
exec "sp " . filename
endfor
end
endfunction
command! OpenChangedFiles :call OpenChangedFiles()
nnoremap <leader>gc :OpenChangedFiles<cr>
imap jj <esc>
vnoremap ; :
vnoremap : ;
cnoremap <expr> %% getcmdtype() == ':' ? expand('%:h').'/' : '%%'
inoremap <Char-0x07F> <BS>
nnoremap <Char-0x07F> <BS>
autocmd GUIEnter * set visualbell t_vb=
autocmd Filetype cs setlocal tabstop=4 shiftwidth=4 softtabstop=4
autocmd Filetype ps1 setlocal tabstop=4 shiftwidth=4 softtabstop=4
autocmd Filetype psm1 setlocal tabstop=4 shiftwidth=4 softtabstop=4
autocmd Filetype go setlocal tabstop=4 shiftwidth=4 softtabstop=4
call plug#begin('~/.vim/plugged')
Plug 'zeis/vim-kolor'
Plug 'bluz71/vim-moonfly-colors'
Plug 'liuchengxu/space-vim-dark'
Plug 'crusoexia/vim-monokai'
Plug 'nanotech/jellybeans.vim'
Plug 'morhetz/gruvbox'
Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'mhinz/vim-startify'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'tpope/vim-dispatch'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-vinegar'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-abolish'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-characterize'
" Plug 'chaoren/vim-wordmotion'
Plug 'easymotion/vim-easymotion'
Plug 'FooSoft/vim-argwrap'
Plug 'sjl/gundo.vim'
Plug 'Wolfy87/vim-syntax-expand'
Plug 'sickill/vim-pasta'
Plug 'tpope/vim-endwise'
Plug 'fsharp/vim-fsharp'
Plug 'PProvost/vim-ps1'
Plug 'othree/html5.vim'
Plug 'mattn/emmet-vim'
Plug 'othree/yajs.vim'
Plug 'othree/es.next.syntax.vim'
Plug 'moll/vim-node'
Plug 'mxw/vim-jsx'
Plug 'leshill/vim-json'
Plug 'othree/javascript-libraries-syntax.vim'
Plug 'kchmck/vim-coffee-script'
Plug 'digitaltoad/vim-pug'
Plug 'Slava/vim-spacebars'
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-rake'
Plug 'tpope/vim-rails'
Plug 'tpope/vim-bundler'
Plug 'kana/vim-textobj-user'
Plug 'nelstrom/vim-textobj-rubyblock'
Plug 'elixir-lang/vim-elixir'
Plug 'slashmili/alchemist.vim'
call plug#end()
nnoremap <leader>pug :PlugUpgrade<cr>
nnoremap <leader>pup :PlugUpdate<cr>
nnoremap <leader>pi :PlugInstall<cr>
nnoremap <leader>pc :PlugClean<cr>
let g:gruvbox_contrast_dark='dark'
colorscheme kolor
let g:airline_theme='kolor'
let g:airline_mode_map = {
\ '__' : '-',
\ 'n' : 'normal',
\ 'i' : 'insert',
\ 'R' : 'replace',
\ 'c' : 'command',
\ 'v' : 'visual',
\ 'V' : 'visual line',
\ '' : 'visual block',
\ 's' : 'select',
\ 'S' : 'select line',
\ '' : 'select block',
\ 't' : 'terminal',
\ }
nnoremap <leader>h :Startify<cr>
let g:ctrlp_map='<c-q>'
nnoremap <silent> <c-q> :CtrlP<cr>
nnoremap <silent> <c-w> :CtrlPBuffer<cr>
nnoremap <silent> <c-e> :CtrlPMRU<cr>
let g:ctrlp_by_filename=1
let g:ctrlp_match_window='bottom,order:ttb,min:1,max:10,results:10'
let g:ctrlp_switch_buffer=0
let g:ctrlp_use_caching=0
let g:ctrlp_user_command='ag %s --files-with-matches -g "" --ignore "\.git$\|\.hg$\|\.svn$"'
let g:ctrlp_open_new_file='h'
let g:ctrlp_open_multiple_files='hjr'
let g:ctrlp_arg_map=0
let g:ctrlp_follow_symlinks=1
let g:ctrlp_brief_prompt=1
let g:ctrlp_extensions=['dir', 'undo', 'line', 'changes', 'mixed', 'bookmarkdir']
map <leader>ie [<space>]<space>i
map <leader>ii 2[<space>k]<space>i
map <leader>ik k[<space>]<space>i
map <leader>ij j[<space>]<space>i
map <leader>sc cs
map <leader>sd ds
map <leader>sw ysiw
map <leader>sW ysiW
map <leader>sl yss
let g:wordmotion_spaces='_-.'
let g:EasyMotion_do_mapping=0
let g:EasyMotion_use_smartsign_us=1
let g:EasyMotion_smartcase=1
let g:EasyMotion_startofline=0
nmap f <plug>(easymotion-overwin-f)
xmap f <plug>(easymotion-bd-f)
omap f <plug>(easymotion-bd-f)
nmap / <plug>(easymotion-sn)
xmap / <plug>(easymotion-sn)
omap / <plug>(easymotion-sn)
map n <plug>(easymotion-next)
map N <plug>(easymotion-prev)
hi link EasyMotionTarget Search
hi link EasyMotionTarget2First Search
hi link EasyMotionTarget2Second Search
hi link EasyMotionShade Comment
hi link EasyMotionIncSearch Search
hi link EasyMotionMoveHL Search
nnoremap <leader>aw :ArgWrap<cr>
let g:gundo_preview_statusline='Preview'
let g:gundo_tree_statusline='Undo Tree'
let g:gundo_width=60
nnoremap <leader>u :GundoToggle<cr>
let g:OmniSharp_server_path = 'C:\dev\utils\omnisharp-roslyn\artifacts\publish\OmniSharp.Http.Driver\win7-x64\OmniSharp.exe'
let g:go_highlight_functions=1
let g:go_highlight_methods=1
let g:go_highlight_structs=1
let g:go_highlight_interfaces=1
let g:go_highlight_operators=1
let g:go_highlight_build_constraints=1
function! ConcealSyntax()
syntax match elixirAnonymousFunction contained "fn" conceal cchar=λ
endfunction
command! ConcealSyntax :call ConcealSyntax()
if filereadable(expand('~/_vimrc.local'))
source ~/_vimrc.local
endif
set lines=30
set columns=119
set lines=37
set columns=145
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment