Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 41 additions & 180 deletions .vimrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" .vimrc

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > General Setting

" Encode
"===============================
" General Settings
"===============================
set encoding=utf-8
scriptencoding utf-8
set fileencoding=utf-8
set fileencodings=ucs-boms,utf-8,euc-jp,cp932
set fileformats=unix,dos,mac
set ambiwidth=double

" Disable beep
set noerrorbells visualbell t_vb=
if has('autocmd')
autocmd GUIEnter * set visualbell t_vb=
endif

set viminfo='100,/50,%,<1000,f50,s100,:100,c,h,!

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Files, backups and undo

" Turn backup off, since most stuff is in SVN, git et.c anyway...
"===============================
" Files, backups and undo
"===============================
set nobackup
set nowb
set noswapfile
Expand All @@ -32,201 +26,68 @@ set nocompatible
set autoread
set updatetime=0

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Search

"===============================
" Search
"===============================
set incsearch
set smartcase
set hlsearch

" :e <TAB> seems good :)
set wildmenu wildmode=list:full

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Text, tab and indent related
set wildmenu
set wildmode=longest:full,full

"===============================
" Text, tab and indent
"===============================
set softtabstop=4
set autoindent
set smartindent

" Use spaces instead of tabs
set expandtab

" Be smart when using tabs ;)
set smarttab

" 1 tab == 2 spaces
set shiftwidth=2
set tabstop=2

" Linebreak on 500 characters
set lbr
set tw=500
set ai
set si
set wrap

set ai "Auto indent
set si "Smart indent
set wrap "Wrap lines

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Clipboard and paste

set clipboard&
"===============================
" Clipboard and paste
"===============================
set clipboard^=unnamedplus
set paste

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Mouse Scroll

"===============================
" Mouse Scroll and Display
"===============================
set backspace=indent,eol,start
set whichwrap=b,s,h,l,<,>,[,],~
set number
set cursorline
set scrolloff=8
set sidescrolloff=16
set sidescroll=1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Custom Keymap

" <C-i> Run Script
nnoremap <C-i> :!python %

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > Language Settings

" Python

let g:pymode_python = 'python3'

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > dein

let s:dein_dir = expand('~/.cache/vim/dein')
let s:dein_repo_dir = s:dein_dir . '/repos/github.com/Shougo/dein.vim'

if &runtimepath !~# '/dein.vim'
if !isdirectory(s:dein_repo_dir)
execute '!git clone https://github.com/Shougo/dein.vim' s:dein_repo_dir
endif
execute 'set runtimepath^=' . fnamemodify(s:dein_repo_dir, ':p')
endif

if dein#load_state(s:dein_dir)
call dein#begin(s:dein_dir)
call dein#add('Shougo/dein.vim')
call dein#add('Shougo/vimproc.vim', {'build': 'make'})
call dein#add('Shougo/neocomplete.vim')
call dein#add('Shougo/neomru.vim')
call dein#add('Shougo/neosnippet')
call dein#add('w0ng/vim-hybrid')
call dein#add('flazz/vim-colorschemes')
call dein#add('bronson/vim-trailing-whitespace')
call dein#add('vim-airline/vim-airline')
call dein#add('vim-airline/vim-airline-themes')
call dein#add('ctrlpvim/ctrlp.vim')
call dein#add('Yggdroot/indentLine')
call dein#add('tomtom/tcomment_vim')
call dein#add('vim-syntastic/syntastic')
call dein#add('Vimjas/vim-python-pep8-indent')
call dein#add('scrooloose/nerdtree')
call dein#add('junegunn/fzf', { 'build': './install', 'merged': 0 })
call dein#add('mileszs/ack.vim')
call dein#add('thinca/vim-quickrun')
call dein#add('w0rp/ale')
call dein#end()
endif

if dein#check_install()
call dein#install()
endif

" airline settings
set laststatus=2
set showmode
set showcmd
set ruler

" fzf settings
" This is the default extra key bindings
let g:fzf_action = {
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }

" An action can be a reference to a function that processes selected lines
function! s:build_quickfix_list(lines)
call setqflist(map(copy(a:lines), '{ "filename": v:val }'))
copen
cc
endfunction

let g:fzf_action = {
\ 'ctrl-q': function('s:build_quickfix_list'),
\ 'ctrl-t': 'tab split',
\ 'ctrl-x': 'split',
\ 'ctrl-v': 'vsplit' }

" Default fzf layout
" - down / up / left / right
let g:fzf_layout = { 'down': '~40%' }

" You can set up fzf window using a Vim command (Neovim or latest Vim 8 required)
let g:fzf_layout = { 'window': 'enew' }
let g:fzf_layout = { 'window': '-tabnew' }
let g:fzf_layout = { 'window': '10split enew' }

" Customize fzf colors to match your color scheme
let g:fzf_colors =
\ { 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
\ 'hl': ['fg', 'Comment'],
\ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
\ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
\ 'hl+': ['fg', 'Statement'],
\ 'info': ['fg', 'PreProc'],
\ 'border': ['fg', 'Ignore'],
\ 'prompt': ['fg', 'Conditional'],
\ 'pointer': ['fg', 'Exception'],
\ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] }

" Enable per-command history.
" CTRL-N and CTRL-P will be automatically bound to next-history and
" previous-history instead of down and up. If you don't like the change,
" explicitly bind the keys to down and up in your $FZF_DEFAULT_OPTS.
let g:fzf_history_dir = '~/.local/share/fzf-history'

" ag settings
let g:ackprg = 'ag --nogroup --nocolor --column'

" PyFlake
let g:PyFlakeOnWrite = 1
let g:PyFlakeCheckers = 'pep8,mccabe,pyflakes'
let g:PyFlakeDefaultComplexity=10
set colorcolumn=80
syntax enable

" QuickRun
let g:quickrun_config = {
\ '_' : {
\ 'runner' : 'vimproc',
\ 'runner/vimproc/updatetime' : 40,
\ 'outputter' : 'error',
\ 'outputter/error/success' : 'buffer',
\ 'outputter/error/error' : 'quickfix',
\ 'outputter/buffer/split' : ':botright 8sp',
\ }
\}
"===============================
" CursorLine and Line Number Styling
"===============================
highlight CursorLine ctermbg=236 guibg=#2C2C2C
highlight LineNr ctermbg=235 guibg=#3C3C3C ctermfg=gray guifg=#AAAAAA
highlight CursorLineNr ctermbg=236 guibg=#505050 ctermfg=white guifg=#FFFFFF

" 実行時に前回の表示内容をクローズ&保存してから実行
let g:quickrun_no_default_key_mappings = 1
nmap <Leader>r :cclose<CR>:write<CR>:QuickRun -mode n<CR>
"===============================
" Command Line & Status Line Styling
"===============================
highlight StatusLine ctermbg=237 guibg=#444444 ctermfg=white guifg=#FFFFFF
highlight StatusLineNC ctermbg=235 guibg=#303030 ctermfg=gray guifg=#AAAAAA
highlight CmdLine ctermbg=238 guibg=#3A3A3A ctermfg=white guifg=#FFFFFF

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" = > colorscheme
"===============================
" Window Split Styling
"===============================
highlight VertSplit ctermbg=236 guibg=#2E2E2E ctermfg=gray guifg=#888888

filetype plugin indent on

colorscheme gruvbox
let g:airline_theme='base16'
set background=dark
syntax enable
58 changes: 26 additions & 32 deletions .zshenv
Original file line number Diff line number Diff line change
@@ -1,34 +1,38 @@
##########################################################################
# ZSHENV

##########################################################################
# EXPORT

# Ensure paths are unique
typeset -U path

# language environment
# Language environment
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

# Don't send analytics
# Don't send analytics or hints (for Homebrew)
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_ENV_HINTS=1

# User configuration
#PATH
path=(/usr/local/bin \
/usr/bin \
/bin \
/usr/sbin \
/sbin \
/usr/bin \
"$path[@]" \
)
# User PATH settings
path=(
"$HOME/.local/bin"
"$HOME/bin"
"/usr/local/bin"
"/usr/bin"
"/bin"
"/usr/sbin"
"/sbin"
"$(command -v brew >/dev/null && brew --prefix)/bin"
"$path[@]"
)

##########################################################################
# HISTORY
##########################################################################

HISTFILE="${HOME}/.cache/zsh_history"
HISTSIZE=1000000
SAVEHIST=1000000
export HISTFILE="${XDG_STATE_HOME:-$HOME/.local/state}/zsh/history"
export HISTSIZE=1000000
export SAVEHIST=1000000

setopt hist_ignore_dups
setopt hist_ignore_space
Expand All @@ -48,28 +52,18 @@ setopt list_packed
setopt list_types
setopt nobeep

REPORTTIME=3
export REPORTTIME=3

##########################################################################
# LS_COLOR
##########################################################################

export CLICOLOR=true
export LSCOLORS='exfxcxdxbxGxDxabagacad'
export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;\
01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:'
export CLICOLOR=1
export LSCOLORS="exfxcxdxbxGxDxabagacad"
export LS_COLORS="di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01"

##########################################################################
# ALIAS
##########################################################################

# EDITOR
if which nvim > /dev/null 2>&1; then
export EDITOR='nvim'
export VISUAL='nvim'
alias v='nvim'
else
export EDITOR='vim'
export VISUAL='vim'
alias v='vim'
fi
alias ls="eza --icons --git --time-style relative -al"
4 changes: 1 addition & 3 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi

source /opt/homebrew/opt/powerlevel10k/powerlevel10k.zsh-theme
source /opt/homebrew/share/powerlevel10k/powerlevel10k.zsh-theme

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh


source ~/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source ~/.zsh/zsh-autocomplete/zsh-autocomplete.plugin.zsh
source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh

Loading