From edaf3c37dffcfbe0153b8c115000a5995d13a48f Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 18 Oct 2014 20:55:53 +0200 Subject: [PATCH 01/12] Fixed root prompt colours --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index 93b335d..a5c624c 100644 --- a/.bashrc +++ b/.bashrc @@ -78,7 +78,7 @@ if [ "$color_prompt" = yes ]; then RED="\[\033[0;31m\]" PROMPT_SYMBOL='$' if [ $USER = 'root' ]; then - PS1="$RED\t $GREEN\u$BLACK@\h:\W$ " + PS1="$YELLOW\t $RED\u$BLACK@\h:\W$ " elif [ -e ~/.dot_is_server ]; then PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " else From b958f3f25706c263f723c7624231f19d400b9783 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sun, 19 Oct 2014 19:52:04 +0200 Subject: [PATCH 02/12] Root prompt needs # --- .bashrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index a5c624c..19a107d 100644 --- a/.bashrc +++ b/.bashrc @@ -78,7 +78,7 @@ if [ "$color_prompt" = yes ]; then RED="\[\033[0;31m\]" PROMPT_SYMBOL='$' if [ $USER = 'root' ]; then - PS1="$YELLOW\t $RED\u$BLACK@\h:\W$ " + PS1="$YELLOW\t $RED\u$BLACK@\h:\W# " elif [ -e ~/.dot_is_server ]; then PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " else From ae6312fa686e41ed5178f8aeeefcd12a4cd2d812 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 10 Nov 2014 21:12:37 +0100 Subject: [PATCH 03/12] Trailing space --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index e6871f7..28b0aa5 100644 --- a/.vimrc +++ b/.vimrc @@ -80,7 +80,7 @@ if &term == "xterm" || &term == "screen-bce" || &term == "screen-256color" || &t " create a bar for airline set laststatus=2 - let g:airline_powerline_fonts = 1 + let g:airline_powerline_fonts = 1 endif " paste and autoindent From 2fb8733ee51e63cdc46b09726531e992bd602408 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Mon, 17 Nov 2014 13:29:57 +0100 Subject: [PATCH 04/12] Shelve extension for Mercurial --- .hgrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgrc b/.hgrc index b650afb..cdbd218 100644 --- a/.hgrc +++ b/.hgrc @@ -13,6 +13,7 @@ hgk= hgflow = ~/workspace/application_addons/mercurial/hgflow/src/hgflow.py #hggit = ~/workspace/application_addons/mercurial/hg-git/hggit prompt = /home/mbscholt/workspace/application_addons/mercurial/hg-prompt/prompt.py +shelve= [git] authors = /home/mbscholt/.hgauthors.txt From 56d4d544bc6c324426cccab86071b3238763165f Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 28 Nov 2014 09:16:49 +0100 Subject: [PATCH 05/12] CtrlP plugin for fuzzy search, CSS colour highlighting and better search --- .vimrc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.vimrc b/.vimrc index 28b0aa5..44e77bf 100644 --- a/.vimrc +++ b/.vimrc @@ -31,6 +31,17 @@ map :NERDTreeToggle " close vim if the only window left open is a NERDTree autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif +" Full path fuzzy file, buffer, mru, tag, ... finder +Plugin 'kien/ctrlp.vim' +let g:ctrlp_map = 't' +let g:ctrlp_match_window_bottom = 0 +let g:ctrlp_match_window_reversed = 0 +let g:ctrlp_custom_ignore = '\v\~$|\.(o|swp|pyc|wav|mp3|ogg|blend)$|(^|[/\\])\.(hg|git|bzr)($|[/\\])|__init__\.py' +let g:ctrlp_working_path_mode = 0 +let g:ctrlp_dotfiles = 0 +let g:ctrlp_switch_buffer = 0 + + " == Content convenience " Python autocompletion @@ -53,6 +64,9 @@ let g:undotree_SetFocusWhenToggle=1 " if undotree is opened, it is likely one " many filetypes. Plugin 'scrooloose/nerdcommenter' +" Highlight colours in CSS files +Plugin 'ap/vim-css-color' + " All of your Plugins must be added before the following line call vundle#end() " required filetype plugin indent on " required @@ -70,6 +84,12 @@ set complete-=k complete+=k " 2006-04-24 set smartcase +" ignorecase plus smartcase make searches case-insensitive except when you +" include upper-case characters (so /foo matches FOO and fOo, but /FOO only +" matches the former) +set ignorecase +set smartcase + " reload file when changes happen in other editors set autoread From a79d70ee218e9d0652f2cc45554d1273e5ad890f Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 28 Nov 2014 10:03:20 +0100 Subject: [PATCH 06/12] Fly through buffers --- .vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.vimrc b/.vimrc index 44e77bf..0533710 100644 --- a/.vimrc +++ b/.vimrc @@ -106,8 +106,12 @@ endif " paste and autoindent set pastetoggle= +" Prettify json and javascript map jt :%!json_xs -f json -t json-pretty +" Fly through buffers instead of cycling +nnoremap l :ls:b + " 2014-01-29 some sane Python settings autocmd FileType python set tabstop=4 autocmd FileType python set shiftwidth=4 From 7fdacacb0c6939c303a7480df62dbefd2003eacf Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 28 Nov 2014 11:50:24 +0100 Subject: [PATCH 07/12] Added F8 toggle for tagbar and note about needing ctags --- .vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.vimrc b/.vimrc index 0533710..af41519 100644 --- a/.vimrc +++ b/.vimrc @@ -6,7 +6,10 @@ call vundle#begin() Plugin 'gmarik/Vundle.vim' " Display tags of the current file ordered by scope +" You need ctags: sudo apt-get install exuberant-ctagsor` or +" `brew install ctags` for example Plugin 'majutsushi/tagbar' +nmap :TagbarToggle " The unite or unite.vim plug-in can search and display information from " arbitrary sources like files, buffers, recently used files or registers. Plugin 'Shougo/unite.vim' From a2685239d201c95ff2f475d606c596ada16e19e1 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 29 Nov 2014 09:25:38 +0100 Subject: [PATCH 08/12] Attempt to put the #stopped jobs in the prompt, doesn't play well with prompt colours --- .bashrc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index 19a107d..ae8d32c 100644 --- a/.bashrc +++ b/.bashrc @@ -57,9 +57,19 @@ if [ -n "$force_color_prompt" ]; then fi hg_ps1() { - #hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null - hg prompt " \[\033[1;37m\]hg\[\033[0m\] {branch}{status}" 2> /dev/null - } + #hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null + hg prompt " \[\033[1;37m\]hg\[\033[0m\] {branch}{status}" 2> /dev/null +} + +function stoppedjobs { + jobs -s | wc -l | sed -e "s/ //g" +} + +jobscount() { + local stopped=$(jobs -sp | wc -l) + local running=$(jobs -rp | wc -l) + ((running+stopped)) && echo -n "${running}r/${stopped}s " +} # gitprompt configuration # Set config variables first @@ -83,6 +93,9 @@ if [ "$color_prompt" = yes ]; then PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " else PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ " + #PS1='$PS1$(jobscount)' + #PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(jobscount)$ ' + #PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(running=$(jobscount); [ "${running:-0}" -eq 0 ] || printf %s "$running")\$ ' fi #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ " #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ " From d22b65ff58cd5cbede19c2900dcd3749c2525caa Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 29 Nov 2014 09:41:11 +0100 Subject: [PATCH 09/12] Moved prompt to a function, so it gets called every time --- .bashrc | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.bashrc b/.bashrc index ae8d32c..68ecc1c 100644 --- a/.bashrc +++ b/.bashrc @@ -61,6 +61,29 @@ hg_ps1() { hg prompt " \[\033[1;37m\]hg\[\033[0m\] {branch}{status}" 2> /dev/null } +set_bash_prompt(){ + # Michiel's colour config + BLACK="\[\033[0m\]" + BLUE="\[\033[0;34m\]" + YELLOW="\[\033[0;33m\]" + GREEN="\[\033[0;32m\]" + RED="\[\033[0;31m\]" + PROMPT_SYMBOL='$' + if [ $USER = 'root' ]; then + PS1="$YELLOW\t $RED\u$BLACK@\h:\W# " + elif [ -e ~/.dot_is_server ]; then + PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " + else + #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ " + #PS1='$PS1$(jobscount)' + PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(jobscount)$ " + #PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(running=$(jobscount); [ "${running:-0}" -eq 0 ] || printf %s "$running")\$ ' + fi + #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ " + #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ " + # /Michiel's colour config +} + function stoppedjobs { jobs -s | wc -l | sed -e "s/ //g" } @@ -80,26 +103,7 @@ jobscount() { if [ "$color_prompt" = yes ]; then #PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' - # Michiel's colour config - BLACK="\[\033[0m\]" - BLUE="\[\033[0;34m\]" - YELLOW="\[\033[0;33m\]" - GREEN="\[\033[0;32m\]" - RED="\[\033[0;31m\]" - PROMPT_SYMBOL='$' - if [ $USER = 'root' ]; then - PS1="$YELLOW\t $RED\u$BLACK@\h:\W# " - elif [ -e ~/.dot_is_server ]; then - PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " - else - PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ " - #PS1='$PS1$(jobscount)' - #PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(jobscount)$ ' - #PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(running=$(jobscount); [ "${running:-0}" -eq 0 ] || printf %s "$running")\$ ' - fi - #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ " - #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ " - # /Michiel's colour config + PROMPT_COMMAND=set_bash_prompt else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi From 71d26a2d3effef26ea8dfcb7920d70241c0b8a34 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 29 Nov 2014 09:44:55 +0100 Subject: [PATCH 10/12] Cleanup and added the jobcount to all prompts --- .bashrc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.bashrc b/.bashrc index 68ecc1c..345344d 100644 --- a/.bashrc +++ b/.bashrc @@ -70,28 +70,24 @@ set_bash_prompt(){ RED="\[\033[0;31m\]" PROMPT_SYMBOL='$' if [ $USER = 'root' ]; then - PS1="$YELLOW\t $RED\u$BLACK@\h:\W# " + #PS1="$YELLOW\t $RED\u$BLACK@\h:\W# " + PS1="$YELLOW\t $RED\u$BLACK@\h:\W$(jobscount)# " elif [ -e ~/.dot_is_server ]; then - PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " + #PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$ " + PS1="$YELLOW\t $GREEN\u$BLACK@\h:\W$(jobscount)$ " else #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$ " - #PS1='$PS1$(jobscount)' PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(jobscount)$ " - #PS1='$YELLOW\t $BLUE\u$BLACK@\h:\W$(running=$(jobscount); [ "${running:-0}" -eq 0 ] || printf %s "$running")\$ ' fi #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$ " #PS1="$YELLOW\t $BLUE\u$BLACK@\h:\W$(hg_ps1)$(__git_ps1)$ " # /Michiel's colour config } -function stoppedjobs { - jobs -s | wc -l | sed -e "s/ //g" -} - jobscount() { local stopped=$(jobs -sp | wc -l) local running=$(jobs -rp | wc -l) - ((running+stopped)) && echo -n "${running}r/${stopped}s " + ((running+stopped)) && echo -n "[${running}r/${stopped}s]" } # gitprompt configuration From dfe133a8a3176ad6ed8e5db9404f48297cfdaf44 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 29 Nov 2014 10:21:56 +0100 Subject: [PATCH 11/12] Typo in comment --- .vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vimrc b/.vimrc index af41519..5b2c824 100644 --- a/.vimrc +++ b/.vimrc @@ -6,7 +6,7 @@ call vundle#begin() Plugin 'gmarik/Vundle.vim' " Display tags of the current file ordered by scope -" You need ctags: sudo apt-get install exuberant-ctagsor` or +" You need ctags: `sudo apt-get install exuberant-ctags` or " `brew install ctags` for example Plugin 'majutsushi/tagbar' nmap :TagbarToggle From c178b58b5f111e40dbd058b1d1258a861b48e37d Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Sat, 29 Nov 2014 11:33:18 +0100 Subject: [PATCH 12/12] Some minor cleanups and tweaks --- .vimrc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.vimrc b/.vimrc index 5b2c824..f5b7d7e 100644 --- a/.vimrc +++ b/.vimrc @@ -5,6 +5,8 @@ call vundle#begin() " let Vundle manage Vundle, required Plugin 'gmarik/Vundle.vim' +" == UI ====== + " Display tags of the current file ordered by scope " You need ctags: `sudo apt-get install exuberant-ctags` or " `brew install ctags` for example @@ -14,8 +16,6 @@ nmap :TagbarToggle " arbitrary sources like files, buffers, recently used files or registers. Plugin 'Shougo/unite.vim' -" == UI - " Nice statusbar, alternative for powerline. Get powerline font for best " looking result Plugin 'bling/vim-airline' @@ -45,7 +45,7 @@ let g:ctrlp_dotfiles = 0 let g:ctrlp_switch_buffer = 0 -" == Content convenience +" == Content convenience ====== " Python autocompletion Plugin 'davidhalter/jedi-vim' @@ -84,13 +84,11 @@ set dictionary+=/usr/share/dict/words " use ctrl-n ctrl-n instead of ctrl-x ctrl-k set complete-=k complete+=k -" 2006-04-24 -set smartcase - " ignorecase plus smartcase make searches case-insensitive except when you " include upper-case characters (so /foo matches FOO and fOo, but /FOO only " matches the former) set ignorecase +" 2006-04-24 set smartcase " reload file when changes happen in other editors