]> git.rmz.io Git - dotfiles.git/commitdiff
Merge branch 'cadscan' (early part)
authorSamir Benmendil <me@rmz.io>
Sat, 1 Apr 2017 17:48:19 +0000 (18:48 +0100)
committerSamir Benmendil <me@rmz.io>
Sat, 1 Apr 2017 18:00:16 +0000 (19:00 +0100)
qutebrowser/quickmarks
qutebrowser/qutebrowser.conf
systemd/user/ssh-agent.service
vim/ftplugin/cpp.vim
vim/indent/cpp.vim
vim/ultisnips/cpp.snippets
vim/vimrc
zsh/lib/envoy.zsh [deleted file]
zshenv

index 8b137891791fe96927ad78e64b0aad7bded08bdc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-
index a68065e7f0ab47b3d6c1f15e3c263a5a9d85adb7..d1c56d30f2ac60d466176194cb58f712f8b53cf5 100644 (file)
@@ -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.
index 08b7dcb76ad7d1aa3ffd57f88cdfa70ffd435cfc..df24fe9fa7cb636378584fc25f5c5564177a25ba 100644 (file)
@@ -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]
index 7631f49a966d5f5268b84e008f1f657ea7cd3a52..faa7395e7366cc2ec9924b413aea94c1ee6e4952 100644 (file)
@@ -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 <buffer> <leader>c :call switch#Switch(g:switch_const_definitions, {})<cr>
+
 nnoremap <buffer> gd :YcmCompleter GoTo<CR>
 nnoremap <buffer> <C-W>d :vs<CR>:YcmCompleter GoTo<CR>
 
+" format with =
+map <buffer> = <Plug>(operator-clang-format)
+vnoremap <buffer> = :ClangFormat<CR>
+" restore = mapping to g=
+nnoremap <buffer>g= =
+vnoremap <buffer>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 ';'
index 87f2adb79f2933bcbbed9276c6b943f70e0bdd7b..d36355318d88aff48977baf5f860c1c7ad44fb80 100644 (file)
@@ -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
index c98a71b6c2f3406ee5c213b497f905d84427846b..f1053621d489d200cf4a4b64674b1133077e9d0a 100644 (file)
@@ -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
index f1dc3f8966578b283ef9e4ec2b6713e6428b87d0..8409f105aa3fd4482096f1daa87108dad5fee16b 100644 (file)
--- 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<CR>
 nnoremap ]oe :set noexpandtab<CR>
 
 for idt in range(1,8)
-  exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'<CR>'
+  exe 'nnoremap co'.idt.' :setlocal tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'<CR>'
 endfor
 
 " toggle auto format of text
diff --git a/zsh/lib/envoy.zsh b/zsh/lib/envoy.zsh
deleted file mode 100644 (file)
index f0ccb56..0000000
+++ /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 b3ce2e5ee2be18853e34b65c5b9bba733620adb2..b161335c19f289bb6a6f53f19e93100f3d90ece9 100644 (file)
--- 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