Skip to content

Instantly share code, notes, and snippets.

@hcoona
Last active October 9, 2021 07:02
Show Gist options
  • Save hcoona/1a7d423a798361ee01bdc402e84f39d3 to your computer and use it in GitHub Desktop.
Save hcoona/1a7d423a798361ee01bdc402e84f39d3 to your computer and use it in GitHub Desktop.
Download common utils & setup them
"dein Scripts-----------------------------
if &compatible
set nocompatible " Be iMproved
endif
" Required:
execute "set runtimepath+=".stdpath('cache').'/dein/repos/github.com/Shougo/dein.vim'
" Required:
if dein#load_state(stdpath('cache').'/dein')
call dein#begin(stdpath('cache').'/dein')
" Let dein manage dein
" Required:
call dein#add(stdpath('cache').'/dein/repos/github.com/Shougo/dein.vim')
" Add or remove your plugins here like this:
"call dein#add('Shougo/neosnippet.vim')
"call dein#add('Shougo/neosnippet-snippets')
" UI
call dein#add('scrooloose/nerdtree')
" Colorscheme
call dein#add('rakr/vim-one')
call dein#add('nanotech/jellybeans.vim')
" EditorConfig
call dein#add('editorconfig/editorconfig-vim')
" Bazel
call dein#add('google/vim-maktaba')
call dein#add('bazelbuild/vim-bazel')
" Fish shell script
call dein#add('dag/vim-fish')
" Required:
call dein#end()
call dein#save_state()
endif
" Required:
filetype plugin indent on
syntax enable
" If you want to install not installed plugins on startup.
if dein#check_install()
call dein#install()
endif
"End dein Scripts-------------------------
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" No compatible with vi
set nocompatible
" Sets how many lines of history VIM has to remember
set history=500
" Enable filetype plugins
filetype plugin on
filetype indent on
" Enable line numbers
set number
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Colors and Fonts
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Enable syntax highlighting
syntax enable
" Enable true color support
" set termguicolors
set background=dark
let g:airline_theme='one'
colorscheme one
"colorscheme jellybeans
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Files, backups and undo
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Turn backup off, since most stuff is in SVN, git et.c anyway...
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Text, tab and indent related
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Be smart when using tabs ;)
set smarttab
" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2
set ai "Auto indent
set si "Smart indent
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Key-maps
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
map <C-n> :NERDTreeToggle<CR>
#!/usr/bin/env bash
set -Eeuxo pipefail
EXA_VERSION="v0.10.1"
BAT_VERSION="v0.18.3"
NCDU_VERSION="2.0-beta2"
NEOVIM_VERSION="v0.5.0"
FDFIND_VERSION="v8.2.1"
RIPGREP_VERSION="13.0.0"
function install_exa() {
EXA_DOWNLOAD_URL="https://github.com/ogham/exa/releases/download/${EXA_VERSION}/exa-linux-x86_64-${EXA_VERSION}.zip"
wget "$EXA_DOWNLOAD_URL" -q -O /tmp/exa.zip
mkdir -p "$HOME/.local"
pushd "$HOME/.local" >/dev/null
unzip -o -qq /tmp/exa.zip
popd # $HOME/.local
source "$HOME/.local/completions/exa.bash"
}
function install_bat() {
BAT_DOWNLOAD_URL="https://github.com/sharkdp/bat/releases/download/${BAT_VERSION}/bat-${BAT_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
wget "$BAT_DOWNLOAD_URL" -q -O /tmp/bat.tar.gz
mkdir -p "$HOME/.local"
mkdir -p "$HOME/.local/bin"
tar --overwrite -xzf /tmp/bat.tar.gz -C "$HOME/.local"
rm -f "$HOME/.local/bin/bat"
ln -s "$HOME/.local/bat-${BAT_VERSION}-x86_64-unknown-linux-gnu/bat" "$HOME/.local/bin/bat"
source "$HOME/.local/bat-${BAT_VERSION}-x86_64-unknown-linux-gnu/autocomplete/bat.bash"
}
function install_ncdu() {
NCDU_DOWNLOAD_URL="https://dev.yorhel.nl/download/ncdu-${NCDU_VERSION}-linux-x86_64.tar.gz"
wget --no-check-certificate "$NCDU_DOWNLOAD_URL" -q -O /tmp/ncdu.tar.gz
mkdir -p "$HOME/.local/bin"
tar --overwrite -xzf /tmp/ncdu.tar.gz -C "$HOME/.local/bin"
}
function install_neovim() {
NEOVIM_DOWNLOAD_URL="https://github.com/neovim/neovim/releases/download/${NEOVIM_VERSION}/nvim-linux64.tar.gz"
wget $NEOVIM_DOWNLOAD_URL -q -O /tmp/neovim.tar.gz
mkdir -p "$HOME/.local"
mkdir -p "$HOME/.local/bin"
tar --overwrite -xzf /tmp/neovim.tar.gz -C "$HOME/.local"
rm -f "$HOME/.local/bin/nvim"
ln -s "$HOME/.local/nvim-linux64/bin/nvim" "$HOME/.local/bin/nvim"
mkdir -p "$HOME/.config/nvim"
wget "https://gist.githubusercontent.com/hcoona/1a7d423a798361ee01bdc402e84f39d3/raw/c0eef40a5952afb9b99f72c7ef03fb8bf3ba4715/init.vim" -q -O "$HOME/.config/nvim/init.vim"
git clone https://github.com/Shougo/dein.vim.git "$HOME/.cache/nvim/dein/repos/github.com/Shougo/dein.vim"
}
function install_fdfind() {
FDFIND_DOWNLOAD_URL="https://github.com/sharkdp/fd/releases/download/${FDFIND_VERSION}/fd-${FDFIND_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
wget "$FDFIND_DOWNLOAD_URL" -q -O /tmp/fdfind.tar.gz
mkdir -p "$HOME/.local"
mkdir -p "$HOME/.local/bin"
tar --overwrite -xzf /tmp/fdfind.tar.gz -C "$HOME/.local"
rm -f "$HOME/.local/bin/fd"
ln -s "$HOME/.local/fd-${FDFIND_VERSION}-x86_64-unknown-linux-gnu/fd" "$HOME/.local/bin/fd"
source "$HOME/.local/fd-${FDFIND_VERSION}-x86_64-unknown-linux-gnu/autocomplete/fd.bash-completion"
}
function install_ripgrep() {
RIPGREP_DOWNLOAD_URL="https://github.com/BurntSushi/ripgrep/releases/download/${RIPGREP_VERSION}/ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl.tar.gz"
wget "$RIPGREP_DOWNLOAD_URL" -q -O /tmp/ripgrep.tar.gz
mkdir -p "$HOME/.local"
mkdir -p "$HOME/.local/bin"
tar --overwrite -xzf /tmp/ripgrep.tar.gz -C "$HOME/.local"
rm -f "$HOME/.local/bin/rg"
ln -s "$HOME/.local/ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl/rg" "$HOME/.local/bin/rg"
source "$HOME/.local/ripgrep-${RIPGREP_VERSION}-x86_64-unknown-linux-musl/complete/rg.bash"
}
install_exa
install_bat
install_ncdu
install_neovim
install_fdfind
install_ripgrep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment