diff --git a/dotfiles/.config/Code - OSS/User/keybindings.json/keybindings.json b/dotfiles/.config/Code - OSS/User/keybindings.json/keybindings.json new file mode 100644 index 0000000..12c252c --- /dev/null +++ b/dotfiles/.config/Code - OSS/User/keybindings.json/keybindings.json @@ -0,0 +1,46 @@ +// Place your key bindings in this file to override the defaults +[ + { + "key": "alt+z", + "command": "-editor.action.toggleWordWrap" + }, + { + "key": "alt+z", + "command": "-workbench.action.terminal.sizeToContentWidth", + "when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen || terminalFocus && terminalIsOpen && terminalProcessSupported" + }, + { + "key": "alt+z", + "command": "workbench.action.toggleMaximizeEditorGroup", + "when": "editorPartMaximizedEditorGroup || editorPartMultipleEditorGroups" + }, + { + "key": "ctrl+k ctrl+m", + "command": "-workbench.action.toggleMaximizeEditorGroup", + "when": "editorPartMaximizedEditorGroup || editorPartMultipleEditorGroups" + }, + { + "key": "alt+z", + "command": "workbench.action.toggleMaximizedPanel", + "when": "!editorTextFocus" + }, + { + "key": "ctrl+p", + "command": "-extension.vim_ctrl+p", + "when": "editorTextFocus && vim.active && vim.use && !inDebugRepl || vim.active && vim.use && !inDebugRepl && vim.mode == 'CommandlineInProgress' || vim.active && vim.use && !inDebugRepl && vim.mode == 'SearchInProgressMode'" + }, + { + "key": "alt+t", + "command": "workbench.action.terminal.toggleTerminal", + "when": "terminal.active" + }, + { + "key": "ctrl+`", + "command": "-workbench.action.terminal.toggleTerminal", + "when": "terminal.active" + }, + { + "key": "ctrl+e", + "command": "-workbench.action.quickOpen" + } +] \ No newline at end of file diff --git a/dotfiles/.local/bin/commands b/dotfiles/.local/bin/commands index f63f9e9..ec1297a 100755 --- a/dotfiles/.local/bin/commands +++ b/dotfiles/.local/bin/commands @@ -9,6 +9,7 @@ import datetime import functools import io import json +import pathlib import logging import optparse import os @@ -1610,9 +1611,9 @@ def aioice_tunnel(argv: list[str]) -> None: return locals() - t1 = await test() + #t1 = await test() - await asyncio.sleep(999) + #await asyncio.sleep(999) def player_v1(folder_url, item_id): #import sys @@ -3688,6 +3689,13 @@ def install(argv: list[str]) -> None: type=pathlib.Path, required=True, ) + parser.add_argument( + '-p', '--relative', + type=pathlib.Path, + help='copy source relative to path, allows to strip extra components', + dest='relative', + default=None, + ) parser.add_argument( '-t', '--target', type=pathlib.Path, @@ -3700,25 +3708,39 @@ def install(argv: list[str]) -> None: help='overwrite if target is present', dest='overwrite', action='store_true', - defualt=False, + default=False, ) options, args = parser.parse_known_args(argv) + if options.relative: + relative_source = options.source.relative_to(options.relative) + else: + if options.source.is_absolute(): + relative_source = options.source.relative_to('/') + else: + relative_source = options.source + logger.info(dict(source=options.source, target=options.source)) - if options.target.exists(): + final_target = options.target / relative_source + + logger.info(dict(final_target=final_target, relative_source=relative_source)) + + if final_target.exists(): if not options.overwrite: raise NotImplementedError - shutil.rmtree(str(options.target)) + shutil.rmtree(str(final_target)) - if option.source.is_dir() and not options.recursive: + if options.source.is_dir() and not options.recursive: raise NotImplementedError + os.makedirs(final_target, exist_ok=True,) + shutil.copy( options.source, - options.target, + final_target, ) logger.info(dict(msg='done')) diff --git a/dotfiles/m.py b/dotfiles/m.py deleted file mode 100644 index e69de29..0000000