From: Samir Benmendil Date: Sat, 1 Apr 2017 17:48:19 +0000 (+0100) Subject: Merge branch 'cadscan' (early part) X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/172cfbb4b15794f9dd12a4531e6ba6b8f0edbb2a?hp=2dae4f7a2e681fc9e06d0771e50f4876a93c1dbc Merge branch 'cadscan' (early part) --- diff --git a/qutebrowser/quickmarks b/qutebrowser/quickmarks index 8b13789..e69de29 100644 --- a/qutebrowser/quickmarks +++ b/qutebrowser/quickmarks @@ -1 +0,0 @@ - diff --git a/qutebrowser/qutebrowser.conf b/qutebrowser/qutebrowser.conf index a68065e..d1c56d3 100644 --- a/qutebrowser/qutebrowser.conf +++ b/qutebrowser/qutebrowser.conf @@ -923,7 +923,7 @@ webgl = true css-regions = true hyperlink-auditing = false geolocation = ask -notifications = ask +notifications = false media-capture = ask javascript-can-open-windows-automatically = false javascript-can-close-windows = false @@ -1020,7 +1020,7 @@ border = 1px solid #E3BE23 mode = letter chars = aoeuidhtns min-chars = 2 -scatter = true +scatter = false uppercase = true dictionary = /usr/share/dict/words auto-follow = unique-match @@ -1057,6 +1057,7 @@ cv = http://docs.opencv.org/3.1.0/index.html#gsc.tab=0&gsc.ref=more%3A3.1&gsc.q= quit = close q = close exit = quit +mpv = spawn --userscript ~/src/qutebrowser/misc/userscripts/view_in_mpv [colors] # Colors used in the UI. diff --git a/systemd/user/ssh-agent.service b/systemd/user/ssh-agent.service index 08b7dcb..df24fe9 100644 --- a/systemd/user/ssh-agent.service +++ b/systemd/user/ssh-agent.service @@ -3,7 +3,7 @@ Description=SSH key agent [Service] Type=forking -Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket +PassEnvironment=SSH_AUTH_SOCK ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK -t 1h [Install] diff --git a/vim/ftplugin/cpp.vim b/vim/ftplugin/cpp.vim index 7631f49..faa7395 100644 --- a/vim/ftplugin/cpp.vim +++ b/vim/ftplugin/cpp.vim @@ -21,9 +21,35 @@ augroup fswitch au BufEnter *.cpp let b:fswitchlocs = 'reg:|source|include/**|' augroup END +let g:switch_const_definitions = + \ [ { + \ '\%(const \)\@!\([[:alnum:]_:<>]\{-}\) \%(&\)\@!': 'const \1 ', + \ 'const \([[:alnum:]_:<>]\{-}\) &\@!': 'const \1 &' , + \ 'const \([[:alnum:]_:<>]\{-}\) &': '\1 ' + \ } ] + +nnoremap c :call switch#Switch(g:switch_const_definitions, {}) + nnoremap gd :YcmCompleter GoTo nnoremap d :vs:YcmCompleter GoTo +" format with = +map = (operator-clang-format) +vnoremap = :ClangFormat +" restore = mapping to g= +nnoremap g= = +vnoremap g= = + +setlocal errorformat= +setlocal errorformat+=%f:%l:%c:\ %trror:\ %m +setlocal errorformat+=%f:%l:%c:\ %tarning:\ %m +setlocal errorformat+=%D%*\\a[%*\\d]:\ Entering\ directory\ [`']%f' +setlocal errorformat+=%X%*\\a[%*\\d]:\ Leaving\ directory\ [`']%f' +setlocal errorformat+=%D%*\\a:\ Entering\ directory\ [`']%f' +setlocal errorformat+=%X%*\\a:\ Leaving\ directory\ [`']%f' +setlocal errorformat+=%*[^[]\[%tRROR\]%m\ \[%f:%l\] +setlocal errorformat+=%*[^[]\[%tARNING\]%m\ \[%f:%l\] + setlocal foldmethod=syntax " set foldlevel according to number of matches of 'namespace' and 'class' not " containing ';' diff --git a/vim/indent/cpp.vim b/vim/indent/cpp.vim index 87f2adb..d363553 100644 --- a/vim/indent/cpp.vim +++ b/vim/indent/cpp.vim @@ -58,3 +58,5 @@ endfunction setlocal indentexpr=GoogleCppIndent() let b:undo_indent = "setl sw< ts< sts< et< tw< wrap< cin< cino< inde<" + +setlocal textwidth=100 diff --git a/vim/ultisnips/cpp.snippets b/vim/ultisnips/cpp.snippets index c98a71b..f105362 100644 --- a/vim/ultisnips/cpp.snippets +++ b/vim/ultisnips/cpp.snippets @@ -55,9 +55,16 @@ endsnippet # # Qt # +global !p +def align(base, a, pad=' '): + amount = abs(len(base) - len(a)) + return amount * pad if len(base) < len(a) else '' +endglobal + snippet connect "Qt connect()" b -connect(${1:this}, SIGNAL(${2:signal()}), - ${3:this}, SLOT(${4:slot()})); +connect(${1:this}, `!p snip.rv = align(t[1],t[3])`&${2:class::function}, + ${3:this}, `!p snip.rv = align(t[3],t[1])`&${4:class::function}); +${0} endsnippet snippet connectl "Qt connect() lambda" b diff --git a/vim/vimrc b/vim/vimrc index f1dc3f8..8409f10 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -69,6 +69,8 @@ Plugin 'ompugao/ctrlp-ros' Plugin 'vim-latex/vim-latex' Plugin 'alx741/vinfo' Plugin 'derekwyatt/vim-protodef' +Plugin 'ram-z/vim-clang-format' +Plugin 'sgeb/vim-diff-fold' " needs editing colorscheme " Plugin 'jeaye/color_coded' " Check LucHermites plugins: https://github.com/LucHermitte/lh-cpp @@ -216,8 +218,8 @@ set foldlevelstart=0 " value for 'foldlevel' when starting to edit a " open folds when jumping to line set foldopen+=jump -" save and restore folds -set viewoptions=cursor " only save cursor position +set viewoptions=cursor " save cursor position +set viewoptions+=folds " save folds " diff mode {{{2 set diffopt+=filler " show filler lines @@ -476,7 +478,7 @@ nnoremap [oe :set expandtab nnoremap ]oe :set noexpandtab for idt in range(1,8) - exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'' + exe 'nnoremap co'.idt.' :setlocal tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'' endfor " toggle auto format of text diff --git a/zsh/lib/envoy.zsh b/zsh/lib/envoy.zsh deleted file mode 100644 index f0ccb56..0000000 --- a/zsh/lib/envoy.zsh +++ /dev/null @@ -1,9 +0,0 @@ -# Return if requirements are not found. -if (( ! $+commands[envoy] )); then - return 1 -fi - -if ! envoy -l >/dev/null ; then - alias ssh='envoy -a && unalias ssh; ssh' -fi -source <(envoy -p) diff --git a/zshenv b/zshenv index b3ce2e5..b161335 100644 --- a/zshenv +++ b/zshenv @@ -7,13 +7,16 @@ export HOST=$(hostname) # gpg export GNUPGHOME="$XDG_CONFIG_HOME/gnupg" +# ssh +export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" if hash systemctl 2>/dev/null; then systemctl --user import-environment \ XDG_CACHE_HOME \ XDG_CONFIG_HOME \ XDG_DATA_HOME \ - GNUPGHOME + GNUPGHOME \ + SSH_AUTH_SOCK fi # vim stuff