Browse Source

Add YCM

Signed-off-by: Ein Verne <[email protected]>
pull/4/head
Ein Verne 5 years ago
parent
commit
1f46dfa197
No known key found for this signature in database
GPG Key ID: F80B65F734D9DD7D
  1. 3
      .vim/startup/map_vimrc
  2. 3
      .vim/startup/vundle_vimrc
  3. 25
      .zshrc

3
.vim/startup/map_vimrc

@ -72,3 +72,6 @@ map <leader>xml :call Xml()
" Normal mode F2 to call NERDTree " Normal mode F2 to call NERDTree
nmap <F2> :NERDTreeToggle<cr> nmap <F2> :NERDTreeToggle<cr>
nnoremap <leader><leader>i :PlugInstall<CR>
nnoremap <leader><leader>u :PlugUpdate<CR>

3
.vim/startup/vundle_vimrc

@ -31,6 +31,8 @@ Plug 'godlygeek/tabular'
Plug 'plasticboy/vim-markdown' Plug 'plasticboy/vim-markdown'
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdcommenter'
" 目录树美化
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'davidhalter/jedi-vim' Plug 'davidhalter/jedi-vim'
Plug 'ervandew/supertab' Plug 'ervandew/supertab'
Plug 'Raimondi/delimitMate' Plug 'Raimondi/delimitMate'
@ -68,6 +70,7 @@ Plug 'ntpeters/vim-better-whitespace'
Plug '907th/vim-auto-save' Plug '907th/vim-auto-save'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': '.install -all'} Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': '.install -all'}
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
Plug 'Valloric/YouCompleteMe', { 'do': './install.py' }
" Git plugin not hosted on GitHub " Git plugin not hosted on GitHub
Plug 'git://git.wincent.com/command-t.git' Plug 'git://git.wincent.com/command-t.git'

25
.zshrc

@ -269,7 +269,7 @@ alias df="df -h"
alias free="free -m" alias free="free -m"
alias grep="grep --color=auto" alias grep="grep --color=auto"
alias open="xdg-open" alias open="xdg-open"
alias ag="ag -i"
#transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi #transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi
#tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } #tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }
@ -373,7 +373,7 @@ fh() {
# fkill - kill process # fkill - kill process
fkill() { fkill() {
local pid local pid
pid=$(ps -ef | sed 1d | fzf -m | awk '{print $2}') pid=$(ps -ef |grep -v ^root | sed 1d | fzf -m | awk '{print $2}')
if [ "x$pid" != "x" ] if [ "x$pid" != "x" ]
then then
@ -411,3 +411,24 @@ z() {
#alias lp="lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\]//g')" #alias lp="lpass show -c --password $(lpass ls | fzf | awk '{print $(NF)}' | sed 's/\]//g')"
gcbr() {
result=$(git branch -a --color=always | grep -v '/HEAD\s' | sort |
fzf --height 50% --border --ansi --tac --preview-window right:70% \
--preview 'git log --oneline --graph --date=short --pretty="format:%C(auto)%cd %h%d %s" $(sed s/^..// <<< {} | cut -d" " -f1) | head -'$LINES |
sed 's/^..//' | cut -d' ' -f1)
if [[ $result != "" ]]; then
if [[ $result == remotes/* ]]; then
git checkout --track $(echo $result | sed 's#remotes/##')
else
git checkout "$result"
fi
fi
}
gfs() {
git -c color.status=always status --short |
fzf --height 50% --border --ansi --multi --ansi --nth 2..,.. \
--preview '(git diff --color=always -- {-1} | sed 1,4d; cat {-1}) | head -500' |
cut -c4- | sed 's/.* -> //'
}

Loading…
Cancel
Save