mirror of
https://github.com/chylex/dotfiles.git
synced 2025-09-14 18:32:10 +02:00
Compare commits
127 Commits
9ed9296f00
...
main
Author | SHA1 | Date | |
---|---|---|---|
d76b82721d
|
|||
580a47aa9b
|
|||
946f464aca
|
|||
1e5c7a752e
|
|||
c1fac762be
|
|||
8cd0b37833
|
|||
5cbaf5587d
|
|||
7b5bbf7bb7
|
|||
6d1840a48c
|
|||
4a77b0588b
|
|||
a9bfe13277
|
|||
be2bdafe78
|
|||
cda970bfc2
|
|||
80e5b074c9
|
|||
60cb335c9a
|
|||
78866848be
|
|||
f69bb44bfa
|
|||
6c4c99a98d
|
|||
0023b10571
|
|||
4fa0da63e8
|
|||
eb54e7d636
|
|||
2a8dbc57ec
|
|||
713fb10dab
|
|||
ca8bc186b2
|
|||
534ea4a4f1
|
|||
2aebc2deeb
|
|||
c83891317f
|
|||
5ce16f984f
|
|||
83d12be425
|
|||
c0c7eccc1d
|
|||
abc7112e75
|
|||
21e38d0d08
|
|||
a43aae61e8
|
|||
c9c9c0223e
|
|||
a3c4fe7259
|
|||
67c485da65
|
|||
62edd5222d
|
|||
1aa9bde933
|
|||
0bcdaaa077
|
|||
9fa73b1ba8
|
|||
e7dca24993
|
|||
ac9b1d4248
|
|||
41840c7b33
|
|||
939134dc49
|
|||
1bc97f78b6
|
|||
6681099e47
|
|||
0903e926bb
|
|||
14aa43ede4
|
|||
cab52d34b1
|
|||
4203b6e583
|
|||
af2f87c518
|
|||
daea01656e
|
|||
35ba420d83
|
|||
f66f0990ff
|
|||
96e832c9cc
|
|||
7ca80f443f
|
|||
19d10e7428
|
|||
e0b0194256
|
|||
b739008bc5
|
|||
3c66f4c85b
|
|||
bd5fb52aa7
|
|||
8a7a591d68
|
|||
7ebb930f0b
|
|||
61f69a7774
|
|||
6c62422353
|
|||
1d9efca953
|
|||
6ac6c169fa
|
|||
dc68b2d2a0
|
|||
8dcd87f989
|
|||
d1e531074c
|
|||
50312ccf3b
|
|||
28098843d2
|
|||
01e92b8cb2
|
|||
ea590d93c1
|
|||
3286d65e8d
|
|||
f700848658
|
|||
adcaeb0403
|
|||
54284be64b
|
|||
f271ae0d8f
|
|||
014763826f
|
|||
40748c3c68
|
|||
2368dc86c4
|
|||
3fe3a9a285
|
|||
14691e4ed9
|
|||
3b7145539e
|
|||
df3e108327
|
|||
db429b3b30
|
|||
569dc0caad
|
|||
8a5da89d0f
|
|||
2bd9758639
|
|||
9efdf74626
|
|||
c31dbc308a
|
|||
63cd476e43
|
|||
309f33a2e3
|
|||
d0081f9b33
|
|||
fc96fddb47
|
|||
9c3436171e
|
|||
02d4e45ed4
|
|||
0d55252227 | |||
e491daeaa1
|
|||
f197f922c6
|
|||
97a510183b
|
|||
58ab227487
|
|||
e50a78f38e
|
|||
2b7e748001
|
|||
f60e9d76fa
|
|||
ecd3b7374d
|
|||
cad038a9a8
|
|||
d244919999
|
|||
4e08e27e09
|
|||
0b1d1ecc80
|
|||
2ac125eb0a
|
|||
98c756df22
|
|||
8c84026cec
|
|||
4a7829a42e
|
|||
b29a2b5605
|
|||
665ef0de23
|
|||
3be83cb6f7
|
|||
8cfde1c326
|
|||
8730db6914
|
|||
0c50bbe9b0
|
|||
1e1c0fe8e9 | |||
1bfafefa5c
|
|||
4e1fea15bb
|
|||
530f74d01b | |||
672a78d3b1 | |||
12e6f5d9d1 |
58
.bashrc
58
.bashrc
@@ -1,14 +1,66 @@
|
||||
alias lsa='ls -l -v --all --human-readable --color=auto'
|
||||
alias gh='history|grep'
|
||||
|
||||
bind "set completion-ignore-case on"
|
||||
bind "set show-all-if-ambiguous on"
|
||||
|
||||
bind '"\e[A": history-search-backward'
|
||||
bind '"\e[B": history-search-forward'
|
||||
|
||||
alias gh='history|grep'
|
||||
alias less='less -R --mouse'
|
||||
alias zless='zless -R --mouse'
|
||||
alias lsa='ls -l -v --all --human-readable --group-directories-first --color=auto'
|
||||
alias vim='vim -p'
|
||||
|
||||
alias d='docker'
|
||||
alias dc='docker compose'
|
||||
alias dcud='docker compose up -d'
|
||||
alias dcul='docker compose up -d && docker compose logs -f'
|
||||
|
||||
function dupdate() { docker compose build --pull && docker compose pull && docker compose up -d; }
|
||||
function dprune() { docker system prune --all --volumes --force; }
|
||||
|
||||
function dlogs() { docker logs $1 2>&1; }
|
||||
function ddebug() { docker run --rm -it --entrypoint "/bin/$2" "$1"; }
|
||||
function dbash() { docker exec -it "$1" /bin/bash; }
|
||||
function dsh() { docker exec -it "$1" /bin/sh; }
|
||||
|
||||
function dname() { docker ps -af "id=$1" --format '{{.Image}}' | tail -n -1; }
|
||||
function dtop() { docker top $1 axo user:30,pid,pcpu,pmem,vsz,rss,tty,stat,start,time,comm; }
|
||||
function dtopall() { for c in $(docker ps -q); do docker inspect $c -f "{{ .Name }}:"; docker top $c axo user:30,pid,comm | tail -n +2; echo "--------------"; done; }
|
||||
function dsubnets() { docker network inspect $(docker network ls | awk '$3 == "bridge" { print $1 }') | jq -r '.[] | .Name + " " + .IPAM.Config[0].Subnet' -; }
|
||||
function dmemlimit() { docker stats --no-stream --format "{{.MemUsage}}" | awk '{print $3}' | sort | sed 's/.$//' | numfmt --from=iec-i | awk '{s+=$1} END {printf "%.0f\n", s}' | numfmt --to=iec --format="%.3f"; }
|
||||
|
||||
function ssh() {
|
||||
if [ -n "${TMUX_PANE}" ]; then
|
||||
tmux rename-window -t"${TMUX_PANE}" "$*"
|
||||
command ssh "$@"
|
||||
tmux set-window-option automatic-rename "on"
|
||||
else
|
||||
command ssh "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
function borgsize() {
|
||||
printf 'Archive\t\t\tOrig\tComp\tDedup\n'
|
||||
printf '%-16.16s\t%s\t%s\t%s\n' $(borg info --json --sort-by name --glob-archives '*' "$1" | jq '.archives[] | "\(.name) \(.stats.original_size) \(.stats.compressed_size) \(.stats.deduplicated_size)"' | sed --expression='s/^"//;s/"$//' | numfmt --field='2-4' --to=iec)
|
||||
}
|
||||
|
||||
function convflac() {(
|
||||
set -e
|
||||
for f in *."$1"; do
|
||||
n="${f%.*}"
|
||||
ffmpeg -i "$n.$1" -compression_level 12 "$n.flac"
|
||||
exiftool -TagsFromFile "$n.$1" "-all:all>all:all" "$n.flac"
|
||||
done
|
||||
)}
|
||||
|
||||
export EDITOR=vim
|
||||
|
||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]'
|
||||
else
|
||||
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
|
||||
fi
|
||||
|
||||
if [ -x /usr/bin/tmux ] && [[ $- =~ i ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_TTY" ]]; then
|
||||
tmux new -A
|
||||
fi
|
||||
|
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* text=auto eol=lf
|
425
.ideavimrc
425
.ideavimrc
@@ -1,30 +1,99 @@
|
||||
set idearefactormode=visual
|
||||
set clipboard-=ideaput
|
||||
set hlsearch
|
||||
set ignorecase
|
||||
set incsearch
|
||||
set noerrorbells
|
||||
set number
|
||||
set nrformats-=octal
|
||||
set relativenumber
|
||||
set scrolloff=12
|
||||
set scrolloff=999
|
||||
set showcmd
|
||||
set showmode
|
||||
set sidescrolloff=48
|
||||
set sidescrolloff=999
|
||||
set smartcase
|
||||
set virtualedit=onemore
|
||||
set visualbell
|
||||
|
||||
set acejump
|
||||
set argtextobj
|
||||
set exchange
|
||||
set highlightedyank
|
||||
set ideajoin
|
||||
set matchit
|
||||
set multiple-cursors
|
||||
set ReplaceWithRegister
|
||||
set surround
|
||||
set textobj-entire
|
||||
set textobj-indent
|
||||
" Use WSL bash as shell
|
||||
if has('win32')
|
||||
set shell=bash.exe
|
||||
set shellcmdflag=-lic
|
||||
set shellxquote=
|
||||
endif
|
||||
|
||||
" http://vimdoc.sourceforge.net/htmldoc/vimindex.html
|
||||
" Configure IDEA settings (https://github.com/JetBrains/ideavim/wiki/set-commands)
|
||||
set ideajoin
|
||||
set idearefactormode=visual
|
||||
|
||||
" Configure IDE keybindings (https://github.com/JetBrains/ideavim/wiki/sethandler)
|
||||
sethandler <C-A> a:ide
|
||||
sethandler <C-B> a:ide
|
||||
sethandler <C-C> a:ide
|
||||
sethandler <C-E> a:ide
|
||||
sethandler <C-F> a:ide
|
||||
sethandler <C-G> a:ide
|
||||
sethandler <C-H> a:ide
|
||||
sethandler <C-I> a:ide
|
||||
sethandler <C-J> a:ide
|
||||
sethandler <C-K> a:ide
|
||||
sethandler <C-L> a:ide
|
||||
sethandler <C-M> a:ide
|
||||
sethandler <C-R> a:ide
|
||||
sethandler <C-S> a:ide
|
||||
sethandler <C-T> a:ide
|
||||
sethandler <C-V> a:ide
|
||||
sethandler <C-W> a:ide
|
||||
sethandler <C-X> a:ide
|
||||
sethandler <C-Y> a:ide
|
||||
sethandler <C-\> a:ide
|
||||
|
||||
sethandler <A-B> a:vim
|
||||
sethandler <A-H> a:vim
|
||||
sethandler <A-J> a:vim
|
||||
sethandler <A-K> a:vim
|
||||
sethandler <A-L> a:vim
|
||||
sethandler <A-N> a:vim
|
||||
sethandler <A-O> a:vim
|
||||
sethandler <A-P> a:vim
|
||||
sethandler <A-S-B> a:vim
|
||||
sethandler <A-S-H> a:vim
|
||||
sethandler <A-S-J> a:vim
|
||||
sethandler <A-S-K> a:vim
|
||||
sethandler <A-S-L> a:vim
|
||||
sethandler <A-S-O> a:vim
|
||||
sethandler <A-V> a:vim
|
||||
sethandler <A-X> a:vim
|
||||
sethandler <C-D> a:vim
|
||||
sethandler <C-I> a:vim
|
||||
sethandler <C-N> a:vim
|
||||
sethandler <C-O> a:vim
|
||||
sethandler <C-P> a:vim
|
||||
sethandler <C-S-W> a:vim
|
||||
sethandler <C-U> a:vim
|
||||
sethandler <S-BS> a:vim
|
||||
|
||||
sethandler <C-Left> a:vim
|
||||
sethandler <C-Right> a:vim
|
||||
sethandler <S-Left> a:vim
|
||||
sethandler <S-Right> a:vim
|
||||
|
||||
if &ide =~? 'rider'
|
||||
" These shortcuts are broken in Rider for some reason...
|
||||
sethandler <A-S-H> a:ide
|
||||
sethandler <A-S-L> a:ide
|
||||
endif
|
||||
|
||||
" Enable plugins (https://github.com/JetBrains/ideavim/wiki/IdeaVim-Plugins)
|
||||
Plug 'argtextobj.vim'
|
||||
Plug 'vim-exchange'
|
||||
Plug 'vim-highlightedyank'
|
||||
Plug 'vim-indent-object'
|
||||
Plug 'vim-matchit'
|
||||
Plug 'vim-multiple-cursors'
|
||||
Plug 'vim-paragraph-motion'
|
||||
Plug 'vim-surround'
|
||||
Plug 'vim-textobj-entire'
|
||||
|
||||
" https://vimhelp.org/index.txt.html
|
||||
|
||||
" Map top row on Czech keyboard layout to digits
|
||||
map + 1
|
||||
@@ -39,181 +108,219 @@ map í 9
|
||||
map é 0
|
||||
|
||||
" Move some commands closer on Czech keyboard layout
|
||||
noremap ů ;
|
||||
map § %
|
||||
map ů %
|
||||
nnoremap ú @@
|
||||
noremap , +
|
||||
|
||||
" Navigate to indents
|
||||
nnoremap J +
|
||||
vnoremap J +
|
||||
nnoremap K -
|
||||
vnoremap K -
|
||||
noremap § `
|
||||
noremap §§ ``
|
||||
nnoremap m§ m
|
||||
|
||||
sunmap ů
|
||||
sunmap §
|
||||
|
||||
" Enter visual block mode
|
||||
map <A-v> <C-v>
|
||||
|
||||
" Navigate camel humps
|
||||
noremap L [w
|
||||
noremap H [b
|
||||
nnoremap L [w
|
||||
vnoremap L [w
|
||||
nnoremap H [b
|
||||
vnoremap H [b
|
||||
|
||||
" Edit camel humps
|
||||
nnoremap dL :raction EditorDeleteToWordEndInDifferentHumpsMode<CR>
|
||||
nnoremap dH :raction EditorDeleteToWordStartInDifferentHumpsMode<CR>
|
||||
nmap dih dHdL " Only works in the middle of a hump
|
||||
nmap cL dLi
|
||||
nmap cH dHi
|
||||
nmap cih dihi
|
||||
" Navigate to end of previous word
|
||||
noremap <A-b> ge
|
||||
noremap <A-S-b> gE
|
||||
|
||||
" Navigate unmatched parentheses/braces
|
||||
noremap g( [(
|
||||
noremap g) ])
|
||||
noremap g{ [{
|
||||
noremap g} ]}
|
||||
|
||||
" Edit from cursor to start/end of parenthesized block
|
||||
nnoremap c) c])
|
||||
nnoremap d) d])
|
||||
nnoremap c( c[((
|
||||
nnoremap d( c[((<ESC>l
|
||||
nnoremap d( c[((<Esc>l
|
||||
|
||||
" Edit from cursor to end of special characters
|
||||
nnoremap c" ct"
|
||||
nnoremap d" dt"
|
||||
nnoremap c' ct'
|
||||
nnoremap d' dt'
|
||||
nnoremap c] ct]
|
||||
nnoremap d] dt]
|
||||
" Create lines
|
||||
nnoremap go o<Esc>$
|
||||
nnoremap gO O<Esc>$
|
||||
nnoremap g<CR> i<CR><Esc>l
|
||||
|
||||
" Alternative way to enter visual block mode
|
||||
nnoremap <Space>v <C-V>
|
||||
" Edit current line
|
||||
nnoremap C cc
|
||||
xnoremap C cc
|
||||
nnoremap D dd
|
||||
xnoremap D dd
|
||||
nnoremap < <<
|
||||
nnoremap > >>
|
||||
|
||||
" Indent keeping selection
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
vnoremap = =gv
|
||||
xnoremap < <gv
|
||||
xnoremap > >gv
|
||||
xnoremap = =gv
|
||||
|
||||
" Extend selection
|
||||
xmap x <Action>(EditorSelectWord)
|
||||
xmap X <Action>(EditorUnSelectWord)
|
||||
|
||||
" Turn capital letters into opposite actions
|
||||
nnoremap U :redo<CR>
|
||||
" nnoremap U :redo<CR> " Handled by custom version of IdeaVIM
|
||||
|
||||
" Reselect pasted text
|
||||
nnoremap gp `[v`]
|
||||
|
||||
" Put without yank
|
||||
xmap p gr
|
||||
xnoremap p P
|
||||
xnoremap P p
|
||||
|
||||
" Clear search highlights
|
||||
nnoremap <Esc> :nohlsearch<Return><Esc>
|
||||
|
||||
" Code completion
|
||||
if &ide !~? 'rider'
|
||||
imap <expr> ! pumvisible() ? '<Action>(EditorChooseLookupItem)<Esc>mzF.bi!<Esc>`zla' : '!'
|
||||
endif
|
||||
|
||||
" Show parameter info
|
||||
nmap <A-p> <Action>(ParameterInfo)
|
||||
imap <A-p> <Action>(ParameterInfo)
|
||||
|
||||
" Navigate back/forward
|
||||
map <BS> <Action>(Back)
|
||||
map <S-BS> <Action>(Forward)
|
||||
|
||||
" Navigate inspection highlights
|
||||
map ( <Action>(GotoPreviousError)
|
||||
map ) <Action>(GotoNextError)
|
||||
|
||||
" Navigate to previous/next method
|
||||
map [ <Action>(MethodUp)
|
||||
map ] <Action>(MethodDown)
|
||||
|
||||
" Navigate paragraphs at indentation
|
||||
map { <Plug>(ParagraphPrevMotion)$
|
||||
map } <Plug>(ParagraphNextMotion)$
|
||||
|
||||
" Move statement/element
|
||||
map <A-S-h> <Action>(MoveElementLeft)
|
||||
map <A-S-l> <Action>(MoveElementRight)
|
||||
|
||||
map <A-S-j> <Action>(MoveStatementDown)
|
||||
map <A-S-k> <Action>(MoveStatementUp)
|
||||
|
||||
" Multiple carets
|
||||
map <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
|
||||
map <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)'
|
||||
|
||||
imap <expr> <A-j> pumvisible() ? '<Action>(EditorDown)' : '<Action>(EditorCloneCaretBelow)'
|
||||
imap <expr> <A-k> pumvisible() ? '<Action>(EditorUp)' : '<Action>(EditorCloneCaretAbove)'
|
||||
|
||||
" Manage editor tabs
|
||||
map <C-w>m <Action>(MoveEditorToOppositeTabGroup)
|
||||
map <C-w>s <Action>(MoveTabDown)
|
||||
map <C-w>u <Action>(Unsplit)
|
||||
map <C-w>U <Action>(UnsplitAll)
|
||||
map <C-w>v <Action>(MoveTabRight)
|
||||
|
||||
noremap <C-w>S <C-w>s
|
||||
noremap <C-w>V <C-w>v
|
||||
|
||||
map <C-w><C-w>a <Action>(CloseAllEditors)
|
||||
map <C-w><C-w>h <Action>(CloseAllToTheLeft)
|
||||
map <C-w><C-w>l <Action>(CloseAllToTheRight)
|
||||
map <C-w><C-w>o <Action>(CloseAllEditorsButActive)
|
||||
|
||||
map \\ <C-w>
|
||||
map \\\\ <C-w><C-w>
|
||||
|
||||
" Rebind repurposed commands
|
||||
noremap g] ]
|
||||
noremap g[ [
|
||||
|
||||
" Rebind commands that will be repurposed
|
||||
nnoremap GG G
|
||||
nnoremap dG dG
|
||||
nnoremap cG cG
|
||||
nnoremap M m
|
||||
nnoremap Z z
|
||||
map <A-S-n> <A-p>
|
||||
|
||||
" Repurpose 'Enter' for statement completion (renaming function requires a custom version of IdeaVIM)
|
||||
function! CompleteStatement()
|
||||
if (renaming())
|
||||
" TODO https://github.com/JetBrains/ideavim/discussions/397#discussioncomment-1573048
|
||||
" return "\<Enter>"
|
||||
return "<Enter>"
|
||||
else
|
||||
action EditorCompleteStatement
|
||||
return ""
|
||||
endif
|
||||
endfunction
|
||||
" Repurpose 'Enter' for statement completion
|
||||
nmap <Enter> <Action>(EditorCompleteStatement)
|
||||
|
||||
nmap <expr> <Enter> CompleteStatement()
|
||||
" Repurpose 'g' for navigation (VimJumpToSource requires a custom version of IdeaVIM)
|
||||
map gb <Action>(GotoNextBookmark)
|
||||
map gB <Action>(GotoPreviousBookmark)
|
||||
map gD <Action>(GotoTypeDeclaration)
|
||||
map ge <Action>(VcsShowNextChangeMarker)
|
||||
map gE <Action>(VcsShowPrevChangeMarker)
|
||||
map gf <Action>(VimJumpToSource)<Action>(HideActiveWindow)
|
||||
map gi <Action>(GotoImplementation)
|
||||
map gr <Action>(RecentLocations)
|
||||
map gR <Action>(RecentChangedFiles)
|
||||
map gs <Action>(GotoSuperMethod)
|
||||
map gS <Action>(ShowSiblings)
|
||||
map gt gg<Action>(KM.GotoNextTypeInFile)
|
||||
map gT <Action>(KM.GotoNextTypeInFile)
|
||||
map gu <Action>(ShowUsages)
|
||||
map gU <Action>(FindUsages)
|
||||
|
||||
" Repurpose special characters for navigation
|
||||
nmap ( :raction GotoPreviousError<CR>
|
||||
nmap ) :raction GotoNextError<CR>
|
||||
nmap [ :raction MethodUp<CR>
|
||||
nmap ] :raction MethodDown<CR>
|
||||
nmap { :raction JumpToLastChange<CR>
|
||||
nmap } :raction JumpToNextChange<CR>
|
||||
" Repurpose 'z' for view actions and debugger
|
||||
map za <Action>(Annotate)
|
||||
map zb <Action>(ViewBreakpoints)
|
||||
map zc <Action>(EditorContextInfo)
|
||||
map zd <Action>(CompareClipboardWithSelection)
|
||||
map ze <Action>(ShowErrorDescription)
|
||||
map zf <Action>(SelectInProjectView)
|
||||
map zi <Action>(ShowHoverInfo)
|
||||
map zm <Action>(ShowBookmarks)
|
||||
map zp <Action>(QuickImplementations)
|
||||
map zP <Action>(QuickTypeDefinition)
|
||||
map zr <Action>(RunToCursor)
|
||||
map zR <Action>(ForceRunToCursor)
|
||||
map zs <Action>(osmedile.intellij.stringmanip.PopupChoiceAction)
|
||||
map zt <Action>(ExpressionTypeInfo)
|
||||
map zx <Action>(EvaluateExpression)
|
||||
|
||||
" Repurpose 'g' for navigation (:raction requires a custom version of IdeaVIM)
|
||||
nmap gb :raction GotoNextBookmark<CR>
|
||||
nmap gB :raction GotoPreviousBookmark<CR>
|
||||
nmap gd :action GotoDeclaration<CR>
|
||||
nmap gD :action GotoTypeDeclaration<CR>
|
||||
nmap ge :raction VcsShowNextChangeMarker<CR>
|
||||
nmap gE :raction VcsShowPrevChangeMarker<CR>
|
||||
map gi :action GotoImplementation<CR>
|
||||
map gj :raction EditorCloneCaretBelow<CR>
|
||||
map gk :raction EditorCloneCaretAbove<CR>
|
||||
nmap go :raction GotoNextElementUnderCaretUsage<CR>
|
||||
nmap gO :raction GotoPrevElementUnderCaretUsage<CR>
|
||||
nmap gr :action RecentLocations<CR>
|
||||
nmap gR :action RecentChangedFiles<CR>
|
||||
map gs :action GotoSuperMethod<CR>
|
||||
map gS :action ShowSiblings<CR>
|
||||
nmap gT /\\<class\>\\\|\\<interface\>\\\|\\<enum\>\\\|\\<object\>\\\|\\<record\>\\\|\\<struct\>\\\|\\<trait\><CR>w:nohlsearch<CR>
|
||||
nmap gt gggT
|
||||
nmap gu :action ShowUsages<CR>
|
||||
nmap gU :action FindUsages<CR>
|
||||
map gz :action NextSplitter<CR>
|
||||
map gZ :action PrevSplitter<CR>
|
||||
map zht <Action>(TypeHierarchy)
|
||||
map zhm <Action>(MethodHierarchy)
|
||||
|
||||
" Make bidirectional 'g' commands work with 'G' too
|
||||
nmap Gb gb
|
||||
nmap GB gB
|
||||
nmap Ge ge
|
||||
nmap GE gE
|
||||
map Gj gj
|
||||
map Gk gk
|
||||
nmap Go go
|
||||
nmap GO gO
|
||||
nmap Gt gt
|
||||
nmap GT gT
|
||||
map Gz gz
|
||||
map GZ gZ
|
||||
if &ide =~? 'rider'
|
||||
map zhc <Action>(RiderShowIncomingCalls)
|
||||
else
|
||||
map zhc <Action>(CallHierarchy)
|
||||
endif
|
||||
|
||||
" Repurpose 'z' for view actions, debugger, and tab management
|
||||
map za :action Annotate<CR>
|
||||
map zb :action ViewBreakpoints<CR>
|
||||
map zc :action EditorContextInfo<CR>
|
||||
map zd :action QuickJavaDoc<CR>
|
||||
map ze :action ShowErrorDescription<CR>
|
||||
map zf :action SelectInProjectView<CR>
|
||||
map zht :action TypeHierarchy<CR>
|
||||
map zhm :action MethodHierarchy<CR>
|
||||
map zhc :action CallHierarchy<CR>
|
||||
map zm :action ShowBookmarks<CR>
|
||||
map zp :action QuickImplementations<CR>
|
||||
map zP :action QuickTypeDefinition<CR>
|
||||
map zr :action RunToCursor<CR>
|
||||
map zR :action ForceRunToCursor<CR>
|
||||
map zsd :action MoveTabDown<CR>
|
||||
map zsr :action MoveTabRight<CR>
|
||||
map zsu :action Unsplit<CR>
|
||||
map zsU :action UnsplitAll<CR>
|
||||
map zt :action ExpressionTypeInfo<CR>
|
||||
map zx :action EvaluateExpression<CR>
|
||||
nmap zhl <Action>(LocalHistory.ShowHistory)
|
||||
xmap zhl <Action>(LocalHistory.ShowSelectionHistory)
|
||||
nmap zhg <Action>(Vcs.ShowTabbedFileHistory)
|
||||
xmap zhg <Action>(Vcs.ShowHistoryForBlock)
|
||||
|
||||
" Repurpose 'm' for refactoring (normal mode)
|
||||
nmap mg :action Generate<CR>
|
||||
nmap mi :action Inline<CR>
|
||||
nmap mn :action RenameElement<CR>
|
||||
nmap mo :action OverrideMethods<CR>
|
||||
nmap ms :action ChangeSignature<CR>
|
||||
nmap mS :action NewScratchFile<CR>
|
||||
" Repurpose 'm' for refactoring
|
||||
map mc <Action>(IntroduceConstant)
|
||||
map md <Action>(SafeDelete)
|
||||
map me <Action>(Move)
|
||||
map mf <Action>(IntroduceField)
|
||||
map mg <Action>(Generate)
|
||||
map mi <Action>(Inline)
|
||||
map mm <Action>(ExtractMethod)
|
||||
map mM <Action>(ExtractFunction)
|
||||
map mn <Action>(RenameElement)
|
||||
map mo <Action>(OverrideMethods)
|
||||
map mp <Action>(IntroduceParameter)
|
||||
map mP <Action>(IntroduceProperty)
|
||||
map mr <Action>(Refactorings.QuickListPopupAction)
|
||||
map ms <Action>(ChangeSignature)
|
||||
map mS <Action>(NewScratchFile)
|
||||
map mt <Action>(InsertLiveTemplate)
|
||||
map mv <Action>(IntroduceVariable)
|
||||
map mw <Action>(SurroundWith)
|
||||
|
||||
" Repurpose 'm' for refactoring (normal / visual mode)
|
||||
nmap mc :action IntroduceConstant<CR>
|
||||
vmap mc :action IntroduceConstant<CR>
|
||||
nmap mf :action IntroduceField<CR>
|
||||
vmap mf :action IntroduceField<CR>
|
||||
nmap mm :action ExtractMethod<CR>
|
||||
vmap mm :action ExtractMethod<CR>
|
||||
nmap mM :action ExtractFunction<CR>
|
||||
vmap mM :action ExtractFunction<CR>
|
||||
nmap mp :action IntroduceParameter<CR>
|
||||
vmap mp :action IntroduceParameter<CR>
|
||||
nmap mP :action IntroduceProperty<CR>
|
||||
vmap mP :action IntroduceProperty<CR>
|
||||
nmap mr :action Refactorings.QuickListPopupAction<CR>
|
||||
vmap mr :action Refactorings.QuickListPopupAction<CR>
|
||||
nmap mv :action IntroduceVariable<CR>
|
||||
vmap mv :action IntroduceVariable<CR>
|
||||
" Remap NERDTree bindings
|
||||
let g:NERDTreeMapOpenVSplit = 'v'
|
||||
let g:NERDTreeMapPreviewVSplit = 'gv'
|
||||
let g:NERDTreeMapOpenSplit = 's'
|
||||
let g:NERDTreeMapPreviewSplit = 'gs'
|
||||
|
||||
" Actions for custom version of AceJump
|
||||
map <Space> <Plug>(acejump)
|
||||
map <Space>d :action AceVimAction_GoToDeclaration<CR>
|
||||
map <Space>D :action AceVimAction_GoToTypeDeclaration<CR>
|
||||
map <Space>i :action AceVimAction_ShowIntentions<CR>
|
||||
map <Space>u :action AceVimAction_ShowUsages<CR>
|
||||
map <Space>U :action AceVimAction_FindUsages<CR>
|
||||
map <Space>r :action AceVimAction_Refactor<CR>
|
||||
map <Space>n :action AceVimAction_Rename<CR>
|
||||
set acejump
|
||||
map <Space> <Action>(AceVimAction_JumpAllEditors)
|
||||
map g<Space> <Action>(AceVimAction_JumpAllEditors_GoToDeclaration)
|
||||
|
21
.tmux.conf
Normal file
21
.tmux.conf
Normal file
@@ -0,0 +1,21 @@
|
||||
set -g default-terminal "screen-256color"
|
||||
set -g escape-time 0
|
||||
set -g history-limit 50000
|
||||
set -g mouse on
|
||||
|
||||
set-window-option -g mode-keys vi
|
||||
|
||||
bind -T copy-mode-vi v send -X begin-selection
|
||||
bind -T copy-mode-vi C-v send -X rectangle-toggle
|
||||
bind -T copy-mode-vi M-v send -X rectangle-toggle
|
||||
bind -T copy-mode-vi Enter send -X copy-selection-and-cancel
|
||||
unbind -T copy-mode-vi MouseDragEnd1Pane
|
||||
|
||||
bind '"' split-window -c "#{pane_current_path}"
|
||||
bind % split-window -hc "#{pane_current_path}"
|
||||
bind c new-window -c "#{pane_current_path}"
|
||||
|
||||
bind -n S-Up move-pane -ht ".{up-of}"
|
||||
bind -n S-Right move-pane -t ".{right-of}"
|
||||
bind -n S-Left move-pane -t ".{left-of}"
|
||||
bind -n S-down move-pane -ht ".{down-of}"
|
@@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
pushd ~/.vim/pack/plugins/start > /dev/null
|
||||
|
||||
git clone https://github.com/easymotion/vim-easymotion.git
|
||||
git clone https://github.com/itchyny/lightline.vim
|
||||
git clone https://github.com/luochen1990/rainbow
|
||||
git clone https://github.com/machakann/vim-highlightedyank
|
||||
git clone https://github.com/mg979/vim-visual-multi
|
||||
git clone https://github.com/michaeljsmith/vim-indent-object.git
|
||||
git clone https://github.com/vim-scripts/ReplaceWithRegister
|
||||
git clone https://tpope.io/vim/repeat.git
|
||||
git clone https://tpope.io/vim/sleuth.git
|
||||
git clone https://tpope.io/vim/surround.git
|
||||
|
||||
popd > /dev/null
|
||||
|
219
.vimrc
219
.vimrc
@@ -1,32 +1,83 @@
|
||||
set autoindent
|
||||
set backspace=indent,eol,start
|
||||
set encoding=utf-8
|
||||
set guifont=Cascadia_Mono:h12:cANSI:qDRAFT
|
||||
set guioptions-=t " Remove menu tearoff
|
||||
set history=1024
|
||||
set hlsearch
|
||||
set ignorecase
|
||||
set incsearch
|
||||
set infercase
|
||||
set laststatus=2
|
||||
set mouse=v
|
||||
set linebreak
|
||||
set list
|
||||
set listchars=lead:·,trail:·,tab:→\ ,extends:>,precedes:<
|
||||
set modeline
|
||||
set modelines=2
|
||||
set mouse=a
|
||||
set noerrorbells
|
||||
set noshowcmd
|
||||
set noshowmode
|
||||
set nrformats-=octal
|
||||
set number
|
||||
set relativenumber
|
||||
set scrolloff=12
|
||||
set scrolloff=999
|
||||
set shiftwidth=0
|
||||
set shortmess-=S " Show search count
|
||||
set shortmess-=l " Show full description for lines and bytes
|
||||
set showbreak=↪\
|
||||
set showmatch
|
||||
set sidescrolloff=48
|
||||
set sidescrolloff=999
|
||||
set smartcase
|
||||
set tabstop=4
|
||||
set ttimeout
|
||||
set ttimeoutlen=50
|
||||
set ttymouse=xterm2
|
||||
set virtualedit=onemore
|
||||
set wildmenu
|
||||
set winaltkeys=no
|
||||
set wrap
|
||||
|
||||
" Windows paths
|
||||
set packpath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
|
||||
set runtimepath=$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME
|
||||
|
||||
" Color scheme
|
||||
syntax enable
|
||||
colorscheme custom
|
||||
highlight LineNr ctermfg=244
|
||||
highlight IncSearch ctermfg=251 ctermbg=238
|
||||
highlight Search ctermfg=251 ctermbg=238
|
||||
highlight Visual ctermfg=240 ctermbg=250
|
||||
|
||||
if has("gui_running")
|
||||
colorscheme retrobox
|
||||
highlight NonText ctermfg=14 guifg=#7c6f64
|
||||
else
|
||||
colorscheme custom
|
||||
highlight LineNr ctermfg=244
|
||||
highlight IncSearch ctermfg=251 ctermbg=238
|
||||
highlight Search ctermfg=251 ctermbg=238
|
||||
highlight Visual ctermfg=240 ctermbg=250
|
||||
endif
|
||||
|
||||
highlight SpecialKey ctermfg=8 guifg=#584f46
|
||||
|
||||
" Windows GUI
|
||||
if has("win32") && has("gui_running")
|
||||
autocmd GUIEnter * simalt ~x " Maximize window
|
||||
autocmd GUIEnter * set visualbell t_vb= " Disable bell sound
|
||||
|
||||
set listchars+=tab:▶\
|
||||
set renderoptions=type:directx " Fix unicode rendering
|
||||
set showbreak=→\
|
||||
endif
|
||||
|
||||
" Fix Alt mappings (https://github.com/vim/vim/issues/2588#issuecomment-697959290)
|
||||
for ord in range(65, 90) + range(97, 122)
|
||||
let char = nr2char(ord)
|
||||
exec printf("set <m-%s>=\<esc>%s", char, char)
|
||||
exec printf("tnoremap <silent> <m-%s> <esc>%s", char, char)
|
||||
endfor
|
||||
|
||||
" Navigate editor tabs
|
||||
noremap <M-h> gT
|
||||
noremap <M-l> gt
|
||||
|
||||
" Map top row on Czech keyboard layout to digits
|
||||
map + 1
|
||||
@@ -41,36 +92,75 @@ map í 9
|
||||
map é 0
|
||||
|
||||
" Move some commands closer on Czech keyboard layout
|
||||
noremap ů ;
|
||||
map § %
|
||||
map ů %
|
||||
nnoremap ú @@
|
||||
noremap , +
|
||||
|
||||
" Navigate to indents
|
||||
nnoremap J +
|
||||
vnoremap J +
|
||||
nnoremap K -
|
||||
vnoremap K -
|
||||
noremap § `
|
||||
noremap §§ ``
|
||||
nnoremap m§ m
|
||||
|
||||
sunmap ů
|
||||
sunmap §
|
||||
|
||||
" Enter visual block mode
|
||||
noremap <M-v> <C-v>
|
||||
|
||||
" Navigate camel humps (https://github.com/vim-scripts/camelcasemotion)
|
||||
map L <Plug>CamelCaseMotion_w
|
||||
map H <Plug>CamelCaseMotion_b
|
||||
sunmap L
|
||||
sunmap H
|
||||
|
||||
omap iL <Plug>CamelCaseMotion_iw
|
||||
xmap iL <Plug>CamelCaseMotion_iw
|
||||
omap iH <Plug>CamelCaseMotion_ib
|
||||
xmap iH <Plug>CamelCaseMotion_ib
|
||||
|
||||
" Navigate to end of previous word
|
||||
noremap <M-b> ge
|
||||
noremap <M-S-b> gE
|
||||
|
||||
" Navigate soft-wrapped lines
|
||||
nnoremap <expr> j v:count ? 'j' : 'gj'
|
||||
xnoremap <expr> j v:count ? 'j' : 'gj'
|
||||
nnoremap <expr> k v:count ? 'k' : 'gk'
|
||||
xnoremap <expr> k v:count ? 'k' : 'gk'
|
||||
|
||||
nnoremap gj j
|
||||
xnoremap gj j
|
||||
nnoremap gk k
|
||||
xnoremap gk k
|
||||
|
||||
" Navigate unmatched parentheses/braces
|
||||
noremap g( [(
|
||||
noremap g) ])
|
||||
noremap g{ [{
|
||||
noremap g} ]}
|
||||
|
||||
" Edit from cursor to start/end of parenthesized block
|
||||
nnoremap c) c])
|
||||
nnoremap d) d])
|
||||
nnoremap c( c[((
|
||||
nnoremap d( c[((<ESC>l
|
||||
nnoremap d( c[((<Esc>l
|
||||
|
||||
" Edit from cursor to end of special characters
|
||||
nnoremap c" ct"
|
||||
nnoremap d" dt"
|
||||
nnoremap c' ct'
|
||||
nnoremap d' dt'
|
||||
nnoremap c] ct]
|
||||
nnoremap d] dt]
|
||||
" Create lines
|
||||
nnoremap go o<Esc>$
|
||||
nnoremap gO O<Esc>$
|
||||
nnoremap g<CR> i<CR><Esc>l
|
||||
|
||||
" Alternative way to enter visual block mode
|
||||
nnoremap <Space>v <C-V>
|
||||
" Edit current line
|
||||
nnoremap C cc
|
||||
xnoremap C cc
|
||||
nnoremap D dd
|
||||
xnoremap D dd
|
||||
nnoremap < <<
|
||||
nnoremap > >>
|
||||
|
||||
" Indent keeping selection
|
||||
vnoremap < <gv
|
||||
vnoremap > >gv
|
||||
vnoremap = =gv
|
||||
xnoremap < <gv
|
||||
xnoremap > >gv
|
||||
xnoremap = =gv
|
||||
|
||||
" Turn capital letters into opposite actions
|
||||
nnoremap U :redo<CR>
|
||||
@@ -79,14 +169,81 @@ nnoremap U :redo<CR>
|
||||
nnoremap gp `[v`]
|
||||
|
||||
" Put without yank
|
||||
xmap p gr
|
||||
xnoremap p P
|
||||
xnoremap P p
|
||||
|
||||
" Clear search highlights
|
||||
nnoremap <Esc> :nohlsearch<Return><Esc>
|
||||
|
||||
" Use Ctrl for selection and clipboard
|
||||
nnoremap <C-a> ggVG
|
||||
xnoremap <C-a> ggoG
|
||||
|
||||
xnoremap <C-c> "+y
|
||||
xnoremap <C-x> "+x
|
||||
|
||||
noremap <C-v> "+gP
|
||||
inoremap <C-v> <C-o>:set paste<CR><C-r>+<C-o>:set nopaste<CR>
|
||||
cnoremap <C-v> <C-r>+
|
||||
|
||||
nnoremap <C-s> :w<CR>
|
||||
xnoremap <C-s> :<C-U>w<CR>gv
|
||||
inoremap <C-s> <C-o>:w<CR>
|
||||
|
||||
" Update search register when using f/t
|
||||
function FindChar(action, reverse, search_affix)
|
||||
let t:reverse_search = a:reverse
|
||||
let char = nr2char(getchar())
|
||||
|
||||
if char == '\'
|
||||
let query = '\\'
|
||||
else
|
||||
let query = '\C\V'.char.'\v'
|
||||
endif
|
||||
|
||||
if a:reverse
|
||||
call setreg('/', query.a:search_affix)
|
||||
else
|
||||
call setreg('/', a:search_affix.query)
|
||||
endif
|
||||
|
||||
nohlsearch
|
||||
execute 'normal! '.a:action.char
|
||||
endfunction
|
||||
|
||||
function FindCharVisual(action, reverse, search_affix)
|
||||
normal gv
|
||||
call FindChar(a:action, a:reverse, a:search_affix)
|
||||
endfunction
|
||||
|
||||
function! ResetReverseSearchFlag()
|
||||
if getcmdtype() =~ "[/?]"
|
||||
let t:reverse_search = 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
nmap f :call FindChar('f', 0, '')<CR>
|
||||
nmap F :call FindChar('F', 1, '')<CR>
|
||||
nmap t :call FindChar('t', 0, '\zs.\ze')<CR>
|
||||
nmap T :call FindChar('T', 1, '\zs.\ze')<CR>
|
||||
|
||||
xmap f :call FindCharVisual('f', 0, '')<CR>
|
||||
xmap F :call FindCharVisual('F', 1, '')<CR>
|
||||
xmap t :call FindCharVisual('t', 0, '\zs.\ze')<CR>
|
||||
xmap T :call FindCharVisual('T', 1, '\zs.\ze')<CR>
|
||||
|
||||
noremap <expr> n 'nN'[t:reverse_search]
|
||||
noremap <expr> N 'Nn'[t:reverse_search]
|
||||
|
||||
cnoremap <CR> <cmd>call ResetReverseSearchFlag()<CR><CR>
|
||||
|
||||
" Plugin: https://github.com/easymotion/vim-easymotion.git
|
||||
map <Space> <Plug>(easymotion-prefix)
|
||||
nmap <Space> <Plug>(easymotion-overwin-f)
|
||||
xmap <Space> <Plug>(easymotion-s)
|
||||
omap <Space> <Plug>(easymotion-s)
|
||||
|
||||
" Plugin: https://github.com/machakann/vim-highlightedyank
|
||||
let g:highlightedyank_highlight_duration = 500
|
||||
|
||||
" Plugin: https://github.com/luochen1990/rainbow
|
||||
let g:rainbow_active = 1
|
||||
|
||||
|
@@ -1,26 +1,5 @@
|
||||
@-moz-document url(chrome://browser/content/browser.xul), url(chrome://browser/content/browser.xhtml) {
|
||||
|
||||
/* Fix broken window colors */
|
||||
|
||||
#main-window {
|
||||
background-color: #000c !important;
|
||||
}
|
||||
|
||||
#toolbar-menubar, #main-menubar, #TabsToolbar {
|
||||
background-color: #000 !important;
|
||||
}
|
||||
|
||||
#main-menubar {
|
||||
color: rgb(249, 249, 250) !important;
|
||||
text-shadow: none !important;
|
||||
border-radius: 0 !important;
|
||||
}
|
||||
|
||||
#TabsToolbar {
|
||||
color: rgb(249, 249, 250) !important;
|
||||
background-image: none !important;
|
||||
}
|
||||
|
||||
/* Menu bar */
|
||||
|
||||
#main-menubar > menu {
|
||||
@@ -37,7 +16,7 @@
|
||||
/* Reload/stop buttons */
|
||||
|
||||
#reload-button, #stop-button {
|
||||
display: -moz-box !important;
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
#stop-reload-button .toolbarbutton-icon {
|
||||
@@ -78,6 +57,10 @@
|
||||
|
||||
/* Tabs & toolbars */
|
||||
|
||||
#navigator-toolbox {
|
||||
border-bottom: none !important;
|
||||
}
|
||||
|
||||
#toolbar-menubar {
|
||||
min-height: 21px !important;
|
||||
}
|
||||
@@ -86,6 +69,10 @@
|
||||
height: 27px !important;
|
||||
}
|
||||
|
||||
.tab-label-container {
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
:root {
|
||||
--tab-min-height: 27px !important;
|
||||
--tab-block-margin: 0 !important;
|
||||
@@ -102,17 +89,13 @@
|
||||
|
||||
.tabbrowser-tab {
|
||||
padding-inline: 0 !important;
|
||||
border-right: 1px solid #484848 !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab[first-visible-unpinned-tab] {
|
||||
border-left: 1px solid #484848 !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab[first-visible-tab] {
|
||||
border-inline-start: 1px solid #484848 !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab[last-visible-tab] {
|
||||
border-inline-end: 1px solid #484848 !important;
|
||||
}
|
||||
|
||||
.tab-content {
|
||||
padding-bottom: 2px !important;
|
||||
}
|
||||
@@ -125,23 +108,33 @@
|
||||
padding: 0 1px !important;
|
||||
}
|
||||
|
||||
/* Tab playback icons */
|
||||
|
||||
.tabbrowser-tab:not([pinned]) .tab-icon-stack:is([muted], [soundplaying], [activemedia-blocked]) {
|
||||
grid-template-areas: "a s";
|
||||
}
|
||||
|
||||
.tabbrowser-tab:not([pinned]) .tab-icon-overlay:is([muted], [soundplaying], [activemedia-blocked]) {
|
||||
grid-area: a !important;
|
||||
}
|
||||
|
||||
.tabbrowser-tab:not([pinned]) .tab-icon-stack[indicator-replaces-favicon] > :not(&) {
|
||||
opacity: 1 !important;
|
||||
grid-area: s;
|
||||
}
|
||||
|
||||
/* Address bar */
|
||||
|
||||
#urlbar-container {
|
||||
--urlbar-container-height: 34px !important;
|
||||
margin-top: -2px !important;
|
||||
margin-inline: 3px !important;
|
||||
}
|
||||
|
||||
#urlbar {
|
||||
margin: 1px 0 !important;
|
||||
}
|
||||
|
||||
#urlbar .urlbarView-row-inner {
|
||||
padding-block: 4px !important;
|
||||
}
|
||||
|
||||
#urlbar .search-one-offs:not([hidden]){
|
||||
#urlbar .search-one-offs:not([hidden]) {
|
||||
padding-block: 4px !important;
|
||||
}
|
||||
|
||||
@@ -153,7 +146,7 @@
|
||||
|
||||
#PersonalToolbar {
|
||||
-moz-window-dragging: no-drag;
|
||||
display: -webkit-box !important;
|
||||
display: flex !important;
|
||||
position: fixed !important;
|
||||
bottom: 0 !important;
|
||||
width: 100% !important;
|
||||
@@ -161,7 +154,6 @@
|
||||
padding: 0 !important;
|
||||
-moz-padding-start: 0 !important;
|
||||
-moz-padding-end: 0 !important;
|
||||
border-top: 1px solid var(--chrome-content-separator-color) !important;
|
||||
background-color: #0E0E0E !important;
|
||||
z-index: 1000 !important;
|
||||
}
|
||||
@@ -170,9 +162,14 @@
|
||||
max-width: none !important;
|
||||
}
|
||||
|
||||
#PersonalToolbar .toolbaritem-combined-buttons {
|
||||
margin-inline: 0 !important;
|
||||
}
|
||||
|
||||
#PersonalToolbar .toolbarbutton-1 {
|
||||
margin: 0 !important;
|
||||
padding: 3px 4px !important;
|
||||
padding: 3px 0 !important;
|
||||
--toolbarbutton-inner-padding: 6px !important;
|
||||
}
|
||||
|
||||
#PersonalToolbar .toolbarbutton-icon {
|
||||
@@ -180,8 +177,8 @@
|
||||
height: 14px !important;
|
||||
}
|
||||
|
||||
#main-window:not([inFullscreen = "true"]) #browser-bottombox {
|
||||
height: 22px;
|
||||
#main-window:not([inFullscreen = "true"]) #browser {
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
/* PDF.js */
|
||||
|
16
README.md
16
README.md
@@ -1,5 +1,15 @@
|
||||
This is primarily for me to keep track of changes and synchronize my configuration, so there aren't many comments or other documentation at the moment, but I might improve that later.
|
||||
|
||||
# Ansible
|
||||
|
||||
This repository includes an Ansible collection that will automatically clone this repository into `~/.dotfiles`. It can be installed with:
|
||||
|
||||
```shell
|
||||
ansible-galaxy collection install git+https://github.com/chylex/dotfiles.git#/ansible/
|
||||
```
|
||||
|
||||
# Files
|
||||
|
||||
### .ideavimrc
|
||||
|
||||
[IdeaVim](https://plugins.jetbrains.com/plugin/164-ideavim) plugin for IntelliJ platform. Some parts require my [fork of IdeaVim](https://github.com/chylex/IntelliJ-IdeaVim/tree/customized/main), and my experimental [fork of AceJump](https://github.com/chylex/IntelliJ-AceJump/tree/experimental-rework). Belongs in the user home directory.
|
||||
@@ -8,12 +18,16 @@ This is primarily for me to keep track of changes and synchronize my configurati
|
||||
|
||||
Configuration for [Vim](https://www.vim.org/). Belongs in the user home directory.
|
||||
|
||||
To install plugins, navigate to `.vim/pack/plugins/start` and run `install.sh`. The script uses `git` to clone the plugin repositories.
|
||||
You can install the vim plugins using the `chylex.dotfiles.vim_plugins` Ansible role, or manually by cloning git repositories listed in the [task file](ansible/roles/vim_plugins/tasks/main.yaml) into `~/.vim/pack/plugins/start`.
|
||||
|
||||
### .bashrc
|
||||
|
||||
Configuration for [Bash](https://www.gnu.org/software/bash/). Belongs in the user home directory.
|
||||
|
||||
### .tmux.conf
|
||||
|
||||
Configuration for [tmux](https://github.com/tmux/tmux). Belongs in the user home directory.
|
||||
|
||||
### Firefox / userChrome.css
|
||||
|
||||
Custom stylesheets for Firefox 94 or newer, designed for [Firefox Developer Edition](https://www.mozilla.org/firefox/developer). To install, place `userChrome.css` into the `chrome` folder:
|
||||
|
31
ansible/README.md
Normal file
31
ansible/README.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Ansible Collection - chylex.dotfiles
|
||||
|
||||
Ansible roles for configuring and updating my dotfiles.
|
||||
|
||||
# Roles
|
||||
|
||||
### `chylex.dotfiles.bash_completion`
|
||||
|
||||
Configures Bash completion for `d` alias for Docker, and `dc` alias for Docker Compose.
|
||||
|
||||
### `chylex.dotfiles.detect_shell`
|
||||
|
||||
Sets the `shell` fact to the remote user's default shell.
|
||||
|
||||
### `chylex.dotfiles.from_repository`
|
||||
|
||||
Clones the dotfiles repository into `~/.dotfiles` and updates the user's dotfiles. **Do not use if you already use the `~/.dotfiles` folder for something else!**
|
||||
|
||||
### `chylex.dotfiles.vim_plugins`
|
||||
|
||||
Installs a bunch of Vim plugins.
|
||||
|
||||
### `chylex.dotfiles.all`
|
||||
|
||||
Does all of the above.
|
||||
|
||||
# Licensing
|
||||
|
||||
The `roles/bash_completion/files/.bin` folder includes third-party scripts under their own licenses:
|
||||
- [complete_alias](https://github.com/cykerway/complete-alias)
|
||||
- [docker_compose](https://github.com/docker/compose/blob/1.28.x/contrib/completion/bash/docker-compose)
|
11
ansible/galaxy.yml
Normal file
11
ansible/galaxy.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace: chylex
|
||||
name: dotfiles
|
||||
version: 1.0.0
|
||||
|
||||
readme: README.md
|
||||
license: [ Unlicense ]
|
||||
authors: [ "chylex <contact@chylex.com>" ]
|
||||
|
||||
homepage: https://github.com/chylex/dotfiles
|
||||
repository: https://github.com/chylex/dotfiles
|
||||
issues: https://github.com/chylex/dotfiles/issues
|
2
ansible/meta/runtime.yml
Normal file
2
ansible/meta/runtime.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
---
|
||||
requires_ansible: '>=2.9.10'
|
6
ansible/roles/all/meta/main.yaml
Normal file
6
ansible/roles/all/meta/main.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: from_repository
|
||||
- role: bash_completion
|
||||
- role: vim_plugins
|
5
ansible/roles/bash_completion/files/.bash_completion
Normal file
5
ansible/roles/bash_completion/files/.bash_completion
Normal file
@@ -0,0 +1,5 @@
|
||||
. ~/.bin/complete_alias
|
||||
. ~/.bin/docker_compose
|
||||
|
||||
complete -F _complete_alias d
|
||||
complete -F _docker_compose dc
|
1062
ansible/roles/bash_completion/files/.bin/complete_alias
Normal file
1062
ansible/roles/bash_completion/files/.bin/complete_alias
Normal file
File diff suppressed because it is too large
Load Diff
671
ansible/roles/bash_completion/files/.bin/docker_compose
Normal file
671
ansible/roles/bash_completion/files/.bin/docker_compose
Normal file
@@ -0,0 +1,671 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# bash completion for docker-compose
|
||||
#
|
||||
# This work is based on the completion for the docker command.
|
||||
#
|
||||
# This script provides completion of:
|
||||
# - commands and their options
|
||||
# - service names
|
||||
# - filepaths
|
||||
#
|
||||
# To enable the completions either:
|
||||
# - place this file in /etc/bash_completion.d
|
||||
# or
|
||||
# - copy this file to e.g. ~/.docker-compose-completion.sh and add the line
|
||||
# below to your .bashrc after bash completion features are loaded
|
||||
# . ~/.docker-compose-completion.sh
|
||||
|
||||
__docker_compose_previous_extglob_setting=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
__docker_compose_q() {
|
||||
docker-compose 2>/dev/null "${top_level_options[@]}" "$@"
|
||||
}
|
||||
|
||||
# Transforms a multiline list of strings into a single line string
|
||||
# with the words separated by "|".
|
||||
__docker_compose_to_alternatives() {
|
||||
local parts=( $1 )
|
||||
local IFS='|'
|
||||
echo "${parts[*]}"
|
||||
}
|
||||
|
||||
# Transforms a multiline list of options into an extglob pattern
|
||||
# suitable for use in case statements.
|
||||
__docker_compose_to_extglob() {
|
||||
local extglob=$( __docker_compose_to_alternatives "$1" )
|
||||
echo "@($extglob)"
|
||||
}
|
||||
|
||||
# Determines whether the option passed as the first argument exist on
|
||||
# the commandline. The option may be a pattern, e.g. `--force|-f`.
|
||||
__docker_compose_has_option() {
|
||||
local pattern="$1"
|
||||
for (( i=2; i < $cword; ++i)); do
|
||||
if [[ ${words[$i]} =~ ^($pattern)$ ]] ; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# Returns `key` if we are currently completing the value of a map option (`key=value`)
|
||||
# which matches the extglob passed in as an argument.
|
||||
# This function is needed for key-specific completions.
|
||||
__docker_compose_map_key_of_current_option() {
|
||||
local glob="$1"
|
||||
|
||||
local key glob_pos
|
||||
if [ "$cur" = "=" ] ; then # key= case
|
||||
key="$prev"
|
||||
glob_pos=$((cword - 2))
|
||||
elif [[ $cur == *=* ]] ; then # key=value case (OSX)
|
||||
key=${cur%=*}
|
||||
glob_pos=$((cword - 1))
|
||||
elif [ "$prev" = "=" ] ; then
|
||||
key=${words[$cword - 2]} # key=value case
|
||||
glob_pos=$((cword - 3))
|
||||
else
|
||||
return
|
||||
fi
|
||||
|
||||
[ "${words[$glob_pos]}" = "=" ] && ((glob_pos--)) # --option=key=value syntax
|
||||
|
||||
[[ ${words[$glob_pos]} == @($glob) ]] && echo "$key"
|
||||
}
|
||||
|
||||
# suppress trailing whitespace
|
||||
__docker_compose_nospace() {
|
||||
# compopt is not available in ancient bash versions
|
||||
type compopt &>/dev/null && compopt -o nospace
|
||||
}
|
||||
|
||||
|
||||
# Outputs a list of all defined services, regardless of their running state.
|
||||
# Arguments for `docker-compose ps` may be passed in order to filter the service list,
|
||||
# e.g. `status=running`.
|
||||
__docker_compose_services() {
|
||||
__docker_compose_q ps --services "$@"
|
||||
}
|
||||
|
||||
# Applies completion of services based on the current value of `$cur`.
|
||||
# Arguments for `docker-compose ps` may be passed in order to filter the service list,
|
||||
# see `__docker_compose_services`.
|
||||
__docker_compose_complete_services() {
|
||||
COMPREPLY=( $(compgen -W "$(__docker_compose_services "$@")" -- "$cur") )
|
||||
}
|
||||
|
||||
# The services for which at least one running container exists
|
||||
__docker_compose_complete_running_services() {
|
||||
local names=$(__docker_compose_services --filter status=running)
|
||||
COMPREPLY=( $(compgen -W "$names" -- "$cur") )
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_build() {
|
||||
case "$prev" in
|
||||
--build-arg)
|
||||
COMPREPLY=( $( compgen -e -- "$cur" ) )
|
||||
__docker_compose_nospace
|
||||
return
|
||||
;;
|
||||
--memory|-m)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--build-arg --compress --force-rm --help --memory -m --no-cache --no-rm --pull --parallel -q --quiet" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter source=build
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_config() {
|
||||
case "$prev" in
|
||||
--hash)
|
||||
if [[ $cur == \\* ]] ; then
|
||||
COMPREPLY=( '\*' )
|
||||
else
|
||||
COMPREPLY=( $(compgen -W "$(__docker_compose_services) \\\* " -- "$cur") )
|
||||
fi
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $( compgen -W "--hash --help --no-interpolate --quiet -q --resolve-image-digests --services --volumes" -- "$cur" ) )
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_create() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--build --force-recreate --help --no-build --no-recreate" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_docker_compose() {
|
||||
case "$prev" in
|
||||
--tlscacert|--tlscert|--tlskey)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
--file|-f)
|
||||
_filedir "y?(a)ml"
|
||||
return
|
||||
;;
|
||||
--ansi)
|
||||
COMPREPLY=( $( compgen -W "never always auto" -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--log-level)
|
||||
COMPREPLY=( $( compgen -W "debug info warning error critical" -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--project-directory)
|
||||
_filedir -d
|
||||
return
|
||||
;;
|
||||
--env-file)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
$(__docker_compose_to_extglob "$daemon_options_with_args") )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "$daemon_boolean_options $daemon_options_with_args $top_level_options_with_args --help -h --no-ansi --verbose --version -v" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_down() {
|
||||
case "$prev" in
|
||||
--rmi)
|
||||
COMPREPLY=( $( compgen -W "all local" -- "$cur" ) )
|
||||
return
|
||||
;;
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --rmi --timeout -t --volumes -v --remove-orphans" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_events() {
|
||||
case "$prev" in
|
||||
--json)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --json" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_exec() {
|
||||
case "$prev" in
|
||||
--index|--user|-u|--workdir|-w)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "-d --detach --help --index --privileged -T --user -u --workdir -w" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_help() {
|
||||
COMPREPLY=( $( compgen -W "${commands[*]}" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_docker_compose_images() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --quiet -q" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_docker_compose_kill() {
|
||||
case "$prev" in
|
||||
-s)
|
||||
COMPREPLY=( $( compgen -W "SIGHUP SIGINT SIGKILL SIGUSR1 SIGUSR2" -- "$(echo $cur | tr '[:lower:]' '[:upper:]')" ) )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help -s" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_logs() {
|
||||
case "$prev" in
|
||||
--tail)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--follow -f --help --no-color --no-log-prefix --tail --timestamps -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_pause() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_port() {
|
||||
case "$prev" in
|
||||
--protocol)
|
||||
COMPREPLY=( $( compgen -W "tcp udp" -- "$cur" ) )
|
||||
return;
|
||||
;;
|
||||
--index)
|
||||
return;
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --index --protocol" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_ps() {
|
||||
local key=$(__docker_compose_map_key_of_current_option '--filter')
|
||||
case "$key" in
|
||||
source)
|
||||
COMPREPLY=( $( compgen -W "build image" -- "${cur##*=}" ) )
|
||||
return
|
||||
;;
|
||||
status)
|
||||
COMPREPLY=( $( compgen -W "paused restarting running stopped" -- "${cur##*=}" ) )
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$prev" in
|
||||
--filter)
|
||||
COMPREPLY=( $( compgen -W "source status" -S "=" -- "$cur" ) )
|
||||
__docker_compose_nospace
|
||||
return;
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--all -a --filter --help --quiet -q --services" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_pull() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --ignore-pull-failures --include-deps --no-parallel --quiet -q" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter source=image
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_push() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --ignore-push-failures" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_restart() {
|
||||
case "$prev" in
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_rm() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--force -f --help --stop -s -v" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
if __docker_compose_has_option "--stop|-s" ; then
|
||||
__docker_compose_complete_services
|
||||
else
|
||||
__docker_compose_complete_services --filter status=stopped
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_run() {
|
||||
case "$prev" in
|
||||
-e)
|
||||
COMPREPLY=( $( compgen -e -- "$cur" ) )
|
||||
__docker_compose_nospace
|
||||
return
|
||||
;;
|
||||
--entrypoint|--label|-l|--name|--user|-u|--volume|-v|--workdir|-w)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--detach -d --entrypoint -e --help --label -l --name --no-deps --publish -p --rm --service-ports -T --use-aliases --user -u --volume -v --workdir -w" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_scale() {
|
||||
case "$prev" in
|
||||
=)
|
||||
COMPREPLY=("$cur")
|
||||
return
|
||||
;;
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $(compgen -S "=" -W "$(__docker_compose_services)" -- "$cur") )
|
||||
__docker_compose_nospace
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_start() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter status=stopped
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_stop() {
|
||||
case "$prev" in
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_top() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_running_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_unpause() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services --filter status=paused
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_up() {
|
||||
case "$prev" in
|
||||
=)
|
||||
COMPREPLY=("$cur")
|
||||
return
|
||||
;;
|
||||
--exit-code-from)
|
||||
__docker_compose_complete_services
|
||||
return
|
||||
;;
|
||||
--scale)
|
||||
COMPREPLY=( $(compgen -S "=" -W "$(__docker_compose_services)" -- "$cur") )
|
||||
__docker_compose_nospace
|
||||
return
|
||||
;;
|
||||
--timeout|-t)
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--abort-on-container-exit --always-recreate-deps --attach-dependencies --build -d --detach --exit-code-from --force-recreate --help --no-build --no-color --no-deps --no-log-prefix --no-recreate --no-start --renew-anon-volumes -V --remove-orphans --scale --timeout -t" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_compose_complete_services
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose_version() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--short" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
_docker_compose() {
|
||||
local previous_extglob_setting=$(shopt -p extglob)
|
||||
shopt -s extglob
|
||||
|
||||
local commands=(
|
||||
build
|
||||
config
|
||||
create
|
||||
down
|
||||
events
|
||||
exec
|
||||
help
|
||||
images
|
||||
kill
|
||||
logs
|
||||
pause
|
||||
port
|
||||
ps
|
||||
pull
|
||||
push
|
||||
restart
|
||||
rm
|
||||
run
|
||||
scale
|
||||
start
|
||||
stop
|
||||
top
|
||||
unpause
|
||||
up
|
||||
version
|
||||
)
|
||||
|
||||
# Options for the docker daemon that have to be passed to secondary calls to
|
||||
# docker-compose executed by this script.
|
||||
local daemon_boolean_options="
|
||||
--skip-hostname-check
|
||||
--tls
|
||||
--tlsverify
|
||||
"
|
||||
local daemon_options_with_args="
|
||||
--context -c
|
||||
--env-file
|
||||
--file -f
|
||||
--host -H
|
||||
--project-directory
|
||||
--project-name -p
|
||||
--tlscacert
|
||||
--tlscert
|
||||
--tlskey
|
||||
"
|
||||
|
||||
# These options are require special treatment when searching the command.
|
||||
local top_level_options_with_args="
|
||||
--ansi
|
||||
--log-level
|
||||
"
|
||||
|
||||
COMPREPLY=()
|
||||
local cur prev words cword
|
||||
_get_comp_words_by_ref -n : cur prev words cword
|
||||
|
||||
# search subcommand and invoke its handler.
|
||||
# special treatment of some top-level options
|
||||
local command='docker_compose'
|
||||
local top_level_options=()
|
||||
local counter=1
|
||||
|
||||
while [ $counter -lt $cword ]; do
|
||||
case "${words[$counter]}" in
|
||||
$(__docker_compose_to_extglob "$daemon_boolean_options") )
|
||||
local opt=${words[counter]}
|
||||
top_level_options+=($opt)
|
||||
;;
|
||||
$(__docker_compose_to_extglob "$daemon_options_with_args") )
|
||||
local opt=${words[counter]}
|
||||
local arg=${words[++counter]}
|
||||
top_level_options+=($opt $arg)
|
||||
;;
|
||||
$(__docker_compose_to_extglob "$top_level_options_with_args") )
|
||||
(( counter++ ))
|
||||
;;
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
command="${words[$counter]}"
|
||||
break
|
||||
;;
|
||||
esac
|
||||
(( counter++ ))
|
||||
done
|
||||
|
||||
local completions_func=_docker_compose_${command//-/_}
|
||||
declare -F $completions_func >/dev/null && $completions_func
|
||||
|
||||
eval "$previous_extglob_setting"
|
||||
return 0
|
||||
}
|
||||
|
||||
eval "$__docker_compose_previous_extglob_setting"
|
||||
unset __docker_compose_previous_extglob_setting
|
||||
|
||||
complete -F _docker_compose docker-compose docker-compose.exe
|
4
ansible/roles/bash_completion/meta/main.yaml
Normal file
4
ansible/roles/bash_completion/meta/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: detect_shell
|
15
ansible/roles/bash_completion/tasks/main.yaml
Normal file
15
ansible/roles/bash_completion/tasks/main.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
|
||||
- when: shell == '/bin/bash'
|
||||
block:
|
||||
- name: Update .bash_completion file
|
||||
copy:
|
||||
src: .bash_completion
|
||||
dest: ~/.bash_completion
|
||||
mode: "600"
|
||||
|
||||
- name: Update custom bash completions
|
||||
copy:
|
||||
src: .bin/
|
||||
dest: ~/.bin/
|
||||
mode: "600"
|
10
ansible/roles/detect_shell/tasks/main.yaml
Normal file
10
ansible/roles/detect_shell/tasks/main.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
---
|
||||
|
||||
- name: Detect shell
|
||||
shell: "echo $SHELL"
|
||||
register: shell
|
||||
changed_when: false
|
||||
|
||||
- name: Set shell fact
|
||||
set_fact:
|
||||
shell: "{{ shell.stdout }}"
|
4
ansible/roles/from_repository/meta/main.yaml
Normal file
4
ansible/roles/from_repository/meta/main.yaml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
|
||||
dependencies:
|
||||
- role: detect_shell
|
48
ansible/roles/from_repository/tasks/main.yaml
Normal file
48
ansible/roles/from_repository/tasks/main.yaml
Normal file
@@ -0,0 +1,48 @@
|
||||
---
|
||||
|
||||
- name: Clone dotfiles repository
|
||||
git:
|
||||
repo: "https://github.com/chylex/dotfiles.git"
|
||||
dest: ~/.dotfiles
|
||||
single_branch: true
|
||||
recursive: false
|
||||
register: dotfiles
|
||||
|
||||
- when: dotfiles.changed and shell == '/bin/bash'
|
||||
block:
|
||||
- name: Load .bashrc contents
|
||||
slurp:
|
||||
src: ~/.dotfiles/.bashrc
|
||||
register: bashrc
|
||||
|
||||
- name: Update .bashrc file
|
||||
blockinfile:
|
||||
block: "{{ bashrc.content | b64decode }}"
|
||||
dest: ~/.bashrc
|
||||
marker: "# {mark} CHYLEX DOTFILES"
|
||||
mode: "644"
|
||||
create: true
|
||||
|
||||
- when: dotfiles.changed
|
||||
block:
|
||||
- name: Update .vimrc file
|
||||
copy:
|
||||
remote_src: true
|
||||
src: ~/.dotfiles/.vimrc
|
||||
dest: ~/.vimrc
|
||||
mode: "600"
|
||||
|
||||
- name: Update .vim folder
|
||||
copy:
|
||||
remote_src: true
|
||||
directory_mode: true
|
||||
src: ~/.dotfiles/.vim
|
||||
dest: ~/
|
||||
mode: "700"
|
||||
|
||||
- name: Update .tmux.conf file
|
||||
copy:
|
||||
remote_src: true
|
||||
src: ~/.dotfiles/.tmux.conf
|
||||
dest: ~/.tmux.conf
|
||||
mode: "600"
|
30
ansible/roles/vim_plugins/tasks/main.yaml
Normal file
30
ansible/roles/vim_plugins/tasks/main.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
|
||||
- name: Install and update vim plugins
|
||||
git:
|
||||
repo: "{{ item.repo }}"
|
||||
dest: "~/.vim/pack/plugins/start/{{ item.name }}"
|
||||
single_branch: true
|
||||
recursive: false
|
||||
loop:
|
||||
- { name: "camelcasemotion" , repo: "https://github.com/vim-scripts/camelcasemotion" }
|
||||
- { name: "easymotion" , repo: "https://github.com/easymotion/vim-easymotion.git" }
|
||||
- { name: "highlighted-yank" , repo: "https://github.com/machakann/vim-highlightedyank.git" }
|
||||
- { name: "indent-object" , repo: "https://github.com/michaeljsmith/vim-indent-object.git" }
|
||||
- { name: "lightline" , repo: "https://github.com/itchyny/lightline.vim.git" }
|
||||
- { name: "paragraph-motion" , repo: "https://github.com/dbakker/vim-paragraph-motion.git" }
|
||||
- { name: "rainbow" , repo: "https://github.com/luochen1990/rainbow.git" }
|
||||
- { name: "repeat" , repo: "https://github.com/tpope/vim-repeat.git" }
|
||||
- { name: "sleuth" , repo: "https://github.com/tpope/vim-sleuth.git" }
|
||||
- { name: "surround" , repo: "https://github.com/tpope/vim-surround.git" }
|
||||
- { name: "visual-multi" , repo: "https://github.com/mg979/vim-visual-multi.git" }
|
||||
- { name: "visual-star-search" , repo: "https://github.com/nelstrom/vim-visual-star-search.git" }
|
||||
loop_control:
|
||||
label: "{{ item.name }}"
|
||||
|
||||
- name: Delete unused vim plugins
|
||||
file:
|
||||
path: "~/.vim/pack/plugins/start/{{ item }}"
|
||||
state: absent
|
||||
loop:
|
||||
- "replace-with-register"
|
Reference in New Issue
Block a user