Created
November 17, 2018 09:14
-
-
Save lewisf/0680bab44d84eb80e5e69b4cf37a9bd6 to your computer and use it in GitHub Desktop.
lewisf vimrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nocompatible | |
| filetype off | |
| syntax enable | |
| " set pyx=3 | |
| set backspace=indent,eol,start | |
| " On pressing tab, insert 2 spaces | |
| set expandtab | |
| " show existing tab with 2 spaces width | |
| set tabstop=2 | |
| set softtabstop=2 | |
| " when indenting with '>', use 2 spaces width | |
| set shiftwidth=2 | |
| " Specify a directory for plugins | |
| " - For Neovim: ~/.local/share/nvim/plugged | |
| " - Avoid using standard Vim directory names like 'plugin' | |
| call plug#begin('~/.vim/plugged') | |
| " Typescript | |
| Plug 'HerringtonDarkholme/yats.vim' | |
| Plug 'mhartington/nvim-typescript', {'do': './install.sh'} | |
| Plug 'prettier/vim-prettier', { 'do': 'yarn install' } | |
| let g:prettier#autoformat = 0 | |
| let g:prettier#config#parser = 'typescript' | |
| let g:prettier#quickfix_enabled = 0 | |
| autocmd BufWritePre *.js,*.json,*.css,*.scss,*.less,*.graphql,*.ts PrettierAsync | |
| " For Denite features | |
| Plug 'Shougo/denite.nvim' | |
| Plug 'itchyny/lightline.vim' | |
| Plug 'terryma/vim-multiple-cursors' | |
| Plug 'tpope/vim-surround' | |
| Plug 'autozimu/LanguageClient-neovim', { | |
| \ 'branch': 'next', | |
| \ 'do': 'bash install.sh', | |
| \ } | |
| " ReasonML | |
| Plug 'reasonml-editor/vim-reason-plus' | |
| let g:LanguageClient_serverCommands = { | |
| \ 'reason': ['~/.vim/reason-language-server.exe'] | |
| \ } | |
| " (Optional) Multi-entry selection UI. | |
| Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } | |
| function! GFilesCommand() | |
| let c = 0 | |
| let wincount = winnr('$') | |
| " Don't open it here if current buffer is not writable (e.g. NERDTree) | |
| while !empty(getbufvar(+expand("<abuf>"), "&buftype")) && c < wincount | |
| exec 'wincmd w' | |
| let c = c + 1 | |
| endwhile | |
| exec 'GFiles' | |
| endfunction | |
| nnoremap <c-p> :call GFilesCommand()<cr> | |
| augroup fzf | |
| autocmd! | |
| autocmd! FileType fzf | |
| autocmd FileType fzf set laststatus=0 noshowmode noruler | |
| \| autocmd BufLeave <buffer> set laststatus=2 showmode ruler | |
| augroup END | |
| Plug 'junegunn/fzf.vim' | |
| Plug 'slashmili/alchemist.vim' | |
| Plug 'elixir-editors/vim-elixir' | |
| Plug 'flazz/vim-colorschemes' | |
| if has('nvim') | |
| Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } | |
| else | |
| Plug 'Shougo/deoplete.nvim' | |
| Plug 'roxma/nvim-yarp' | |
| Plug 'roxma/vim-hug-neovim-rpc' | |
| endif | |
| Plug 'scrooloose/nerdcommenter' | |
| let g:NERDDefaultAlign = 'left' | |
| let g:NERDCompactSexyComs = 1 | |
| let g:NERDSpaceDelims = 1 | |
| Plug 'scrooloose/nerdtree' | |
| Plug 'ryanoasis/vim-devicons' | |
| Plug 'mhinz/vim-mix-format' | |
| Plug '/usr/local/opt/fzf' | |
| " Writing plugins | |
| Plug 'reedes/vim-pencil' " Super-powered writing things | |
| Plug 'tpope/vim-abolish' " Fancy abbreviation replacements | |
| Plug 'junegunn/limelight.vim' " Highlights only active paragraph | |
| Plug 'junegunn/goyo.vim' " Full screen writing mode | |
| Plug 'plasticboy/vim-markdown' " Vim Markdown, duh | |
| Plug 'reedes/vim-lexical' " Better spellcheck mappings | |
| Plug 'reedes/vim-litecorrect' " Better autocorrections | |
| Plug 'reedes/vim-textobj-sentence' " Treat sentences as text objects | |
| Plug 'reedes/vim-wordy' " Weasel words and passive voice | |
| " Purescript | |
| Plug 'purescript-contrib/purescript-vim' | |
| let purescript_indent_if = 3 | |
| let purescript_indent_case = 5 | |
| let purescript_indent_let = 4 | |
| let purescript_indent_where = 6 | |
| let purescript_indent_do = 3 | |
| let purescript_indent_in = 1 | |
| let purescript_indent_dot = v:true | |
| Plug 'frigoeu/psc-ide-vim' | |
| " Haskell | |
| Plug 'neovimhaskell/haskell-vim' | |
| Plug 'alx741/vim-hindent' | |
| Plug 'eagletmt/ghcmod-vim' | |
| Plug 'parsonsmatt/intero-neovim' | |
| map <silent> <leader>t <Plug>InteroGenericType | |
| " Mustache + Handlebars | |
| Plug 'mustache/vim-mustache-handlebars' | |
| " ----- neovimhaskell/haskell-vim ----- | |
| " Align 'then' two spaces after 'if' | |
| let g:haskell_indent_if = 2 | |
| " Indent 'where' block two spaces under previous body | |
| let g:haskell_indent_before_where = 2 | |
| " Allow a second case indent style (see haskell-vim README) | |
| let g:haskell_indent_case_alternative = 1 | |
| " Only next under 'let' if there's an equals sign | |
| let g:haskell_indent_let_no_in = 0 | |
| augroup pencil | |
| autocmd! | |
| autocmd filetype markdown,mkd call pencil#init() | |
| \ | call lexical#init() | |
| \ | call litecorrect#init() | |
| \ | setl spell spl=en_us fdl=4 noru nonu nornu | |
| \ | setl fdo+=search | |
| augroup END | |
| call plug#end() | |
| "use TAB as the mapping | |
| " inoremap <silent><expr> <TAB> | |
| " \ pumvisible() ? "\<C-n>" : | |
| " \ <SID>check_back_space() ? "\<TAB>" : | |
| " \ deoplete#mappings#manual_complete() | |
| " function! s:check_back_space() abort "" | |
| " let col = col(.) - 1 | |
| " return !col || getline(.)[col - 1] =~ s | |
| " endfunction "" | |
| inoremap <silent><expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>" | |
| inoremap <expr><BS> deoplete#smart_close_popup()."\<C-h>" | |
| let g:deoplete#enable_at_startup = 1 | |
| filetype plugin indent on | |
| " NERDTree | |
| nnoremap <Leader>f :NERDTreeToggle<Enter> | |
| nnoremap <silent> <Leader>v :NERDTreeFind<CR> | |
| set number | |
| set encoding=UTF-8 | |
| let g:python3_host_prog = '/usr/local/bin/python3' | |
| let g:python_host_prog = '/usr/local/bin/python' | |
| let g:loaded_python_provider = 1 | |
| let g:python3_host_prog = '/usr/local/bin/python3' | |
| " Map leader to space! | |
| map <Space> <leader> | |
| " no highlight on search | |
| set nohlsearch | |
| let NERDTreeIgnore = ['\.bs.js$'] | |
| " Language server extras | |
| nnoremap <silent> gd :call LanguageClient_textDocument_definition()<cr> | |
| nnoremap <silent> gf :call LanguageClient_textDocument_formatting()<cr> | |
| nnoremap <silent> <cr> :call LanguageClient_textDocument_hover()<cr> | |
| " FZF Find | |
| command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0) | |
| " FZF Buffer | |
| nnoremap <silent> ; :Buffers<cr> | |
| " Colorscheme | |
| autocmd! ColorScheme * hi VertSplit ctermbg=none | |
| colorscheme Tomorrow-Night | |
| set fillchars=vert:\ | |
| hi VertSplit cterm=NONE | |
| " elixir | |
| let g:mix_format_on_save = 1 | |
| let g:mix_format_silent_errors = 1 | |
| " typescript | |
| set runtimepath+=~/.vim/plugged/nvim-typescript | |
| " Terminal in VIM | |
| :tnoremap <Esc> <C-\><C-n> | |
| :tnoremap <C-[> <C-\><C-n> | |
| nnoremap <silent> <Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR> | |
| nnoremap <silent> <Leader>- :exe "resize " . (winheight(0) * 2/3)<CR> | |
| command! Term :10sp term://zsh <bar> normal <C-w><S-j> <bar> :resize 15<CR> | |
| " Open current buffer in new tab | |
| nnoremap <silent> tt :tab split<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment