From 492e6b14367cf855e1605caa7a9a6dba5f02e954 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Fri, 7 Mar 2014 00:11:55 +0000 Subject: [PATCH 01/16] vim: add custom mappings for GoldenView --- vim/vimrc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 5ca9cfd..7d3cabb 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -128,11 +128,6 @@ set previewheight=20 " default height for the preview window set splitright " a new window is put right of the current one -nmap j -nmap k -nmap h -nmap l - map :ls:b " using the mouse {{{1 @@ -257,6 +252,14 @@ let g:airline_left_sep = '▶' let g:airline_right_sep = '◀' let g:airline#extensions#tabline#enabled = 1 +" GoldenView {{{2 +let g:goldenview__enable_default_mapping = 0 +nmap GoldenViewSplit +nmap GoldenViewNext +nmap GoldenViewPrevious +nmap GoldenViewSwitchMain +nmap GoldenViewPrevious + " Gundo {{{2 nnoremap :GundoToggle " fugitive {{{2 @@ -281,7 +284,7 @@ let g:syntastic_always_populate_loc_list=1 nmap y :SyntasticCheck if ! &diff - let g:syntastic_check_on_open=1 + let g:syntastic_check_on_open=1 endif " tagbar {{{2 -- 2.49.0 From b0c973a85a9a27906f6e7793c961579e7911669a Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 17 Mar 2014 12:54:19 +0000 Subject: [PATCH 02/16] aliases: usew CoW it available --- aliases | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aliases b/aliases index cf04b1c..1f26d60 100644 --- a/aliases +++ b/aliases @@ -9,9 +9,9 @@ alias la='ls -lha --color=auto -F' #alias grep='grep --color=tty -d skip' -alias cp='cp -i' # confirm before overwriting something -alias df='df -h' # human-readable sizes -alias free='free -m' # show sizes in MB +alias cp='cp -i --reflink=auto' # interactive + auto CoW +alias df='df -h' # human-readable sizes +alias free='free -m' # show sizes in MB alias vi='vim' alias svi='sudo -e' -- 2.49.0 From e61c88322ae0fd8c9f5111057bfdaea72b8ece38 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 17 Mar 2014 12:57:52 +0000 Subject: [PATCH 03/16] zsh: define environment variables in zshenv --- profile | 5 +---- zprofile | 1 - zshenv | 14 ++++++++++++++ zshrc | 10 ---------- 4 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 zprofile create mode 100644 zshenv diff --git a/profile b/profile index fc234d9..586ff0f 100644 --- a/profile +++ b/profile @@ -1,4 +1 @@ -export PATH="$HOME/bin:$PATH" -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_DATA_HOME="$HOME/.local/share" -export XDG_CACHE_HOME="$HOME/.cache" +[[ -r $HOME/.zshenv ]] && source $HOME/.zshenv diff --git a/zprofile b/zprofile deleted file mode 100644 index 53ca887..0000000 --- a/zprofile +++ /dev/null @@ -1 +0,0 @@ -emulate sh -c 'source ~/.profile' diff --git a/zshenv b/zshenv new file mode 100644 index 0000000..b411fb5 --- /dev/null +++ b/zshenv @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +export PATH="$HOME/bin:$PATH" +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_DATA_HOME="$HOME/.local/share" +export XDG_CACHE_HOME="$HOME/.cache" + +# vim stuff +[[ -d "$XDG_CACHE_HOME/vim" ]] || mkdir -p "$XDG_CACHE_HOME/vim" +export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' +export EDITOR=vim +export VISUAL=vim + +# default browser +export BROWSER=dwb diff --git a/zshrc b/zshrc index 2d8463f..5604a7c 100644 --- a/zshrc +++ b/zshrc @@ -45,15 +45,6 @@ for alias_file ($ZSH/aliases/*.zsh); do source $alias_file done -# vim stuff -[[ -d "$XDG_CACHE_HOME/vim" ]] || mkdir -p "$XDG_CACHE_HOME/vim" -export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' -export EDITOR=vim -export VISUAL=vim - -# default browser -export BROWSER=dwb - # set up a few named directories hash -d Skaro=/mnt/Skaro hash -d ccr=~/ccr @@ -66,4 +57,3 @@ hash -d UniMaas=~/dropbox/Documents/UniMaas # set some env variables export _gamedir=/mnt/Skaro/Games/Linux/HumbleBundle - -- 2.49.0 From 800bba6e8c13326e3dba6bc0b9c77cf8e88fa5be Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 27 Mar 2014 00:22:12 +0000 Subject: [PATCH 04/16] vimrc: rename bundles --- vim/vimrc | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 7d3cabb..74889e2 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -8,24 +8,32 @@ set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after " bundles {{{1 filetype off -set rtp+=$XDG_DATA_HOME/vim/vundle +set runtimepath+=$XDG_DATA_HOME/vim/vundle call vundle#rc('$XDG_DATA_HOME/vim') Bundle 'gmarik/vundle' + Bundle 'bling/vim-airline' -Bundle 'ctrlp.vim' -Bundle 'fugitive.vim' -Bundle 'Gundo' -Bundle 'The-NERD-tree' -Bundle 'surround.vim' -Bundle 'Syntastic' -Bundle 'Tagbar' -Bundle 'tComment' -Bundle 'Valloric/YouCompleteMe' Bundle 'elzr/vim-json' -Bundle 'http://git.code.sf.net/p/vim-latex/vim-latex' Bundle 'ervandew/ag.git' -Bundle 'zhaocai/GoldenView.Vim' +Bundle 'http://git.code.sf.net/p/vim-latex/vim-latex' +Bundle 'kien/ctrlp.vim' +Bundle 'majutsushi/tagbar' +Bundle 'scrooloose/nerdtree' +Bundle 'scrooloose/syntastic' +Bundle 'sjl/gundo.vim' +Bundle 'tomtom/tcomment_vim' +Bundle 'tpope/vim-fugitive' +Bundle 'tpope/vim-surround' +Bundle 'tpope/vim-unimpaired' +Bundle 'valloric/youcompleteme' +Bundle 'zhaocai/goldenview.vim' + +Bundle 'ompugao/ros.vim' +Bundle 'ompugao/ctrlp-ros' + +Bundle 'derekwyatt/vim-fswitch' +Bundle 'jalcine/cmake.vim' filetype plugin indent on -- 2.49.0 From 3e043b9780dfffb1873a6ba8e6a015d1e38a24d3 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 27 Mar 2014 00:25:56 +0000 Subject: [PATCH 05/16] vimrc: don't wrap anymore --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 74889e2..7ef205b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -64,7 +64,7 @@ set path=.,** " current + subdirectory search for :find, :grep:, ... " displaying text {{{1 set scrolloff=5 " number of screen lines to show around the cursor -set wrap " long lines wrap +set nowrap " long lines wrap set linebreak " wrap long lines at a character in 'breakat' set showbreak=▒▒ " show these chars for wrapped lines -- 2.49.0 From 4455d479ce77e19d8a4944a2444069a477c92ecb Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 27 Mar 2014 00:26:46 +0000 Subject: [PATCH 06/16] vimrc: don't show info message on startup --- vim/vimrc | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/vimrc b/vim/vimrc index 7ef205b..8728936 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -150,6 +150,7 @@ vnoremap s set showcmd " Show (partial) command in status line. set ruler " show the cursor position all the time set confirm " Ask what to do when closing unsaved documents +set shortmess=filnxtoOI " don't show intro message " editing text {{{1 set backspace=indent,eol,start " allow backspacing over everything in insert mode -- 2.49.0 From ec400a1134eeee19ad98dd023d42e79d67eebb31 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 27 Mar 2014 00:27:54 +0000 Subject: [PATCH 07/16] vimrc: fix ycm path --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 8728936..ac1529e 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -305,7 +305,7 @@ let g:tagbar_width = 25 let g:tagbar_iconchars = ['+', '-'] " YouCompleteMe {{{2 -let g:ycm_extra_conf_globlist = ['/mnt/data/src/*'] +let g:ycm_extra_conf_globlist = ['~/src/*'] " vim-json {{{2 let g:vim_json_syntax_conceal = 0 -- 2.49.0 From 89a4b8e019f6bc3a4e0230ddc17ef0806cefb766 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 27 Mar 2014 13:06:54 +0000 Subject: [PATCH 08/16] vimrc: add shortcuts for vimrc + autosource on save --- vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index ac1529e..bebb15a 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -315,6 +315,10 @@ let g:tex_flavor='latex' let g:Tex_DefaultTargetFormat='pdf' " functions {{{1 +" auto source vimrc when saved +autocmd bufwritepost vimrc source $MYVIMRC +nmap v :tabedit $MYVIMRC + " Convenient command to see the difference between the current buffer and the " file it was loaded from, thus the changes you made. " Only define it when not defined already. -- 2.49.0 From 7b722cd95717089ae9b86fea4825e181cdf0514d Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 27 Mar 2014 13:28:27 +0000 Subject: [PATCH 09/16] vimrc: delete fugitive buffers on close --- vim/vimrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index bebb15a..788e3df 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -273,6 +273,8 @@ nmap GoldenViewPrevious nnoremap :GundoToggle " fugitive {{{2 nmap dd :tab split \| Gdiff \| wincmd h +" delete fugitive buffers when closed +autocmd BufReadPost fugitive://* set bufhidden=delete " NERDTree {{{2 " open/close NERDTree with \e -- 2.49.0 From 8a5f4add378f794a5e1bdfd7b552d53aa3d1efa9 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 30 Mar 2014 23:44:00 +0100 Subject: [PATCH 10/16] mutt: add some more settings --- mutt/accounts/chakra | 1 + mutt/accounts/gmail | 1 + mutt/accounts/unimaas | 1 + mutt/bindings | 2 +- mutt/hooks | 9 +++++++++ mutt/mailcap | 1 + mutt/muttrc | 12 ++++++++++-- 7 files changed, 24 insertions(+), 3 deletions(-) diff --git a/mutt/accounts/chakra b/mutt/accounts/chakra index f2d9607..e7b5719 100644 --- a/mutt/accounts/chakra +++ b/mutt/accounts/chakra @@ -1,4 +1,5 @@ # vim: ft=muttrc set realname = "Ram-Z" set from = "ram-z@chakra-project.org" +unmy_hdr Bcc: my_hdr Bcc: $from diff --git a/mutt/accounts/gmail b/mutt/accounts/gmail index f5e0422..2d059e7 100644 --- a/mutt/accounts/gmail +++ b/mutt/accounts/gmail @@ -1,4 +1,5 @@ # vim: ft=muttrc set realname = "Samir Benmendil" set from = "samir.benmendil@gmail.com" +unmy_hdr Bcc: my_hdr Bcc: $from diff --git a/mutt/accounts/unimaas b/mutt/accounts/unimaas index 0c624db..bf6ee9c 100644 --- a/mutt/accounts/unimaas +++ b/mutt/accounts/unimaas @@ -1,4 +1,5 @@ # vim: ft=muttrc set realname = "Samir Benmendil" set from = "s.benmendil@student.maastrichtuniversity.nl" +unmy_hdr Bcc: my_hdr Bcc: $from diff --git a/mutt/bindings b/mutt/bindings index d441abc..433b6bf 100644 --- a/mutt/bindings +++ b/mutt/bindings @@ -27,7 +27,7 @@ bind index,pager \CO sidebar-open macro index b "toggle sidebar_visible" "Toggle sidebar" macro pager b "toggle sidebar_visible" "Toggle sidebar" -macro pager \Cu "|urlview" " +macro pager \Cu "|urlview" "open urlview" # Remap bounce-message function to “B” bind index,pager B bounce-message diff --git a/mutt/hooks b/mutt/hooks index fa323c2..43f61c1 100644 --- a/mutt/hooks +++ b/mutt/hooks @@ -1,6 +1,15 @@ # vim: ft=muttrc +reply-hook . source ~/.mutt/accounts/gmail +reply-hook "%L chakra" source ~/.mutt/accounts/chakra +reply-hook "%L unimaas" source ~/.mutt/accounts/unimaas + folder-hook . source ~/.mutt/accounts/gmail folder-hook chakra source ~/.mutt/accounts/chakra folder-hook unimaas source ~/.mutt/accounts/unimaas folder-hook * "exec collapse-all" + +# limit inbox to Unread and Flagged mails +folder-hook inbox push '=(=U|=F)' +# delete mails older than 3 months +folder-hook inbox push '!~(~U|~F|~d<3m)' diff --git a/mutt/mailcap b/mutt/mailcap index 3fc2db1..664bda6 100644 --- a/mutt/mailcap +++ b/mutt/mailcap @@ -2,3 +2,4 @@ text/html; ~/.mutt/mutt_bgrun dwb -p mail --name dwb-mail %s; test=test -n text/html; w3m -I %{charset} -T text/html; copiousoutput; image/*; ~/.mutt/mutt_bgrun feh %s; application/pdf; ~/.mutt/mutt_bgrun okular %s; +application/*; ~/.mutt/mutt_bgrun mimeo %s; diff --git a/mutt/muttrc b/mutt/muttrc index d41b885..7e0bbba 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -1,5 +1,8 @@ # general settings -alternates samir.benmendil@.* ram-z@.* s.benmendil@.* +alternates -group me samir.benmendil@gmail.com ram-z@hotmail.com +alternates -group me -group chakra ram-z@chakra-project.org +alternates -group me -group unimaas s.benmendil@student.maastrichtuniversity.nl + set mail_check = 0 set envelope_from set forward_format = "Fwd: %s" @@ -22,9 +25,14 @@ set duplicate_threads = yes set collapse_unread = no # lists -subscribe ^chakra-.*@googlegroups.com +subscribe -group chakra ^chakra-.*@googlegroups.com subscribe clementine-player@googlegroups.com +# performance tuning +set read_inc = 1000 # nb of messages read before printing status +set write_inc = 1000 # nb of messages written before printing status +set time_inc = 100 # time interval (ms) between status print + # look and feel set pager_index_lines = 12 set pager_context = 5 -- 2.49.0 From 16e30208c2040f4f903bb5c877bb0c85fa5e63b3 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 30 Mar 2014 23:45:07 +0100 Subject: [PATCH 11/16] aliases: sort du --- aliases | 1 + 1 file changed, 1 insertion(+) diff --git a/aliases b/aliases index 1f26d60..37363cc 100644 --- a/aliases +++ b/aliases @@ -11,6 +11,7 @@ alias la='ls -lha --color=auto -F' alias cp='cp -i --reflink=auto' # interactive + auto CoW alias df='df -h' # human-readable sizes +du() { /usr/bin/du -h ${@} | sort -h } alias free='free -m' # show sizes in MB alias vi='vim' -- 2.49.0 From 8c6ad023ff08c62d552c05eced0a53aa9ad5b3af Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 30 Mar 2014 23:45:38 +0100 Subject: [PATCH 12/16] vimrc: disable goldenview --- vim/vimrc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 788e3df..5e4a0b4 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -27,7 +27,7 @@ Bundle 'tpope/vim-fugitive' Bundle 'tpope/vim-surround' Bundle 'tpope/vim-unimpaired' Bundle 'valloric/youcompleteme' -Bundle 'zhaocai/goldenview.vim' +"Bundle 'zhaocai/goldenview.vim' Bundle 'ompugao/ros.vim' Bundle 'ompugao/ctrlp-ros' @@ -60,7 +60,7 @@ noremap noremap set nostartofline " don't move the cursor to the first non-blank char of a line -set path=.,** " current + subdirectory search for :find, :grep:, ... +set path=.,include/,../include/,/usr/include/c++/*,/opt/ros/hydro/include " displaying text {{{1 set scrolloff=5 " number of screen lines to show around the cursor @@ -138,6 +138,9 @@ set splitright " a new window is put right of the current one map :ls:b +nmap w +nmap W + " using the mouse {{{1 set mouse=rnv " list of flags for using the mouse set ttymouse=xterm " type of mouse @@ -262,12 +265,12 @@ let g:airline_right_sep = '◀' let g:airline#extensions#tabline#enabled = 1 " GoldenView {{{2 -let g:goldenview__enable_default_mapping = 0 -nmap GoldenViewSplit -nmap GoldenViewNext -nmap GoldenViewPrevious -nmap GoldenViewSwitchMain -nmap GoldenViewPrevious +"let g:goldenview__enable_default_mapping = 0 +"nmap GoldenViewSplit +"nmap GoldenViewNext +"nmap GoldenViewPrevious +"nmap GoldenViewSwitchMain +"nmap GoldenViewPrevious " Gundo {{{2 nnoremap :GundoToggle -- 2.49.0 From dd41cc10fb8fc2ca829a69af1905f93276d6261d Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sun, 30 Mar 2014 23:47:43 +0100 Subject: [PATCH 13/16] ycm: add ycm_extra_conf.py --- ycm_extra_conf.py | 174 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 174 insertions(+) create mode 100644 ycm_extra_conf.py diff --git a/ycm_extra_conf.py b/ycm_extra_conf.py new file mode 100644 index 0000000..6a93229 --- /dev/null +++ b/ycm_extra_conf.py @@ -0,0 +1,174 @@ +# This file is NOT licensed under the GPLv3, which is the license for the rest +# of YouCompleteMe. +# +# Here's the license text for this file: +# +# This is free and unencumbered software released into the public domain. +# +# Anyone is free to copy, modify, publish, use, compile, sell, or +# distribute this software, either in source code form or as a compiled +# binary, for any purpose, commercial or non-commercial, and by any +# means. +# +# In jurisdictions that recognize copyright laws, the author or authors +# of this software dedicate any and all copyright interest in the +# software to the public domain. We make this dedication for the benefit +# of the public at large and to the detriment of our heirs and +# successors. We intend this dedication to be an overt act of +# relinquishment in perpetuity of all present and future rights to this +# software under copyright law. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +# OTHER DEALINGS IN THE SOFTWARE. +# +# For more information, please refer to + +import os +import shlex +import subprocess +import ycm_core + +# These are the compilation flags that will be used in case there's no +# compilation database set (by default, one is not set). +# CHANGE THIS LIST OF FLAGS. YES, THIS IS THE DROID YOU HAVE BEEN LOOKING FOR. +flags = [ +'-Wall', +'-Wextra', +'-Wshadow', +#'-Werror', +#'-Wc++98-compat', +'-Wno-long-long', +'-Wno-variadic-macros', +'-fexceptions', +'-DNDEBUG', +# THIS IS IMPORTANT! Without a "-std=" flag, clang won't know which +# language to use when compiling headers. So it will guess. Badly. So C++ +# headers will be compiled as C headers. You don't want that so ALWAYS specify +# a "-std=". +# For a C project, you would set this to something like 'c99' instead of +# 'c++11'. +'-std=c++11', +# ...and the same thing goes for the magic -x option which specifies the +# language that the files to be compiled are written in. This is mostly +# relevant for c++ headers. +# For a C project, you would set this to 'c' instead of 'c++'. +'-x', 'c++', +'-isystem', '/usr/include', +] + +# This function makes it easy to pull in additional flags from pkg-config +def rospack(): + cmd = ['rospack', 'cflags-only-I'] + print subprocess.Popen('pwd') + out = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE).stdout + line = out.readline()[:-1].split(" ") + includes = [] + for include in line: + includes += ['-I', include] + return filter(lambda a: a != ' ', line) + +flags += rospack() + +# Set this to the absolute path to the folder (NOT the file!) containing the +# compile_commands.json file to use that instead of 'flags'. See here for +# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html +# +# Most projects will NOT need to set this to anything; you can just change the +# 'flags' list of compilation flags. Notice that YCM itself uses that approach. +compilation_database_folder = '' + +if os.path.exists( compilation_database_folder ): + database = ycm_core.CompilationDatabase( compilation_database_folder ) +else: + database = None + +SOURCE_EXTENSIONS = [ '.cpp', '.cxx', '.cc', '.c', '.m', '.mm' ] + +def DirectoryOfThisScript(): + return os.path.dirname( os.path.abspath( __file__ ) ) + + +def MakeRelativePathsInFlagsAbsolute( flags, working_directory ): + if not working_directory: + return list( flags ) + new_flags = [] + make_next_absolute = False + path_flags = [ '-isystem', '-I', '-iquote', '--sysroot=' ] + for flag in flags: + new_flag = flag + + if make_next_absolute: + make_next_absolute = False + if not flag.startswith( '/' ): + new_flag = os.path.join( working_directory, flag ) + + for path_flag in path_flags: + if flag == path_flag: + make_next_absolute = True + break + + if flag.startswith( path_flag ): + path = flag[ len( path_flag ): ] + new_flag = path_flag + os.path.join( working_directory, path ) + break + + if new_flag: + new_flags.append( new_flag ) + return new_flags + + +def IsHeaderFile( filename ): + extension = os.path.splitext( filename )[ 1 ] + return extension in [ '.h', '.hxx', '.hpp', '.hh' ] + + +def GetCompilationInfoForFile( filename ): + # The compilation_commands.json file generated by CMake does not have entries + # for header files. So we do our best by asking the db for flags for a + # corresponding source file, if any. If one exists, the flags for that file + # should be good enough. + if IsHeaderFile( filename ): + basename = os.path.splitext( filename )[ 0 ] + for extension in SOURCE_EXTENSIONS: + replacement_file = basename + extension + if os.path.exists( replacement_file ): + compilation_info = database.GetCompilationInfoForFile( + replacement_file ) + if compilation_info.compiler_flags_: + return compilation_info + return None + return database.GetCompilationInfoForFile( filename ) + + +def FlagsForFile( filename, **kwargs ): + if database: + # Bear in mind that compilation_info.compiler_flags_ does NOT return a + # python list, but a "list-like" StringVec object + compilation_info = GetCompilationInfoForFile( filename ) + if not compilation_info: + return None + + final_flags = MakeRelativePathsInFlagsAbsolute( + compilation_info.compiler_flags_, + compilation_info.compiler_working_dir_ ) + + # NOTE: This is just for YouCompleteMe; it's highly likely that your project + # does NOT need to remove the stdlib flag. DO NOT USE THIS IN YOUR + # ycm_extra_conf IF YOU'RE NOT 100% SURE YOU NEED IT. + try: + final_flags.remove( '-stdlib=libc++' ) + except ValueError: + pass + else: + relative_to = DirectoryOfThisScript() + final_flags = MakeRelativePathsInFlagsAbsolute( flags, relative_to ) + + return { + 'flags': final_flags, + 'do_cache': True + } -- 2.49.0 From ae6a4470f4251c1d6a641a10614e11234eda0ccb Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Mon, 7 Apr 2014 21:53:08 +0100 Subject: [PATCH 14/16] zsh: remove oh-my-zsh tools dir --- zsh/tools/check_for_upgrade.sh | 52 ----------- zsh/tools/install.sh | 38 -------- zsh/tools/require_tool.sh | 161 --------------------------------- zsh/tools/theme_chooser.sh | 96 -------------------- zsh/tools/uninstall.sh | 28 ------ zsh/tools/upgrade.sh | 19 ---- 6 files changed, 394 deletions(-) delete mode 100644 zsh/tools/check_for_upgrade.sh delete mode 100755 zsh/tools/install.sh delete mode 100755 zsh/tools/require_tool.sh delete mode 100755 zsh/tools/theme_chooser.sh delete mode 100644 zsh/tools/uninstall.sh delete mode 100644 zsh/tools/upgrade.sh diff --git a/zsh/tools/check_for_upgrade.sh b/zsh/tools/check_for_upgrade.sh deleted file mode 100644 index 581f03a..0000000 --- a/zsh/tools/check_for_upgrade.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh - -function _current_epoch() { - echo $(($(date +%s) / 60 / 60 / 24)) -} - -function _update_zsh_update() { - echo "LAST_EPOCH=$(_current_epoch)" > ~/.zsh-update -} - -function _upgrade_zsh() { - /usr/bin/env ZSH=$ZSH /bin/sh $ZSH/tools/upgrade.sh - # update the zsh file - _update_zsh_update -} - -epoch_target=$UPDATE_ZSH_DAYS -if [[ -z "$epoch_target" ]]; then - # Default to old behavior - epoch_target=13 -fi - -if [ -f ~/.zsh-update ] -then - . ~/.zsh-update - - if [[ -z "$LAST_EPOCH" ]]; then - _update_zsh_update && return 0; - fi - - epoch_diff=$(($(_current_epoch) - $LAST_EPOCH)) - if [ $epoch_diff -gt $epoch_target ] - then - if [ "$DISABLE_UPDATE_PROMPT" = "true" ] - then - _upgrade_zsh - else - echo "[Oh My Zsh] Would you like to check for updates?" - echo "Type Y to update oh-my-zsh: \c" - read line - if [ "$line" = Y ] || [ "$line" = y ]; then - _upgrade_zsh - else - _update_zsh_update - fi - fi - fi -else - # create the zsh file - _update_zsh_update -fi - diff --git a/zsh/tools/install.sh b/zsh/tools/install.sh deleted file mode 100755 index 41f83e3..0000000 --- a/zsh/tools/install.sh +++ /dev/null @@ -1,38 +0,0 @@ -if [ -d ~/.oh-my-zsh ] -then - echo "\033[0;33mYou already have Oh My Zsh installed.\033[0m You'll need to remove ~/.oh-my-zsh if you want to install" - exit -fi - -echo "\033[0;34mCloning Oh My Zsh...\033[0m" -hash git >/dev/null && /usr/bin/env git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh || { - echo "git not installed" - exit -} - -echo "\033[0;34mLooking for an existing zsh config...\033[0m" -if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] -then - echo "\033[0;33mFound ~/.zshrc.\033[0m \033[0;32mBacking up to ~/.zshrc.pre-oh-my-zsh\033[0m"; - mv ~/.zshrc ~/.zshrc.pre-oh-my-zsh; -fi - -echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" -cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc - -echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" -echo "export PATH=$PATH" >> ~/.zshrc - -echo "\033[0;34mTime to change your default shell to zsh!\033[0m" -chsh -s `which zsh` - -echo "\033[0;32m"' __ __ '"\033[0m" -echo "\033[0;32m"' ____ / /_ ____ ___ __ __ ____ _____/ /_ '"\033[0m" -echo "\033[0;32m"' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ '"\033[0m" -echo "\033[0;32m"'/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / '"\033[0m" -echo "\033[0;32m"'\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ '"\033[0m" -echo "\033[0;32m"' /____/ '"\033[0m" - -echo "\n\n \033[0;32m....is now installed.\033[0m" -/usr/bin/env zsh -source ~/.zshrc diff --git a/zsh/tools/require_tool.sh b/zsh/tools/require_tool.sh deleted file mode 100755 index 1fa77f7..0000000 --- a/zsh/tools/require_tool.sh +++ /dev/null @@ -1,161 +0,0 @@ -__require_tool_version_compare () -{ - ( - # Locally ignore failures, otherwise we'll exit whenever $1 and $2 - # are not equal! - set +e - -awk_strverscmp=' - # Use only awk features that work with 7th edition Unix awk (1978). - # My, what an old awk you have, Mr. Solaris! - END { - while (length(v1) || length(v2)) { - # Set d1 to be the next thing to compare from v1, and likewise for d2. - # Normally this is a single character, but if v1 and v2 contain digits, - # compare them as integers and fractions as strverscmp does. - if (v1 ~ /^[0-9]/ && v2 ~ /^[0-9]/) { - # Split v1 and v2 into their leading digit string components d1 and d2, - # and advance v1 and v2 past the leading digit strings. - for (len1 = 1; substr(v1, len1 + 1) ~ /^[0-9]/; len1++) continue - for (len2 = 1; substr(v2, len2 + 1) ~ /^[0-9]/; len2++) continue - d1 = substr(v1, 1, len1); v1 = substr(v1, len1 + 1) - d2 = substr(v2, 1, len2); v2 = substr(v2, len2 + 1) - if (d1 ~ /^0/) { - if (d2 ~ /^0/) { - # Compare two fractions. - while (d1 ~ /^0/ && d2 ~ /^0/) { - d1 = substr(d1, 2); len1-- - d2 = substr(d2, 2); len2-- - } - if (len1 != len2 && ! (len1 && len2 && substr(d1, 1, 1) == substr(d2, 1, 1))) { - # The two components differ in length, and the common prefix - # contains only leading zeros. Consider the longer to be less. - d1 = -len1 - d2 = -len2 - } else { - # Otherwise, compare as strings. - d1 = "x" d1 - d2 = "x" d2 - } - } else { - # A fraction is less than an integer. - exit 1 - } - } else { - if (d2 ~ /^0/) { - # An integer is greater than a fraction. - exit 2 - } else { - # Compare two integers. - d1 += 0 - d2 += 0 - } - } - } else { - # The normal case, without worrying about digits. - if (v1 == "") d1 = v1; else { d1 = substr(v1, 1, 1); v1 = substr(v1,2) } - if (v2 == "") d2 = v2; else { d2 = substr(v2, 1, 1); v2 = substr(v2,2) } - } - if (d1 < d2) exit 1 - if (d1 > d2) exit 2 - } - } -' - awk "$awk_strverscmp" v1="$1" v2="$2" /dev/null - case $? in - 1) echo '<';; - 0) echo '=';; - 2) echo '>';; - esac - ) -} - - -__require_tool_fatal () -{ - echo $@ >/dev/stderr - return 1 -} - -# Usage: require_tool program version -# Returns: 0 if $1 version if greater equals than $2, 1 otherwise. -# In case of error, message is written on error output. -# -# Example: require_tool gcc 4.6 -# Use GCC environment variable if defined instead of lookup for the tool -# in the environment. -require_tool () -{ - envvar_name=$(echo $1 | tr '[:lower:]' '[:upper:]') - tool=$(printenv $envvar_name || echo $1) - local version=$($tool --version 2>/dev/null| \ - sed -n 's/.*[^0-9.]\([0-9]*\.[0-9.]*\).*/\1/p;q') - if test x"$version" = x ; then - echo "$tool is required" >/dev/stderr - return 1 - fi - case $(__require_tool_version_compare "$2" "$version") in - '>') - echo "$1 $2 or better is required: this is $tool $version" >/dev/stderr - return 1 - ;; - esac -} - -usage() { - cat < /dev/null ; then - echo "Already in favlist" - else - echo $THEME_NAME >> $FAVLIST - echo "Saved to favlist" - fi - -} - -function theme_chooser() { - for THEME in $(ls $THEMES_DIR); do - echo - theme_preview $THEME - echo - if [[ -z $1 ]]; then - noyes "Do you want to add it to your favourite list ($FAVLIST)?" || \ - insert_favlist $THEME_NAME - echo - fi - done -} - -while getopts ":lhs" Option -do - case $Option in - l ) list_themes ;; - s ) theme_chooser 0 ;; - h ) usage ;; - * ) usage ;; # Default. - esac -done - -if [[ -z $Option ]]; then - if [[ -z $1 ]]; then - banner - echo - theme_chooser - else - theme_preview $1".zsh-theme" - fi -fi diff --git a/zsh/tools/uninstall.sh b/zsh/tools/uninstall.sh deleted file mode 100644 index 41d6015..0000000 --- a/zsh/tools/uninstall.sh +++ /dev/null @@ -1,28 +0,0 @@ -echo "Removing ~/.oh-my-zsh" -if [[ -d ~/.oh-my-zsh ]] -then - rm -rf ~/.oh-my-zsh -fi - -echo "Looking for original zsh config..." -if [ -f ~/.zshrc.pre-oh-my-zsh ] || [ -h ~/.zshrc.pre-oh-my-zsh ] -then - echo "Found ~/.zshrc.pre-oh-my-zsh -- Restoring to ~/.zshrc"; - - if [ -f ~/.zshrc ] || [ -h ~/.zshrc ] - then - ZSHRC_SAVE=".zshrc.omz-uninstalled-`date +%Y%m%d%H%M%S`"; - echo "Found ~/.zshrc -- Renaming to ~/${ZSHRC_SAVE}"; - mv ~/.zshrc ~/${ZSHRC_SAVE}; - fi - - mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc; - - source ~/.zshrc; -else - echo "Switching back to bash" - chsh -s /bin/bash - source /etc/profile -fi - -echo "Thanks for trying out Oh My Zsh. It's been uninstalled." diff --git a/zsh/tools/upgrade.sh b/zsh/tools/upgrade.sh deleted file mode 100644 index b2a1c06..0000000 --- a/zsh/tools/upgrade.sh +++ /dev/null @@ -1,19 +0,0 @@ -current_path=`pwd` -printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh" -cd $ZSH - -if git pull origin master -then - printf '\033[0;32m%s\033[0m\n' ' __ __ ' - printf '\033[0;32m%s\033[0m\n' ' ____ / /_ ____ ___ __ __ ____ _____/ /_ ' - printf '\033[0;32m%s\033[0m\n' ' / __ \/ __ \ / __ `__ \/ / / / /_ / / ___/ __ \ ' - printf '\033[0;32m%s\033[0m\n' '/ /_/ / / / / / / / / / / /_/ / / /_(__ ) / / / ' - printf '\033[0;32m%s\033[0m\n' '\____/_/ /_/ /_/ /_/ /_/\__, / /___/____/_/ /_/ ' - printf '\033[0;32m%s\033[0m\n' ' /____/ ' - printf '\033[0;34m%s\033[0m\n' 'Hooray! Oh My Zsh has been updated and/or is at the current version.' - printf '\033[0;34m%s\033[1m%s\033[0m\n' 'To keep up on the latest, be sure to follow Oh My Zsh on twitter: ' 'http://twitter.com/ohmyzsh' -else - printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?' -fi - -cd "$current_path" \ No newline at end of file -- 2.49.0 From 3d23d16c731ee8c3e9ffe678a964032e9f6023c5 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 10 Apr 2014 00:36:16 +0100 Subject: [PATCH 15/16] weechat: upgrade weechat configs --- weechat/alias.conf | 2 +- weechat/aspell.conf | 2 +- weechat/buffer_autoset.conf | 2 +- weechat/buffers.conf | 2 +- weechat/charset.conf | 2 +- weechat/iset.conf | 2 +- weechat/logger.conf | 2 +- weechat/plugins.conf | 2 +- weechat/relay.conf | 2 +- weechat/rmodifier.conf | 2 +- weechat/script.conf | 2 +- weechat/sec.conf | 2 +- weechat/weechat.conf | 13 +++++++++++-- weechat/xfer.conf | 3 ++- 14 files changed, 25 insertions(+), 15 deletions(-) diff --git a/weechat/alias.conf b/weechat/alias.conf index d78b693..2a5d648 100644 --- a/weechat/alias.conf +++ b/weechat/alias.conf @@ -1,5 +1,5 @@ # -# alias.conf -- weechat v0.4.2 +# alias.conf -- weechat v0.4.3 # [cmd] diff --git a/weechat/aspell.conf b/weechat/aspell.conf index cb39cb9..49b99fb 100644 --- a/weechat/aspell.conf +++ b/weechat/aspell.conf @@ -1,5 +1,5 @@ # -# aspell.conf -- weechat v0.4.2 +# aspell.conf -- weechat v0.4.3 # [color] diff --git a/weechat/buffer_autoset.conf b/weechat/buffer_autoset.conf index 1773cb1..bb1d7fa 100644 --- a/weechat/buffer_autoset.conf +++ b/weechat/buffer_autoset.conf @@ -1,5 +1,5 @@ # -# buffer_autoset.conf -- weechat v0.4.2 +# buffer_autoset.conf -- weechat v0.4.3 # [buffer] diff --git a/weechat/buffers.conf b/weechat/buffers.conf index 0a22479..6aaa21a 100644 --- a/weechat/buffers.conf +++ b/weechat/buffers.conf @@ -1,5 +1,5 @@ # -# buffers.conf -- weechat v0.4.2 +# buffers.conf -- weechat v0.4.3 # [color] diff --git a/weechat/charset.conf b/weechat/charset.conf index 569434b..54dc741 100644 --- a/weechat/charset.conf +++ b/weechat/charset.conf @@ -1,5 +1,5 @@ # -# charset.conf -- weechat v0.4.2 +# charset.conf -- weechat v0.4.3 # [default] diff --git a/weechat/iset.conf b/weechat/iset.conf index 8e476cc..d583b8f 100644 --- a/weechat/iset.conf +++ b/weechat/iset.conf @@ -1,5 +1,5 @@ # -# iset.conf -- weechat v0.4.2 +# iset.conf -- weechat v0.4.3 # [color] diff --git a/weechat/logger.conf b/weechat/logger.conf index c3f4b07..6d65ea8 100644 --- a/weechat/logger.conf +++ b/weechat/logger.conf @@ -1,5 +1,5 @@ # -# logger.conf -- weechat v0.4.2 +# logger.conf -- weechat v0.4.3 # [look] diff --git a/weechat/plugins.conf b/weechat/plugins.conf index 568ef1f..1db6fbd 100644 --- a/weechat/plugins.conf +++ b/weechat/plugins.conf @@ -1,5 +1,5 @@ # -# plugins.conf -- weechat v0.4.2 +# plugins.conf -- weechat v0.4.3 # [var] diff --git a/weechat/relay.conf b/weechat/relay.conf index 23bd18e..e5c404c 100644 --- a/weechat/relay.conf +++ b/weechat/relay.conf @@ -1,5 +1,5 @@ # -# relay.conf -- weechat v0.4.2 +# relay.conf -- weechat v0.4.3 # [look] diff --git a/weechat/rmodifier.conf b/weechat/rmodifier.conf index c75a0e2..c454770 100644 --- a/weechat/rmodifier.conf +++ b/weechat/rmodifier.conf @@ -1,5 +1,5 @@ # -# rmodifier.conf -- weechat v0.4.2 +# rmodifier.conf -- weechat v0.4.3 # [look] diff --git a/weechat/script.conf b/weechat/script.conf index d29e7e2..91b5a95 100644 --- a/weechat/script.conf +++ b/weechat/script.conf @@ -1,5 +1,5 @@ # -# script.conf -- weechat v0.4.2 +# script.conf -- weechat v0.4.3 # [look] diff --git a/weechat/sec.conf b/weechat/sec.conf index 838efac..527627f 100644 --- a/weechat/sec.conf +++ b/weechat/sec.conf @@ -1,5 +1,5 @@ # -# sec.conf -- weechat v0.4.2 +# sec.conf -- weechat v0.4.3 # [crypt] diff --git a/weechat/weechat.conf b/weechat/weechat.conf index 375ef17..587b148 100644 --- a/weechat/weechat.conf +++ b/weechat/weechat.conf @@ -1,5 +1,5 @@ # -# weechat.conf -- weechat v0.4.2 +# weechat.conf -- weechat v0.4.3 # [debug] @@ -17,7 +17,13 @@ bar_more_down = "▼" bar_more_left = "◀" bar_more_right = "▶" bar_more_up = "▲" +buffer_auto_renumber = on buffer_notify_default = all +buffer_position = end +buffer_search_case_sensitive = off +buffer_search_force_default = off +buffer_search_regex = off +buffer_search_where = message buffer_time_format = "${253}%H:${245}%M:%S" color_basic_force_bold = off color_inactive_buffer = off @@ -57,6 +63,7 @@ input_share = none input_share_overwrite = off input_undo_max = 32 item_buffer_filter = "•" +item_buffer_zoom = "!" item_time_format = "%H:%M" jump_current_to_previous_buffer = on jump_previous_buffer_when_closing = on @@ -96,10 +103,12 @@ scroll_page_percent = 100 search_text_not_found_alert = on separator_horizontal = "=" separator_vertical = "" -set_title = on +tab_width = 1 time_format = "%a, %d %b %Y %T" +window_auto_zoom = off window_separator_horizontal = on window_separator_vertical = on +window_title = "WeeChat ${info:version}" [palette] diff --git a/weechat/xfer.conf b/weechat/xfer.conf index 8f0f551..29e6680 100644 --- a/weechat/xfer.conf +++ b/weechat/xfer.conf @@ -1,5 +1,5 @@ # -# xfer.conf -- weechat v0.4.2 +# xfer.conf -- weechat v0.4.3 # [look] @@ -30,6 +30,7 @@ timeout = 300 auto_accept_chats = off auto_accept_files = off auto_accept_nicks = "" +auto_check_crc32 = off auto_rename = on auto_resume = on convert_spaces = on -- 2.49.0 From 7e9e852a934ba42a26ded1c0adfed29577c7e5a9 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Thu, 10 Apr 2014 00:44:59 +0100 Subject: [PATCH 16/16] =?utf8?q?xkb:=20add=20=C2=A3=20to=20L3Shift+P?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- xkb/symbols/dvorak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xkb/symbols/dvorak b/xkb/symbols/dvorak index 94ba439..42b173c 100644 --- a/xkb/symbols/dvorak +++ b/xkb/symbols/dvorak @@ -21,7 +21,7 @@ xkb_symbols "default" { //{{{1 key { [ apostrophe, quotedbl, dead_acute, dead_diaeresis ] }; key { [ comma, less, dead_cedilla, dead_caron ] }; key { [ period, greater, dead_abovedot, periodcentered ] }; - key { [ p, P ] }; + key { [ p, P, sterling, sterling ] }; key { [ y, Y ] }; key { [ f, F ] }; key { [ g, G ] }; -- 2.49.0