Skip to content

Instantly share code, notes, and snippets.

@concatime
Last active November 1, 2017 17:51
Show Gist options
  • Save concatime/639ec7e4bda54319530e688cc887820f to your computer and use it in GitHub Desktop.
Save concatime/639ec7e4bda54319530e688cc887820f to your computer and use it in GitHub Desktop.
# WATCHOUT, THIS WILL ERASE YOUR .VIMRC & TESTED ONLY UNDER UBUNTU 17.10
LJVER=2.1.0-beta3 # LuaJIT
VMVER=8.0 # VIM
CFLAGS+=-pipe
MAKEFLAGS+=-j`nproc`
CC=clang
[ -z $1 ] || { CC=$1; }
export CC CFLAGS MAKEFLAGS
set -e
for k in ln cd mktemp pushd popd source echo wait sudo curl wget git $CC make python3 ldconfig
do hash $k 1>&-
done
#libc-dev libtinfo-dev
# Manage python3 dependencies for deoplete behind vim8
sudo apt install python3-dev python3-pip python3-setuptools python3-wheel -qqy --no-install-recommends
pip3 install neovim
sudo ln luajit-$LJVER /usr/local/bin/luajit --symbolic --force
pushd $(mktemp --directory)
# Install & extract LuaJIT
curl http://luajit.org/download/LuaJIT-$LJVER.tar.gz --silent | tar xz
# While using CPU for compiling LuaJIT
# Download Vim8 in background
curl ftp://ftp.vim.org/pub/vim/unix/vim-$VMVER.tar.bz2 --silent | tar xj &
# Compile/build & install LuaJIT
pushd LuaJIT-$LJVER
make CC=$CC
sudo make install
popd
# Wait for vim sources
wait
# Compile/build & install Vim
pushd vim*
./configure --quiet \
--without-x \
--disable-netbeans \
--enable-largefile \
--enable-multibyte \
--enable-python3interp \
--enable-luainterp \
--with-luajit \
--with-lua-prefix=/usr/local \
make CC=$CC
sudo make install
popd
rm `pwd` --force --recursive
popd
sudo ldconfig
pushd ~
# Install vim package manager
source <(curl https://raw.githubusercontent.com/Shougo/dein.vim/master/bin/installer.sh --silent) .vim/pack 1> /dev/null
# Download vim settings
curl https://gist.githubusercontent.com/concatime/639ec7e4bda54319530e688cc887820f/raw/.vimrc --remote-name
popd
echo You can now run vim!
if &compatible
set nocompatible
endif
set runtimepath+=~/.vim/pack/repos/github.com/Shougo/dein.vim
if dein#load_state('~/.vim')
call dein#begin('~/.vim/pack')
call dein#add('~/.vim/pack/repos/github.com/Shougo/dein.vim')
call dein#add('Shougo/deoplete.nvim')
if !has('nvim')
call dein#add('roxma/nvim-yarp')
call dein#add('roxma/vim-hug-neovim-rpc')
endif
call dein#add('w0rp/ale')
call dein#add('fatih/vim-go')
call dein#add('altercation/vim-colors-solarized')
call dein#end()
call dein#save_state()
endif
if dein#check_install()
call dein#install()
endif
let g:netrw_liststyle = 3
let g:deoplete#enable_at_startup = 1
" stackoverflow.com/a/33380495
if !exists('g:syntax_on')
syntax enable
endif
filetype indent plugin on
" roxma/vim-hug-neovim-rpc#requirements
set ts=4 nuw=5
\ encoding=utf-8
\ termguicolors
\ autowrite
\ number
\ nobackup
\ noswapfile
\ visualbell
\ noerrorbells
" Map#0 (k_free & superuser.com/a/400502)
"noremap ; l
"noremap l j
"noremap j h
" Map#1 (shift one keys’ position ; groove on J…)
noremap ; l
noremap l k
noremap k j
noremap j h
" Map#2 (stackoverflow.com/a/3084012)
"noremap ; l
"noremap l h
"noremap k j
"noremap j k
" github.com/altercation/vim-colors-solarized#important-note-for-terminal-users
let g:solarized_termcolors=256
" github.com/tomasiser/vim-code-dark#the-background-color-in-my-terminal-is-wrong-when-there-is-no-text
" github.com/Microsoft/BashOnWindows/issues/1706#issuecomment-280522843
"set t_Co=256
"set t_ut=
"set term=screen-256color
set background=dark
colorscheme solarized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment