Compare commits
No commits in common. "10b03f5244b64e7e7f05d5b18a35fe5ef1084df8" and "03f749ad35d81a3a517ee760c7a447093145f9c5" have entirely different histories.
10b03f5244
...
03f749ad35
9 changed files with 25 additions and 352 deletions
|
|
@ -1,40 +1,9 @@
|
||||||
if [ -x /usr/bin/dircolors ]; then
|
alias gm="git checkout master && git pull"
|
||||||
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 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 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 &
|
||||||
alias gm="git checkout main && git pull"
|
disown
|
||||||
|
}
|
||||||
|
|
||||||
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
34
.bash_prompt
|
|
@ -1,34 +0,0 @@
|
||||||
# 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'
|
|
||||||
|
|
@ -11,7 +11,7 @@ The repo has two branches, the main branch I use on Ubuntu distros with an GNOME
|
||||||
While in $HOME
|
While in $HOME
|
||||||
1. Add the following to .bashrc alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
|
1. Add the following to .bashrc alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
|
||||||
2. source .bashrc
|
2. source .bashrc
|
||||||
3. echo ".cfg">> .gitignore. This is to prevent potential recursive problems
|
3. echo ".cfg">> .gitignore. This is to preent potential recursive problems
|
||||||
4. git clone --bare https://github.com/leoalho/dotfiles.git $HOME/.cfg
|
4. git clone --bare https://github.com/leoalho/dotfiles.git $HOME/.cfg
|
||||||
5. Checkout the content to $HOME: config checkout
|
5. Checkout the content to $HOME: config checkout
|
||||||
6. config config --local status.showUntrackedFiles no
|
6. config config --local status.showUntrackedFiles no
|
||||||
|
|
@ -27,13 +27,8 @@ if [ -f ~/.bash_aliases ]; then
|
||||||
. ~/.bash_aliases
|
. ~/.bash_aliases
|
||||||
fi
|
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
|
## Tmux uses the tpm for plugins
|
||||||
https://github.com/tmux-plugins/tpm
|
https://github.com/tmux-plugins/tpm
|
||||||
|
|
||||||
## Nvim uses vim-plug
|
## Nvim uses vim-plug
|
||||||
https://github.com/junegunn/vim-plug
|
https://github.com/junegunn/vim-plug
|
||||||
|
|
||||||
## Shell scripts
|
|
||||||
The repository also contains a couple of helper shell scripts located in .local/bin
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
{
|
|
||||||
"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,25 +1,13 @@
|
||||||
[terminal.shell]
|
# [shell]
|
||||||
program = "/bin/bash"
|
# program = "/bin/bash"
|
||||||
args = [ "-l", "-c", "tmux attach || tmux" ]
|
# args = ["-l","-c","tmux attach || tmux"]
|
||||||
|
|
||||||
# [general]
|
|
||||||
# import = [
|
|
||||||
# "~/.config/alacritty/themes/dayfox.toml"
|
|
||||||
#]
|
|
||||||
|
|
||||||
[window]
|
[window]
|
||||||
# opacity = 0.85
|
opacity = 0.75
|
||||||
decorations = "None"
|
padding = { x = 5, y = 5}
|
||||||
|
|
||||||
[window.padding]
|
[colors.primary]
|
||||||
x = 10
|
background = "#000000"
|
||||||
y = 10
|
|
||||||
|
|
||||||
# [colors.primary]
|
|
||||||
# background = "#000000"
|
|
||||||
|
|
||||||
# [bell]
|
|
||||||
# command = { program = "paplay", args = ["/usr/share/sounds/freedesktop/stereo/message.oga"] }
|
|
||||||
|
|
||||||
[font]
|
[font]
|
||||||
size = 11
|
size = 11
|
||||||
|
|
@ -39,12 +27,3 @@ size = 11
|
||||||
[font.normal]
|
[font.normal]
|
||||||
family = "SpaceMono Nerd Font Mono"
|
family = "SpaceMono Nerd Font Mono"
|
||||||
style = "Regular"
|
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" }
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,139 +0,0 @@
|
||||||
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,
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
#!/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"
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
#!/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,21 +10,9 @@ bind-key C-a send-prefix
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
|
|
||||||
set -g status-style bg=white,fg=black
|
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
|
# List of plugins
|
||||||
set -g @plugin 'tmux-plugins/tpm'
|
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)
|
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
|
||||||
run '~/.tmux/plugins/tpm/tpm'
|
run '~/.tmux/plugins/tpm/tpm'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue