Compare commits
7 Commits
nvim
..
1f96e4ef15
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f96e4ef15 | |||
| 7fa9fd78b0 | |||
| 704ce76284 | |||
| eb35a68b9a | |||
| e6d839432f | |||
| 7b212c6037 | |||
| f2cb448b37 |
+2
-1
@@ -1 +1,2 @@
|
||||
nvim-pack-lock.json
|
||||
env.nu
|
||||
history.txt
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export def lumen-assono-overtime-calc [startdate = datetime]: nothing -> string {
|
||||
pwsh -command $'Invoke-assOrgaOvertimeCalculator ($startdate)'
|
||||
}
|
||||
@@ -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,9 @@
|
||||
export def lumen-kwin-get-class [waittimesec = int]: nothing -> string {
|
||||
mut timer = ($waittimesec | into int)
|
||||
while ($timer > 0) {
|
||||
$timer | print
|
||||
$timer -= 1
|
||||
sleep 1sec
|
||||
}
|
||||
qdbus6 org.kde.KWin /KWin queryWindowInfo
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export def lumen-search-content [searchstr = string]: any -> table {
|
||||
let $tmp = $in
|
||||
mut $path = pwd
|
||||
if ($tmp != null) {
|
||||
$path = $tmp
|
||||
}
|
||||
cd $path
|
||||
ls -a **/* | par-each {|i|
|
||||
{file: $i.name,
|
||||
content: (if (($i | get type) == file ) {
|
||||
try {open $i.name --raw | find $searchstr} catch {|err| {}}
|
||||
})
|
||||
}
|
||||
} | compact content -e
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
# 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.config.show_banner = false
|
||||
$env.EDITOR = 'hx'
|
||||
$env.VISUAL = 'hx'
|
||||
@@ -1,113 +0,0 @@
|
||||
-- Set Language {{{
|
||||
vim.api.nvim_exec2('language POSIX', {})
|
||||
-- }}}
|
||||
|
||||
-- Plugins {{{
|
||||
if os.execute('which git') == 0 then
|
||||
vim.pack.add({'https://github.com/nvim-mini/mini.pick'})
|
||||
pcall(function() require('mini.pick').setup() end)
|
||||
end
|
||||
-- }}}
|
||||
|
||||
-- General Editor Settings {{{
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars:append 'space:·'
|
||||
vim.opt.wildmenu = true
|
||||
vim.opt.wrap = false
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.inccommand = 'split'
|
||||
vim.opt.foldmethod = 'marker'
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = false
|
||||
-- }}}
|
||||
|
||||
-- Setup Clipboard for OSC 52 {{{
|
||||
vim.g.clipboard = 'osc52'
|
||||
-- }}}
|
||||
|
||||
-- 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')
|
||||
vim.keymap.set('n', '<leader>y', '"+y')
|
||||
vim.keymap.set('n', '<leader>Y', '"+y$')
|
||||
vim.keymap.set('n', '<leader>p', '"+p')
|
||||
vim.keymap.set('n', '<leader>P', '"+P')
|
||||
vim.keymap.set('v', '<leader>y', '"+y')
|
||||
vim.keymap.set('v', '<leader>Y', '"+y$')
|
||||
vim.keymap.set('v', '<leader>p', '"+p')
|
||||
vim.keymap.set('v', '<leader>P', '"+P')
|
||||
-- }}}
|
||||
Reference in New Issue
Block a user