Skip to content

Instantly share code, notes, and snippets.

@andreypopp
Created July 17, 2015 18:20
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save andreypopp/500b23c0a21ead135b96 to your computer and use it in GitHub Desktop.
Save andreypopp/500b23c0a21ead135b96 to your computer and use it in GitHub Desktop.
if !1 | finish | endif
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'venantius/vim-cljfmt'
Plug 'Shougo/vimproc.vim', { 'do': 'make' }
Plug 'tpope/vim-surround'
Plug 'bling/vim-airline'
Plug 'vim-scripts/Rename'
Plug 'kien/ctrlp.vim'
Plug 'JazzCore/ctrlp-cmatcher', { 'do': './install.sh' }
Plug 'mattn/webapi-vim'
Plug 'mattn/gist-vim'
Plug 'editorconfig/editorconfig-vim'
Plug 'tpope/vim-fireplace'
Plug 'tpope/vim-classpath'
Plug 'guns/vim-clojure-static'
Plug 'paredit.vim'
Plug 'leafgarland/typescript-vim'
Plug 'mileszs/ack.vim'
Plug 'terryma/vim-expand-region'
Plug 'def-lkb/ocp-indent-vim'
"" Plug 'scrooloose/syntastic'
Plug 'junegunn/goyo.vim'
Plug 'amix/vim-zenroom2'
Plug 'altercation/vim-colors-solarized'
Plug 'chriskempson/vim-tomorrow-theme'
Plug 'spwhitt/vim-nix'
call plug#end()
filetype on
filetype plugin on
filetype plugin indent on
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute "set rtp+=" . g:opamshare . "/merlin/vim"
"" Preferences
let mapleader=","
nmap < ,
let maplocalleader="\\"
set hidden
set noshowmode
set wrap
set backspace=indent,eol,start
set expandtab
set nofoldenable
set autoindent
set copyindent
set sw=2 ts=2 sts=2
set textwidth=80
set shiftround
set showmatch
set smartcase
set virtualedit=block
set smarttab
set hlsearch
set incsearch
set scrolloff=4
set history=1000
set undolevels=1000
set wildignore=*.swp,*.bak,*.pyc,*.class,*.egg-info,.git,.svn,.hg,.bzr,.env,node_modules,.sass-cache
set title
set visualbell
set noerrorbells
set vb t_vb=
set tildeop
set nobackup
set noswapfile
set wildmenu
set wildmode=longest,list
set showcmd
set shortmess=atI
set display=lastline,uhex
set mouse=a
set confirm
set ttimeoutlen=100
set clipboard+=unnamed
set fileencodings=ucs-bom,utf-8,latin1,default
set pastetoggle=<F3>
set completeopt-=preview
set tags+=.tags,./.tags
if has('statusline')
set laststatus=2
set statusline=%<%f\
set statusline+=%w%h%m%r
set statusline+=\ [%{&ff}/%Y]
set statusline+=%=%-14.(%l,%c%V%)\ %p%%
endif
nnoremap ; :
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
nmap <silent> <leader>/ :nohlsearch<CR>
nmap <space> i_<esc>r
" nmap K i<cr><esc>0
nmap s :w <enter>
cmap w!! w !sudo tee % >/dev/null
map й q
map ц w
map у e
map к r
map е t
map н y
map г u
map ш i
map щ o
map з p
map х [
map ъ ]
map ф a
map ы s
map в d
map а f
map п g
map р h
map о j
map л k
map д l
map ж ;
map э '
map я z
map ч x
map с c
map м v
map и b
map т n
map ь m
map б ,
map ю .
map Й Q
map Ц W
map У E
map К R
map Е T
map Н Y
map Г U
map Ш I
map Щ O
map З P
map Х {
map Ъ }
map Ф A
map Ы S
map В D
map А F
map П G
map Р H
map О J
map Л K
map Д L
map Ж ;
map Э "
map Я Z
map Ч X
map С C
map М V
map И B
map Т N
map Ь M
map Б <
map Ю >
nmap j gj
nmap k gk
inoremap <Up> <nop>
inoremap <Down> <nop>
inoremap <Left> <nop>
inoremap <Right> <nop>
noremap <Up> <nop>
noremap <Down> <nop>
noremap <Left> <nop>
noremap <Right> <nop>
vnoremap < <gv
vnoremap > >gv
map Y y$
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
map <CR> i<CR><Esc>
imap <C-l> </<C-x><C-o>
""" Appearance
if &t_Co > 2 || has("gui_running")
syntax on
endif
if has("gui_running")
set guioptions=aegimLt
set go-=M
set go-=m
set go-=L
set number
set cursorline
set background=light
colorscheme tomorrow
else
set background=dark
set t_Co=256
let g:solarized_termcolors=256
let g:solarized_termtrans=1
let g:solarized_contrast="high"
let g:solarized_visibility="high"
colorscheme solarized
endif
""" Highlight extra whitespace
:highlight ExtraWhitespace ctermbg=red guibg=red
:match ExtraWhitespace /\s\+\%#\@<!$/
""" Specifics
au BufRead,BufNewFile *.sjs setlocal ft=javascript
au BufRead,BufNewFile *.jspc setlocal ft=javascript
au BufRead,BufNewFile *.rkt,*.rktl setlocal ft=racket
au BufRead,BufNewFile *.go setlocal ft=go
au BufRead,BufNewFile *.coq setlocal ft=coq
au BufRead,BufNewFile *.purs setlocal ft=haskell
au BufRead,BufNewFile *.ijs,*.ijt,*.ijp,*.ijx setlocal ft=j
au BufRead,BufNewFile *.less setlocal ft=less
au BufRead,BufNewFile *.jinja setlocal ft=jinja
au BufRead,BufNewFile *.jinja2 setlocal ft=jinja
au BufRead,BufNewFile *.md set ft=markdown
au filetype racket set lisp
au filetype racket set autoindent
au FileType python setl sw=4 sts=4 ts=4 et
au FileType javascript setl sw=2 sts=2 ts=2 et
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
let g:ctrlp_working_path_mode = ''
let g:ctrlp_switch_buffer = 'et'
let g:ctrlp_match_func = { 'match': 'matcher#cmatch' }
let g:ctrlp_user_command = 'ag %s -i --nocolor --nogroup --hidden
\ --ignore .git
\ --ignore .svn
\ --ignore .hg
\ --ignore .DS_Store
\ --ignore node_modules
\ --ignore site-packages
\ --ignore "*.egg-info"
\ --ignore "**/*.pyc"
\ -g ""'
nnoremap <C-b> <Esc>:CtrlPBuffer<CR>
nnoremap <C-t> <Esc>:CtrlPTag<CR>
nnoremap <C-c> <Esc>:CtrlPClearCache<CR>
let g:gist_clip_command = 'pbcopy'
let g:gist_post_private = 1
let g:gist_show_privates = 1
let g:netrw_list_hide = '.*\.swp$,.*\.pyc$,\.svn$,^\.[A-Za-z].*'
let g:netrw_banner = 0
if filereadable($HOME.'/.vimrc.local')
source ~/.vimrc.local
endif
let g:airline_left_sep=''
let g:airline_right_sep=''
let g:localvimrc_count=1
let g:localvimrc_sandbox=0
let g:localvimrc_ask=0
let g:syntastic_ocaml_checkers = ['merlin']
nnoremap <Leader>G :Goyo<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment