Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 731188fa52 | |||
| ee3d625e66 | |||
| e2fd0adcc0 | |||
| e67cc5b90c | |||
| b00cf98f97 | |||
| 275787b689 | |||
| 46fed03268 | |||
| 8571495a53 | |||
| 814305c82d | |||
| 6f3131bedc | |||
| 65fed10281 | |||
| 38555114b1 | |||
| 0d27c52f6e | |||
| 2f43f25649 | |||
| de4aafdd80 | |||
| 482c639b30 | |||
| 1a651bb023 | |||
| e2fe842098 | |||
| 65ec0c8bf8 | |||
| 6793e4e0ae | |||
| ac8fc8529b | |||
| e6b082f38c | |||
| 614a57652f | |||
| 80a119972f | |||
| 05d3aaa8dd | |||
| 9afb3328ba | |||
| e866e94303 | |||
| 283b4f0e56 | |||
| 01035f61bd | |||
| 1f697ecc23 | |||
| 4703c6c492 | |||
| a9aa507b4c | |||
| f2cb448b37 |
@@ -0,0 +1,2 @@
|
|||||||
|
env.nu
|
||||||
|
history.txt
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[submodule "pack/plugins/start/nvim-treesitter"]
|
|
||||||
path = pack/plugins/start/nvim-treesitter
|
|
||||||
url = https://github.com/nvim-treesitter/nvim-treesitter
|
|
||||||
[submodule "pack/plugins/start/mini.nvim"]
|
|
||||||
path = pack/plugins/start/mini.nvim
|
|
||||||
url = https://github.com/echasnovski/mini.nvim.git
|
|
||||||
branch = stable
|
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
export def lumen-assono-backup-nexttape [dateinput: datetime]: nothing -> nothing {
|
||||||
|
print 'Next Required Tape:'
|
||||||
|
print $'($dateinput | get-backup-string 0)'
|
||||||
|
print ''
|
||||||
|
print 'Tapes after that:'
|
||||||
|
|
||||||
|
1..11 | each {|i|
|
||||||
|
print ($dateinput | get-backup-string $i)
|
||||||
|
} | ignore
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-backup-string [index]: datetime -> string {
|
||||||
|
let firstDayMonth = $'01-((($in | format date '%m' | into int) + $index) mod 12 + 1)($in | format date '-%y')' | into datetime --format '%d-%m-%y'
|
||||||
|
let firstDayMonth = if ($firstDayMonth < $in) {
|
||||||
|
$'($firstDayMonth | format date '%d-%m-')(($firstDayMonth | format date '%y' | into int) + 1)' | into datetime --format '%d-%m-%y'
|
||||||
|
} else {
|
||||||
|
$firstDayMonth
|
||||||
|
}
|
||||||
|
let backupDay = $firstDayMonth - ($firstDayMonth | format date '%w' | into duration -u day) + 6day
|
||||||
|
let monthOfQuarter = $backupDay | get-month-of-quarter
|
||||||
|
let quarter = $backupDay | get-quarter
|
||||||
|
let year = $backupDay | get-year
|
||||||
|
|
||||||
|
if ($monthOfQuarter == 1) {
|
||||||
|
if ($quarter == 1) {
|
||||||
|
$"($backupDay): TapeLTO5-Y(($year - 1| into string | str substring 3..))"
|
||||||
|
} else {
|
||||||
|
$"($backupDay): TapeLTO5-Q($quarter - 1)"
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$"($backupDay): TapeLTO5-M($monthOfQuarter - 1)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-month-of-quarter []: datetime -> int {
|
||||||
|
let month = ($in | format date '%m' | into int) + 3
|
||||||
|
($month..($month - 3)..1) | last
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-quarter []: datetime -> int {
|
||||||
|
(($in | format date '%m') | into int) / 3 | math ceil
|
||||||
|
}
|
||||||
|
|
||||||
|
def get-year []: datetime -> int {
|
||||||
|
$in | format date '%Y' | into int
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export def lumen-assono-overtime-calc [startdate: datetime]: nothing -> string {
|
||||||
|
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate | format date '%d/%m/%Y')'
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
export def lumen-assono-worktime-calc [datestr: string]: nothing -> string {
|
||||||
|
let $datestr = $datestr | str replace ' +' ' '
|
||||||
|
mut $dateArray = []
|
||||||
|
let $rawDateArray = $datestr | split row ' '
|
||||||
|
if (($rawDateArray | length) mod 2 == 1) {
|
||||||
|
mut $spliceCounter = true
|
||||||
|
for $i in $rawDateArray {
|
||||||
|
if ($spliceCounter) {
|
||||||
|
$dateArray = $dateArray | append $i
|
||||||
|
}
|
||||||
|
$spliceCounter = not $spliceCounter
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$dateArray = $rawDateArray
|
||||||
|
}
|
||||||
|
|
||||||
|
if (($dateArray | length) mod 2 == 1) {
|
||||||
|
error make {msg: 'Uneven Times given!'}
|
||||||
|
}
|
||||||
|
|
||||||
|
mut $dateArrayOutput = []
|
||||||
|
mut $dateArrayOutputBuilderCounter = true
|
||||||
|
for $i in $dateArray {
|
||||||
|
$dateArrayOutput = $dateArrayOutput | append ($i | date from-human | format date '%H:%M')
|
||||||
|
if ($dateArrayOutputBuilderCounter) {
|
||||||
|
$dateArrayOutput = $dateArrayOutput | append '-'
|
||||||
|
} else {
|
||||||
|
$dateArrayOutput = $dateArrayOutput | append '|'
|
||||||
|
}
|
||||||
|
$dateArrayOutputBuilderCounter = not $dateArrayOutputBuilderCounter
|
||||||
|
}
|
||||||
|
let $dateArrayOutput = ($dateArrayOutput | drop 1) | str join ' '
|
||||||
|
|
||||||
|
# $dateArray[0]
|
||||||
|
mut $hours = 0min
|
||||||
|
while (($dateArray | length) > 0) {
|
||||||
|
$hours += ($dateArray | get 1 | into datetime) - ($dateArray | get 0 | into datetime)
|
||||||
|
$dateArray = $dateArray | skip 2
|
||||||
|
}
|
||||||
|
$"($dateArrayOutput)\n($hours | into string)"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export def lumen-headset-power-toggle []: nothing -> nothing {
|
||||||
|
sudo uhubctl -f -a toggle -p 1 -l 3-5
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
export def lumen-kwin-get-class [waittimesec: int]: nothing -> string {
|
||||||
|
if ($waittimesec == 0) {
|
||||||
|
qdbus6 org.kde.KWin /KWin queryWindowInfo
|
||||||
|
} else {
|
||||||
|
for $i in $waittimesec..1 {
|
||||||
|
$i | print
|
||||||
|
sleep 1sec
|
||||||
|
}
|
||||||
|
qdbus6 org.kde.KWin /KWin queryWindowInfo
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
export def lumen-search-content [searchstr: string]: any -> table {
|
||||||
|
let $tmp = (if ($in != null) {
|
||||||
|
$in
|
||||||
|
} else {
|
||||||
|
pwd
|
||||||
|
})
|
||||||
|
cd $tmp
|
||||||
|
ls -a **/* | par-each {|i|
|
||||||
|
{file: $i.name,
|
||||||
|
content: (if (($i | get type) == file ) {
|
||||||
|
try {open $i.name --raw | find $searchstr} catch {{}}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} | compact content -e
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
# config.nu
|
||||||
|
#
|
||||||
|
# Installed by:
|
||||||
|
# version = "0.104.1"
|
||||||
|
#
|
||||||
|
# This file is used to override default Nushell settings, define
|
||||||
|
# (or import) custom commands, or run any other startup tasks.
|
||||||
|
# See https://www.nushell.sh/book/configuration.html
|
||||||
|
#
|
||||||
|
# This file is loaded after env.nu and before login.nu
|
||||||
|
#
|
||||||
|
# You can open this file in your default editor using:
|
||||||
|
# config nu
|
||||||
|
#
|
||||||
|
# See `help config nu` for more options
|
||||||
|
#
|
||||||
|
# You can remove these comments if you want or leave
|
||||||
|
# them for future reference.
|
||||||
|
|
||||||
|
$env.EDITOR = 'nvim'
|
||||||
|
$env.VISUAL = 'nvim'
|
||||||
|
|
||||||
|
use std/util 'path add'
|
||||||
|
path add '~/.local/bin'
|
||||||
|
path add '~/.cargo/bin'
|
||||||
|
|
||||||
|
$env.config.show_banner = false
|
||||||
|
$env.config.table.trim.methodology = 'truncating'
|
||||||
|
$env.config.table.trim.truncating_suffix = ' >>'
|
||||||
|
$env.config.table.mode = 'frameless'
|
||||||
|
|
||||||
|
if ((sys host).name !~ '.*Windows.*') {
|
||||||
|
$env.SSH_AUTH_SOCK = $'($env.HOME)/.var/app/com.bitwarden.desktop/data/.bitwarden-ssh-agent.sock'
|
||||||
|
# $env.SSH_AUTH_SOCK = $'($env.HOME)/.bitwarden-ssh-agent.sock'
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
carapace _carapace nushell | let carapace_nu
|
||||||
|
mkdir $'($nu.cache-dir)'
|
||||||
|
$carapace_nu | save --force $'($nu.cache-dir)/carapace.nu'
|
||||||
|
} catch {}
|
||||||
|
source (if ($'($nu.cache-dir)/carapace.nu' | path exists) {($'($nu.cache-dir)/carapace.nu')} else { null })
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
-- Set Language {{{
|
|
||||||
vim.api.nvim_exec2('language POSIX', {})
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- Source plugins if they exist {{{
|
|
||||||
pcall(require, 'mini-pick')
|
|
||||||
pcall(require, 'treesitter')
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- General Editor Settings {{{
|
|
||||||
vim.opt.number = true
|
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.tabstop = 4
|
|
||||||
vim.opt.shiftwidth = 4
|
|
||||||
vim.opt.expandtab = false
|
|
||||||
vim.opt.list = true
|
|
||||||
vim.opt.listchars:append 'space:·'
|
|
||||||
vim.opt.wildmenu = true
|
|
||||||
vim.opt.wrap = false
|
|
||||||
vim.opt.clipboard = 'unnamedplus'
|
|
||||||
vim.opt.ignorecase = true
|
|
||||||
vim.opt.smartcase = true
|
|
||||||
vim.opt.inccommand = 'split'
|
|
||||||
vim.opt.foldmethod = 'marker'
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- Setup (Disable) Netrw {{{
|
|
||||||
vim.g.loaded_netrw = 1
|
|
||||||
vim.g.loaded_netrwPlugin = 1
|
|
||||||
--[[
|
|
||||||
vim.g.netrw_banner = 0
|
|
||||||
vim.g.netrw_sort_sequence = '[\\/]$'
|
|
||||||
vim.g.netrw_sort_options = 'i'
|
|
||||||
vim.g.netrw_silent = 1
|
|
||||||
]]
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- WriteSudo and ReadSudo hacks {{{
|
|
||||||
vim.api.nvim_create_user_command('WriteSudo', 'w !sudo tee %', {})
|
|
||||||
vim.api.nvim_create_user_command('ReadSudo', function(opts)
|
|
||||||
vim.cmd('r !sudo cat ' .. opts['args'])
|
|
||||||
end, { nargs = 1 })
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- Statusbar {{{
|
|
||||||
vim.opt.statusline = ' #%n %f %h%w%m%r %= %{&fileformat} %y %l:%c %p%% '
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- Toggle Terminal Script {{{
|
|
||||||
local term_buf = nil
|
|
||||||
local term_winid = nil
|
|
||||||
|
|
||||||
local function openTerminal()
|
|
||||||
if vim.fn.bufexists(term_buf) ~= 1 then
|
|
||||||
vim.api.nvim_command('autocmd TermOpen * setlocal nonumber norelativenumber signcolumn=no')
|
|
||||||
vim.api.nvim_command('split | wincmd J | resize 10 | term')
|
|
||||||
term_winid = vim.fn.win_getid()
|
|
||||||
term_buf = vim.fn.bufnr('%')
|
|
||||||
elseif vim.fn.win_gotoid(term_winid) ~= 1 then
|
|
||||||
vim.api.nvim_command('sbuffer ' .. term_buf .. '| wincmd J | resize 10')
|
|
||||||
term_winid = vim.fn.win_getid()
|
|
||||||
end
|
|
||||||
vim.api.nvim_command('startinsert')
|
|
||||||
end
|
|
||||||
|
|
||||||
local function hideTerminal()
|
|
||||||
if vim.fn.win_gotoid(term_winid) == 1 then
|
|
||||||
vim.api.nvim_command('hide')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function ToggleTerminal()
|
|
||||||
if vim.fn.win_gotoid(term_winid) == 1 then
|
|
||||||
hideTerminal()
|
|
||||||
else
|
|
||||||
openTerminal()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- Automatic insertmode in Terminal Mode {{{
|
|
||||||
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
|
||||||
pattern = { 'term://*' },
|
|
||||||
command = 'startinsert',
|
|
||||||
})
|
|
||||||
-- }}}
|
|
||||||
|
|
||||||
-- Keymaps {{{
|
|
||||||
vim.keymap.set('n', '<F6>', ':b#<CR>', { noremap = true, silent = true })
|
|
||||||
vim.keymap.set('n', '<F7>', ':bprevious<CR>', { noremap = true, silent = true })
|
|
||||||
vim.keymap.set('n', '<F8>', ':bnext<CR>', { noremap = true, silent = true })
|
|
||||||
vim.keymap.set('n', '<leader>f', ':Pick files<CR>', { noremap = true })
|
|
||||||
vim.keymap.set('n', '<leader>g', ':Pick grep_live<CR>', { noremap = true })
|
|
||||||
vim.keymap.set('n', '<leader>b', ':Pick buffers<CR>', { noremap = true })
|
|
||||||
vim.keymap.set('n', '<leader>t', ToggleTerminal)
|
|
||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>')
|
|
||||||
vim.keymap.set('n', 'x', '"_x')
|
|
||||||
-- }}}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require('mini.pick').setup()
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
require('nvim-treesitter.install').prefer_git = true
|
|
||||||
require('nvim-treesitter.configs').setup {
|
|
||||||
auto_install = true,
|
|
||||||
highlight = { enable = true },
|
|
||||||
indent = { enable = true }
|
|
||||||
}
|
|
||||||
Submodule pack/plugins/start/mini.nvim deleted from 94cae4660a
Submodule pack/plugins/start/nvim-treesitter deleted from 42fc28ba91
@@ -1 +0,0 @@
|
|||||||
git submodule update --init --remote --recursive
|
|
||||||
Reference in New Issue
Block a user