Skip to content

Instantly share code, notes, and snippets.

@dmitry-vsl
Last active December 17, 2015 15:59
Show Gist options
  • Save dmitry-vsl/5635220 to your computer and use it in GitHub Desktop.
Save dmitry-vsl/5635220 to your computer and use it in GitHub Desktop.
#~/.vimrc
set number
set tabstop=4
set shiftwidth=4
set expandtab
inoremap jj <Esc>
set hidden
set noswapfile
set autoindent
set smartindent
set suffixesadd+=.js
set incsearch
set ignorecase
set smartcase
"Show current file name
set laststatus=2
set statusline+=%F
"Complete xml tags
inoremap ><Tab> ><Esc>F<lyt>o</<C-r>"><Esc>O<Space>
"Center vertically after search
:nnoremap n nzz
:nnoremap N Nzz
:nnoremap * *zz
:nnoremap # #zz
:nnoremap g* g*zz
:nnoremap g# g#zz
"grep hotkeys. Set cmdheight to 2 and one more <CR> to supress 'Press Enter' message
set cmdheight=2
set grepprg=grep\ -rnw\ --binary-files=without-match\ --exclude-dir=.svn\ --exclude-dir=.git\ --exclude-dir=build\ --exclude=\"*.src\"\ --exclude=\"*.map\"\ --exclude=\"tags\"\ $*
map <F4> :execute "grep ".expand("<cword>") . " . " <bar> cwindow<CR><CR>
map <F11> :cprev<CR>
map <F12> :cnext<CR>
"search tags in parent directories
set tags+=tags;/
syntax on
:colorscheme zenburn
map dw diw
map cw ciw
#~/.bashrc
# If not running interactively, don't do anything
[[ "$-" != *i* ]] && return
export EDITOR=vim
alias expl='cmd /c "start ."'
shopt -s globstar
#Mintty clear
alias cls='echo -e "\ec\e[3J"'
function fj(){
file="$1"
pattern="$2"
if [ -n "$pattern" ] ; then pattern="|$pattern"; fi;
tail -F $file | grep --color -iP --line-buffered 'WARN|ERROR|FATAL|Exception|at.*\.java|more'"$pattern"
}
cd /cygdrive/c/projects
function targrep(){
pattern=$1
file=$2
tar xf $file --to-command "awk '/$1/{print ENVIRON[\"TAR_FILENAME\"], \$0}'" | awk "{print \"$file\",\$0}"
}
apachedir=/cygdrive/c/Program\ Files\ \(x86\)/Apache\ Software\ Foundation/Apache2.2/
HISTFILESIZE=50000
export LANG=EN
export LC_ALL=en_US.UTF8
#~/.minttyrc
#See .minttyrc here
#http://www.billzajac.com/wordpress/articles/2010/12/28/windows-is-nicer-with-mintty/
#CursorColour=252,24,70
#CursorType=block
#CursorBlinks=no
#~/.ctags
--langdef=js
--langmap=js:.js
--regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\{/\1/,object/
--regex-js=/([A-Za-z0-9_$()]+)[ \t]*[:=][ \t]*function[ \t]*\(/\1/,function/
--regex-js=/function[ \t]+([A-Za-z0-9._$]+)[ \t]*\(([^)])\)/\1/,function/
--regex-js=/prototype\.+([A-Za-z0-9._$]+)[ \t]*=/\1/,function/
--regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\[/\1/,array/
--regex-js=/([^= ]+)[ \t]*=[ \t]*[^"]'[^']*/\1/,string/
--regex-js=/([^= ]+)[ \t]*=[ \t]*[^']"[^"]*/\1/,string/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment