mirror of
https://github.com/don-philipe/dotfiles.git
synced 2026-05-14 04:21:46 +02:00
Compare commits
11 Commits
d6707b3dff
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 15240d7e86 | |||
| 97e16f6273 | |||
| 16d1175f21 | |||
| 5ede1b3b47 | |||
| 6033bd016e | |||
| 4f6b390ba6 | |||
| 1b6cad45f5 | |||
| b648f0a936 | |||
| 434df00be3 | |||
| 6a82e1dc6f | |||
| 081a2f5498 |
+1
-1
@@ -4,7 +4,7 @@ URxvt.foreground: white
|
|||||||
!URxvt.borderColor: dark grey
|
!URxvt.borderColor: dark grey
|
||||||
URxvt.scrollBar: false
|
URxvt.scrollBar: false
|
||||||
URxvt.cursorColor: green
|
URxvt.cursorColor: green
|
||||||
URxvt.font: xft:monospace:size=9,xft:Noto Color Emoji
|
URxvt.font: xft:Jet Brains Mono Nerd Font:size=9,xft:monospace:size=9,xft:Noto Color Emoji
|
||||||
URxvt.perl-ext-common: default,matcher
|
URxvt.perl-ext-common: default,matcher
|
||||||
URxvt.url-launcher: /usr/bin/xdg-open
|
URxvt.url-launcher: /usr/bin/xdg-open
|
||||||
URxvt.matcher.button: 1
|
URxvt.matcher.button: 1
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ text = "#000000"
|
|||||||
[env]
|
[env]
|
||||||
# set this to have true color when using nvim etc. in remote tmux session
|
# set this to have true color when using nvim etc. in remote tmux session
|
||||||
TERM = "xterm-256color"
|
TERM = "xterm-256color"
|
||||||
|
WINIT_X11_SCALE_FACTOR = "1.0"
|
||||||
|
|
||||||
[font]
|
[font]
|
||||||
size = 9
|
size = 9
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
-- utilities functions
|
||||||
|
--require("utils")
|
||||||
|
|
||||||
require("config.remap")
|
require("config.remap")
|
||||||
require("config.set")
|
require("config.set")
|
||||||
require("config.commands")
|
require("config.commands")
|
||||||
@@ -11,7 +14,6 @@ require("config.lazy")
|
|||||||
|
|
||||||
-- plugins
|
-- plugins
|
||||||
require("config.cmp")
|
require("config.cmp")
|
||||||
require("config.gen-private")
|
|
||||||
require("config.lsp")
|
require("config.lsp")
|
||||||
require("config.mason")
|
require("config.mason")
|
||||||
require("config.treesitter")
|
require("config.treesitter")
|
||||||
@@ -20,8 +22,11 @@ require("config.gitsigns")
|
|||||||
require("config.lualine")
|
require("config.lualine")
|
||||||
require("config.telescope")
|
require("config.telescope")
|
||||||
require("config.indentline")
|
require("config.indentline")
|
||||||
require("config.redmine")
|
--require("config.redmine")
|
||||||
require("config.diffview")
|
require("config.diffview")
|
||||||
|
require("config.dap")
|
||||||
|
require("config.parrot")
|
||||||
|
--require("config.gitea")
|
||||||
|
|
||||||
-- for some reason this must be placed in init.lua file
|
-- for some reason this must be placed in init.lua file
|
||||||
-- it doesn't work in any lua/config/*.lua files
|
-- it doesn't work in any lua/config/*.lua files
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ cmp.setup({
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- switch on rounded borders in floating completion windows
|
-- switch on rounded borders in floating completion windows
|
||||||
|
-- additionally vim.o.winborder = 'rounded' must be set (set.lua)
|
||||||
window = {
|
window = {
|
||||||
completion = cmp.config.window.bordered(),
|
completion = cmp.config.window.bordered(),
|
||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
|
|||||||
@@ -21,3 +21,47 @@ vim.api.nvim_create_autocmd('Filetype', {
|
|||||||
},
|
},
|
||||||
command = 'setlocal shiftwidth=2 tabstop=2 expandtab'
|
command = 'setlocal shiftwidth=2 tabstop=2 expandtab'
|
||||||
})
|
})
|
||||||
|
if vim.filetype then
|
||||||
|
vim.filetype.add({
|
||||||
|
pattern = {
|
||||||
|
[".*/defaults/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/host_vars/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/group_vars/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/group_vars/.*/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/playbook.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/playbooks/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/roles/.*/tasks/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/roles/.*/handlers/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/tasks/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
[".*/molecule/.*%.ya?ml"] = "yaml.ansible",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
else
|
||||||
|
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" }, {
|
||||||
|
pattern = {
|
||||||
|
"*/defaults/*.yml",
|
||||||
|
"*/defaults/*.yaml",
|
||||||
|
"*/host_vars/*.yml",
|
||||||
|
"*/host_vars/*.yaml",
|
||||||
|
"*/group_vars/*.yml",
|
||||||
|
"*/group_vars/*.yaml",
|
||||||
|
"*/group_vars/*/*.yml",
|
||||||
|
"*/group_vars/*/*.yaml",
|
||||||
|
"*/playbook*.yml",
|
||||||
|
"*/playbook*.yaml",
|
||||||
|
"*/playbooks/*.yml",
|
||||||
|
"*/playbooks/*.yaml",
|
||||||
|
"*/roles/*/tasks/*.yml",
|
||||||
|
"*/roles/*/tasks/*.yaml",
|
||||||
|
"*/roles/*/handlers/*.yml",
|
||||||
|
"*/roles/*/handlers/*.yaml",
|
||||||
|
"*/tasks/*.yml",
|
||||||
|
"*/tasks/*.yaml",
|
||||||
|
"*/molecule/*.yml",
|
||||||
|
"*/molecule/*.yaml",
|
||||||
|
},
|
||||||
|
callback = function()
|
||||||
|
vim.bo.filetype = "yaml.ansible"
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
|
-- return {
|
||||||
|
-- model = "llama3.2",
|
||||||
|
-- host = "jupiter",
|
||||||
|
-- port = "11434",
|
||||||
|
-- }
|
||||||
return {
|
return {
|
||||||
model = "llama3.2",
|
model = "llama3.3",
|
||||||
host = "foo",
|
host = "owu-zegv-api.med.tu-dresden.de",
|
||||||
port = "11343",
|
port = "443",
|
||||||
|
https = true,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,10 @@ require('gitsigns').setup()
|
|||||||
local gitsigns = require('gitsigns')
|
local gitsigns = require('gitsigns')
|
||||||
vim.keymap.set('n', '<leader>gm', gitsigns.blame_line, { desc = 'Show git message for current line' })
|
vim.keymap.set('n', '<leader>gm', gitsigns.blame_line, { desc = 'Show git message for current line' })
|
||||||
vim.keymap.set('n', '<leader>gd', ':Gitsigns diffthis ~ vertical=true<CR>:wincmd w<CR>', { desc = 'Show diff for current line' })
|
vim.keymap.set('n', '<leader>gd', ':Gitsigns diffthis ~ vertical=true<CR>:wincmd w<CR>', { desc = 'Show diff for current line' })
|
||||||
|
vim.keymap.set('n', '<leader>gs', gitsigns.stage_hunk, { desc = 'Stage current hunk' })
|
||||||
|
vim.keymap.set('n', '<leader>gS', gitsigns.stage_buffer, { desc = 'Stage current buffer' })
|
||||||
vim.keymap.set('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'Reset current hunk' })
|
vim.keymap.set('n', '<leader>gr', gitsigns.reset_hunk, { desc = 'Reset current hunk' })
|
||||||
|
vim.keymap.set('n', '<leader>gR', gitsigns.reset_buffer, { desc = 'Reset current buffer' })
|
||||||
vim.keymap.set('n', '<leader>h', gitsigns.next_hunk, { desc = 'Move to next hunk' })
|
vim.keymap.set('n', '<leader>h', gitsigns.next_hunk, { desc = 'Move to next hunk' })
|
||||||
vim.keymap.set('n', '<leader>H', gitsigns.prev_hunk, { desc = 'Move to previous hunk' })
|
vim.keymap.set('n', '<leader>H', gitsigns.prev_hunk, { desc = 'Move to previous hunk' })
|
||||||
vim.keymap.set('n', '<leader>ph', gitsigns.preview_hunk, { desc = 'Preview hunk in popup' })
|
vim.keymap.set('n', '<leader>ph', gitsigns.preview_hunk, { desc = 'Preview hunk in popup' })
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ require("lazy").setup({
|
|||||||
install = { colorscheme = { "habamax" } },
|
install = { colorscheme = { "habamax" } },
|
||||||
-- automatically check for plugin updates
|
-- automatically check for plugin updates
|
||||||
checker = { enabled = true },
|
checker = { enabled = true },
|
||||||
|
change_detection = { enabled = false }, -- active change detection seems to eat up memory over time https://github.com/folke/lazy.nvim/issues/1008
|
||||||
ui = {
|
ui = {
|
||||||
border = "rounded",
|
border = "rounded",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -32,3 +32,10 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
|
vim.keymap.set('n', '<F4>', '<cmd>lua vim.lsp.buf.code_action()<cr>', opts)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- helper plugin configuration
|
||||||
|
require'py_lsp'.setup{
|
||||||
|
host_python = '/usr/bin/python3',
|
||||||
|
default_venv_name = "venv",
|
||||||
|
language_server = "pylsp",
|
||||||
|
}
|
||||||
|
|||||||
@@ -18,3 +18,5 @@ vim.diagnostic.config({
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.opt.undofile = true
|
vim.opt.undofile = true
|
||||||
|
|
||||||
|
vim.o.winborder = 'rounded'
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
local ok, vars = pcall(require, 'config.gen-private')
|
|
||||||
if not ok then
|
|
||||||
print("Missing gen-private configuration file.")
|
|
||||||
end
|
|
||||||
|
|
||||||
return {
|
|
||||||
{ "David-Kunz/gen.nvim",
|
|
||||||
opts = {
|
|
||||||
model = vars["model"],
|
|
||||||
host = vars["host"],
|
|
||||||
port = vars["port"],
|
|
||||||
https = vars["https"],
|
|
||||||
show_prompt = true,
|
|
||||||
debug = false,
|
|
||||||
|
|
||||||
-- https://github.com/David-Kunz/gen.nvim/issues/116
|
|
||||||
command = function(options)
|
|
||||||
local body = { model = options.model, stream = true }
|
|
||||||
local schema = "http"
|
|
||||||
if options.https then
|
|
||||||
schema = "https"
|
|
||||||
end
|
|
||||||
return "curl --silent --no-buffer -X POST " .. schema .. "://" .. options.host .. ":" .. options.port .. "/api/chat -d $body"
|
|
||||||
end,
|
|
||||||
}},
|
|
||||||
}
|
|
||||||
@@ -2,4 +2,6 @@ return {
|
|||||||
{'neovim/nvim-lspconfig', tag = 'v1.7.0'}, -- pin to a version thats compatible with nvim < 0.10
|
{'neovim/nvim-lspconfig', tag = 'v1.7.0'}, -- pin to a version thats compatible with nvim < 0.10
|
||||||
{'hrsh7th/cmp-nvim-lsp'},
|
{'hrsh7th/cmp-nvim-lsp'},
|
||||||
{'hrsh7th/nvim-cmp'},
|
{'hrsh7th/nvim-cmp'},
|
||||||
|
-- helper plugins
|
||||||
|
{'HallerPatrick/py_lsp.nvim'},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
return {
|
||||||
|
"frankroeder/parrot.nvim",
|
||||||
|
dependencies = { "ibhagwan/fzf-lua", "nvim-lua/plenary.nvim" },
|
||||||
|
}
|
||||||
@@ -21,6 +21,10 @@ checkcert()
|
|||||||
{
|
{
|
||||||
openssl s_client -connect "$1":443 2>/dev/null
|
openssl s_client -connect "$1":443 2>/dev/null
|
||||||
}
|
}
|
||||||
|
pem2crt()
|
||||||
|
{
|
||||||
|
openssl x509 -inform PEM -in "$1" -out "${1%.*}.crt"
|
||||||
|
}
|
||||||
|
|
||||||
# works only without tex-ending
|
# works only without tex-ending
|
||||||
tex2pdf()
|
tex2pdf()
|
||||||
@@ -71,12 +75,28 @@ git-blobs()
|
|||||||
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
|
$(command -v gnumfmt || echo numfmt) --field=2 --to=iec-i --suffix=B --padding=7 --round=nearest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Do a short code review via several git commands
|
||||||
|
# https://piechowski.io/post/git-commands-before-reading-code/
|
||||||
|
git-review()
|
||||||
|
{
|
||||||
|
echo "### What Changes the Most (1y ago) ###"
|
||||||
|
git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20
|
||||||
|
echo "\n### Who Built This ###"
|
||||||
|
git --no-pager shortlog -sn --no-merges
|
||||||
|
echo "\n### Where Do Bugs Cluster ###"
|
||||||
|
git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20
|
||||||
|
echo "\n### Is This Project Accelerating or Dying (commit count per m) ###"
|
||||||
|
git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c
|
||||||
|
echo "\n### How Often Is the Team Firefighting ###"
|
||||||
|
git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback'
|
||||||
|
}
|
||||||
|
|
||||||
sshs()
|
sshs()
|
||||||
{
|
{
|
||||||
tmprc=$(ssh $1 "mktemp --directory")
|
tmprc=$(ssh $1 "mktemp --directory")
|
||||||
scp -q $HOME/.zshrc $1:$tmprc
|
scp -q $HOME/.zshrc $1:$tmprc
|
||||||
ssh -t $1 "export ZDOTDIR=${tmprc}; exec zsh"
|
ssh -t $1 "export ZDOTDIR=${tmprc}; trap 'rm -rf ${tmprc}' EXIT INT TERM; exec zsh"
|
||||||
ssh $1 "rm -rf ${tmprc}"
|
#ssh $1 "rm -rf ${tmprc}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# show the current mode:
|
# show the current mode:
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ autoload -U promptinit
|
|||||||
promptinit
|
promptinit
|
||||||
|
|
||||||
export XDG_CONFIG_HOME=$HOME/.config/
|
export XDG_CONFIG_HOME=$HOME/.config/
|
||||||
export EDITOR=vim
|
export EDITOR=nvim
|
||||||
|
|
||||||
alias ls='ls --color=always'
|
alias ls='ls --color=always'
|
||||||
alias grep='grep --color=always'
|
alias grep='grep --color=always'
|
||||||
@@ -114,6 +114,7 @@ alias less='less -R'
|
|||||||
alias dd='dd status=progress oflag=direct'
|
alias dd='dd status=progress oflag=direct'
|
||||||
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
alias dotfiles='git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
|
||||||
alias hibernate='sudo systemctl hibernate'
|
alias hibernate='sudo systemctl hibernate'
|
||||||
alias ssh="TERM=linux ssh" # for not complaining urxvt about terminals without TERM set
|
#alias ssh="TERM=linux ssh" # for not complaining urxvt about terminals without TERM set
|
||||||
alias cpup="cp -T $0 ../$0"
|
alias cpup="cp -T $0 ../$0"
|
||||||
alias pythonweb="python -m SimpleHTTPServer 8090"
|
alias pythonweb="python -m SimpleHTTPServer 8090"
|
||||||
|
alias sayhi="echo hi"
|
||||||
|
|||||||
Reference in New Issue
Block a user