configs
This commit is contained in:
22
google/.hgrc
22
google/.hgrc
@ -8,8 +8,13 @@ username = Christian Nieves <cnieves@google.com>
|
|||||||
# graphnodetemplate = {label("graphnode.{graphnode}", graphnode)}
|
# graphnodetemplate = {label("graphnode.{graphnode}", graphnode)}
|
||||||
|
|
||||||
[extdiff]
|
[extdiff]
|
||||||
|
icdiff = icdiff --recursive --line-numbers
|
||||||
cmd.meld = /usr/bin/meld
|
cmd.meld = /usr/bin/meld
|
||||||
cmd.pmeld = /usr/bin/meld
|
cmd.pmeld = /usr/bin/meld
|
||||||
|
cmd.vimdiff = nvim
|
||||||
|
_real_multidiff = hg-multi-diff
|
||||||
|
# opts.vimdiff = -d $base $local $output $other +close +close
|
||||||
|
# opts.vimdiff = -f '+next' '+execute "DirDiff" fnameescape(argv(0)) fnameescape(argv(1))'
|
||||||
|
|
||||||
[extensions]
|
[extensions]
|
||||||
unsupported.tree =
|
unsupported.tree =
|
||||||
@ -29,6 +34,10 @@ vimdiff.executable = nvim
|
|||||||
vimdiff.args = -f -d $output -M $local $base $other -c "wincmd J" -c "set modifiable" -c "set write"
|
vimdiff.args = -f -d $output -M $local $base $other -c "wincmd J" -c "set modifiable" -c "set write"
|
||||||
vimdiff.premerge = keep
|
vimdiff.premerge = keep
|
||||||
|
|
||||||
|
[diff-tools]
|
||||||
|
vimdiff.executable = nvim
|
||||||
|
vimdiff.args = -d $base $local $output $other +close +close
|
||||||
|
|
||||||
[committemplate]
|
[committemplate]
|
||||||
changeset = {desc}\n\n
|
changeset = {desc}\n\n
|
||||||
HG: {extramsg}
|
HG: {extramsg}
|
||||||
@ -40,11 +49,24 @@ changeset = {desc}\n\n
|
|||||||
{splitlines(diff()) % 'HG: {line}\n'}
|
{splitlines(diff()) % 'HG: {line}\n'}
|
||||||
|
|
||||||
[alias]
|
[alias]
|
||||||
|
dt = icdiff --pager=on
|
||||||
|
dtex = dt -r exported(.)
|
||||||
|
dtp4 = dt -r p4base
|
||||||
|
dtup = dt -r .^
|
||||||
|
|
||||||
whatsout = status -n --change . --template=hgshort_status
|
whatsout = status -n --change . --template=hgshort_status
|
||||||
what = status -n --change . --template=hgshort_status
|
what = status -n --change . --template=hgshort_status
|
||||||
whatsoutall = status --rev p4base --no-status --template=hgshort_status
|
whatsoutall = status --rev p4base --no-status --template=hgshort_status
|
||||||
# unbranch = cp --forget --at-rev . $1
|
# unbranch = cp --forget --at-rev . $1
|
||||||
unbranch = !$HG uncommit --keep $1 && $HG forget $1 && $HG add $1 && $HG amend $1
|
unbranch = !$HG uncommit --keep $1 && $HG forget $1 && $HG add $1 && $HG amend $1
|
||||||
|
g3docpreview = ! $HG status --rev p4base --no-status -I re:.*\.md$ | xargs -I PATH -n 1 echo "https://g3doc.corp.google.com/PATH?cl=$(citctools info | grep Workspace.ID | cut '-d ' -f 3)"
|
||||||
|
|
||||||
|
mdiff = ! HG_ROOT=$(hg root) hg _real_multidiff "$@"
|
||||||
|
# For some reason, aliases that reuse mdiff don't work, so the
|
||||||
|
# entire thing has to be copied.
|
||||||
|
mdiffp4 = ! HG_ROOT=$(hg root) hg _real_multidiff --rev p4base "$@"
|
||||||
|
mdiffup = ! HG_ROOT=$(hg root) hg _real_multidiff --rev .^ "$@"
|
||||||
|
|
||||||
[trainingwheels]
|
[trainingwheels]
|
||||||
warn-head-paths=False
|
warn-head-paths=False
|
||||||
|
prevent-push-dirty=false
|
||||||
|
24
scripts/scripts/hg-multi-diff
Executable file
24
scripts/scripts/hg-multi-diff
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
left=$2
|
||||||
|
right=$1
|
||||||
|
prefix=
|
||||||
|
# The directory name format seems to be the $repo[.$hash],
|
||||||
|
# where the hash is optional if we're comparing to the working directory
|
||||||
|
if [[ -d "$left" && "$right" != *.* ]]; then
|
||||||
|
prefix=$(dirname $HG_ROOT)/
|
||||||
|
fi
|
||||||
|
if [ -n "$DISPLAY" ]; then
|
||||||
|
meld_arg="--diff "
|
||||||
|
fi
|
||||||
|
# "#" is used as the pattern delimiter because paths might start with "/",
|
||||||
|
# which would create an invalid pattern.
|
||||||
|
files=$(find $left $right -type f | sed -e "s#^$left\/##" -e "s#^$right\/##" \
|
||||||
|
| sort | uniq | xargs -I{} -n 1 echo $left/{} $right/{} \
|
||||||
|
| awk -v pre=$prefix -v meld_arg="$meld_arg" \
|
||||||
|
'{ print meld_arg $1 " " pre $2 }')
|
||||||
|
if [ -z "$DISPLAY" ]; then
|
||||||
|
exec vimdiff-multi $files
|
||||||
|
else
|
||||||
|
# pass $@ so that the left-most tab is a directory tree tab.
|
||||||
|
meld --diff "$@" $files
|
||||||
|
fi
|
9
scripts/scripts/vimdiff-multi
Executable file
9
scripts/scripts/vimdiff-multi
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Like gvimdiff, but can diff multiple pairs of files.
|
||||||
|
cmd='nvim'
|
||||||
|
exec $cmd -R -f \
|
||||||
|
-c 'silent call TabMultiDiff()' \
|
||||||
|
-c 'tabdo windo set nofoldenable foldcolumn=0' \
|
||||||
|
-c 'tabfirst' \
|
||||||
|
"$@"
|
@ -9,6 +9,10 @@ set -g mouse off
|
|||||||
set -g prefix `
|
set -g prefix `
|
||||||
bind-key ` send-prefix
|
bind-key ` send-prefix
|
||||||
|
|
||||||
|
# Hide pane with Prefix-h
|
||||||
|
bind-key h break-pane -d -n _hidden_pane
|
||||||
|
bind-key H join-pane -s $.1
|
||||||
|
|
||||||
# Tick -> Ctrl-A, sets prefix to Ctrl-A
|
# Tick -> Ctrl-A, sets prefix to Ctrl-A
|
||||||
bind-key C-a set-option -g prefix C-a
|
bind-key C-a set-option -g prefix C-a
|
||||||
|
|
||||||
@ -27,8 +31,10 @@ set-option -g base-index 1
|
|||||||
set-window-option -g pane-base-index 1
|
set-window-option -g pane-base-index 1
|
||||||
|
|
||||||
# enable OSC 52 clipboard
|
# enable OSC 52 clipboard
|
||||||
set -s set-clipboard external
|
set -as terminal-overrides ',tmux*:Ms=\\E]52;%p1%s;%p2%s\\007'
|
||||||
set-option -ag terminal-overrides ",xterm-256color:Ms=\\E]52;c;%p2%s\\7"
|
set -as terminal-overrides ',screen*:Ms=\\E]52;%p1%s;%p2%s\\007'
|
||||||
|
set -s set-clipboard on
|
||||||
|
set -g @thumbs-osc52 '1'
|
||||||
|
|
||||||
# tmux-256color instead of screen-256color enables italics
|
# tmux-256color instead of screen-256color enables italics
|
||||||
set -g default-terminal "tmux-256color"
|
set -g default-terminal "tmux-256color"
|
||||||
|
@ -3,7 +3,7 @@ name: dev
|
|||||||
|
|
||||||
windows:
|
windows:
|
||||||
- gmscore:
|
- gmscore:
|
||||||
layout: main-vertical
|
layout: main-horizontal
|
||||||
panes:
|
panes:
|
||||||
- main:
|
- main:
|
||||||
- hgd gmscore
|
- hgd gmscore
|
||||||
@ -12,7 +12,7 @@ windows:
|
|||||||
- hgd gmscore
|
- hgd gmscore
|
||||||
|
|
||||||
- experimental:
|
- experimental:
|
||||||
layout: main-vertical
|
layout: main-horizontal
|
||||||
panes:
|
panes:
|
||||||
- main:
|
- main:
|
||||||
- hgd experimental
|
- hgd experimental
|
||||||
@ -26,7 +26,7 @@ windows:
|
|||||||
- cd ~/zettelkasten
|
- cd ~/zettelkasten
|
||||||
- vim ~/zettelkasten/Todo.md
|
- vim ~/zettelkasten/Todo.md
|
||||||
- dotfiles:
|
- dotfiles:
|
||||||
layout: main-vertical
|
layout: main-horizontal
|
||||||
panes:
|
panes:
|
||||||
- main:
|
- main:
|
||||||
- cd ~/dotfiles
|
- cd ~/dotfiles
|
||||||
|
@ -1,3 +1,2 @@
|
|||||||
vim.keymap.set('n', '<leader>y', require('osc52').copy_operator, {expr = true})
|
vim.keymap.set('n', '<leader>y', require('osc52').copy_operator, {expr = true})
|
||||||
vim.keymap.set('n', '<leader>yy', '<leader>c_', {remap = true})
|
|
||||||
vim.keymap.set('v', '<leader>y', require('osc52').copy_visual)
|
vim.keymap.set('v', '<leader>y', require('osc52').copy_visual)
|
||||||
|
@ -20,6 +20,7 @@ require('packer').startup(function(use)
|
|||||||
use 'wbthomason/packer.nvim'
|
use 'wbthomason/packer.nvim'
|
||||||
use 'lewis6991/impatient.nvim'
|
use 'lewis6991/impatient.nvim'
|
||||||
use 'dstein64/vim-startuptime'
|
use 'dstein64/vim-startuptime'
|
||||||
|
use 'will133/vim-dirdiff'
|
||||||
|
|
||||||
-- use {
|
-- use {
|
||||||
-- 'google/vim-glaive',
|
-- 'google/vim-glaive',
|
||||||
|
@ -174,7 +174,7 @@ nnoremap <leader>po :PiperOpenPath<CR>
|
|||||||
|
|
||||||
nmap <leader>rbs ss <leader>rb
|
nmap <leader>rbs ss <leader>rb
|
||||||
|
|
||||||
nmap <leader>yb :let @" = join(blaze#GetTargets(), ' ')<cr>
|
nmap <leader>yb :let @+ = join(blaze#GetTargets(), ' ')<cr>
|
||||||
|
|
||||||
Glug corpweb
|
Glug corpweb
|
||||||
nnoremap <leader>csw :CorpWebCsFile<cr>
|
nnoremap <leader>csw :CorpWebCsFile<cr>
|
||||||
|
@ -102,7 +102,7 @@ vnoremap <leader>c<Space> :call nerdcommenter#Comment(0,"toggle")<CR>
|
|||||||
nnoremap <leader>c$ :call nerdcommenter#Comment(0,"ToEOL")<CR>
|
nnoremap <leader>c$ :call nerdcommenter#Comment(0,"ToEOL")<CR>
|
||||||
vnoremap <leader>c$ :call nerdcommenter#Comment(0,"ToEOL")<CR>
|
vnoremap <leader>c$ :call nerdcommenter#Comment(0,"ToEOL")<CR>
|
||||||
|
|
||||||
nmap <leader>yf :let @" = expand("%")<cr>
|
nmap <leader>yf :let @+ = expand("%")<cr>
|
||||||
nmap <leader>ut :UndotreeToggle<cr>
|
nmap <leader>ut :UndotreeToggle<cr>
|
||||||
nmap <leader>e :e %%
|
nmap <leader>e :e %%
|
||||||
|
|
||||||
|
34
vim/.vimrc
34
vim/.vimrc
@ -180,4 +180,38 @@ let g:loaded_netrwPlugin = 1
|
|||||||
let g:loaded_tutor_mode_plugin = 1
|
let g:loaded_tutor_mode_plugin = 1
|
||||||
let g:loaded_remote_plugins = 1
|
let g:loaded_remote_plugins = 1
|
||||||
|
|
||||||
|
|
||||||
|
" Permanent "very magic" mode
|
||||||
|
nnoremap / /\v
|
||||||
|
vnoremap / /\v
|
||||||
|
cnoremap %s/ %smagic/
|
||||||
|
cnoremap \>s/ \>smagic/
|
||||||
|
nnoremap :g/ :g/\v
|
||||||
|
nnoremap :g// :g//
|
||||||
|
|
||||||
|
function! TabMultiDiff()
|
||||||
|
let s:tab_multi_diff = 0
|
||||||
|
argdo call s:AddBufferToTab()
|
||||||
|
tabclose
|
||||||
|
endfun
|
||||||
|
|
||||||
|
" Helper function used by TabMultiDiff(). Adds current buffer to new tab
|
||||||
|
" or last tab as appropriate, and sets new window's "diff" option.
|
||||||
|
function! s:AddBufferToTab()
|
||||||
|
let buf = bufnr("%")
|
||||||
|
if s:tab_multi_diff
|
||||||
|
tablast
|
||||||
|
vsplit
|
||||||
|
wincmd w
|
||||||
|
else
|
||||||
|
tab split
|
||||||
|
tabmove
|
||||||
|
endif
|
||||||
|
let s:tab_multi_diff = ! s:tab_multi_diff
|
||||||
|
exe 'b ' . buf
|
||||||
|
diffthis
|
||||||
|
tabfirst
|
||||||
|
endfun
|
||||||
|
|
||||||
lua require("plugins")
|
lua require("plugins")
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ export XAUTHORITY=~/.Xauthority
|
|||||||
export GOROOT=/usr/lib/google-golang
|
export GOROOT=/usr/lib/google-golang
|
||||||
export PATH=$GOROOT/bin:$PATH
|
export PATH=$GOROOT/bin:$PATH
|
||||||
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
|
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
|
||||||
|
source /google/bin/releases/knock/knock.sh
|
||||||
|
|
||||||
function gcert() {
|
function gcert() {
|
||||||
if [[ -n $TMUX ]]; then
|
if [[ -n $TMUX ]]; then
|
||||||
@ -16,6 +17,7 @@ function gcert() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
command gcert "$@"
|
command gcert "$@"
|
||||||
|
source /google/bin/releases/knock/knock.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
function tmux_title() {
|
function tmux_title() {
|
||||||
|
@ -13,7 +13,7 @@ autoload -Uz add-zsh-hook
|
|||||||
add-zsh-hook chpwd g3path::hook
|
add-zsh-hook chpwd g3path::hook
|
||||||
|
|
||||||
g3path::zle::accept-line () {
|
g3path::zle::accept-line () {
|
||||||
if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui|builddoctor|unused_deps|clipper) ]]; then
|
if [[ -n $GOOGLE3_ROOT && ! $BUFFER =~ \\s*(blaze|g4|p4|g4d|add_dep|buildozer|build_cleaner|debug_android_lint|rabbit|hb|gqui|builddoctor|unused_deps|clipper|blaze_lint_refactoring) ]]; then
|
||||||
BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/}
|
BUFFER=${BUFFER// \/\// $GOOGLE3_ROOT\/}
|
||||||
fi
|
fi
|
||||||
zle .accept-line
|
zle .accept-line
|
||||||
|
Reference in New Issue
Block a user