Compare commits
22 Commits
14159884fa
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| b5dee7e0f2 | |||
| 145a25974e | |||
| 7e925b2c31 | |||
| ead675c788 | |||
| ff3f9e4604 | |||
| 60c67eecee | |||
| 3b349870d8 | |||
| 2fa4e8b410 | |||
| b8c520d600 | |||
| 0bf63bd848 | |||
| 7f2ecfaa3f | |||
| ef8459d278 | |||
| 28b8b35561 | |||
| d6c0cc2358 | |||
| a8452abee8 | |||
| 8fafb14b77 | |||
| c37b908c12 | |||
| 47d6d42a38 | |||
| dcfff8dbbf | |||
| b1d05220ae | |||
| b1f1ff8545 | |||
| 8129a8a2f3 |
@@ -0,0 +1,79 @@
|
|||||||
|
[colors.bright]
|
||||||
|
black = "#6272a4"
|
||||||
|
blue = "#d6acff"
|
||||||
|
cyan = "#a4ffff"
|
||||||
|
green = "#69ff94"
|
||||||
|
magenta = "#ff92df"
|
||||||
|
red = "#ff6e6e"
|
||||||
|
white = "#ffffff"
|
||||||
|
yellow = "#ffffa5"
|
||||||
|
|
||||||
|
[colors.cursor]
|
||||||
|
cursor = "CellForeground"
|
||||||
|
text = "CellBackground"
|
||||||
|
|
||||||
|
[colors.footer_bar]
|
||||||
|
background = "#282a36"
|
||||||
|
foreground = "#f8f8f2"
|
||||||
|
|
||||||
|
[colors.hints.end]
|
||||||
|
background = "#282a36"
|
||||||
|
foreground = "#f1fa8c"
|
||||||
|
|
||||||
|
[colors.hints.start]
|
||||||
|
background = "#f1fa8c"
|
||||||
|
foreground = "#282a36"
|
||||||
|
|
||||||
|
[colors.line_indicator]
|
||||||
|
background = "None"
|
||||||
|
foreground = "None"
|
||||||
|
|
||||||
|
[colors.normal]
|
||||||
|
black = "#21222c"
|
||||||
|
blue = "#bd93f9"
|
||||||
|
cyan = "#8be9fd"
|
||||||
|
green = "#50fa7b"
|
||||||
|
magenta = "#ff79c6"
|
||||||
|
red = "#ff5555"
|
||||||
|
white = "#f8f8f2"
|
||||||
|
yellow = "#f1fa8c"
|
||||||
|
|
||||||
|
[colors.primary]
|
||||||
|
background = "#282a36"
|
||||||
|
bright_foreground = "#ffffff"
|
||||||
|
foreground = "#f8f8f2"
|
||||||
|
|
||||||
|
[colors.search.focused_match]
|
||||||
|
background = "#ffb86c"
|
||||||
|
foreground = "#44475a"
|
||||||
|
|
||||||
|
[colors.search.matches]
|
||||||
|
background = "#11aa7b"
|
||||||
|
foreground = "#44475a"
|
||||||
|
|
||||||
|
[colors.selection]
|
||||||
|
background = "#44475a"
|
||||||
|
text = "CellForeground"
|
||||||
|
|
||||||
|
[colors.vi_mode_cursor]
|
||||||
|
cursor = "CellForeground"
|
||||||
|
text = "CellBackground"
|
||||||
|
|
||||||
|
[font]
|
||||||
|
size = 10
|
||||||
|
|
||||||
|
[font.bold]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Bold"
|
||||||
|
|
||||||
|
[font.bold_italic]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Bold Italic"
|
||||||
|
|
||||||
|
[font.italic]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Italic"
|
||||||
|
|
||||||
|
[font.normal]
|
||||||
|
family = "SFMono Nerd Font"
|
||||||
|
style = "Regular"
|
||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
[push]
|
[push]
|
||||||
default = simple
|
default = simple
|
||||||
|
autoSetupRemote = true
|
||||||
|
|
||||||
[fetch]
|
[fetch]
|
||||||
prune = true
|
prune = true
|
||||||
|
|||||||
+174
-55
@@ -32,61 +32,11 @@ require("nvim-tree").setup({
|
|||||||
dotfiles = false,
|
dotfiles = false,
|
||||||
custom = { "^.git$" },
|
custom = { "^.git$" },
|
||||||
},
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- mason
|
|
||||||
require("mason").setup()
|
|
||||||
require("mason-lspconfig").setup()
|
|
||||||
|
|
||||||
-- lspconfig
|
|
||||||
-- require('lspconfig')['gofumpt'].setup{}
|
|
||||||
-- require('lspconfig')['golines'].setup{}
|
|
||||||
-- require('lspconfig')['goimports'].setup{}
|
|
||||||
require('lspconfig')['gopls'].setup{
|
|
||||||
on_attach = on_attach,
|
|
||||||
cmd = {"gopls"},
|
|
||||||
filetypes = {"go", "gomod", "gowork", "dotmpl"},
|
|
||||||
settings = {
|
|
||||||
gopls = {
|
|
||||||
gofumpt = true,
|
|
||||||
completeUnimported = true,
|
|
||||||
usePlaceholders = true,
|
|
||||||
analyses = {
|
|
||||||
unusedparams = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
require('lspconfig')['pyright'].setup {
|
|
||||||
on_attach = on_attach,
|
|
||||||
flags = lsp_flags,
|
|
||||||
}
|
|
||||||
require('lspconfig')['powershell_es'].setup{}
|
|
||||||
require('lspconfig')['clangd'].setup{}
|
|
||||||
require('lspconfig')['rust_analyzer'].setup{}
|
|
||||||
require('lspconfig')['ansiblels'].setup{}
|
|
||||||
require('lspconfig')['bashls'].setup{}
|
|
||||||
require('lspconfig')['lua_ls'].setup{
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = { 'vim', 'on_attach', 'lsp_flags'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
require('lspconfig')['yamlls'].setup{
|
|
||||||
settings = {
|
|
||||||
yaml = {
|
|
||||||
customTags = { '!vault'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
require('lspconfig')['intelephense'].setup{}
|
|
||||||
require('lspconfig')['grammarly'].setup{}
|
|
||||||
require('lspconfig')['puppet'].setup{}
|
|
||||||
require('lspconfig')['terraformls'].setup{}
|
|
||||||
|
|
||||||
-- Completion Plugin Setup
|
-- Completion Plugin Setup
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
@@ -140,10 +90,167 @@ cmp.setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- LSP configuration using Neovim 0.11+ vim.lsp.config() API
|
||||||
|
-- Note: Default keybindings and capabilities are automatically set
|
||||||
|
|
||||||
|
-- mason (for LSP server management)
|
||||||
|
require("mason").setup()
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
automatic_installation = true,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Go language server configuration
|
||||||
|
vim.lsp.config('gopls', {
|
||||||
|
cmd = {"gopls"},
|
||||||
|
filetypes = {"go", "gomod", "gowork", "gotmpl"},
|
||||||
|
settings = {
|
||||||
|
gopls = {
|
||||||
|
gofumpt = true,
|
||||||
|
completeUnimported = true,
|
||||||
|
usePlaceholders = true,
|
||||||
|
analyses = {
|
||||||
|
unusedparams = true,
|
||||||
|
shadow = true,
|
||||||
|
},
|
||||||
|
hints = {
|
||||||
|
assignVariableTypes = true,
|
||||||
|
compositeLiteralFields = true,
|
||||||
|
compositeLiteralTypes = true,
|
||||||
|
constantValues = true,
|
||||||
|
functionTypeParameters = true,
|
||||||
|
parameterNames = true,
|
||||||
|
rangeVariableTypes = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Python language server
|
||||||
|
vim.lsp.config('pyright', {
|
||||||
|
settings = {
|
||||||
|
python = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "basic",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- PowerShell language server
|
||||||
|
vim.lsp.config('powershell_es', {})
|
||||||
|
|
||||||
|
-- C/C++ language server
|
||||||
|
vim.lsp.config('clangd', {})
|
||||||
|
|
||||||
|
-- Rust language server
|
||||||
|
vim.lsp.config('rust_analyzer', {
|
||||||
|
settings = {
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
checkOnSave = {
|
||||||
|
command = "clippy",
|
||||||
|
},
|
||||||
|
inlayHints = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- -- Ansible language server
|
||||||
|
-- vim.lsp.config('ansiblels', {})
|
||||||
|
|
||||||
|
-- Bash language server
|
||||||
|
vim.lsp.config('bashls', {})
|
||||||
|
|
||||||
|
-- Lua language server
|
||||||
|
vim.lsp.config('lua_ls', {
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = { 'vim' },
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
hint = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- vim.lsp.config('helm_ls', {
|
||||||
|
-- settings = {
|
||||||
|
-- ['helm-ls'] = {
|
||||||
|
-- yamlls = {
|
||||||
|
-- path = "yaml-language-server",
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- -- YAML language server
|
||||||
|
-- vim.lsp.config('yamlls', {
|
||||||
|
-- settings = {
|
||||||
|
-- yaml = {
|
||||||
|
-- customTags = { '!vault' },
|
||||||
|
-- schemas = {
|
||||||
|
-- kubernetes = "*.yaml",
|
||||||
|
-- ["http://json.schemastore.org/github-workflow"] = ".github/workflows/*",
|
||||||
|
-- ["http://json.schemastore.org/ansible-playbook"] = "*play*.{yml,yaml}",
|
||||||
|
-- ["http://json.schemastore.org/chart"] = "Chart.{yml,yaml}",
|
||||||
|
-- ["https://json.schemastore.org/gitlab-ci"] = "*gitlab-ci*.{yml,yaml}",
|
||||||
|
-- ["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = "*docker-compose*.{yml,yaml}",
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
-- })
|
||||||
|
|
||||||
|
-- PHP language server
|
||||||
|
vim.lsp.config('intelephense', {})
|
||||||
|
|
||||||
|
-- Grammar checking
|
||||||
|
vim.lsp.config('grammarly', {})
|
||||||
|
|
||||||
|
-- Puppet language server
|
||||||
|
vim.lsp.config('puppet', {})
|
||||||
|
|
||||||
|
-- Terraform language server
|
||||||
|
vim.lsp.config('terraformls', {})
|
||||||
|
|
||||||
|
-- Enable all configured language servers
|
||||||
|
vim.lsp.enable('gopls')
|
||||||
|
vim.lsp.enable('pyright')
|
||||||
|
vim.lsp.enable('powershell_es')
|
||||||
|
vim.lsp.enable('clangd')
|
||||||
|
vim.lsp.enable('rust_analyzer')
|
||||||
|
-- vim.lsp.enable('ansiblels')
|
||||||
|
vim.lsp.enable('bashls')
|
||||||
|
vim.lsp.enable('lua_ls')
|
||||||
|
-- vim.lsp.enable('yamlls')
|
||||||
|
-- vim.lsp.enable('helm_ls')
|
||||||
|
vim.lsp.enable('intelephense')
|
||||||
|
vim.lsp.enable('grammarly')
|
||||||
|
vim.lsp.enable('puppet')
|
||||||
|
vim.lsp.enable('terraformls')
|
||||||
|
vim.api.nvim_create_autocmd({"BufWritePre"}, {
|
||||||
|
pattern = {"*.tf", "*.tfvars"},
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- treesitter
|
-- treesitter
|
||||||
require('nvim-treesitter.configs').setup {
|
require('nvim-treesitter.configs').setup {
|
||||||
--ensure_installed = { "lua", "toml", "python", "bash", "yaml", "go" },
|
ensure_installed = { "lua", "toml", "python", "bash", "yaml", "go" },
|
||||||
ensure_installed = "all",
|
--ensure_installed = "all",
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
@@ -223,3 +330,15 @@ require('mini.indentscope').setup()
|
|||||||
require('mini.splitjoin').setup()
|
require('mini.splitjoin').setup()
|
||||||
require('mini.surround').setup()
|
require('mini.surround').setup()
|
||||||
require('mini.trailspace').setup()
|
require('mini.trailspace').setup()
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufEnter", {
|
||||||
|
pattern = "*.py",
|
||||||
|
callback = function()
|
||||||
|
vim.defer_fn(function()
|
||||||
|
local venv_path = vim.fn.getcwd() .. "/.venv/bin/python"
|
||||||
|
if vim.fn.filereadable(venv_path) == 1 then
|
||||||
|
vim.cmd("PyrightSetPythonPath " .. venv_path)
|
||||||
|
end
|
||||||
|
end, 1000) -- 1 second delay (1000ms)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|||||||
+46
-13
@@ -1,27 +1,60 @@
|
|||||||
-- FUNCTIONS --
|
-- FUNCTIONS --
|
||||||
|
|
||||||
-- all language functions
|
-- all language functions
|
||||||
vim.cmd [[
|
require('func.utils')
|
||||||
augroup lang_all
|
require('func.tabline')
|
||||||
autocmd!
|
require('func.popterm')
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/utils.lua
|
require('func.sessions')
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/tabline.lua
|
require('func.findfile')
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/popterm.lua
|
|
||||||
autocmd FileType * luafile ~/.config/nvim/lua/func/sessions.lua
|
-- vim.cmd [[
|
||||||
augroup END
|
-- augroup lang_all
|
||||||
]]
|
-- autocmd!
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/utils.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/tabline.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/popterm.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/sessions.lua
|
||||||
|
-- autocmd FileType * luafile ~/.config/nvim/lua/func/findfile.lua
|
||||||
|
-- augroup END
|
||||||
|
-- ]]
|
||||||
|
|
||||||
-- puppet language keybindings
|
-- puppet language keybindings
|
||||||
vim.cmd [[
|
vim.cmd [[
|
||||||
augroup lang_puppet
|
augroup lang_puppet
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gg :call OpenPuppetClassOrTemplate(tab)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gg :call OpenPuppetClassOrTemplate('tab')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gt :call OpenPuppetClassOrTemplate(tab)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gt :call OpenPuppetClassOrTemplate('tab')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gh :call OpenPuppetClassOrTemplate(horizontal)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gh :call OpenPuppetClassOrTemplate('horizontal')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>gv :call OpenPuppetClassOrTemplate(vertical)<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>gv :call OpenPuppetClassOrTemplate('vertical')<CR>
|
||||||
autocmd FileType puppet nnoremap <buffer> <Leader>t :call OpenPuppetTestMode()<CR>
|
autocmd FileType puppet nnoremap <buffer> <Leader>t :call OpenPuppetTestMode()<CR>
|
||||||
autocmd BufNewFile site/roles/manifests/**.pp call ApplyPuppetTemplate()
|
autocmd BufNewFile site/roles/manifests/**.pp call ApplyPuppetTemplate()
|
||||||
autocmd BufNewFile site/profiles/manifests/**.pp call ApplyPuppetTemplate()
|
autocmd BufNewFile site/profiles/manifests/**.pp call ApplyPuppetTemplate()
|
||||||
augroup END
|
augroup END
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
-- erb/eruby language keybindings
|
||||||
|
vim.cmd [[
|
||||||
|
augroup lang_eruby
|
||||||
|
autocmd!
|
||||||
|
autocmd FileType eruby nnoremap <buffer> <Leader>s :call ToggleERBSyntax()<CR>
|
||||||
|
augroup END
|
||||||
|
]]
|
||||||
|
|
||||||
|
|
||||||
|
-- terraform language keybindings
|
||||||
|
vim.cmd [[
|
||||||
|
augroup lang_terraform
|
||||||
|
autocmd!
|
||||||
|
autocmd BufNewFile,BufRead *.tf set filetype=terraform
|
||||||
|
augroup END
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- tmpl language keybindings
|
||||||
|
vim.cmd [[
|
||||||
|
augroup lang_tmpl
|
||||||
|
autocmd!
|
||||||
|
autocmd BufNewFile,BufRead *.yml.tmpl set filetype=yaml
|
||||||
|
autocmd BufNewFile,BufRead *.yaml.tmpl set filetype=yaml
|
||||||
|
autocmd BufNewFile,BufRead *.hcl.tmpl set filetype=hcl
|
||||||
|
augroup END
|
||||||
|
]]
|
||||||
|
|||||||
@@ -0,0 +1,95 @@
|
|||||||
|
vim.cmd([[
|
||||||
|
let g:previous_buffer = 0
|
||||||
|
|
||||||
|
function! FindFile(searchType)
|
||||||
|
" Store the buffer number of the current window
|
||||||
|
let g:previous_buffer = bufnr('%')
|
||||||
|
|
||||||
|
" Prompt user for search pattern
|
||||||
|
let pattern = input('Enter search pattern: ')
|
||||||
|
let keywords = split(pattern)
|
||||||
|
" Construct a regex pattern for flexible matching in paths
|
||||||
|
let regex_pattern = join(map(keywords, 'escape(v:val, "\\/$.*[~")'), '.*')
|
||||||
|
|
||||||
|
" Initialize an empty list for results
|
||||||
|
let results = []
|
||||||
|
|
||||||
|
" Find in file content
|
||||||
|
if a:searchType ==# 'string' || a:searchType ==# 'all'
|
||||||
|
let cmd_content = "rg --column --no-heading --color=never -l " . shellescape(pattern)
|
||||||
|
let results_content = systemlist(cmd_content)
|
||||||
|
let results = results + results_content
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Find in file path with the constructed regex pattern
|
||||||
|
if a:searchType ==# 'path' || a:searchType ==# 'all'
|
||||||
|
" Use the regex pattern for searching in paths
|
||||||
|
let cmd_path = "rg --files | grep -P '" . regex_pattern . "'"
|
||||||
|
let results_path = systemlist(cmd_path)
|
||||||
|
let results = results + results_path
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Remove duplicates and sort the results
|
||||||
|
let results = sort(uniq(results))
|
||||||
|
|
||||||
|
if empty(results)
|
||||||
|
echo "No files found for pattern: " . pattern
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Open a new split window at the bottom
|
||||||
|
new
|
||||||
|
" Set the height of the new split window
|
||||||
|
resize 10
|
||||||
|
|
||||||
|
" Set the buffer to be unlisted, no swapfile
|
||||||
|
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile
|
||||||
|
|
||||||
|
" Clear the 'readonly' option in case it's set by default
|
||||||
|
setlocal noreadonly
|
||||||
|
|
||||||
|
" Populate the buffer with the search results
|
||||||
|
call setline(1, results)
|
||||||
|
|
||||||
|
" Make the buffer read-only after populating it
|
||||||
|
setlocal readonly
|
||||||
|
|
||||||
|
" Map keys to open files in different modes
|
||||||
|
nnoremap <silent> <buffer> <CR> :call OpenFile('edit', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> v :call OpenFile('vsplit', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> h :call OpenFile('split', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> t :call OpenFile('tabedit', g:previous_buffer)<CR>
|
||||||
|
nnoremap <silent> <buffer> q :close<CR>
|
||||||
|
|
||||||
|
" Focus on the results window
|
||||||
|
normal! G
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! OpenFile(openType, bufnr)
|
||||||
|
" Extract the file path from the current line
|
||||||
|
let file_path = getline('.')
|
||||||
|
if filereadable(file_path)
|
||||||
|
" Save the current buffer number
|
||||||
|
let current_bufnr = bufnr('%')
|
||||||
|
" Close the search results window
|
||||||
|
bd!
|
||||||
|
" Switch to the buffer that was active before the search
|
||||||
|
execute 'buffer' g:previous_buffer
|
||||||
|
" Open the file based on the specified openType
|
||||||
|
execute a:openType . ' ' . file_path
|
||||||
|
" If opening in a new tab, switch back to the original buffer in the new tab
|
||||||
|
if a:openType == 'tabnew'
|
||||||
|
execute 'tabnext'
|
||||||
|
execute 'buffer' . current_bufnr
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
echo "File does not exist or cannot be read"
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
nnoremap <Leader>ff :call FindFile("string")<CR>
|
||||||
|
nnoremap <Leader>fs :call FindFile("string")<CR>
|
||||||
|
nnoremap <Leader>fp :call FindFile("path")<CR>
|
||||||
|
nnoremap <Leader>fa :call FindFile("all")<CR>
|
||||||
|
|
||||||
|
]])
|
||||||
@@ -1,9 +1,31 @@
|
|||||||
-- enter testmode
|
-- Popterm configuration with named terminals support
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
" nvim-only config
|
" nvim-only config
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
|
|
||||||
function! OpenCenteredTerminal()
|
" Global dictionaries to track terminal windows and buffers by name
|
||||||
|
let g:popterm_windows = {}
|
||||||
|
let g:popterm_buffers = {}
|
||||||
|
let g:popterm_current_win = -1
|
||||||
|
|
||||||
|
function! ToggleNamedPopterm(name, command)
|
||||||
|
" Check if this named terminal window exists and is valid
|
||||||
|
if has_key(g:popterm_windows, a:name) && g:popterm_windows[a:name] != -1 && nvim_win_is_valid(g:popterm_windows[a:name])
|
||||||
|
" Close the terminal window
|
||||||
|
call nvim_win_close(g:popterm_windows[a:name], v:false)
|
||||||
|
let g:popterm_windows[a:name] = -1
|
||||||
|
let g:popterm_current_win = -1
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Close any other open popterm window first
|
||||||
|
for [term_name, win_id] in items(g:popterm_windows)
|
||||||
|
if win_id != -1 && nvim_win_is_valid(win_id)
|
||||||
|
call nvim_win_close(win_id, v:false)
|
||||||
|
let g:popterm_windows[term_name] = -1
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
" Calculate the desired width and height as 80% of the current window size
|
" Calculate the desired width and height as 80% of the current window size
|
||||||
let height = float2nr((&lines * 0.8) / 1)
|
let height = float2nr((&lines * 0.8) / 1)
|
||||||
let width = float2nr((&columns * 0.8) / 1)
|
let width = float2nr((&columns * 0.8) / 1)
|
||||||
@@ -12,27 +34,64 @@ vim.cmd([[
|
|||||||
let top = float2nr((&lines - height) / 2)
|
let top = float2nr((&lines - height) / 2)
|
||||||
let left = float2nr((&columns - width) / 2)
|
let left = float2nr((&columns - width) / 2)
|
||||||
|
|
||||||
" Define options for the floating window, including its size and position
|
" Define options for the floating window with border
|
||||||
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
|
let opts = {
|
||||||
|
\ 'relative': 'editor',
|
||||||
|
\ 'row': top,
|
||||||
|
\ 'col': left,
|
||||||
|
\ 'width': width,
|
||||||
|
\ 'height': height,
|
||||||
|
\ 'style': 'minimal',
|
||||||
|
\ 'border': 'rounded',
|
||||||
|
\ 'title': ' ' . a:name . ' ',
|
||||||
|
\ 'title_pos': 'center'
|
||||||
|
\ }
|
||||||
|
|
||||||
" Create a new buffer for the terminal, set it to not listed and with no swapfile
|
" Reuse existing buffer for this terminal or create new one
|
||||||
let buf = nvim_create_buf(v:false, v:true)
|
if !has_key(g:popterm_buffers, a:name) || g:popterm_buffers[a:name] == -1 || !nvim_buf_is_valid(g:popterm_buffers[a:name])
|
||||||
|
let g:popterm_buffers[a:name] = nvim_create_buf(v:false, v:true)
|
||||||
|
endif
|
||||||
|
|
||||||
" Open a new window with the terminal buffer, applying the specified options
|
" Open a new window with the terminal buffer
|
||||||
call nvim_open_win(buf, v:true, opts)
|
let g:popterm_windows[a:name] = nvim_open_win(g:popterm_buffers[a:name], v:true, opts)
|
||||||
|
let g:popterm_current_win = g:popterm_windows[a:name]
|
||||||
|
|
||||||
" Run the default shell in the terminal
|
" Start terminal if buffer is empty or hasn't been initialized
|
||||||
call termopen($SHELL)
|
let buffer_lines = nvim_buf_get_lines(g:popterm_buffers[a:name], 0, -1, v:false)
|
||||||
|
if empty(buffer_lines) || (len(buffer_lines) == 1 && buffer_lines[0] == '')
|
||||||
|
if a:command != ''
|
||||||
|
call termopen(a:command, {'buffer': g:popterm_buffers[a:name]})
|
||||||
|
else
|
||||||
|
call termopen($SHELL, {'buffer': g:popterm_buffers[a:name]})
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
" Adjust the focus to the newly opened terminal window
|
" Set terminal-specific key mappings for this terminal
|
||||||
|
execute 'tnoremap <buffer> <leader>T <C-\><C-n>:call ToggleNamedPopterm("' . a:name . '", "' . a:command . '")<CR>'
|
||||||
|
execute 'tnoremap <buffer> <leader>a <C-\><C-n>:call ToggleNamedPopterm("claude", "claude")<CR>'
|
||||||
|
|
||||||
|
" Enter insert mode
|
||||||
startinsert
|
startinsert
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Define the :Popterm command to open the centered terminal
|
" Wrapper functions for specific terminals
|
||||||
command! Popterm call OpenCenteredTerminal()
|
function! TogglePopterm()
|
||||||
|
call ToggleNamedPopterm('general', '')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! ToggleClaudePopterm()
|
||||||
|
call ToggleNamedPopterm('claude', 'claude')
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
" Define commands
|
||||||
highlight Terminal guibg=#000000 guifg=none
|
highlight Terminal guibg=#000000 guifg=none
|
||||||
|
command! Popterm call TogglePopterm()
|
||||||
|
command! ClaudePopterm call ToggleClaudePopterm()
|
||||||
|
|
||||||
|
" Key mappings
|
||||||
nnoremap T :Popterm<CR>
|
nnoremap T :Popterm<CR>
|
||||||
autocmd TermOpen * setlocal winhighlight=Normal:Terminal
|
nnoremap <S-t> :Popterm<CR>
|
||||||
|
nnoremap <leader>a :ClaudePopterm<CR>
|
||||||
|
|
||||||
endif
|
endif
|
||||||
]])
|
]])
|
||||||
|
|||||||
@@ -46,6 +46,89 @@ function! OpenPuppetProfileOrRole(layout)
|
|||||||
" Initialize an empty variable for the directory
|
" Initialize an empty variable for the directory
|
||||||
let dirpath = ""
|
let dirpath = ""
|
||||||
|
|
||||||
|
" List modules in puppet-control here
|
||||||
|
let module_list = []
|
||||||
|
call add(module_list, 'certbot')
|
||||||
|
call add(module_list, 'droneci')
|
||||||
|
call add(module_list, 'frrouting')
|
||||||
|
call add(module_list, 'glauth')
|
||||||
|
call add(module_list, 'incus')
|
||||||
|
call add(module_list, 'jellyfin')
|
||||||
|
call add(module_list, 'lidarr')
|
||||||
|
call add(module_list, 'networking')
|
||||||
|
call add(module_list, 'nzbget')
|
||||||
|
call add(module_list, 'prowlarr')
|
||||||
|
call add(module_list, 'radarr')
|
||||||
|
call add(module_list, 'readarr')
|
||||||
|
call add(module_list, 'redisha')
|
||||||
|
call add(module_list, 'sonarr')
|
||||||
|
call add(module_list, 'vlcluster')
|
||||||
|
call add(module_list, 'vmcluster')
|
||||||
|
|
||||||
|
" Check if the class name starts with 'profiles::' or 'roles::'
|
||||||
|
if classname =~ '^profiles::'
|
||||||
|
let dirpath = "site/profiles/manifests/"
|
||||||
|
let classname = substitute(classname, 'profiles::', '', '')
|
||||||
|
elseif classname =~ '^roles::'
|
||||||
|
let dirpath = "site/roles/manifests/"
|
||||||
|
let classname = substitute(classname, 'roles::', '', '')
|
||||||
|
else
|
||||||
|
let matched = 0
|
||||||
|
for module in module_list
|
||||||
|
if classname =~ '^' . module . '::'
|
||||||
|
let dirpath = "modules/" . module . "/manifests/"
|
||||||
|
let parts = split(classname, '::')
|
||||||
|
if len(parts) > 1
|
||||||
|
let classname = join(parts[1:], '::')
|
||||||
|
else
|
||||||
|
let classname = 'init'
|
||||||
|
endif
|
||||||
|
let matched = 1
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
if matched == 0
|
||||||
|
if classname =~ '::'
|
||||||
|
echo "Unknown module"
|
||||||
|
return
|
||||||
|
else
|
||||||
|
echo "Unknown class prefix, should be profiles:: or roles::, or be a listed module."
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" Replace :: with / to convert class name to file path
|
||||||
|
let filepath = substitute(classname, '::', '/', 'g')
|
||||||
|
|
||||||
|
" Create the full file path
|
||||||
|
let fullpath = dirpath . filepath . ".pp"
|
||||||
|
|
||||||
|
" Open the file in a new tab
|
||||||
|
if a:layout == 'horizontal'
|
||||||
|
execute 'split ' . fullpath
|
||||||
|
elseif a:layout == 'vertical'
|
||||||
|
execute 'vsplit ' . fullpath
|
||||||
|
elseif a:layout == 'tab'
|
||||||
|
execute 'tabedit ' . fullpath
|
||||||
|
else
|
||||||
|
echo "Invalid layout specified."
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
]])
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
|
function! OpenPuppetProfileOrRoleOriginal(layout)
|
||||||
|
|
||||||
|
" Get the line under the cursor
|
||||||
|
let line = getline(".")
|
||||||
|
|
||||||
|
" Use a regex to find the full class name
|
||||||
|
let classname = tolower(matchstr(line, '\v\w+(\:\:\w+)+'))
|
||||||
|
|
||||||
|
" Initialize an empty variable for the directory
|
||||||
|
let dirpath = ""
|
||||||
|
|
||||||
" Check if the class name starts with 'profiles::' or 'roles::'
|
" Check if the class name starts with 'profiles::' or 'roles::'
|
||||||
if classname =~ '^profiles::'
|
if classname =~ '^profiles::'
|
||||||
let dirpath = "site/profiles/manifests/"
|
let dirpath = "site/profiles/manifests/"
|
||||||
@@ -116,19 +199,19 @@ endfunction
|
|||||||
|
|
||||||
-- open puppet resource
|
-- open puppet resource
|
||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
function! OpenPuppetClassOrTemplate()
|
function! OpenPuppetClassOrTemplate(layout)
|
||||||
" Get the line under the cursor
|
" Get the line under the cursor
|
||||||
let line = getline(".")
|
let line = getline(".")
|
||||||
|
|
||||||
" Check if it's a template (erb or epp)
|
" Check if it's a template (erb or epp)
|
||||||
if line =~ 'profiles\/.*\.\(erb\|epp\)'
|
if line =~ 'profiles\/.*\.\(erb\|epp\)'
|
||||||
call OpenPuppetTemplate()
|
call OpenPuppetTemplate(a:layout)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Check if it's an included class (profiles:: or roles::)
|
" Check if it's an included class (profiles:: or roles::)
|
||||||
if line =~ '\(profiles\|roles\)::'
|
if line =~ '::'
|
||||||
call OpenPuppetProfileOrRole()
|
call OpenPuppetProfileOrRole(a:layout)
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -187,3 +270,55 @@ function! ApplyPuppetTemplate()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
|
function! ToggleERBSyntax()
|
||||||
|
if !exists('b:original_syntax')
|
||||||
|
" If b:original_syntax is not set, default to eruby and store the current syntax
|
||||||
|
let b:original_syntax = &filetype
|
||||||
|
setlocal syntax=eruby
|
||||||
|
else
|
||||||
|
" If b:original_syntax is set, toggle the syntax based on the current setting
|
||||||
|
if &syntax == 'eruby'
|
||||||
|
" Extract the base file type from the file name
|
||||||
|
let l:filename = expand('%:t')
|
||||||
|
let l:base_filetype = matchstr(l:filename, '\v%(\.\w+)?\.erb$')
|
||||||
|
let l:base_filetype = substitute(l:base_filetype, '\.erb$', '', '')
|
||||||
|
let l:base_filetype = substitute(l:base_filetype, '^.', '', '')
|
||||||
|
|
||||||
|
" Determine the syntax based on the base file type
|
||||||
|
if l:base_filetype == 'sh'
|
||||||
|
setlocal syntax=sh
|
||||||
|
elseif l:base_filetype == 'py'
|
||||||
|
setlocal syntax=python
|
||||||
|
elseif l:base_filetype == 'pl'
|
||||||
|
setlocal syntax=perl
|
||||||
|
elseif l:base_filetype == 'yml' || l:base_filetype == 'yaml'
|
||||||
|
setlocal syntax=yaml
|
||||||
|
else
|
||||||
|
" Attempt to guess the syntax from the shebang if unknown
|
||||||
|
let l:firstline = getline(1)
|
||||||
|
if l:firstline =~# '^#!.*\/bash'
|
||||||
|
setlocal syntax=sh
|
||||||
|
elseif l:firstline =~# '^#!.*\/zsh'
|
||||||
|
setlocal syntax=sh
|
||||||
|
elseif l:firstline =~# '^#!.*\/python'
|
||||||
|
setlocal syntax=python
|
||||||
|
elseif l:firstline =~# '^#!.*\/perl'
|
||||||
|
setlocal syntax=perl
|
||||||
|
else
|
||||||
|
" Fallback to eruby syntax if no known type is found
|
||||||
|
echo "Could not swap syntax highlighter; falling back to eruby."
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
" If the current syntax is not eruby, revert to the original syntax
|
||||||
|
setlocal syntax=eruby
|
||||||
|
echo "Switched back to eruby syntax."
|
||||||
|
endif
|
||||||
|
" Reset b:original_syntax to indicate the syntax has been toggled back
|
||||||
|
unlet b:original_syntax
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
]])
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
vim.cmd([[
|
vim.cmd([[
|
||||||
|
let g:session_dir = expand('~/.cache/nvim/sessions/')
|
||||||
|
if !isdirectory(g:session_dir)
|
||||||
|
call mkdir(g:session_dir, "p")
|
||||||
|
endif
|
||||||
|
|
||||||
command! SaveSession call SaveSession()
|
command! SaveSession call SaveSession()
|
||||||
function! SaveSession()
|
function! SaveSession()
|
||||||
let session_file = g:session_dir . GetRepositoryName() . '_' . GetCurrentGitBranch() . '.vim'
|
let session_file = g:session_dir . GetRepositoryName() . '_' . GetCurrentGitBranch() . '.vim'
|
||||||
|
|||||||
@@ -48,6 +48,6 @@ map('n', 'ff', [[:Telescope find_files]], {})
|
|||||||
-- map('n', 'T', ':lua require("FTerm").toggle()<CR>', {})
|
-- map('n', 'T', ':lua require("FTerm").toggle()<CR>', {})
|
||||||
|
|
||||||
-- Open a file in a vertical split, horizontal split and move a split to a new tab
|
-- Open a file in a vertical split, horizontal split and move a split to a new tab
|
||||||
map('n', '<Leader>sv', ':vsplit ', {noremap = true, silent = false})
|
map('n', '<Leader>ov', ':vsplit ', {noremap = true, silent = false})
|
||||||
map('n', '<Leader>sh', ':split ', {noremap = true, silent = false})
|
map('n', '<Leader>oh', ':split ', {noremap = true, silent = false})
|
||||||
map('n', '<Leader>mt', ':tabedit %<CR>', {noremap = true, silent = true})
|
map('n', '<Leader>mt', ':tabedit %<CR>', {noremap = true, silent = true})
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ return require('packer').startup(function(use)
|
|||||||
use 'hrsh7th/cmp-path'
|
use 'hrsh7th/cmp-path'
|
||||||
use 'hrsh7th/cmp-buffer'
|
use 'hrsh7th/cmp-buffer'
|
||||||
use 'hrsh7th/vim-vsnip'
|
use 'hrsh7th/vim-vsnip'
|
||||||
|
use "rafamadriz/friendly-snippets"
|
||||||
|
|
||||||
-- telescope
|
-- telescope
|
||||||
use {
|
use {
|
||||||
@@ -49,7 +50,9 @@ return require('packer').startup(function(use)
|
|||||||
use { 'numToStr/FTerm.nvim' } -- floating terminal
|
use { 'numToStr/FTerm.nvim' } -- floating terminal
|
||||||
use { 'HampusHauffman/block.nvim' } -- code blocks in different colours
|
use { 'HampusHauffman/block.nvim' } -- code blocks in different colours
|
||||||
use { 'rodjek/vim-puppet' } -- vim puppet enhancements
|
use { 'rodjek/vim-puppet' } -- vim puppet enhancements
|
||||||
|
use { 'jvirtanen/vim-hcl' } -- hcl syntax highlighting
|
||||||
-- use { 'fatih/vim-go' } -- go-vim
|
-- use { 'fatih/vim-go' } -- go-vim
|
||||||
|
use { 'qvalentin/helm-ls.nvim' }
|
||||||
|
|
||||||
|
|
||||||
-- theme
|
-- theme
|
||||||
|
|||||||
+1
-1
Submodule .config/password-store updated: 8bafa7394b...3bd76085eb
@@ -32,6 +32,8 @@ if command -v nvim >/dev/null 2>&1; then
|
|||||||
alias vi='nvim'
|
alias vi='nvim'
|
||||||
fi
|
fi
|
||||||
alias purevim='vim -u NONE'
|
alias purevim='vim -u NONE'
|
||||||
|
alias vimp='xargs nvim -p'
|
||||||
|
|
||||||
|
|
||||||
# tmux
|
# tmux
|
||||||
if [[ -n $TMUX ]]; then
|
if [[ -n $TMUX ]]; then
|
||||||
@@ -70,7 +72,7 @@ alias ypush="yadm push && yadm push origin master"
|
|||||||
# fix commands
|
# fix commands
|
||||||
alias ipcalc='~/.local/bin/ipcalc -n'
|
alias ipcalc='~/.local/bin/ipcalc -n'
|
||||||
alias mpv="mpv -hwdec=vdpau"
|
alias mpv="mpv -hwdec=vdpau"
|
||||||
alias ifstat="/usr/bin/ifstat"
|
alias ifstat="/usr/local/bin/ifstat"
|
||||||
alias snapper="sudo /usr/bin/snapper"
|
alias snapper="sudo /usr/bin/snapper"
|
||||||
alias ap="~/.local/bin/ansible-playbook"
|
alias ap="~/.local/bin/ansible-playbook"
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,22 @@ fi
|
|||||||
export ANSIBLE_NOCOWS=1
|
export ANSIBLE_NOCOWS=1
|
||||||
export ANSIBLE_VAULT_PASSWORD_FILE=$HOME/.local/bin/ansible-vault-pass-client
|
export ANSIBLE_VAULT_PASSWORD_FILE=$HOME/.local/bin/ansible-vault-pass-client
|
||||||
|
|
||||||
|
# VAULT
|
||||||
|
export VAULT_ADDR=https://vault.service.consul:8200
|
||||||
|
vaultlogin () {
|
||||||
|
#vault login $(pass show personal/vault/syd1/token)
|
||||||
|
export VAULT_TOKEN=$(vault login --field=token --method=ldap username=benvin)
|
||||||
|
}
|
||||||
|
|
||||||
|
# CONSUL: https://developer.hashicorp.com/consul/commands
|
||||||
|
export CONSUL_HTTP_ADDR=consul.service.consul
|
||||||
|
export CONSUL_HTTP_TOKEN_FILE=$HOME/.config/consul/token.secret
|
||||||
|
export CONSUL_HTTP_SSL=true
|
||||||
|
export CONSUL_HTTP_SSL_VERIFY=true
|
||||||
|
|
||||||
|
# NOMAD
|
||||||
|
export NOMAD_ADDR=https://nomad.service.consul:4646
|
||||||
|
|
||||||
# set MPD host
|
# set MPD host
|
||||||
export MPD_HOST="$HOME/.config/mpd/socket"
|
export MPD_HOST="$HOME/.config/mpd/socket"
|
||||||
|
|
||||||
@@ -54,6 +70,14 @@ ytpl-export () {yt-dlp -j --flat-playlist "$1" | jq -r '.id' | sed 's_^_https://
|
|||||||
# common date format
|
# common date format
|
||||||
shdate () {date +'%Y%m%d'}
|
shdate () {date +'%Y%m%d'}
|
||||||
|
|
||||||
|
ncurl() {
|
||||||
|
curl --netrc-file <(pass show personal/netrc) "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
export RESTIC_REPOSITORY=s3:https://radosgw.service.consul/restic-personal
|
||||||
|
export RESTIC_PASSWORD_COMMAND="pass show personal/restic/metabox"
|
||||||
|
|
||||||
# create function later:
|
# create function later:
|
||||||
# large image heavy pdf into smaller pdf
|
# large image heavy pdf into smaller pdf
|
||||||
# below will:
|
# below will:
|
||||||
@@ -64,3 +88,55 @@ shdate () {date +'%Y%m%d'}
|
|||||||
# pdftoppm -jpeg -r 300 input_document.pdf output_image
|
# pdftoppm -jpeg -r 300 input_document.pdf output_image
|
||||||
# jpegoptim --size=100k output_image*.jpg
|
# jpegoptim --size=100k output_image*.jpg
|
||||||
# img2pdf $(ls -v output_image*.jpg) -o output_document.pdf
|
# img2pdf $(ls -v output_image*.jpg) -o output_document.pdf
|
||||||
|
|
||||||
|
# Create a git worktree for the current repo.
|
||||||
|
# Usage: newtree <branch-name> [<from-ref>]
|
||||||
|
# - If <from-ref> is omitted, defaults to HEAD.
|
||||||
|
# - Worktree path: $HOME/src/worktrees/<repo_name>/<branch_name_sanitised>
|
||||||
|
# (slashes and dashes in the *path component only* are replaced with underscores)
|
||||||
|
newtree() {
|
||||||
|
local branch from_ref repo_root repo_name sanitized dest parent
|
||||||
|
branch="$1"
|
||||||
|
from_ref="${2:-HEAD}"
|
||||||
|
|
||||||
|
if [[ -z "$branch" ]]; then
|
||||||
|
echo "Usage: newtree <branch-name> [<from-ref>]" >&2
|
||||||
|
return 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Ensure we're inside a git repo
|
||||||
|
if ! repo_root="$(git rev-parse --show-toplevel 2>/dev/null)"; then
|
||||||
|
echo "Error: not inside a git repository." >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
repo_name="$(basename "$repo_root")"
|
||||||
|
|
||||||
|
# Sanitize the branch *for the path only* (keep original branch name for git)
|
||||||
|
sanitized="${branch//[\/-]/_}"
|
||||||
|
dest="$HOME/src/worktrees/$repo_name/$sanitized"
|
||||||
|
parent="$(dirname "$dest")"
|
||||||
|
|
||||||
|
# Create parent dir; git will create the final leaf
|
||||||
|
mkdir -p "$parent" || {
|
||||||
|
echo "Error: unable to create directory: $parent" >&2
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Optional: prune stale worktrees to avoid false conflicts
|
||||||
|
git -C "$repo_root" worktree prune >/dev/null 2>&1
|
||||||
|
|
||||||
|
# Does the branch already exist?
|
||||||
|
if git -C "$repo_root" rev-parse --verify --quiet "refs/heads/$branch" >/dev/null; then
|
||||||
|
echo "Branch '$branch' exists; adding worktree at: $dest"
|
||||||
|
# --force in case the branch is already checked out elsewhere
|
||||||
|
git -C "$repo_root" worktree add --force "$dest" "$branch" || return $?
|
||||||
|
else
|
||||||
|
echo "Branch '$branch' does not exist; creating from '$from_ref' at: $dest"
|
||||||
|
git -C "$repo_root" worktree add --force -b "$branch" "$dest" "$from_ref" || return $?
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Jump into the new worktree
|
||||||
|
cd "$dest" || return $?
|
||||||
|
echo "✔ Worktree ready at: $dest"
|
||||||
|
}
|
||||||
|
|||||||
@@ -0,0 +1,341 @@
|
|||||||
|
# Default config for sway
|
||||||
|
#
|
||||||
|
# Copy this to ~/.config/sway/config and edit it to your liking.
|
||||||
|
#
|
||||||
|
# Read `man 5 sway` for a complete reference.
|
||||||
|
|
||||||
|
|
||||||
|
set $mod Mod4
|
||||||
|
set $term alacritty
|
||||||
|
set $termalt xfce4-terminal
|
||||||
|
set $web firefox
|
||||||
|
set $file ranger
|
||||||
|
set $lock slock
|
||||||
|
set $code codium
|
||||||
|
set $guieditor geany
|
||||||
|
set $calc /home/ben/.local/bin/bc-launcher
|
||||||
|
set $music /home/ben/.local/bin/ncmpcpp-launcher
|
||||||
|
|
||||||
|
|
||||||
|
# Your preferred application launcher
|
||||||
|
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||||
|
# on the original workspace that the command was run on.
|
||||||
|
set $menu dmenu_path | dmenu | xargs swaymsg exec --
|
||||||
|
|
||||||
|
### Output configuration
|
||||||
|
#
|
||||||
|
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
|
||||||
|
output * bg /usr/share/backgrounds/default.png fill
|
||||||
|
|
||||||
|
|
||||||
|
### Idle configuration
|
||||||
|
# This will lock your screen after 300 seconds of inactivity, then turn off
|
||||||
|
# your displays after another 300 seconds, and turn your screens back on when
|
||||||
|
# resumed. It will also lock your screen before your computer goes to sleep.
|
||||||
|
exec swayidle -w \
|
||||||
|
timeout 300 'swaylock -f -c 000000' \
|
||||||
|
timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' \
|
||||||
|
before-sleep 'swaylock -f -c 000000'
|
||||||
|
|
||||||
|
# Font for window titles. Will also be used by the bar unless a different font
|
||||||
|
# is used in the bar {} block below.
|
||||||
|
font pango:monospace 8
|
||||||
|
|
||||||
|
# This font is widely installed, provides lots of unicode glyphs, right-to-left
|
||||||
|
# text rendering and scalability on retina/hidpi displays (thanks to pango).
|
||||||
|
#font pango:DejaVu Sans Mono 8
|
||||||
|
|
||||||
|
# network manager applet: manage wifi, ethernet and vpns
|
||||||
|
exec --no-startup-id nm-applet
|
||||||
|
|
||||||
|
# bluetooth manager applet: manage bluetooth pairing and connections
|
||||||
|
#exec --no-startup-id blueman-applet
|
||||||
|
|
||||||
|
# udiskie: manage usb storage devices
|
||||||
|
exec --no-startup-id udiskie -a -n -t
|
||||||
|
|
||||||
|
# dunst: a notification daemon
|
||||||
|
exec --no-startup-id dunst
|
||||||
|
|
||||||
|
# Audio controls
|
||||||
|
# Use pamixer to adjust volume in PulseAudio.
|
||||||
|
bindsym --locked XF86AudioRaiseVolume exec pamixer --increase 5
|
||||||
|
bindsym --locked XF86AudioLowerVolume exec pamixer --decrease 5
|
||||||
|
bindsym --locked XF86AudioMute exec pamixer --toggle-mute
|
||||||
|
bindsym XF86AudioMicMute exec pamixer --toggle-mute --default-source
|
||||||
|
bindsym --locked $mod+greater exec pamixer --increase 5
|
||||||
|
bindsym --locked $mod+less exec pamixer --decrease 5
|
||||||
|
|
||||||
|
# backlight brightness
|
||||||
|
bindsym XF86MonBrightnessDown exec brightnessctl set 5%- # decrease screen brightness
|
||||||
|
bindsym XF86MonBrightnessUp exec brightnessctl set +5% # increase screen brightness
|
||||||
|
bindsym $mod+F8 exec brightnessctl set 5-% # decrease screen brightness
|
||||||
|
bindsym $mod+F9 exec brightnessctl set +5% # increase screen brightness
|
||||||
|
|
||||||
|
# Use Mouse+$mod to drag floating windows to their wanted position
|
||||||
|
floating_modifier $mod
|
||||||
|
|
||||||
|
# start a terminal
|
||||||
|
bindsym $mod+Return exec $term
|
||||||
|
bindsym $mod+Shift+Return exec $termalt
|
||||||
|
|
||||||
|
# start a web browser
|
||||||
|
bindsym $mod+F1 exec $web
|
||||||
|
|
||||||
|
# start a file manager
|
||||||
|
bindsym $mod+F2 exec $file
|
||||||
|
|
||||||
|
# start an ide
|
||||||
|
bindsym $mod+F3 exec $code
|
||||||
|
|
||||||
|
# start a gui notepad
|
||||||
|
bindsym $mod+F4 exec $guieditor
|
||||||
|
|
||||||
|
# kill focused window
|
||||||
|
bindsym $mod+Shift+q kill
|
||||||
|
|
||||||
|
# start rofi in drun mode (a program launcher)
|
||||||
|
bindsym $mod+d exec --no-startup-id "rofi -show drun -font \\"DejaVu 9\\" -run-shell-command '{terminal} -e \\" {cmd}; read -n 1 -s\\"'"
|
||||||
|
#bindsym $mod+shift+d exec selected=$(ls ~/rdp/ntschools/|rofi -dmenu -p "Run: ")&&zsh ~/rdp/ntschools/$selected
|
||||||
|
|
||||||
|
|
||||||
|
# A more modern dmenu replacement is rofi:
|
||||||
|
# bindcode $mod+40 exec "rofi -modi drun,run -show drun"
|
||||||
|
# There also is i3-dmenu-desktop which only displays applications shipping a
|
||||||
|
# .desktop file. It is a wrapper around dmenu, so you need that installed.
|
||||||
|
# bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
|
||||||
|
|
||||||
|
# change focus
|
||||||
|
bindsym $mod+Left focus left
|
||||||
|
bindsym $mod+Down focus down
|
||||||
|
bindsym $mod+Up focus up
|
||||||
|
bindsym $mod+Right focus right
|
||||||
|
|
||||||
|
# move focused window
|
||||||
|
bindsym $mod+Shift+Left move left
|
||||||
|
bindsym $mod+Shift+Down move down
|
||||||
|
bindsym $mod+Shift+Up move up
|
||||||
|
bindsym $mod+Shift+Right move right
|
||||||
|
|
||||||
|
# split in horizontal orientation
|
||||||
|
bindsym $mod+h split v ;; exec $term
|
||||||
|
|
||||||
|
# split in vertical orientation
|
||||||
|
bindsym $mod+v split h ;; exec $term
|
||||||
|
|
||||||
|
# enter fullscreen mode for the focused container
|
||||||
|
bindsym $mod+f fullscreen toggle
|
||||||
|
|
||||||
|
# change container layout (stacked, tabbed, toggle split)
|
||||||
|
bindsym $mod+s layout stacking
|
||||||
|
bindsym $mod+w layout tabbed
|
||||||
|
bindsym $mod+e layout toggle split
|
||||||
|
|
||||||
|
# toggle tiling / floating
|
||||||
|
bindsym $mod+Shift+space floating toggle
|
||||||
|
|
||||||
|
# change focus between tiling / floating windows
|
||||||
|
bindsym $mod+space focus mode_toggle
|
||||||
|
|
||||||
|
# focus the parent container
|
||||||
|
bindsym $mod+a focus parent
|
||||||
|
|
||||||
|
# focus the child container
|
||||||
|
bindsym $mod+Shift+a focus child
|
||||||
|
|
||||||
|
# calculator scratchpad
|
||||||
|
bindsym $mod+c [title="calc-launcher"] scratchpad show; [title="calc-launcher"] move position center
|
||||||
|
for_window [title="calc-launcher"] floating enable
|
||||||
|
for_window [title="calc-launcher"] resize set 800 600
|
||||||
|
for_window [title="calc-launcher"] move scratchpad
|
||||||
|
for_window [title="calc-launcher"] border pixel 5
|
||||||
|
exec --no-startup-id $term -T "calc-launcher" -e "$calc"
|
||||||
|
|
||||||
|
# dropdown scratchpad
|
||||||
|
bindsym $mod+x [title="dropdown"] scratchpad show; [title="dropdown"] move position center
|
||||||
|
for_window [title="dropdown"] floating enable
|
||||||
|
for_window [title="dropdown"] resize set 1280 800
|
||||||
|
for_window [title="dropdown"] move scratchpad
|
||||||
|
for_window [title="dropdown"] border pixel 5
|
||||||
|
exec --no-startup-id $term -T "dropdown"
|
||||||
|
|
||||||
|
# music scratchpad
|
||||||
|
bindsym $mod+m [title="music-launcher"] scratchpad show; [title="music-launcher"] move position center
|
||||||
|
for_window [title="music-launcher"] floating enable
|
||||||
|
for_window [title="music-launcher"] resize set 800 600
|
||||||
|
for_window [title="music-launcher"] move scratchpad
|
||||||
|
for_window [title="music-launcher"] border pixel 5
|
||||||
|
exec --no-startup-id $term -T "music-launcher" -e "$music"
|
||||||
|
|
||||||
|
# f5vpn scratchpad
|
||||||
|
bindsym $mod+F10 [title="F5 VPN"] scratchpad show; [title="F5 VPN"] move position center
|
||||||
|
for_window [title="F5 VPN"] floating enable
|
||||||
|
for_window [title="F5 VPN"] resize set 800 600
|
||||||
|
for_window [title="F5 VPN"] move scratchpad
|
||||||
|
for_window [title="F5 VPN"] border pixel 5
|
||||||
|
|
||||||
|
# restore scratchpads
|
||||||
|
bindsym $mod+F11 exec --no-startup-id $term -T "music-launcher" -e "$music"
|
||||||
|
bindsym $mod+F12 exec --no-startup-id $term -T "calc-launcher" -e "$calc"
|
||||||
|
|
||||||
|
# mpd/mpc commands
|
||||||
|
bindsym $mod+p exec mpc --host $HOME/.config/mpd/socket toggle
|
||||||
|
|
||||||
|
# Define names for default workspaces for which we configure key bindings later on.
|
||||||
|
# We use variables to avoid repeating the names in multiple places.
|
||||||
|
set $ws1 "1: shell"
|
||||||
|
set $ws2 "2: web"
|
||||||
|
set $ws3 "3: code"
|
||||||
|
set $ws4 "4: lab"
|
||||||
|
set $ws5 "5: games"
|
||||||
|
set $ws6 "6"
|
||||||
|
set $ws7 "7"
|
||||||
|
set $ws8 "8"
|
||||||
|
set $ws9 "9"
|
||||||
|
set $ws10 "10"
|
||||||
|
|
||||||
|
# switch to workspace
|
||||||
|
bindsym $mod+1 workspace $ws1
|
||||||
|
bindsym $mod+2 workspace $ws2; layout tabbed
|
||||||
|
bindsym $mod+3 workspace $ws3; layout tabbed
|
||||||
|
bindsym $mod+4 workspace $ws4
|
||||||
|
bindsym $mod+5 workspace $ws5
|
||||||
|
bindsym $mod+6 workspace $ws6
|
||||||
|
bindsym $mod+7 workspace $ws7
|
||||||
|
bindsym $mod+8 workspace $ws8
|
||||||
|
bindsym $mod+9 workspace $ws9
|
||||||
|
bindsym $mod+0 workspace $ws10
|
||||||
|
|
||||||
|
# move focused container to workspace
|
||||||
|
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||||
|
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||||
|
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||||
|
bindsym $mod+Shift+4 move container to workspace $ws4
|
||||||
|
bindsym $mod+Shift+5 move container to workspace $ws5
|
||||||
|
bindsym $mod+Shift+6 move container to workspace $ws6
|
||||||
|
bindsym $mod+Shift+7 move container to workspace $ws7
|
||||||
|
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||||
|
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||||
|
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||||
|
|
||||||
|
# move focused workspace between monitors
|
||||||
|
bindsym $mod+Ctrl+greater move workspace to output right
|
||||||
|
bindsym $mod+Ctrl+less move workspace to output left
|
||||||
|
|
||||||
|
# print screen
|
||||||
|
bindsym --release Print exec grim
|
||||||
|
bindsym --release $mod+Print exec grim -g "$(slurp)" $HOME/Pictures/screenshots/$(date +%Y-%m-%d_%H-%M-%S).png
|
||||||
|
bindsym --release $mod+Shift+Print exec grim -g "$(slurp)" - | wl-copy
|
||||||
|
bindsym --release $mod+Shift+s exec grim -g "$(slurp)" - | wl-copy
|
||||||
|
|
||||||
|
# lock screen
|
||||||
|
#bindsym $mod+l --release exec $lock
|
||||||
|
bindsym $mod+l exec swaylock --image Pictures/1920x1200/tux-text-1920x1200.png
|
||||||
|
|
||||||
|
# reload the configuration file
|
||||||
|
bindsym $mod+Shift+c reload
|
||||||
|
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
|
||||||
|
bindsym $mod+Shift+r restart
|
||||||
|
# exit sway (logs you out of your wayland session)
|
||||||
|
bindsym $mod+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'
|
||||||
|
|
||||||
|
# for_windows settings
|
||||||
|
for_window [class="urxvt"] border pixel 5
|
||||||
|
for_window [title="Mozilla Firefox"] move container to workspace $ws2
|
||||||
|
for_window [title="Chromium"] move container to workspace $ws2
|
||||||
|
for_window [class="VSCodium"] move container to workspace $ws3
|
||||||
|
for_window [title="Visual Studio Code"] move container to workspace $ws3
|
||||||
|
for_window [class="xfreerdp"] floating disable move container to workspace $ws4
|
||||||
|
for_window [title="Picture-in-Picture"] sticky enable
|
||||||
|
for_window [title="noVNC"] sticky enable floating enable
|
||||||
|
for_window [title="Proxmox Console"] sticky enable floating enable
|
||||||
|
for_window [title="feh"] sticky enable floating enable
|
||||||
|
for_window [title="(?:Open|Save) (?:File|Folder|As)"] floating enable, resize set width 1030 height 710
|
||||||
|
|
||||||
|
# waylan = app_id
|
||||||
|
for_window [app_id="mpv"] inhibit_idle fullscreen
|
||||||
|
|
||||||
|
# https://github.com/ValveSoftware/steam-for-linux/issues/1040
|
||||||
|
for_window [class="^Steam$"] floating disable move container to workspace $ws5
|
||||||
|
for_window [instance="steamwebhelper"] floating disable move container to workspace $ws5
|
||||||
|
for_window [class="^Steam$" title="^Friends$"] floating enable
|
||||||
|
for_window [class="^Steam$" title="Steam - News"] floating enable
|
||||||
|
for_window [class="^Steam$" title=".* - Chat"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Settings$"] floating enable
|
||||||
|
for_window [class="^Steam$" title=".* - event started"] floating enable
|
||||||
|
for_window [class="^Steam$" title=".* CD key"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Steam - Self Updater$"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Screenshot Uploader$"] floating enable
|
||||||
|
for_window [class="^Steam$" title="^Steam Guard - Computer Authorization Required$"] floating enable
|
||||||
|
for_window [title="^Steam Keyboard$"] floating enable
|
||||||
|
|
||||||
|
# resize window (you can also use the mouse for that)
|
||||||
|
mode "resize" {
|
||||||
|
# These bindings trigger as soon as you enter the resize mode
|
||||||
|
|
||||||
|
# Pressing left will shrink the window’s width.
|
||||||
|
# Pressing right will grow the window’s width.
|
||||||
|
# Pressing up will shrink the window’s height.
|
||||||
|
# Pressing down will grow the window’s height.
|
||||||
|
bindsym j resize shrink width 10 px or 10 ppt
|
||||||
|
bindsym k resize grow height 10 px or 10 ppt
|
||||||
|
bindsym l resize shrink height 10 px or 10 ppt
|
||||||
|
bindsym semicolon resize grow width 10 px or 10 ppt
|
||||||
|
|
||||||
|
# same bindings, but for the arrow keys
|
||||||
|
bindsym Left resize shrink width 10 px or 10 ppt
|
||||||
|
bindsym Down resize grow height 10 px or 10 ppt
|
||||||
|
bindsym Up resize shrink height 10 px or 10 ppt
|
||||||
|
bindsym Right resize grow width 10 px or 10 ppt
|
||||||
|
|
||||||
|
# back to normal: Enter or Escape or $mod+r
|
||||||
|
bindsym Return mode "default"
|
||||||
|
bindsym Escape mode "default"
|
||||||
|
bindsym $mod+r mode "default"
|
||||||
|
}
|
||||||
|
|
||||||
|
bindsym $mod+r mode "resize"
|
||||||
|
|
||||||
|
# monitor-mode settings
|
||||||
|
# use "swaymsg -t get_outputs" to list outputs
|
||||||
|
set $laptop eDP-1
|
||||||
|
set $dell1 'Dell Inc. DELL U4320Q D1QV193'
|
||||||
|
set $dell2 'Dell Inc. DELL U2713HM GK0KD357413L'
|
||||||
|
set $tv 'Samsung Electric Company SAMSUNG 0x01000E00'
|
||||||
|
bindswitch --reload --locked lid:on output $laptop disable
|
||||||
|
bindswitch --reload --locked lid:off output $laptop enable
|
||||||
|
output $laptop resolution 1920x1080 position 0,0
|
||||||
|
output $dell1 resolution 3840x2160@59.997Hz position 0,660 transform normal
|
||||||
|
output $dell2 resolution 2560x1440@59.951Hz position 3840,530 transform 270
|
||||||
|
output $tv resolution 1920x1080@59.951Hz position 0,660 transform normal
|
||||||
|
|
||||||
|
workspace $ws1 output $dell1
|
||||||
|
workspace $ws2 output $dell2
|
||||||
|
workspace $ws3 output $dell1
|
||||||
|
workspace $ws4 output $dell2
|
||||||
|
|
||||||
|
# class border bground text indicator child_border
|
||||||
|
client.focused #6272A4 #6272A4 #F8F8F2 #6272A4 #6272A4
|
||||||
|
client.focused_inactive #44475A #44475A #F8F8F2 #44475A #44475A
|
||||||
|
client.unfocused #282A36 #282A36 #BFBFBF #282A36 #282A36
|
||||||
|
client.urgent #44475A #FF5555 #F8F8F2 #FF5555 #FF5555
|
||||||
|
client.placeholder #282A36 #282A36 #F8F8F2 #282A36 #282A36
|
||||||
|
|
||||||
|
client.background #F8F8F2
|
||||||
|
|
||||||
|
|
||||||
|
#exec_always --no-startup-id $HOME/.config/polybar/start
|
||||||
|
bar {
|
||||||
|
swaybar_command waybar
|
||||||
|
colors {
|
||||||
|
background #282A36
|
||||||
|
statusline #F8F8F2
|
||||||
|
separator #44475A
|
||||||
|
|
||||||
|
focused_workspace #44475A #44475A #F8F8F2
|
||||||
|
active_workspace #282A36 #44475A #F8F8F2
|
||||||
|
inactive_workspace #282A36 #282A36 #BFBFBF
|
||||||
|
urgent_workspace #FF5555 #FF5555 #F8F8F2
|
||||||
|
binding_mode #FF5555 #FF5555 #F8F8F2
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,486 @@
|
|||||||
|
# Tig default configuration
|
||||||
|
#
|
||||||
|
# Please see 'man tigrc' for a complete reference.
|
||||||
|
|
||||||
|
# Settings
|
||||||
|
# --------
|
||||||
|
# Most of these settings can be toggleable, either via the toggle-*
|
||||||
|
# actions or via the option menu (bound to `o` by default).
|
||||||
|
|
||||||
|
# View settings
|
||||||
|
#
|
||||||
|
# Supported column types and their options:
|
||||||
|
#
|
||||||
|
# author
|
||||||
|
# - display (enum) [no|full|abbreviated|email|email-user]
|
||||||
|
# : Show author information?
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
# - maxwidth (int) : Autosize limit
|
||||||
|
#
|
||||||
|
# commit-title
|
||||||
|
# - display (bool) : Show the commit title?
|
||||||
|
# - graph (enum) [no|v2|v1] : Show the commit graph? (main view only)
|
||||||
|
# - refs (bool) : Show branches, tags and remotes? (main view only)
|
||||||
|
# - overflow (boolint) : Highlight overflows? Defaults to 50 when enabled.
|
||||||
|
#
|
||||||
|
# date
|
||||||
|
# - display (enum) [no|default|relative|relative-compact|custom]
|
||||||
|
# : Show dates?
|
||||||
|
# - local (bool) : Show local dates?
|
||||||
|
# - format (string) : Custom strftime(3) format
|
||||||
|
# Note: %Z is formatted as %z
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
#
|
||||||
|
# file-name
|
||||||
|
# - display (enum) [no|always|auto] : Show file names?
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
# - maxwidth (int) : Autosize limit
|
||||||
|
#
|
||||||
|
# file-size
|
||||||
|
# - display (enum) [no|default|units]
|
||||||
|
# : Show file sizes?
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
#
|
||||||
|
# id
|
||||||
|
# - display (bool) : Show commit/tree ID?
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
#
|
||||||
|
# line-number
|
||||||
|
# - display (bool) : Show line numbers?
|
||||||
|
# - interval (int) : Interval between line numbers; defaults to 5
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
#
|
||||||
|
# mode
|
||||||
|
# - display (bool) : Show file modes?
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
#
|
||||||
|
# ref
|
||||||
|
# - display (bool) : Show ref names?
|
||||||
|
# - width (int) : Fixed width when nonzero
|
||||||
|
# - maxwidth (int) : Autosize limit
|
||||||
|
#
|
||||||
|
# status
|
||||||
|
# - display (enum) [no|short|long] : Show status label?
|
||||||
|
#
|
||||||
|
# text
|
||||||
|
# - display (bool) : Show text?
|
||||||
|
# - commit-title-overflow (boolint) : Highlight overflow in log and diff view?
|
||||||
|
#
|
||||||
|
|
||||||
|
set blame-view = id:yes,color file-name:auto author:full date:default,format="%Y-%m-%d" line-number:yes,interval=1 text
|
||||||
|
set grep-view = file-name:no line-number:yes,interval=1 text
|
||||||
|
set main-view = line-number:no,interval=5 id:no date:default,format="%Y-%m-%d" author:full commit-title:yes,graph,refs,overflow=no
|
||||||
|
set reflog-view = line-number:no,interval=5 id:yes date:no,format="%Y-%m-%d" author:no commit-title:yes,refs,overflow=no
|
||||||
|
set refs-view = line-number:no id:no date:default,format="%Y-%m-%d" author:full ref commit-title
|
||||||
|
set stash-view = line-number:no,interval=5 id:no date:default,format="%Y-%m-%d" author:full commit-title
|
||||||
|
set status-view = line-number:no,interval=5 status:short file-name
|
||||||
|
set tree-view = line-number:no,interval=5 mode author:full file-size date:default,format="%Y-%m-%d" id:no file-name
|
||||||
|
|
||||||
|
# Pager based views
|
||||||
|
set pager-view = line-number:no,interval=5 text
|
||||||
|
set stage-view = line-number:no,interval=5 text
|
||||||
|
set log-view = line-number:no,interval=5 text
|
||||||
|
set blob-view = line-number:no,interval=5 text
|
||||||
|
set diff-view = line-number:no,interval=5 text:yes,commit-title-overflow=no
|
||||||
|
|
||||||
|
# UI display settings
|
||||||
|
set show-changes = yes # Show changes commits in the main view?
|
||||||
|
set show-untracked = yes # Show also untracked changes?
|
||||||
|
set wrap-lines = no # Wrap long lines in pager views?
|
||||||
|
set tab-size = 8 # Number of spaces to use when expanding tabs
|
||||||
|
set line-graphics = default # Enum: ascii, default, utf-8, auto
|
||||||
|
set truncation-delimiter = ~ # Character drawn for truncations, or "utf-8"
|
||||||
|
|
||||||
|
# Format reference names based on type.
|
||||||
|
# - head : The current HEAD.
|
||||||
|
# - tag : An annotated tag.
|
||||||
|
# - local-tag : A lightweight tag.
|
||||||
|
# - remote : A remote.
|
||||||
|
# - tracked-remote : The remote tracked by current HEAD.
|
||||||
|
# - replace : A replaced reference.
|
||||||
|
# - branch : A branch.
|
||||||
|
# - stash : The stash.
|
||||||
|
# - other : Any other reference.
|
||||||
|
# If no format is defined for `local-tag` then the one for `tag` is used.
|
||||||
|
# Similarly, `remote` is used if no `tracked-remote` format exists.
|
||||||
|
# Prefix with `hide:` to not show that reference type, e.g. `hide:remote`.
|
||||||
|
# Expects a space-separated list of format strings.
|
||||||
|
set reference-format = [branch] <tag> {remote} ~replace~
|
||||||
|
|
||||||
|
# Settings controlling how content is read from Git
|
||||||
|
set commit-order = auto # Enum: auto, default, topo, date, reverse (main)
|
||||||
|
set status-show-untracked-dirs = yes # Show files in untracked directories? (status)
|
||||||
|
set status-show-untracked-files = yes # Show untracked files?
|
||||||
|
set ignore-space = no # Enum: no, all, some, at-eol (diff)
|
||||||
|
set show-notes = yes # When non-bool passed as `--show-notes=...` (diff)
|
||||||
|
#set diff-context = 3 # Number of lines to show around diff changes (diff)
|
||||||
|
#set diff-options = -C # User-defined options for `tig show` (git-diff)
|
||||||
|
#set diff-highlight = true # String (or bool): Path to diff-highlight script,
|
||||||
|
# defaults to `diff-highlight`.
|
||||||
|
#set blame-options = -C -C -C # User-defined options for `tig blame` (git-blame)
|
||||||
|
#set log-options = --pretty=raw # User-defined options for `tig log` (git-log)
|
||||||
|
#set main-options = -n 1000 # User-defined options for `tig` (git-log)
|
||||||
|
set mailmap = yes # Use .mailmap to show canonical name and email address?
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
set start-on-head = no # Start with cursor on HEAD commit?
|
||||||
|
set refresh-mode = auto # Enum: manual, auto, after-command, periodic
|
||||||
|
set refresh-interval = 10 # Interval in seconds between refreshes
|
||||||
|
set ignore-case = no # Enum: no, yes, smart-case
|
||||||
|
# Ignore case when searching?
|
||||||
|
set wrap-search = yes # Wrap around to top/bottom of view when searching?
|
||||||
|
set focus-child = yes # Move focus to child view when opened?
|
||||||
|
set send-child-enter = yes # Propagate "enter" keypresses to child views?
|
||||||
|
set horizontal-scroll = 50% # Number of columns to scroll as % of width
|
||||||
|
set split-view-height = 67% # Height of the bottom view for horizontal splits
|
||||||
|
set vertical-split = auto # Enum: horizontal, vertical, auto; Use auto to
|
||||||
|
# switch to horizontal split when width allows it
|
||||||
|
set split-view-width = 50% # Width of right-most view for vertical splits
|
||||||
|
set editor-line-number = yes # Automatically pass line number to editor? Used
|
||||||
|
# for opening file at specific line e.g. from a diff
|
||||||
|
set history-size = 500 # Size of persistent history, 0 to disable
|
||||||
|
set mouse = no # Enable mouse support?
|
||||||
|
set mouse-scroll = 3 # Number of lines to scroll via the mouse
|
||||||
|
set mouse-wheel-cursor = no # Prefer moving the cursor to scrolling the view?
|
||||||
|
set pgrp = no # Make tig process-group leader?
|
||||||
|
set pager-autoscroll = no # Scroll the pager view automatically while loading?
|
||||||
|
|
||||||
|
# User-defined commands
|
||||||
|
# ---------------------
|
||||||
|
# These commands allow to run shell commands directly from within Tig.
|
||||||
|
# Unless otherwise specified, commands are run in the foreground with
|
||||||
|
# their console output shown (as if '!' was specified). When multiple
|
||||||
|
# command options are specified their behavior are combined, e.g. "?<git
|
||||||
|
# commit" will prompt the user whether to execute the command and will
|
||||||
|
# exit Tig after completion.
|
||||||
|
#
|
||||||
|
# ! Run the command in the foreground with output shown.
|
||||||
|
# @ Run the command in the background with no output.
|
||||||
|
# ? Prompt the user before executing the command.
|
||||||
|
# + Run the command synchronously, and echo the first line of output to the status bar.
|
||||||
|
# < Exit Tig after executing the command.
|
||||||
|
# > Re-open Tig instantly in the last displayed view after executing the command.
|
||||||
|
#
|
||||||
|
# User-defined commands can optionally refer to Tig's internal state
|
||||||
|
# using the following variable names, which are substituted before
|
||||||
|
# commands are run:
|
||||||
|
#
|
||||||
|
# %(head) The current ref ID. Defaults to HEAD
|
||||||
|
# %(commit) The current commit ID.
|
||||||
|
# %(blob) The current blob ID.
|
||||||
|
# %(branch) The current branch name.
|
||||||
|
# %(remote) The current remote name.
|
||||||
|
# %(tag) The current tag name.
|
||||||
|
# %(stash) The current stash name.
|
||||||
|
# %(directory) The current directory path in the tree view;
|
||||||
|
# empty for the root directory.
|
||||||
|
# %(file) The currently selected file.
|
||||||
|
# %(ref) The reference given to blame or HEAD if undefined.
|
||||||
|
# %(revargs) The revision arguments passed on the command line.
|
||||||
|
# %(fileargs) The file arguments passed on the command line.
|
||||||
|
# %(cmdlineargs) All other options passed on the command line.
|
||||||
|
# %(diffargs) The diff options from `diff-options` or `TIG_DIFF_OPTS`
|
||||||
|
# %(prompt) Prompt for the argument value.
|
||||||
|
|
||||||
|
bind generic 8 @sh -c "echo -n %(commit) | wl-copy && echo Copied %(commit) to clipboard"
|
||||||
|
bind generic 9 @sh -c "~/.local/bin/_helper_tig_commit_copy %(commit)"
|
||||||
|
|
||||||
|
bind main C ?git cherry-pick %(commit)
|
||||||
|
bind status C !git commit
|
||||||
|
bind stash A ?git stash apply %(stash)
|
||||||
|
bind stash P ?git stash pop %(stash)
|
||||||
|
bind stash ! ?git stash drop %(stash)
|
||||||
|
bind refs C ?git checkout %(branch)
|
||||||
|
bind refs ! ?git branch -D %(branch)
|
||||||
|
bind reflog C ?git checkout %(branch)
|
||||||
|
bind reflog ! ?git reset --hard %(commit)
|
||||||
|
|
||||||
|
# Normal commands
|
||||||
|
# ---------------
|
||||||
|
|
||||||
|
# View switching
|
||||||
|
bind generic m view-main
|
||||||
|
bind generic d view-diff
|
||||||
|
bind generic l view-log
|
||||||
|
bind generic L view-reflog
|
||||||
|
bind generic t view-tree
|
||||||
|
bind generic f view-blob
|
||||||
|
bind generic b view-blame
|
||||||
|
bind generic r view-refs
|
||||||
|
bind generic p view-pager
|
||||||
|
bind generic h view-help
|
||||||
|
bind generic s view-status
|
||||||
|
bind generic S view-status # Compat binding to avoid going crazy!
|
||||||
|
bind generic c view-stage
|
||||||
|
bind generic y view-stash
|
||||||
|
bind generic g view-grep
|
||||||
|
|
||||||
|
# View manipulation
|
||||||
|
bind generic <Enter> enter # Enter and open selected entry
|
||||||
|
bind generic <Lt> back # Go back to the previous view state
|
||||||
|
bind generic <Down> next # Move to next
|
||||||
|
bind generic <C-N> next
|
||||||
|
bind generic J next
|
||||||
|
bind generic <Up> previous # Move to previous
|
||||||
|
bind generic <C-P> previous
|
||||||
|
bind generic K previous
|
||||||
|
bind generic , parent # Move to parent
|
||||||
|
bind generic <Tab> view-next # Move focus to the next view
|
||||||
|
bind generic R refresh # Reload and refresh view
|
||||||
|
bind generic <F5> refresh
|
||||||
|
bind generic O maximize # Maximize the current view
|
||||||
|
bind generic q view-close # Close the current view
|
||||||
|
bind generic Q quit # Close all views and quit
|
||||||
|
bind generic <C-C> quit # Close all views and quit
|
||||||
|
|
||||||
|
# View specific
|
||||||
|
bind status u status-update # Stage/unstage changes in file
|
||||||
|
bind status ! status-revert # Revert changes in file
|
||||||
|
bind status M status-merge # Open git-mergetool(1)
|
||||||
|
# bind status ??? :toggle status # Show short or long status labels
|
||||||
|
bind stage u status-update # Stage/unstage current diff (c)hunk
|
||||||
|
bind stage 1 stage-update-line # Stage/unstage current line
|
||||||
|
bind stage 2 stage-update-part # Stage/unstage part of chunk
|
||||||
|
bind stage ! status-revert # Revert current diff (c)hunk
|
||||||
|
bind stage \ stage-split-chunk # Split current diff (c)hunk
|
||||||
|
bind stage @ :/^@@ # Jump to next (c)hunk
|
||||||
|
bind stage [ :toggle diff-context -1 # Decrease the diff context
|
||||||
|
bind stage ] :toggle diff-context +1 # Increase the diff context
|
||||||
|
bind diff @ :/^@@ # Jump to next (c)hunk
|
||||||
|
bind diff [ :toggle diff-context -1 # Decrease the diff context
|
||||||
|
bind diff ] :toggle diff-context +1 # Increase the diff context
|
||||||
|
bind pager @ :/^@@ # Jump to next (c)hunk
|
||||||
|
bind main H :goto HEAD # Jump to HEAD commit
|
||||||
|
bind main G :toggle commit-title-graph # Toggle revision graph visualization
|
||||||
|
bind main F :toggle commit-title-refs # Toggle reference display (tags/branches)
|
||||||
|
bind reflog F :toggle commit-title-refs # Toggle reference display (tags/branches)
|
||||||
|
|
||||||
|
# Cursor navigation
|
||||||
|
bind generic j move-down
|
||||||
|
bind generic k move-up
|
||||||
|
bind generic <C-D> move-half-page-down
|
||||||
|
bind generic <C-U> move-half-page-up
|
||||||
|
bind generic <PgDown> move-page-down
|
||||||
|
bind generic <Space> move-page-down
|
||||||
|
bind generic <PgUp> move-page-up
|
||||||
|
bind generic - move-page-up
|
||||||
|
bind generic <Home> move-first-line
|
||||||
|
bind generic <End> move-last-line
|
||||||
|
|
||||||
|
# Scrolling
|
||||||
|
bind generic | scroll-first-col
|
||||||
|
bind generic <Left> scroll-left
|
||||||
|
bind generic <Right> scroll-right
|
||||||
|
bind generic <Ins> scroll-line-up
|
||||||
|
bind generic <C-Y> scroll-line-up
|
||||||
|
bind generic <Del> scroll-line-down
|
||||||
|
bind generic <C-E> scroll-line-down
|
||||||
|
bind generic <SBack> scroll-page-up
|
||||||
|
bind generic <SFwd> scroll-page-down
|
||||||
|
# bind generic ??? scroll-half-page-up
|
||||||
|
# bind generic ??? scroll-half-page-down
|
||||||
|
|
||||||
|
# Searching
|
||||||
|
bind generic / search
|
||||||
|
bind generic ? search-back
|
||||||
|
bind generic n find-next
|
||||||
|
bind generic N find-prev
|
||||||
|
# Navigation keys used while searching
|
||||||
|
bind search <Down> find-next
|
||||||
|
bind search <C-N> find-next
|
||||||
|
bind search <C-J> find-next
|
||||||
|
bind search <Up> find-prev
|
||||||
|
bind search <C-P> find-prev
|
||||||
|
bind search <C-K> find-prev
|
||||||
|
bind search <C-C> view-close
|
||||||
|
|
||||||
|
# Option manipulation
|
||||||
|
bind generic o options # Open the options menu
|
||||||
|
# Bindings for toggling settings
|
||||||
|
bind generic I :toggle sort-order # Toggle ascending/descending sort order
|
||||||
|
bind generic i :toggle sort-field # Toggle field to sort by
|
||||||
|
bind generic <Hash> :toggle line-number # Toggle line numbers
|
||||||
|
bind generic D :toggle date # Toggle date display
|
||||||
|
bind generic A :toggle author # Toggle author display
|
||||||
|
# bind generic ??? :toggle commit-title-display
|
||||||
|
# Toggle commit title display
|
||||||
|
bind generic ~ :toggle line-graphics # Toggle (line) graphics mode
|
||||||
|
bind generic F :toggle file-name # Toggle file name display
|
||||||
|
# bind generic ??? :toggle show-changes # Toggle local changes display in the main view
|
||||||
|
bind generic W :toggle ignore-space # Toggle ignoring whitespace in diffs
|
||||||
|
# bind generic ??? :toggle ignore-case # Toggle ignoring case when searching
|
||||||
|
# bind generic ??? :toggle commit-order # Toggle commit ordering
|
||||||
|
bind generic X :toggle id # Toggle commit ID display
|
||||||
|
bind generic $ :toggle commit-title-overflow
|
||||||
|
# Toggle highlighting of commit title overflow
|
||||||
|
# bind generic ??? :toggle file-size # Toggle file size format
|
||||||
|
# bind generic ??? :toggle status # Toggle status display
|
||||||
|
# bind generic ??? :toggle status-show-untracked-dirs
|
||||||
|
# Toggle display of file in untracked directories
|
||||||
|
# bind generic ??? :toggle vertical-split # Toggle vertical split
|
||||||
|
# bind generic ??? :toggle word-diff # Toggle word diff
|
||||||
|
bind generic % :toggle file-filter # Toggle filtering by pathspecs in file-args
|
||||||
|
bind generic ^ :toggle rev-filter # Toggle filtering by revisions in rev-args
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
bind generic e edit # Open in editor
|
||||||
|
bind generic : prompt # Open the prompt
|
||||||
|
bind generic <C-L> screen-redraw # Redraw the screen
|
||||||
|
bind generic z stop-loading # Stop all loading views
|
||||||
|
bind generic v show-version # Show Tig version
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
# ------
|
||||||
|
|
||||||
|
# The colors in the UI can be customized. In addition to the colors used
|
||||||
|
# for the UI you can also define new colors to use in the pager, blob,
|
||||||
|
# diff, and stage views by placing the text to match for in quotes.
|
||||||
|
#
|
||||||
|
# Prefix the name of a view to set a color only for that view, e.g.
|
||||||
|
#
|
||||||
|
# color grep.file blue default
|
||||||
|
#
|
||||||
|
# As an example, this setting will to color Signed-off-by lines with a
|
||||||
|
# yellow foreground color and use the default background color.
|
||||||
|
#
|
||||||
|
# color " Signed-off-by" yellow default
|
||||||
|
#
|
||||||
|
# Note the four leading spaces in the string to match. This is because
|
||||||
|
# Git automatically indents commit messages by four spaces.
|
||||||
|
|
||||||
|
color "---" blue default
|
||||||
|
color "diff --" yellow default
|
||||||
|
color "--- " yellow default
|
||||||
|
color "+++ " yellow default
|
||||||
|
color "@@" magenta default
|
||||||
|
color "+" green default
|
||||||
|
color " +" green default
|
||||||
|
color "-" red default
|
||||||
|
color " -" red default
|
||||||
|
color "index " blue default
|
||||||
|
color "old file mode " yellow default
|
||||||
|
color "new file mode " yellow default
|
||||||
|
color "deleted file mode " yellow default
|
||||||
|
color "copy from " yellow default
|
||||||
|
color "copy to " yellow default
|
||||||
|
color "rename from " yellow default
|
||||||
|
color "rename to " yellow default
|
||||||
|
color "similarity " yellow default
|
||||||
|
color "dissimilarity " yellow default
|
||||||
|
color "\ No newline at end of file" blue default
|
||||||
|
color "diff-tree " blue default
|
||||||
|
color "Author: " cyan default
|
||||||
|
color "Commit: " magenta default
|
||||||
|
color "Tagger: " magenta default
|
||||||
|
color "Merge: " blue default
|
||||||
|
color "Date: " yellow default
|
||||||
|
color "AuthorDate: " yellow default
|
||||||
|
color "CommitDate: " yellow default
|
||||||
|
color "TaggerDate: " yellow default
|
||||||
|
color "Refs: " red default
|
||||||
|
color "Reflog: " red default
|
||||||
|
color "Reflog message: " yellow default
|
||||||
|
color "stash@{" magenta default
|
||||||
|
color "commit " green default
|
||||||
|
color "parent " blue default
|
||||||
|
color "tree " blue default
|
||||||
|
color "author " green default
|
||||||
|
color "committer " magenta default
|
||||||
|
color " Signed-off-by:" yellow default
|
||||||
|
color " Acked-by:" yellow default
|
||||||
|
color " Reviewed-by:" yellow default
|
||||||
|
color " Helped-by:" yellow default
|
||||||
|
color " Reported-by:" yellow default
|
||||||
|
color " Mentored-by:" yellow default
|
||||||
|
color " Suggested-by:" yellow default
|
||||||
|
color " Cc:" yellow default
|
||||||
|
color " Noticed-by:" yellow default
|
||||||
|
color " Tested-by:" yellow default
|
||||||
|
color " Improved-by:" yellow default
|
||||||
|
color " Thanks-to:" yellow default
|
||||||
|
color " Based-on-patch-by:" yellow default
|
||||||
|
color " Contributions-by:" yellow default
|
||||||
|
color " Co-authored-by:" yellow default
|
||||||
|
color " Requested-by:" yellow default
|
||||||
|
color " Original-patch-by:" yellow default
|
||||||
|
color " Inspired-by:" yellow default
|
||||||
|
color default default default normal
|
||||||
|
color cursor white green bold
|
||||||
|
color status green default
|
||||||
|
color delimiter magenta default
|
||||||
|
color date blue default
|
||||||
|
color mode cyan default
|
||||||
|
color id magenta default
|
||||||
|
color overflow red default
|
||||||
|
color header yellow default
|
||||||
|
color section cyan default
|
||||||
|
color directory yellow default
|
||||||
|
color file default default
|
||||||
|
color grep.file blue default
|
||||||
|
color file-size default default
|
||||||
|
color line-number cyan default
|
||||||
|
color title-blur white blue
|
||||||
|
color title-focus white blue bold
|
||||||
|
color main-commit default default
|
||||||
|
color main-annotated default default bold
|
||||||
|
color main-tag magenta default bold
|
||||||
|
color main-local-tag magenta default
|
||||||
|
color main-remote yellow default
|
||||||
|
color main-replace cyan default
|
||||||
|
color main-tracked yellow default bold
|
||||||
|
color main-ref cyan default
|
||||||
|
color main-head cyan default bold
|
||||||
|
color stat-none default default
|
||||||
|
color stat-staged magenta default
|
||||||
|
color stat-unstaged magenta default
|
||||||
|
color stat-untracked magenta default
|
||||||
|
color help-group blue default
|
||||||
|
color help-action yellow default
|
||||||
|
color diff-stat blue default
|
||||||
|
color diff-add-highlight green default standout
|
||||||
|
color diff-del-highlight red default standout
|
||||||
|
color palette-0 magenta default
|
||||||
|
color palette-1 yellow default
|
||||||
|
color palette-2 cyan default
|
||||||
|
color palette-3 green default
|
||||||
|
color palette-4 default default
|
||||||
|
color palette-5 white default
|
||||||
|
color palette-6 red default
|
||||||
|
color palette-7 magenta default bold
|
||||||
|
color palette-8 yellow default bold
|
||||||
|
color palette-9 cyan default bold
|
||||||
|
color palette-10 green default bold
|
||||||
|
color palette-11 default default bold
|
||||||
|
color palette-12 white default bold
|
||||||
|
color palette-13 red default bold
|
||||||
|
color graph-commit blue default
|
||||||
|
color search-result black yellow
|
||||||
|
|
||||||
|
# Mappings for colors read from git configuration.
|
||||||
|
# Set to "no" to disable.
|
||||||
|
set git-colors = \
|
||||||
|
branch.current=main-head \
|
||||||
|
branch.local=main-ref \
|
||||||
|
branch.plain=main-ref \
|
||||||
|
branch.remote=main-remote \
|
||||||
|
\
|
||||||
|
diff.meta=diff-header \
|
||||||
|
diff.meta=diff-index \
|
||||||
|
diff.meta=diff-oldmode \
|
||||||
|
diff.meta=diff-newmode \
|
||||||
|
diff.frag=diff-chunk \
|
||||||
|
diff.old=diff-del \
|
||||||
|
diff.new=diff-add \
|
||||||
|
\
|
||||||
|
diff-highlight.oldHighlight=diff-del-highlight \
|
||||||
|
diff-highlight.newHighlight=diff-add-highlight \
|
||||||
|
\
|
||||||
|
grep.filename=grep.file \
|
||||||
|
grep.linenumber=grep.line-number \
|
||||||
|
grep.separator=grep.delimiter \
|
||||||
|
\
|
||||||
|
status.branch=status.header \
|
||||||
|
status.added=stat-staged \
|
||||||
|
status.updated=stat-staged \
|
||||||
|
status.changed=stat-unstaged \
|
||||||
|
status.untracked=stat-untracked
|
||||||
@@ -5,7 +5,7 @@ sudo dnf install -y dnf-plugins-core
|
|||||||
|
|
||||||
# enable copr
|
# enable copr
|
||||||
sudo dnf copr enable ganto/lxc4 -y
|
sudo dnf copr enable ganto/lxc4 -y
|
||||||
sudo dnf copr enable livegrenier/i3-desktop -y
|
#sudo dnf copr enable livegrenier/i3-desktop -y
|
||||||
sido dnf copr enable tokariew/i3lock-color -y
|
sido dnf copr enable tokariew/i3lock-color -y
|
||||||
|
|
||||||
# install rpmfusion
|
# install rpmfusion
|
||||||
@@ -32,3 +32,9 @@ sudo dnf install -y firefox chromium gimp libreoffice dia shotwell thunderbird i
|
|||||||
tmux udiskie upower vifm virt-manager libvirt jpegoptim poppler-utils qpdf alacritty dunst feh i3 i3blocks \
|
tmux udiskie upower vifm virt-manager libvirt jpegoptim poppler-utils qpdf alacritty dunst feh i3 i3blocks \
|
||||||
maim network-manager-applet pavucontrol sway swaylock waybar wl-clipboard grim slurp polybar mpc mpd mpv \
|
maim network-manager-applet pavucontrol sway swaylock waybar wl-clipboard grim slurp polybar mpc mpd mpv \
|
||||||
ncmpcpp openvpn
|
ncmpcpp openvpn
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# NPM
|
||||||
|
npm i opencode-ai@latest
|
||||||
|
ln -s ~/node_modules/.bin/opencode ~/bin/opencode
|
||||||
|
|||||||
@@ -154,3 +154,16 @@ export SSH_AUTH_SOCK
|
|||||||
# load shell settings
|
# load shell settings
|
||||||
test -r $XDG_CONFIG_HOME/shell/common && source $XDG_CONFIG_HOME/shell/common
|
test -r $XDG_CONFIG_HOME/shell/common && source $XDG_CONFIG_HOME/shell/common
|
||||||
test -r $XDG_CONFIG_HOME/shell/aliases && source $XDG_CONFIG_HOME/shell/aliases
|
test -r $XDG_CONFIG_HOME/shell/aliases && source $XDG_CONFIG_HOME/shell/aliases
|
||||||
|
|
||||||
|
# autocomplete tools
|
||||||
|
autoload -U +X bashcompinit && bashcompinit
|
||||||
|
complete -o nospace -C /usr/bin/terraform terraform
|
||||||
|
complete -o nospace -C /usr/bin/consul consul
|
||||||
|
complete -o nospace -C /usr/bin/nomad nomad
|
||||||
|
complete -o nospace -C /usr/bin/vault vault
|
||||||
|
eval "$(uv generate-shell-completion zsh)"
|
||||||
|
eval "$(nfpm completion zsh)"
|
||||||
|
|
||||||
|
fpath+=~/.zfunc; autoload -Uz compinit; compinit
|
||||||
|
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
|||||||
Binary file not shown.
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/bash
|
||||||
|
export GPG_TTY=$(tty)
|
||||||
|
export $(pass show personal/radosgw/benvin)
|
||||||
|
|
||||||
|
restic backup "$HOME" --exclude-caches --one-file-system \
|
||||||
|
--exclude '**/.cache' \
|
||||||
|
--exclude '**/.terraform' \
|
||||||
|
--exclude '**/.terragrunt-cache' \
|
||||||
|
--exclude '**/.local/share/containers' \
|
||||||
|
--exclude '**/go/pkg/mod' \
|
||||||
|
--exclude '**/Downloads' \
|
||||||
|
--exclude '**/.thunderbird' \
|
||||||
|
--exclude '**/backups' \
|
||||||
|
--exclude '**/Video'
|
||||||
Reference in New Issue
Block a user