Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
My Dot Files
#!/bin/bash
#PS1="[\u@\h \W]\$ "
# very simple:
export PS1="[\u:\W]\$ "
# newline with full:
export PS1="\r\n[\D{%F} \t \u@\H job#\j/his#\!/com#\# \w]\r\n\$ "
# newline normal:
export PS1="\r\n[\D{%F} \t \u:\w]\r\n\$ "
alias ll='ls -lFG --color'
alias la='ls -aFG --color'
alias ls='ls -FG --color'
# no-color
#alias ll='ls -lFG'
#alias la='ls -aFG'
#alias ls='ls -FG'
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias od='/usr/bin/od -Ax -tx1z -v'
alias hexdump='/usr/bin/hexdump -C -v'
alias xxd='/usr/bin/xxd -g 1'
export EDITOR=/usr/bin/vim
#export PAGER=/usr/bin/lv
# modern less:
alias less='/usr/bin/less -MN'
export LESSCHARSET=utf-8
export PAGER=/usr/bin/less
alias cp='cp -i'
alias la='ls -aF'
alias ll='ls -ltr'
alias ls='ls -hF --color=tty'
alias mv='mv -i'
alias rm='rm -i'
# for mintty scroll buffer clear
# see: http://www.glamenv-septzen.net/view/1113
alias cls='echo -ne "\ec\e[3J"'
# for "lv" pager UTF-8 "OOPS" message
# see: http://www.glamenv-septzen.net/view/1108
export TERM=cygwin
export PAGER=lv
# for mintty title string updates
# see: http://www.glamenv-septzen.net/view/1107
function settitle ()
{
t="[$@]@`hostname`"
# "\e]2;"までがウインドウタイトル変更開始の制御コード
# "\007"が変更終了・・・らしい、です。
echo -ne "\e]2;$t\007"
}
function cd()
{
builtin cd $@ && settitle $(cygpath -m `/usr/bin/pwd`)
}
function pwd()
{
settitle $(cygpath -m `/usr/bin/pwd`)
builtin pwd $@
}
[user]
name = NNNN MMMMM
email = aaaaaa@aaaaaaa
[alias]
co = checkout
ci = commit
stat = status
st = status
unstage = reset HEAD --
revert = checkout --
br = branch
[core]
# from http://stackoverflow.com/questions/2183900/how-do-i-prevent-git-diff-from-using-a-pager
# git config --global core.pager cat
pager = cat
# NOTE 1 : "^[" : for VIM, type Ctrl-v, next ESC
# NOTE 2 : "^G" : for VIM, type Ctrl-v, next Ctrl-g
# erace by current bgcolor
defbce on
# set bell msg
bell_msg "^G"
# encoding settings
defkanji utf-8
defencoding utf-8
encoding utf-8 utf-8
# use light color for bold char
#attrcolor b ".I"
# use 256 color
term xterm-256color
# for putty resize problems : see http://d.hatena.ne.jp/ousttrue/20080511/1210494446
termcapinfo xterm-256color 'is=^[r^[m^[2J^[H^[?7h^[?1;4;6l'
defscrollback 10000
# for less, vim
altscreen on
escape ^Tt
vbell off
bell_msg "Bell in window %^G"
# auto dettach for terminal hungup
autodetach on
startup_message off
#logfile "$HOME/.screen/screen-%Y%m%d-%n.log"
#deflog on
caption always "%{= wb} %-w%{=bu dr}%n %t%{-}%+w %{=b wk} %-040=[%l] %Y/%m/%d %C:%s %A"
# see http://blog.remora.cx/2010/02/gnu-screen-2.html
#caption always "%{= wb} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wk} [%l] %{=b wb}%y/%m/%d(%D) %{=b wm}%c"
#caption always "%{= Rk} %?%F%{b kr}%? %?%h%:%t (screen #%n)%? %{-}"
#hardstatus alwayslastline "%{= Gk} %-Lw%40L>%{b kg} %n %t %{-}%+Lw%-040=%{b km} %l %{.b} %Y/%m/%d %C:%s %A "
#sorendition "= Rk"
" vim: expandtab fenc=utf-8 ff=unix ft=vim ts=2 sw=2 sts=0
" about 'mode line', see: http://nanasi.jp/articles/howto/file/modeline.html
if &encoding !=# 'utf-8'
set encoding=japan
set fileencoding=japan
endif
if has('iconv')
let s:enc_euc = 'euc-jp'
let s:enc_jis = 'iso-2022-jp'
if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'eucjp-ms'
let s:enc_jis = 'iso-2022-jp-3'
elseif iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'euc-jisx0213'
let s:enc_jis = 'iso-2022-jp-3'
endif
if &encoding ==# 'utf-8'
let s:fileencodings_default = &fileencodings
let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
let &fileencodings = &fileencodings .','. s:fileencodings_default
unlet s:fileencodings_default
else
let &fileencodings = &fileencodings .','. s:enc_jis
set fileencodings+=utf-8,ucs-2le,ucs-2
if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$'
set fileencodings+=cp932
set fileencodings-=euc-jp
set fileencodings-=euc-jisx0213
set fileencodings-=eucjp-ms
let &encoding = s:enc_euc
let &fileencoding = s:enc_euc
else
let &fileencodings = &fileencodings .','. s:enc_euc
endif
endif
unlet s:enc_euc
unlet s:enc_jis
endif
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
set fileformats=unix,dos,mac
if exists('&ambiwidth')
set ambiwidth=double
endif
set nocompatible
set history=999
" show the cursor position all the time
set ruler
" display incomplete commands
set showcmd
" do incremental searching
set incsearch
" about tabstop, shiftwiddth, softtabstop, see:
" http://d.hatena.ne.jp/waku_52/20110325/1301039968
" http://peacepipe.toshiville.com/2006/05/vimrc-vim.html
set tabstop=4
set shiftwidth=4
set softtabstop=0
" dont replace TAB to spaces by default
"set expandtab
set backspace=2
set shortmess+=I
set visualbell
" display special chars
set listchars=tab:>-,extends:<,trail:-
"set listchars=eol:$,tab:>--
"set listchars=eol:$,tab:>-
" NOTICE : if enable this, TABs are NOT displayed. (anti-pattern)
"set grepprg=search\ $*
set number
set showmatch
set showmode
set complete+=k
let &titleold=expand("%:p:h")
set title
map Q gq
if has("autocmd")
" about FileType detection, see:
" $RUNTIME/filetype.vim
" http://blog.starbug1.com/archives/146
" http://blog.monoweb.info/blog/2010/06/19/
autocmd FileType text setlocal textwidth=78
autocmd FileType vim setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType c setlocal expandtab tabstop=4 shiftwidth=4
autocmd FileType perl setlocal expandtab tabstop=4 shiftwidth=4
autocmd FileType php setlocal expandtab tabstop=4 shiftwidth=4
autocmd FileType ruby setlocal expandtab tabstop=4 shiftwidth=4
autocmd FileType python setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType java setlocal expandtab tabstop=4 shiftwidth=4
autocmd FileType groovy setlocal expandtab tabstop=4 shiftwidth=4
autocmd FileType gsp setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType javascript setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType html setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType css setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType xml setlocal expandtab tabstop=2 shiftwidth=2
autocmd FileType yaml setlocal expandtab tabstop=2 shiftwidth=2
" autocmd FileType php setlocal dictionary+=~/.vim/php.dict
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
autocmd BufNewFile,BufRead *.gradle setlocal expandtab tabstop=4 shiftwidth=4
endif " has("autocmd")
set ignorecase
set smartcase
set wrapscan
syntax on
set list
set hlsearch
set laststatus=2
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P
map <F2> <ESC>:bp<CR>
map <F3> <ESC>:bn<CR>
map <F4> <ESC>:bw<CR>
nnoremap j gj
nnoremap k gk
map <kPlus> <C-W>+
map <kMinus> <C-W>-
"set tags+=~/tags/tags
"set tags+=~/.ctags/symfony
hi Comment ctermfg=lightred
hi Function ctermfg=cyan
" always set autoindenting on
set autoindent
set autochdir
"set nocp
set nobackup
set backupcopy=yes
set fdm=marker
"see:
" http://qiita.com/items/019250dbca167985fe32
" http://blogaomu21.blog91.fc2.com/blog-entry-190.html
"set paste
" ... oops, 'set paste' disables 'set autoindent'!!
"colorscheme blue
filetype off
set rtp+=~/.vim/vundle.git/
call vundle#rc()
" original repos on github
"Bundle '...'
Bundle 'https://github.com/Shougo/unite.vim.git'
Bundle 'https://github.com/Shougo/vimfiler.git'
Bundle 'https://github.com/Shougo/vimproc.git'
Bundle 'https://github.com/Shougo/vimshell.git'
Bundle 'surround.vim'
Bundle 'https://github.com/mattn/emmet-vim'
Bundle 'JavaScript-syntax'
Bundle "pangloss/vim-javascript"
Bundle 'basyura/jslint.vim'
"sudo.vim :
"https://github.com/vim-scripts/sudo.vim
"http://nanasi.jp/articles/vim/sudo_vim.html
"http://nob-log.info/2012/04/04/sudo-vim/
Bundle 'https://github.com/vim-scripts/sudo.vim.git'
" -> 'vim sudo:/etc/xxxx' or ':e sudo:%'
" vim-scripts repos
"Bundle '...vim'
" non github repos
"Bundle 'git://git.....com/foo.git'
filetype plugin indent on
"vimfiler {{{
" open new tab
let g:vimfiler_edit_action = 'tabopen'
" disable netrw
let g:vimfiler_as_default_explorer = 1
let g:vimfiler_safe_mode_by_default = 0
" open directory for current buffer
nnoremap <silent> <Leader>fe :<C-u>VimFilerBufferDir -quit<CR>
" open direcotry (like IDE side bar control)
nnoremap <silent> <Leader>fi :<C-u>VimFilerBufferDir -split -simple -winwidth=35 -no-quit<CR>
augroup VimFiler
autocmd FileType vimfiler call s:vimfiler_my_settings()
augroup END
function! s:vimfiler_my_settings()
" customize keymappings
nunmap <buffer> j
nunmap <buffer> k
" unmap <buffer> t
" unmap <buffer> T
" nnoremap <buffer> zR <Plug>(vimfiler_expand_tree_recursive)
" nnoremap <buffer> zo <Plug>(vimfiler_expand_tree)
" nmap <buffer> q <Plug>(vimfiler_exit)
" nmap <buffer> Q <Plug>(vimfiler_hide)
endfunction
"}}}
"zencoding-vim {{{
let g:user_zen_settings = {
\ 'lang' : 'ja',
\ 'html' : {
\ 'filters' : 'html',
\ 'snippets' : {
\ 'jq' : "<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"></script>\n<script>\n\\$(function() {\n\t|\n})()\n</script>",
\ 'cd' : "<![CDATA[|]]>",
\ },
\ },
\ 'php' : {
\ 'extends' : 'html',
\ 'filters' : 'html,c',
\ },
\ 'xml' : {
\ 'extends' : 'html',
\ },
\ 'haml' : {
\ 'extends' : 'html',
\ },
\ 'javascript' : {
\ 'snippets' : {
\ 'jq' : "\\$(function() {\n\t\\${cursor}\\${child}\n});",
\ 'jq:json' : "\\$.getJSON(\"${cursor}\", function(data) {\n\t\\${child}\n});",
\ 'jq:each' : "\\$.each(data, function(index, item) {\n\t\\${child}\n});",
\ 'fn' : "(function() {\n\t\\${cursor}\n})();",
\ 'tm' : "setTimeout(function() {\n\t\\${cursor}\n}, 100);",
\ },
\ 'use_pipe_for_cursor' : 0,
\ },
\}
"}}}
" jslint.vim
function! s:javascript_filetype_settings()
autocmd BufLeave <buffer> call jslint#clear()
autocmd BufWritePost <buffer> call jslint#check()
autocmd CursorMoved <buffer> call jslint#message()
endfunction
autocmd FileType javascript call s:javascript_filetype_settings()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment