Compare commits
10 commits
03f749ad35
...
10b03f5244
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10b03f5244 | ||
|
|
b394159a6e | ||
|
|
fd2c0c1421 | ||
|
|
9de44888ba | ||
|
|
d79b804e93 | ||
|
|
4e307708a0 | ||
|
|
1ad60be8b6 | ||
|
|
f769891708 | ||
|
|
90f0cf897e | ||
|
|
49bb2bc80e |
9 changed files with 353 additions and 26 deletions
|
|
@ -1,9 +1,40 @@
|
|||
alias gm="git checkout master && git pull"
|
||||
alias count="ls -l | wc -l"
|
||||
if [ -x /usr/bin/dircolors ]; then
|
||||
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
||||
alias ls='ls --color=auto'
|
||||
#alias dir='dir --color=auto'
|
||||
#alias vdir='vdir --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
fi
|
||||
|
||||
# ls aliases
|
||||
alias count="ls -l | wc -l"
|
||||
alias ll='ls -alF'
|
||||
alias la='ls -A'
|
||||
alias l='ls -CF'
|
||||
|
||||
alias c="clear"
|
||||
|
||||
function csa(){ cd $1 && ls -a; }
|
||||
function cs(){ cd $1 && ls; }
|
||||
|
||||
# Git aliases
|
||||
function gcam() { git commit -a -m "$1"; }
|
||||
|
||||
function dt() {
|
||||
nohup "$@" </dev/null >/dev/null 2>&1 &
|
||||
disown
|
||||
}
|
||||
function dt() { nohup "$@" </dev/null >/dev/null 2>&1 & disown; }
|
||||
|
||||
alias gm="git checkout main && git pull"
|
||||
|
||||
|
||||
function mkcdir () { mkdir "$1" && cd "$1"; }
|
||||
|
||||
alias scripts="jq .scripts package.json"
|
||||
|
||||
# Add an "alert" alias for long running commands. Use like so:
|
||||
# sleep 10; alert
|
||||
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
|
||||
|
||||
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
|
||||
|
||||
alias timestamp='date +%s%3N'
|
||||
|
|
|
|||
34
.bash_prompt
Normal file
34
.bash_prompt
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# set a fancy prompt (non-color, unless we know we "want" color)
|
||||
case "$TERM" in
|
||||
xterm-color|*-256color) color_prompt=yes;;
|
||||
esac
|
||||
|
||||
function __set_prompt() {
|
||||
local branch
|
||||
branch=$(git branch --show-current 2>/dev/null)
|
||||
|
||||
# Colors (wrapped in \[ \] for proper length calculation)
|
||||
local yellow_bg='\[\033[43;30m\]'
|
||||
local blue_bg='\[\033[44;30m\]'
|
||||
local yellow_on_blue='\[\033[44;33m\]'
|
||||
local blue='\[\033[0;34m\]'
|
||||
local yellow='\[\033[0;33m\]'
|
||||
local reset='\[\033[0m\]'
|
||||
local arrow=$'\ue0b0'
|
||||
|
||||
if [[ -n "$branch" ]]; then
|
||||
PS1="${yellow_bg} \w ${yellow_on_blue}${arrow}${blue_bg} ${branch} ${blue}${arrow}${reset} "
|
||||
else
|
||||
PS1="${yellow_bg} \w ${yellow}${arrow}${reset} "
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$color_prompt" = yes ]; then
|
||||
PROMPT_COMMAND=__set_prompt
|
||||
else
|
||||
PS1='\w\$ '
|
||||
fi
|
||||
|
||||
unset color_prompt
|
||||
|
||||
printf '\033[3 q'
|
||||
26
.claude/settings.json
Normal file
26
.claude/settings.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"hooks": {
|
||||
"Notification": [
|
||||
{
|
||||
"matcher": "",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "paplay /usr/share/sounds/freedesktop/stereo/message.oga & tmux display-message 'Window #I: #W' & notify-send -a 'Claude Code' -i ~/.claude/claude-color.png \"Window $(tmux display-message -p '#I: #W') is needing your professional and ever so wise feedback.\""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"enabledPlugins": {
|
||||
"typescript-lsp@claude-plugins-official": true,
|
||||
"gopls-lsp@claude-plugins-official": true
|
||||
},
|
||||
"feedbackSurveyState": {
|
||||
"lastShownTime": 1754297707811
|
||||
},
|
||||
"statusLine": {
|
||||
"type": "command",
|
||||
"command": "branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null); printf '\\033[00m%s%s' \"$(pwd)\" \"${branch:+ ($branch)}\""
|
||||
}
|
||||
}
|
||||
|
|
@ -1,29 +1,50 @@
|
|||
# [shell]
|
||||
# program = "/bin/bash"
|
||||
# args = ["-l","-c","tmux attach || tmux"]
|
||||
[terminal.shell]
|
||||
program = "/bin/bash"
|
||||
args = [ "-l", "-c", "tmux attach || tmux" ]
|
||||
|
||||
# [general]
|
||||
# import = [
|
||||
# "~/.config/alacritty/themes/dayfox.toml"
|
||||
#]
|
||||
|
||||
[window]
|
||||
opacity = 0.75
|
||||
padding = { x = 5, y = 5}
|
||||
# opacity = 0.85
|
||||
decorations = "None"
|
||||
|
||||
[colors.primary]
|
||||
background = "#000000"
|
||||
[window.padding]
|
||||
x = 10
|
||||
y = 10
|
||||
|
||||
# [colors.primary]
|
||||
# background = "#000000"
|
||||
|
||||
# [bell]
|
||||
# command = { program = "paplay", args = ["/usr/share/sounds/freedesktop/stereo/message.oga"] }
|
||||
|
||||
[font]
|
||||
size = 11
|
||||
|
||||
[font.bold]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Bold"
|
||||
[font.bold]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Bold"
|
||||
|
||||
[font.bold_italic]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Bold Italic"
|
||||
[font.bold_italic]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Bold Italic"
|
||||
|
||||
[font.italic]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Italic"
|
||||
[font.italic]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Italic"
|
||||
|
||||
[font.normal]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Regular"
|
||||
|
||||
|
||||
[[hints.enabled]]
|
||||
regex = "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)[^\u0000-\u001f\u007f-\u009f<>\"\\s{-}\\^⟨⟩`]+"
|
||||
command = "xdg-open"
|
||||
post_processing = true
|
||||
mouse = { enabled = true, mods = "Control" }
|
||||
binding = { key = "U", mods = "Control|Shift" }
|
||||
|
||||
[font.normal]
|
||||
family = "SpaceMono Nerd Font Mono"
|
||||
style = "Regular"
|
||||
|
|
|
|||
139
.config/nvim/init.lua
Normal file
139
.config/nvim/init.lua
Normal file
|
|
@ -0,0 +1,139 @@
|
|||
local Plug = vim.fn['plug#']
|
||||
|
||||
vim.call('plug#begin')
|
||||
|
||||
Plug 'nvim-tree/nvim-web-devicons'
|
||||
Plug 'nvim-tree/nvim-tree.lua'
|
||||
|
||||
Plug 'williamboman/mason.nvim'
|
||||
Plug 'williamboman/mason-lspconfig.nvim'
|
||||
Plug 'neovim/nvim-lspconfig'
|
||||
|
||||
Plug 'hrsh7th/cmp-nvim-lsp'
|
||||
Plug 'hrsh7th/cmp-buffer'
|
||||
Plug 'hrsh7th/cmp-path'
|
||||
Plug 'hrsh7th/cmp-cmdline'
|
||||
Plug 'hrsh7th/nvim-cmp'
|
||||
|
||||
vim.call('plug#end')
|
||||
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = {"ts_ls"}
|
||||
})
|
||||
require("nvim-tree").setup({
|
||||
filters = {
|
||||
dotfiles = false,
|
||||
},
|
||||
git = {
|
||||
ignore = false,
|
||||
}
|
||||
})
|
||||
|
||||
require("lspconfig").ts_ls.setup {}
|
||||
|
||||
vim.opt.number = true
|
||||
vim.opt.swapfile = true
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.confirm = true
|
||||
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
-- REQUIRED - you must specify a snippet engine
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
-- vim.snippet.expand(args.body) -- For native neovim snippets (Neovim v0.10+)
|
||||
|
||||
-- For `mini.snippets` users:
|
||||
-- local insert = MiniSnippets.config.expand.insert or MiniSnippets.default_insert
|
||||
-- insert({ body = args.body }) -- Insert at cursor
|
||||
-- cmp.resubscribe({ "TextChangedI", "TextChangedP" })
|
||||
-- require("cmp.config").set_onetime({ sources = {} })
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'vsnip' }, -- For vsnip users.
|
||||
-- { name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- To use git you need to install the plugin petertriho/cmp-git and uncomment lines below
|
||||
-- Set configuration for specific filetype.
|
||||
--[[ cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
require("cmp_git").setup() ]]--
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
}),
|
||||
matching = { disallow_symbol_nonprefix_matching = false }
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
require('lspconfig')['ts_ls'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
||||
|
||||
-- set space as leader keymap
|
||||
vim.keymap.set('n', ' ', '<Nop>', {noremap = true, silent = true})
|
||||
vim.g.mapleader = ' '
|
||||
vim.keymap.set('n', '<leader>x', ':NvimTreeToggle<CR>', {noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<leader>n', ':bnext<CR>', {noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<leader>p', ':bprevious<CR>', {noremap = true, silent = true})
|
||||
vim.keymap.set('n', '<leader>d', ':bdelete<CR>', {noremap = true, silent = true})
|
||||
|
||||
vim.opt.statuscolumn = "%s %l %r "
|
||||
vim.o.rnu=true
|
||||
|
||||
local treeApi = require("nvim-tree.api")
|
||||
|
||||
-- Close the tree when a new buffer is opened
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
callback = function()
|
||||
if (vim.fn.bufname() == "NvimTree_1") then return end
|
||||
treeApi.tree.close()
|
||||
end,
|
||||
})
|
||||
|
||||
34
.local/bin/git-pr
Executable file
34
.local/bin/git-pr
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Get the current branch name
|
||||
CURRENT_BRANCH=$(git branch --show-current)
|
||||
|
||||
# Get the default branch (usually main or master)
|
||||
DEFAULT_BRANCH=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
|
||||
|
||||
# Push the current branch to origin
|
||||
echo "Pushing $CURRENT_BRANCH to origin..."
|
||||
git push -u origin "$CURRENT_BRANCH"
|
||||
|
||||
# Check if push was successful
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: Failed to push branch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the last commit's first line (title)
|
||||
PR_TITLE=$(git log -1 --pretty=format:%s)
|
||||
|
||||
# Get the last commit's body (everything after the first line)
|
||||
PR_BODY=$(git log -1 --pretty=format:%b)
|
||||
|
||||
# Create PR using the commit message
|
||||
echo "Creating PR..."
|
||||
echo "Title: $PR_TITLE"
|
||||
echo "Body: $PR_BODY"
|
||||
|
||||
gh pr create \
|
||||
--base "$DEFAULT_BRANCH" \
|
||||
--head "$CURRENT_BRANCH" \
|
||||
--title "$PR_TITLE" \
|
||||
--body "$PR_BODY"
|
||||
25
.local/bin/toggle-opacity
Executable file
25
.local/bin/toggle-opacity
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Path to alacritty config file
|
||||
CONFIG_FILE="$HOME/.config/alacritty/alacritty.toml"
|
||||
|
||||
# Check if config file exists
|
||||
if [ ! -f "$CONFIG_FILE" ]; then
|
||||
echo "Error: Config file not found at $CONFIG_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if opacity line exists (commented or not)
|
||||
if grep -q "^opacity = 0.85" "$CONFIG_FILE"; then
|
||||
# Line is uncommented, comment it out
|
||||
sed -i 's/^opacity = 0.85/# opacity = 0.85/' "$CONFIG_FILE"
|
||||
echo "Opacity disabled (line commented out)"
|
||||
elif grep -q "^# opacity = 0.85" "$CONFIG_FILE"; then
|
||||
# Line is commented, uncomment it
|
||||
sed -i 's/^# opacity = 0.85/opacity = 0.85/' "$CONFIG_FILE"
|
||||
echo "Opacity enabled (line uncommented)"
|
||||
else
|
||||
# Line doesn't exist, add it uncommented
|
||||
echo "opacity = 0.85" >> "$CONFIG_FILE"
|
||||
echo "Opacity line added and enabled"
|
||||
fi
|
||||
12
.tmux.conf
12
.tmux.conf
|
|
@ -10,9 +10,21 @@ bind-key C-a send-prefix
|
|||
set -g mouse on
|
||||
|
||||
set -g status-style bg=white,fg=black
|
||||
set -g pane-active-border-style fg=yellow
|
||||
set -g pane-border-style fg=gray
|
||||
set -g pane-border-lines heavy
|
||||
|
||||
# List of plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
|
||||
set-option -g status-right ""
|
||||
set-option -g status-left ""
|
||||
set -g status-style bg=default
|
||||
|
||||
# set-window-option -g visual-bell on
|
||||
|
||||
bind-key H display-popup -E "htop"
|
||||
bind-key N display-popup
|
||||
|
||||
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||
run '~/.tmux/plugins/tpm/tpm'
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ The repo has two branches, the main branch I use on Ubuntu distros with an GNOME
|
|||
While in $HOME
|
||||
1. Add the following to .bashrc alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
|
||||
2. source .bashrc
|
||||
3. echo ".cfg">> .gitignore. This is to preent potential recursive problems
|
||||
3. echo ".cfg">> .gitignore. This is to prevent potential recursive problems
|
||||
4. git clone --bare https://github.com/leoalho/dotfiles.git $HOME/.cfg
|
||||
5. Checkout the content to $HOME: config checkout
|
||||
6. config config --local status.showUntrackedFiles no
|
||||
|
|
@ -27,8 +27,13 @@ if [ -f ~/.bash_aliases ]; then
|
|||
. ~/.bash_aliases
|
||||
fi
|
||||
|
||||
Also a .bash_prompt file is included that can be included in the same way as the bash_aliases. It provides styling for the prompt
|
||||
|
||||
## Tmux uses the tpm for plugins
|
||||
https://github.com/tmux-plugins/tpm
|
||||
|
||||
## Nvim uses vim-plug
|
||||
https://github.com/junegunn/vim-plug
|
||||
|
||||
## Shell scripts
|
||||
The repository also contains a couple of helper shell scripts located in .local/bin
|
||||
Loading…
Reference in a new issue