Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Last active February 16, 2019 16:54
Show Gist options
  • Select an option

  • Save thosakwe/40393b8da1eb16af2cb0435ea5f072af to your computer and use it in GitHub Desktop.

Select an option

Save thosakwe/40393b8da1eb16af2cb0435ea5f072af to your computer and use it in GitHub Desktop.
" Plugins
call plug#begin('~/.local/share/nvim/plugged')
Plug 'tpope/vim-sensible'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'itchyny/lightline.vim'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
Plug 'vim-syntastic/syntastic'
Plug 'JamshedVesuna/vim-markdown-preview'
call plug#end()
" Global variables
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
" let g:syntastic_ocaml_checkers = ['merlin']
execute "set rtp+=" . g:opamshare . "/merlin/vim"
" set statusline+=%#warningmsg#
" set statusline+=%{SyntasticStatuslineFlag()}
" set statusline+=%*
" Options
let mapleader = "j"
let vim_markdown_preview_github = 1
set autoread
set expandtab
set foldmethod=marker
set mouse=a
set number
set shiftwidth=2
set splitbelow
set splitright
set tabstop=3
" Normal mode
nnoremap // :noh<cr>
nnoremap <leader>3 :NERDTreeToggle<cr>
nnoremap <leader>9 :sp term://bash<cr>
nnoremap <leader>eb :sp ~/.bashrc<cr>
nnoremap <leader>ev :sp ~/.vimrc<cr>
nnoremap <leader>p :Files<cr>
nnoremap <leader>sv :source ~/.vimrc<cr>
nnoremap xx :x<cr>
" Edit mode
inoremap <c-d> <esc>0v$yA<cr><esc>pa<esc>jddk$i
inoremap j0 <esc>0i
inoremap ja <esc>A
inoremap jdd <esc>dd$i
inoremap ji <esc>
inoremap jk <esc>
inoremap jj j
inoremap jn <esc>:
inoremap jr <esc><c-r><cr>i
inoremap ju <esc>ua
inoremap jv <esc>lv
inoremap jw <esc>:w<cr>a
inoremap jx <esc>:x<cr>
" Terminal mode
tnoremap <esc> <c-\><c-n>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment