Compare commits
2 Commits
caaff2aee3
...
6fa4bc2808
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fa4bc2808 | |||
| 692dfc6f02 |
7
.gitignore
vendored
7
.gitignore
vendored
@ -1 +1,8 @@
|
|||||||
nushell/history.txt
|
nushell/history.txt
|
||||||
|
# Ignore application history files
|
||||||
|
**/history.txt
|
||||||
|
**/history.db
|
||||||
|
|
||||||
|
# Ignore shell history files
|
||||||
|
.zsh_history
|
||||||
|
.bash_history
|
||||||
|
|||||||
@ -2,28 +2,30 @@
|
|||||||
|
|
||||||
# A script to REMOVE old broken links and CREATE correct new ones.
|
# A script to REMOVE old broken links and CREATE correct new ones.
|
||||||
|
|
||||||
|
set -e # Exit immediately if a command exits with a non-zero status.
|
||||||
|
|
||||||
DOTFILES_DIR="$HOME/dotfiles"
|
DOTFILES_DIR="$HOME/dotfiles"
|
||||||
CONFIG_DIR="$HOME/.config"
|
CONFIG_DIR="$HOME/.config"
|
||||||
|
|
||||||
# List of all config DIRECTORIES to be linked into ~/.config
|
# List of all config DIRECTORIES to be linked into ~/.config
|
||||||
CONFIG_DIRS=(
|
CONFIG_DIRS=(
|
||||||
"atuin" "borg" "btop" "carapace" "gh" "ghostty"
|
"atuin" "borg" "btop" "carapace" "gh" "ghostty"
|
||||||
"kitty" "lazygit" "nushell" "nvim" "zellij"
|
"kitty" "lazygit" "nushell" "nvim" "zellij"
|
||||||
)
|
)
|
||||||
|
|
||||||
echo "--- Starting to fix symbolic links ---"
|
echo "--- Starting to fix symbolic links ---"
|
||||||
|
|
||||||
# --- 1. Fix links for directories inside ~/.config ---
|
# --- 1. Fix links for directories inside ~/.config ---
|
||||||
for dir in "${CONFIG_DIRS[@]}"; do
|
for dir in "${CONFIG_DIRS[@]}"; do
|
||||||
SOURCE_PATH="$DOTFILES_DIR/$dir"
|
SOURCE_PATH="$DOTFILES_DIR/$dir"
|
||||||
LINK_PATH="$CONFIG_DIR/$dir"
|
LINK_PATH="$CONFIG_DIR/$dir"
|
||||||
|
|
||||||
echo "-> Processing $dir..."
|
echo "-> Processing $dir..."
|
||||||
# Remove any existing file or broken link at the destination
|
# Remove any existing file, directory, or broken link at the destination
|
||||||
rm -rf "$LINK_PATH"
|
rm -rf "$LINK_PATH"
|
||||||
# Create the new, correct symlink
|
# Create the new, correct symlink. -T prevents nesting.
|
||||||
ln -s "$SOURCE_PATH" "$LINK_PATH"
|
ln -sT "$SOURCE_PATH" "$LINK_PATH"
|
||||||
echo " Linked $SOURCE_PATH -> $LINK_PATH"
|
echo " Linked $SOURCE_PATH -> $LINK_PATH"
|
||||||
done
|
done
|
||||||
|
|
||||||
# --- 2. Fix link for starship.toml file in ~/.config ---
|
# --- 2. Fix link for starship.toml file in ~/.config ---
|
||||||
@ -31,7 +33,7 @@ SOURCE_PATH_STARSHIP="$DOTFILES_DIR/starship.toml"
|
|||||||
LINK_PATH_STARSHIP="$CONFIG_DIR/starship.toml"
|
LINK_PATH_STARSHIP="$CONFIG_DIR/starship.toml"
|
||||||
echo "-> Processing starship.toml..."
|
echo "-> Processing starship.toml..."
|
||||||
rm -f "$LINK_PATH_STARSHIP"
|
rm -f "$LINK_PATH_STARSHIP"
|
||||||
ln -s "$SOURCE_PATH_STARSHIP" "$LINK_PATH_STARSHIP"
|
ln -sT "$SOURCE_PATH_STARSHIP" "$LINK_PATH_STARSHIP"
|
||||||
echo " Linked $SOURCE_PATH_STARSHIP -> $LINK_PATH_STARSHIP"
|
echo " Linked $SOURCE_PATH_STARSHIP -> $LINK_PATH_STARSHIP"
|
||||||
|
|
||||||
# --- 3. Fix link for .zshrc file in ~ ---
|
# --- 3. Fix link for .zshrc file in ~ ---
|
||||||
@ -39,7 +41,7 @@ SOURCE_PATH_ZSHRC="$DOTFILES_DIR/.zshrc"
|
|||||||
LINK_PATH_ZSHRC="$HOME/.zshrc"
|
LINK_PATH_ZSHRC="$HOME/.zshrc"
|
||||||
echo "-> Processing .zshrc..."
|
echo "-> Processing .zshrc..."
|
||||||
rm -f "$LINK_PATH_ZSHRC"
|
rm -f "$LINK_PATH_ZSHRC"
|
||||||
ln -s "$SOURCE_PATH_ZSHRC" "$LINK_PATH_ZSHRC"
|
ln -sT "$SOURCE_PATH_ZSHRC" "$LINK_PATH_ZSHRC"
|
||||||
echo " Linked $SOURCE_PATH_ZSHRC -> $LINK_PATH_ZSHRC"
|
echo " Linked $SOURCE_PATH_ZSHRC -> $LINK_PATH_ZSHRC"
|
||||||
|
|
||||||
echo "--- All links have been reset correctly. ---"
|
echo "--- All links have been reset correctly. ---"
|
||||||
|
|||||||
@ -33,7 +33,7 @@ local keymap = function(mode, lhs, rhs, opts)
|
|||||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- --- General ---
|
-- --- General --V-
|
||||||
-- Save the current file
|
-- Save the current file
|
||||||
keymap("n", "<leader>w", ":w<CR>", { desc = "Write (Save) File" })
|
keymap("n", "<leader>w", ":w<CR>", { desc = "Write (Save) File" })
|
||||||
|
|
||||||
@ -60,3 +60,6 @@ keymap("n", "<S-l>", ":bnext<CR>", { desc = "Next Buffer" })
|
|||||||
|
|
||||||
-- Go to the previous buffer
|
-- Go to the previous buffer
|
||||||
keymap("n", "<S-h>", ":bprevious<CR>", { desc = "Previous Buffer" })
|
keymap("n", "<S-h>", ":bprevious<CR>", { desc = "Previous Buffer" })
|
||||||
|
vim.keymap.set({'n', 'i', 'v'}, '<F14>', '<C-V>', { desc = 'Enter Visual Block' })
|
||||||
|
vim.keymap.set({'n', 'i'}, '<F15>', 'V', { desc = 'Enter Visual Line' })
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user