-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD: separate linux dotfiles configure
- Loading branch information
Showing
6 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
EMAIL:[email protected] | ||
NAME:=dotfiles | ||
|
||
.PHONY: setup | ||
setup: | ||
./setup.sh $(EMAIL) $(NAME) | ||
-./tools/install_brew.sh | ||
sudo update-alternatives --config editor | ||
|
||
.PHONY: install | ||
install: | ||
sudo apt install -y vim | ||
curl -fsSL https://get.docker.com -o get-docker.sh | ||
./get-docker.sh | ||
sudo groupadd docker | ||
sudo usermod -aG docker $(USER) | ||
sudo chown $(USER):$(USER) /home/$(USER)/.docker -R | ||
mkdir -p /home/$(USER)/.docker | ||
sudo chmod g+rwx $(HOME)/.docker -R | ||
brew install peco | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[alias] | ||
lg = log --graph --date=short --format='%C(yellow)%h%C(reset)%C(magenta) [%ad]%C(reset)%C(auto)%d%C(reset) %s%C(cyan) @%an%C(reset)' | ||
st = status | ||
cm = commit -m | ||
sh = show -b | ||
df = diff -b | ||
sa = "!git show -b --reverse `git log --format='%h' --merges -n 1`.." | ||
ra = "!git rebase -i `git log --format='%h' --merges -n 1`" | ||
[core] | ||
quotepath = false | ||
[init] | ||
defaultBranch = main |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh -eux | ||
|
||
if [ -z "${1:-""}" ]; then | ||
exit 1 | ||
fi | ||
|
||
cp gitconfig_addon ~/.gitconfig | ||
git config --global user.name "$2" | ||
git config --global user.email "$1" | ||
|
||
mkdir -p ~/.zsh | ||
cd ~/.zsh | ||
curl -o git-prompt.sh https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh | ||
curl -o git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash | ||
curl -o _git https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh | ||
cd - | ||
|
||
ln -fs "$(pwd)"/zshrc ~/.zshrc | ||
ln -fs "$(pwd)"/vimrc ~/.vimrc | ||
|
||
mkdir -p ~/.config/nvim/ | ||
touch ~/.config/nvim/init.vim | ||
ln -fs "$(pwd)"/vimrc ~/.config/nvim/init.vim |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash -eux | ||
|
||
sudo apt-get install build-essential procps curl file git | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | ||
|
||
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.zshrc | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
sudo apt-get install build-essential | ||
brew install gcc |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
" esc | ||
noremap <C-f> <esc> | ||
noremap! <C-f> <esc> | ||
" init.vim quick setting | ||
nnoremap <Space>. | ||
\ :<C-u>edit $MYVIMRC<CR> | ||
" init.vim quick setting | ||
" env settings | ||
set shiftwidth=4 | ||
set tabstop=4 | ||
set expandtab | ||
set clipboard+=unnamed " clipboard enable | ||
set fenc=utf-8 | ||
set nobackup | ||
set noswapfile | ||
set autoread | ||
set hidden | ||
set showcmd | ||
set number | ||
set cursorline | ||
set cursorcolumn | ||
set virtualedit=onemore | ||
set smartindent | ||
set visualbell | ||
set showmatch | ||
set laststatus=2 | ||
set wildmode=list:longest | ||
set title | ||
set nofoldenable | ||
set encoding=utf-8 | ||
set fileencodings=utf-8,iso-2022-jp,euc-jp,sjis | ||
set fileformats=unix,dos,mac | ||
nnoremap j gj | ||
nnoremap k gk | ||
syntax enable | ||
nmap <Esc><Esc> :nohlsearch<CR><Esc> | ||
" env settings | ||
" kannokanno/previm | ||
augroup previm_loading | ||
autocmd! | ||
autocmd BufRead,BufNewFile *.md set filetype=markdown | ||
augroup END | ||
let g:previm_open_cmd = 'open -a Google\ Chrome' | ||
nnoremap <silent> <C-p> :PrevimOpen<CR> | ||
" tyru/open-browser.vim | ||
let g:netrw_nogx = 1 " disable netrw's gx mapping. | ||
nmap gx <Plug>(openbrowser-smart-search) | ||
vmap gx <Plug>(openbrowser-smart-search) | ||
" for cloudformation yaml tab space | ||
set expandtab smarttab | ||
augroup yaml-tab | ||
autocmd! | ||
autocmd BufRead,BufNewFile *.yml,*.yaml setlocal tabstop=2 shiftwidth=2 softtabstop=2 | ||
augroup end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
source ~/.zsh/git-prompt.sh | ||
|
||
fpath=(~/.zsh $fpath) | ||
zstyle ':completion:*:*:git:*' script ~/.zsh/git-completion.bash | ||
autoload -Uz compinit && compinit | ||
|
||
GIT_PS1_SHOWDIRTYSTATE=true | ||
GIT_PS1_SHOWUNTRACKEDFILES=true | ||
GIT_PS1_SHOWSTASHSTATE=true | ||
GIT_PS1_SHOWUPSTREAM=auto | ||
|
||
setopt PROMPT_SUBST | ||
PS1='%F{green}[%n cicd/agent01 %F{cyan}%c%F{white}$(__git_ps1)%F{green}]>>%f' | ||
|
||
autoload -Uz compinit | ||
rm -f ~/.zcompdump | ||
compinit | ||
|
||
zstyle ':completion:*:default' list-colors ${(s.:.)LSCOLORS} | ||
zstyle ':completion:*:default' menu select=1 | ||
|
||
alias ls='ls -GF' | ||
export CLICOLOR=1 | ||
export LSCOLORS=gxfxcxdxbxegedabagacad | ||
|
||
export HISTFILE=${HOME}/.zsh_history | ||
export HISTSIZE=1000 | ||
export SAVEHIST=100000 | ||
setopt EXTENDED_HISTORY | ||
|
||
setopt auto_cd | ||
setopt share_history | ||
setopt hist_ignore_dups | ||
setopt hist_ignore_all_dups | ||
setopt hist_ignore_space | ||
setopt hist_reduce_blanks | ||
|
||
function peco-select-history() { | ||
BUFFER=$(\history -n 1 | tac | peco) | ||
CURSOR=$#BUFFER | ||
zle clear-screen | ||
} | ||
zle -N peco-select-history | ||
bindkey '^r' peco-select-history | ||
|
||
# brew | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" |