From 0391b1c62b808314160ebf61b94a0564b97cccfe Mon Sep 17 00:00:00 2001 From: Jannik ZANDER Date: Wed, 4 Jul 2018 20:12:55 +0200 Subject: [PATCH] Add Ctrl-P to vim --- .bashrc | 17 +++++------------ .gitmodules | 3 +++ .profile | 2 +- .vim/pack/plugins/start/ctrlp.vim | 1 + .vim/vimrc | 16 +++++++++++----- 5 files changed, 21 insertions(+), 18 deletions(-) create mode 160000 .vim/pack/plugins/start/ctrlp.vim diff --git a/.bashrc b/.bashrc index 3b9326d..65bbcf5 100644 --- a/.bashrc +++ b/.bashrc @@ -1,5 +1,10 @@ # .bashrc is for configuring the interactive Bash usage, like Bash aliases, setting favorite editor, setting Bash prompt, etc. +# If not running interactively, don't do anything +[[ -z "$PS1" ]] && return + +cd ~ + # Set favorites export SHELL='bash' export EDITOR='vim' @@ -7,23 +12,11 @@ export VISUAL='vim' export PAGER='less -eFRX' export MANPAGER="less -eFRX" -# If not running interactively, don't do anything -[[ -z "$PS1" ]] && return - # Set prompt if [[ -z "$MSYS2_PS1" ]]; then PS1='${debian_chroot:+($debian_chroot)}' # debian else PS1='\[\033]0;$PWD\007\]' # terminal title in msys2 - cd ~ - GIT_EXEC_PATH="$(git --exec-path 2>/dev/null)" - COMPLETION_PATH="${GIT_EXEC_PATH%/libexec/git-core}" - COMPLETION_PATH="${COMPLETION_PATH%/lib/git-core}" - COMPLETION_PATH="$COMPLETION_PATH/share/git/completion" - if test -f "$COMPLETION_PATH/git-prompt.sh"; then - . "$COMPLETION_PATH/git-completion.bash" - . "$COMPLETION_PATH/git-prompt.sh" - fi fi PS1="$PS1"'\[\033[01;32m\]' # change color diff --git a/.gitmodules b/.gitmodules index 77b5730..582054d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -31,3 +31,6 @@ [submodule ".vim/pack/plugins/start/incsearch.vim"] path = .vim/pack/plugins/start/incsearch.vim url = https://github.com/haya14busa/incsearch.vim.git +[submodule ".vim/pack/plugins/start/ctrlp.vim"] + path = .vim/pack/plugins/start/ctrlp.vim + url = https://github.com/ctrlpvim/ctrlp.vim.git diff --git a/.profile b/.profile index 97d7b17..cefad05 100644 --- a/.profile +++ b/.profile @@ -21,8 +21,8 @@ fi #export XDG_DATA_DIRS=/usr/local/share/:/usr/share/ export QT_STYLE_OVERRIDE=adwaita-dark -export USERNAME=$LOGNAME export HOSTNAME=`hostname` + echo Welcome $USERNAME @ $HOSTNAME ! ################################# DEBIAN LOCAL SETTINGS ##### TO BE MOVED #### diff --git a/.vim/pack/plugins/start/ctrlp.vim b/.vim/pack/plugins/start/ctrlp.vim new file mode 160000 index 0000000..e66b5b5 --- /dev/null +++ b/.vim/pack/plugins/start/ctrlp.vim @@ -0,0 +1 @@ +Subproject commit e66b5b50e5c539354813e2ecac6fb75a2121e29e diff --git a/.vim/vimrc b/.vim/vimrc index 94089b2..946aa54 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -68,16 +68,17 @@ set shell=/bin/bash set path=.,,**,C:\programs\IAR\\\ System\EWB_V850_V360\common\bin "set makeprg=cmake\ --build\ . +set makeprg=msbuild " Visual studio 2013 -"set errorformat=\ %#%f(%l):\ %m +set errorformat=\ %#%f(%l):\ %m " Visual studio 2008 "set errorformat=%.%#>\ %#%f(%l)\ :\ %m " " IAR compiler -if executable('vim-iarbuild.cmd') - set makeprg=vim-iarbuild.cmd - set errorformat=%f(%l)\ :\ %m -endif +"if executable('vim-iarbuild.cmd') +" set makeprg=vim-iarbuild.cmd +" set errorformat=%f(%l)\ :\ %m +"endif if executable('ag') set grepprg=ag\ --vimgrep\ --skip-vcs-ignores\ --path-to-ignore\ ~/.ignore\ --cpp\ --cc @@ -239,6 +240,11 @@ if has("cscope") map :cstag =expand("") endif +" Ctrl-P +let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard'] +let g:ctrlp_map = '' +let g:ctrlp_cmd = 'CtrlP' + " Maps Ctrl-[h,j,k,l,+,-] to windows split navigations and resizing nnoremap nnoremap -- 2.43.0