Compare commits
11 Commits
e086d23d1c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7279d1272e | |||
| bfdd433d4a | |||
| 82030bea78 | |||
| 478ac65fd7 | |||
| 9173d3332b | |||
| 89fda09d17 | |||
| c7f0678ed4 | |||
| f494b1840a | |||
| 455169b537 | |||
| ffb21643d5 | |||
| 614784daf4 |
@@ -16,7 +16,7 @@ From your users home directory (~/), execute:
|
|||||||
To install oh-my-zsh and symlink the config files run:
|
To install oh-my-zsh and symlink the config files run:
|
||||||
```sh .config/dotfiles/install.sh```
|
```sh .config/dotfiles/install.sh```
|
||||||
|
|
||||||
This replaces the managed dotfiles in your home directory (`.zshrc`, `.zprofile`, `.gitconfig`, `.p10k.zsh`, `~/.config/kitty`, `~/.config/nvim`, and `~/.config/tmux`). On macOS it also links `~/.config/karabiner/karabiner.json` and `~/.config/karabiner/assets`, while leaving Karabiner's local backup files unmanaged.
|
This replaces the managed dotfiles in your home directory (`.zshrc`, `.zprofile`, `.gitconfig`, `.p10k.zsh`, `~/.config/kitty`, `~/.config/nvim`, and `~/.config/tmux`). On macOS it also links `~/.config/karabiner/karabiner.json` and `~/.config/karabiner/assets`, while leaving Karabiner's local backup files unmanaged. The Kitty HUD display pin lives in a host-specific file and is only installed on the host named `studio`.
|
||||||
|
|
||||||

|

|
||||||
[original image, 1.8M](https://24unix.net/build/images/Settings/user_screen_original.png)
|
[original image, 1.8M](https://24unix.net/build/images/Settings/user_screen_original.png)
|
||||||
|
|||||||
4
TODO
Normal file
4
TODO
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- check for vimrc
|
||||||
|
- move to new packer
|
||||||
|
- for plugins with more config ines than 5, crezte a dedicatet folder/file
|
||||||
|
|
||||||
3
hosts/studio/kitty/quick-access-terminal.conf
Normal file
3
hosts/studio/kitty/quick-access-terminal.conf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Pin the quick access terminal to the center display instead of following the
|
||||||
|
# active monitor when it is toggled open.
|
||||||
|
output_name LU28R55
|
||||||
80
install.sh
80
install.sh
@@ -49,13 +49,20 @@ command_exists() {
|
|||||||
command -v "$@" >/dev/null 2>&1
|
command -v "$@" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
require_command() {
|
is_macos() {
|
||||||
command_name=$1
|
[ "$(uname -s)" = "Darwin" ]
|
||||||
|
}
|
||||||
|
|
||||||
if ! command_exists "$command_name"; then
|
current_host_name() {
|
||||||
error "$command_name is required but not installed. Install it first via your package manager."
|
if is_macos && command_exists scutil; then
|
||||||
exit 1
|
scutil --get LocalHostName 2>/dev/null && return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
hostname -s 2>/dev/null || hostname
|
||||||
|
}
|
||||||
|
|
||||||
|
is_studio_host() {
|
||||||
|
[ "$(current_host_name)" = "studio" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
error() {
|
error() {
|
||||||
@@ -88,21 +95,16 @@ setup_color() {
|
|||||||
apply_dotfiles() {
|
apply_dotfiles() {
|
||||||
echo "${BLUE}Applying dotfiles...${RESET}"
|
echo "${BLUE}Applying dotfiles...${RESET}"
|
||||||
|
|
||||||
require_command lsd
|
|
||||||
require_command tmux
|
|
||||||
require_command nvim
|
|
||||||
require_command rg
|
|
||||||
|
|
||||||
remove_legacy_dotfile "$HOME/.vimrc"
|
remove_legacy_dotfile "$HOME/.vimrc"
|
||||||
link_dotfile "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc"
|
link_dotfile "$DOTFILES_DIR/.zshrc" "$HOME/.zshrc"
|
||||||
link_dotfile "$DOTFILES_DIR/.zprofile" "$HOME/.zprofile"
|
link_dotfile "$DOTFILES_DIR/.zprofile" "$HOME/.zprofile"
|
||||||
link_dotfile "$DOTFILES_DIR/.gitconfig" "$HOME/.gitconfig"
|
link_dotfile "$DOTFILES_DIR/.gitconfig" "$HOME/.gitconfig"
|
||||||
link_dotfile "$DOTFILES_DIR/.p10k.zsh" "$HOME/.p10k.zsh"
|
link_dotfile "$DOTFILES_DIR/.p10k.zsh" "$HOME/.p10k.zsh"
|
||||||
mkdir -p "$HOME/.config"
|
mkdir -p "$HOME/.config"
|
||||||
link_dotfile "$DOTFILES_DIR/kitty" "$HOME/.config/kitty"
|
install_kitty_config
|
||||||
link_dotfile "$DOTFILES_DIR/nvim" "$HOME/.config/nvim"
|
link_dotfile "$DOTFILES_DIR/nvim" "$HOME/.config/nvim"
|
||||||
link_dotfile "$DOTFILES_DIR/tmux" "$HOME/.config/tmux"
|
link_dotfile "$DOTFILES_DIR/tmux" "$HOME/.config/tmux"
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
if is_macos; then
|
||||||
install_karabiner_config
|
install_karabiner_config
|
||||||
fi
|
fi
|
||||||
install_fonts
|
install_fonts
|
||||||
@@ -113,6 +115,24 @@ apply_dotfiles() {
|
|||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validate_prerequisites() {
|
||||||
|
missing_commands=""
|
||||||
|
|
||||||
|
for command_name in git zsh lsd tmux nvim rg; do
|
||||||
|
if ! command_exists "$command_name"; then
|
||||||
|
if [ -n "$missing_commands" ]; then
|
||||||
|
missing_commands="$missing_commands, "
|
||||||
|
fi
|
||||||
|
missing_commands="${missing_commands}${command_name}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$missing_commands" ]; then
|
||||||
|
error "required tools are missing: $missing_commands. Install them first via your package manager."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
remove_legacy_dotfile() {
|
remove_legacy_dotfile() {
|
||||||
target_path=$1
|
target_path=$1
|
||||||
|
|
||||||
@@ -162,6 +182,32 @@ link_dotfile() {
|
|||||||
echo "${GREEN}Linked $target_path -> $source_path${RESET}"
|
echo "${GREEN}Linked $target_path -> $source_path${RESET}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ensure_directory() {
|
||||||
|
target_path=$1
|
||||||
|
|
||||||
|
if [ -L "$target_path" ] || [ -f "$target_path" ]; then
|
||||||
|
echo "${YELLOW}Removing existing $target_path${RESET}"
|
||||||
|
rm -rf "$target_path"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p "$target_path"
|
||||||
|
}
|
||||||
|
|
||||||
|
install_kitty_config() {
|
||||||
|
kitty_config_dir="$HOME/.config/kitty"
|
||||||
|
|
||||||
|
ensure_directory "$kitty_config_dir"
|
||||||
|
link_dotfile "$DOTFILES_DIR/kitty/kitty.conf" "$kitty_config_dir/kitty.conf"
|
||||||
|
link_dotfile "$DOTFILES_DIR/kitty/macos-launch-services-cmdline" "$kitty_config_dir/macos-launch-services-cmdline"
|
||||||
|
|
||||||
|
if is_studio_host; then
|
||||||
|
link_dotfile "$DOTFILES_DIR/hosts/studio/kitty/quick-access-terminal.conf" "$kitty_config_dir/quick-access-terminal.conf"
|
||||||
|
elif [ -L "$kitty_config_dir/quick-access-terminal.conf" ] || [ -e "$kitty_config_dir/quick-access-terminal.conf" ]; then
|
||||||
|
echo "${YELLOW}Removing existing $kitty_config_dir/quick-access-terminal.conf${RESET}"
|
||||||
|
rm -rf "$kitty_config_dir/quick-access-terminal.conf"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
install_karabiner_config() {
|
install_karabiner_config() {
|
||||||
mkdir -p "$HOME/.config/karabiner"
|
mkdir -p "$HOME/.config/karabiner"
|
||||||
link_dotfile "$DOTFILES_DIR/karabiner/karabiner.json" "$HOME/.config/karabiner/karabiner.json"
|
link_dotfile "$DOTFILES_DIR/karabiner/karabiner.json" "$HOME/.config/karabiner/karabiner.json"
|
||||||
@@ -171,7 +217,7 @@ install_karabiner_config() {
|
|||||||
install_kitty_icon() {
|
install_kitty_icon() {
|
||||||
icon_path="$DOTFILES_DIR/kitty/kitty.app.png"
|
icon_path="$DOTFILES_DIR/kitty/kitty.app.png"
|
||||||
|
|
||||||
if [ "$(uname -s)" != "Darwin" ]; then
|
if ! is_macos; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -199,7 +245,7 @@ install_kitty_icon() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
install_fonts() {
|
install_fonts() {
|
||||||
if [ "$(uname -s)" != "Darwin" ]; then
|
if ! is_macos; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -383,11 +429,7 @@ main() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
setup_color
|
setup_color
|
||||||
|
validate_prerequisites
|
||||||
if ! command_exists zsh; then
|
|
||||||
echo "${YELLOW}Zsh is not installed.${RESET} Please install zsh first."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
setup_ohmyzsh
|
setup_ohmyzsh
|
||||||
setup_shell
|
setup_shell
|
||||||
|
|||||||
1
karabiner/assets
Symbolic link
1
karabiner/assets
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/Users/tracer/.config/dotfiles/karabiner/assets
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"type": "basic",
|
|
||||||
"from": {
|
|
||||||
"key_code": "return_or_enter",
|
|
||||||
"modifiers": {
|
|
||||||
"mandatory": ["control"],
|
|
||||||
"optional": []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"to": [
|
|
||||||
{
|
|
||||||
"key_code": "vk_none"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"shell_command": "/Applications/kitty.app/Contents/kitty-quick-access.app/Contents/MacOS/kitty-quick-access --instance-group quick-access >/tmp/kitty-quick-access.log 2>&1 < /dev/null &"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"title": "Kitty quick access terminal",
|
|
||||||
"rules": [
|
|
||||||
{
|
|
||||||
"description": "Ctrl+Enter toggles kitty quick-access-terminal",
|
|
||||||
"manipulators": [
|
|
||||||
{
|
|
||||||
"type": "basic",
|
|
||||||
"from": {
|
|
||||||
"key_code": "return_or_enter",
|
|
||||||
"modifiers": {
|
|
||||||
"mandatory": ["control"],
|
|
||||||
"optional": ["any"]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"to": [
|
|
||||||
{
|
|
||||||
"shell_command": "/Applications/kitty.app/Contents/kitty-quick-access.app/Contents/MacOS/kitty-quick-access --instance-group quick-access >/tmp/kitty-quick-access.log 2>&1 < /dev/null &"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -71,13 +71,15 @@
|
|||||||
"from": {
|
"from": {
|
||||||
"key_code": "return_or_enter",
|
"key_code": "return_or_enter",
|
||||||
"modifiers": {
|
"modifiers": {
|
||||||
"mandatory": ["command"],
|
"mandatory": ["command"]
|
||||||
"optional": ["any"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"to": [
|
"to": [
|
||||||
{
|
{
|
||||||
"shell_command": "/Applications/kitty.app/Contents/MacOS/kitty --single-instance"
|
"key_code": "vk_none"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"shell_command": "/usr/bin/osascript -e 'tell application \"kitty\" to activate' -e 'tell application \"System Events\" to keystroke return using command down'"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "basic"
|
"type": "basic"
|
||||||
@@ -99,8 +101,7 @@
|
|||||||
"from": {
|
"from": {
|
||||||
"key_code": "return_or_enter",
|
"key_code": "return_or_enter",
|
||||||
"modifiers": {
|
"modifiers": {
|
||||||
"mandatory": ["control"],
|
"mandatory": ["control"]
|
||||||
"optional": ["any"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"to": [
|
"to": [
|
||||||
@@ -108,7 +109,7 @@
|
|||||||
"key_code": "vk_none"
|
"key_code": "vk_none"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"shell_command": "/Applications/kitty.app/Contents/MacOS/kitten quick-access-terminal --instance-group quick-access >/tmp/kitty-quick-access.log 2>&1 < /dev/null &"
|
"shell_command": "/Applications/kitty.app/Contents/MacOS/kitten quick-access-terminal /Applications/kitty.app/Contents/MacOS/kitten run-shell --cwd \"$HOME\" >/tmp/kitty-quick-access.log 2>&1 < /dev/null &"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"type": "basic"
|
"type": "basic"
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ map ctrl+right next_tab
|
|||||||
window_padding_width 10
|
window_padding_width 10
|
||||||
|
|
||||||
map cmd+shift+r load_config_file
|
map cmd+shift+r load_config_file
|
||||||
map cmd+enter new_os_window
|
map cmd+enter launch --type=os-window --cwd=~
|
||||||
|
|||||||
128
kitty/quick_access_terminal.conf
Normal file
128
kitty/quick_access_terminal.conf
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
# vim:fileencoding=utf-8:foldmethod=marker
|
||||||
|
|
||||||
|
#: Window appearance {{{
|
||||||
|
|
||||||
|
# lines 25
|
||||||
|
|
||||||
|
#: The number of lines shown in the panel. Ignored for background,
|
||||||
|
#: centered, and vertical panels. If it has the suffix px then it sets
|
||||||
|
#: the height of the panel in pixels instead of lines.
|
||||||
|
|
||||||
|
# columns 80
|
||||||
|
|
||||||
|
#: The number of columns shown in the panel. Ignored for background,
|
||||||
|
#: centered, and horizontal panels. If it has the suffix px then it
|
||||||
|
#: sets the width of the panel in pixels instead of columns.
|
||||||
|
|
||||||
|
# edge top
|
||||||
|
|
||||||
|
#: Which edge of the screen to place the panel on. Note that some
|
||||||
|
#: window managers (such as i3) do not support placing docked windows
|
||||||
|
#: on the left and right edges. The value background means make the
|
||||||
|
#: panel the "desktop wallpaper". Note that when using sway if you set
|
||||||
|
#: a background in your sway config it will cover the background drawn
|
||||||
|
#: using this kitten. Additionally, there are three more values:
|
||||||
|
#: center, center-sized and none. The value center anchors the panel
|
||||||
|
#: to all sides and covers the entire display (on macOS the part of
|
||||||
|
#: the display not covered by titlebar and dock). The panel can be
|
||||||
|
#: shrunk and placed using the margin parameters. The value none
|
||||||
|
#: anchors the panel to the top left corner and should be placed using
|
||||||
|
#: the margin parameters. Its size is set by lines and columns. The
|
||||||
|
#: value center-sized is just like none except that the panel is
|
||||||
|
#: centered instead of in the top left corner and the margins have no
|
||||||
|
#: effect.
|
||||||
|
|
||||||
|
# background_opacity 0.85
|
||||||
|
|
||||||
|
#: The background opacity of the window. This works the same as the
|
||||||
|
#: kitty option of the same name, it is present here as it has a
|
||||||
|
#: different default value for the quick access terminal.
|
||||||
|
|
||||||
|
# hide_on_focus_loss no
|
||||||
|
|
||||||
|
#: Hide the window when it loses keyboard focus automatically. Using
|
||||||
|
#: this option will force focus_policy to on-demand.
|
||||||
|
|
||||||
|
# grab_keyboard no
|
||||||
|
|
||||||
|
#: Grab the keyboard. This means global shortcuts defined in the OS
|
||||||
|
#: will be passed to kitty instead. Useful if you want to create an OS
|
||||||
|
#: modal window. How well this works depends on the OS/window
|
||||||
|
#: manager/desktop environment. On Wayland it works only if the
|
||||||
|
#: compositor implements the inhibit-keyboard-shortcuts protocol
|
||||||
|
#: <https://wayland.app/protocols/keyboard-shortcuts-inhibit-
|
||||||
|
#: unstable-v1>. On macOS Apple doesn't allow applications to grab the
|
||||||
|
#: keyboard without special permissions, so it doesn't work.
|
||||||
|
|
||||||
|
# margin_left 0
|
||||||
|
|
||||||
|
#: Set the left margin for the panel, in pixels. Has no effect for
|
||||||
|
#: right edge panels. Only works on macOS and Wayland compositors that
|
||||||
|
#: supports the wlr layer shell protocol.
|
||||||
|
|
||||||
|
# margin_right 0
|
||||||
|
|
||||||
|
#: Set the right margin for the panel, in pixels. Has no effect for
|
||||||
|
#: left edge panels. Only works on macOS and Wayland compositors that
|
||||||
|
#: supports the wlr layer shell protocol.
|
||||||
|
|
||||||
|
# margin_top 0
|
||||||
|
|
||||||
|
#: Set the top margin for the panel, in pixels. Has no effect for
|
||||||
|
#: bottom edge panels. Only works on macOS and Wayland compositors
|
||||||
|
#: that supports the wlr layer shell protocol.
|
||||||
|
|
||||||
|
# margin_bottom 0
|
||||||
|
|
||||||
|
#: Set the bottom margin for the panel, in pixels. Has no effect for
|
||||||
|
#: top edge panels. Only works on macOS and Wayland compositors that
|
||||||
|
#: supports the wlr layer shell protocol.
|
||||||
|
|
||||||
|
# kitty_conf
|
||||||
|
|
||||||
|
#: Path to config file to use for kitty when drawing the window. Can
|
||||||
|
#: be specified multiple times. By default, the normal kitty.conf is
|
||||||
|
#: used. Relative paths are resolved with respect to the kitty config
|
||||||
|
#: directory.
|
||||||
|
|
||||||
|
# kitty_override
|
||||||
|
|
||||||
|
#: Override individual kitty configuration options, can be specified
|
||||||
|
#: multiple times. Syntax: kitty_override name=value. For example:
|
||||||
|
#: kitty_override font_size=20.
|
||||||
|
|
||||||
|
# app_id kitty-quick-access
|
||||||
|
|
||||||
|
#: On Wayland set the namespace of the layer shell surface. On X11 set
|
||||||
|
#: the WM_CLASS assigned to the quick access window. (Linux only)
|
||||||
|
|
||||||
|
# output_name
|
||||||
|
|
||||||
|
#: The panel can only be displayed on a single monitor (output) at a
|
||||||
|
#: time. This allows you to specify which output is used, by name. If
|
||||||
|
#: not specified the compositor will choose an output automatically,
|
||||||
|
#: typically the last output the user interacted with or the primary
|
||||||
|
#: monitor. Run kitten panel --output-name list to get a list of
|
||||||
|
#: available outputs. Use listjson for a json encoded output. Note
|
||||||
|
#: that on Wayland the output can only be set at panel creation time,
|
||||||
|
#: it cannot be changed after creation, nor is there anyway to display
|
||||||
|
#: a single panel on all outputs. Please complain to the Wayland
|
||||||
|
#: developers about this.
|
||||||
|
|
||||||
|
# start_as_hidden no
|
||||||
|
|
||||||
|
#: Whether to start the quick access terminal hidden. Useful if you
|
||||||
|
#: are starting it as part of system startup.
|
||||||
|
|
||||||
|
# focus_policy exclusive
|
||||||
|
|
||||||
|
#: On a Wayland compositor that supports the wlr layer shell protocol,
|
||||||
|
#: specify the focus policy for keyboard interactivity with the panel.
|
||||||
|
#: Please refer to the wlr layer shell protocol documentation for more
|
||||||
|
#: details. Note that different Wayland compositors behave very
|
||||||
|
#: differently with exclusive, your mileage may vary. On macOS,
|
||||||
|
#: exclusive and on-demand are currently the same.
|
||||||
|
|
||||||
|
#: }}}
|
||||||
|
|
||||||
|
|
||||||
8
nvim.log
Normal file
8
nvim.log
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
WRN 2026-04-01T22:04:13.317 ?.6087 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/BZ5xQs/nvim.6087.0
|
||||||
|
WRN 2026-04-01T22:04:13.317 ?.6086 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/W6ywmm/nvim.6086.0
|
||||||
|
WRN 2026-04-01T22:09:00.578 ?.7002 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/EE2fn7/nvim.7002.0
|
||||||
|
WRN 2026-04-01T22:10:22.134 ?.7483 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/q30iDC/nvim.7483.0
|
||||||
|
WRN 2026-04-01T22:10:22.134 ?.7481 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/JODETW/nvim.7481.0
|
||||||
|
WRN 2026-04-01T22:10:22.134 ?.7482 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/lKGUPU/nvim.7482.0
|
||||||
|
WRN 2026-04-01T22:10:29.772 ?.7512 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/84u53h/nvim.7512.0
|
||||||
|
WRN 2026-04-01T22:10:29.772 ?.7509 server_start:197: Failed to start server: operation not permitted: /var/folders/jr/2c20bjfn48ld1tm7_75l6dz00000gn/T/nvim.tracer/oWmRd9/nvim.7509.0
|
||||||
47
nvim/lua/mason/health.lua
Normal file
47
nvim/lua/mason/health.lua
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
local health = vim.health or require("health")
|
||||||
|
|
||||||
|
local M = {}
|
||||||
|
|
||||||
|
local report_start = health.start or health.report_start
|
||||||
|
local report_ok = health.ok or health.report_ok
|
||||||
|
local report_warn = health.warn or health.report_warn
|
||||||
|
|
||||||
|
local function check_executable(name, command, advice)
|
||||||
|
if vim.fn.executable(command) == 1 then
|
||||||
|
report_ok(("%s: available"):format(name))
|
||||||
|
else
|
||||||
|
report_warn(("%s: not available"):format(name), advice and { advice } or {})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function check_php()
|
||||||
|
local php_version = vim.fn.system({ "php", "-r", "echo PHP_MAJOR_VERSION . '.' . PHP_MINOR_VERSION;" })
|
||||||
|
if vim.v.shell_error ~= 0 then
|
||||||
|
report_warn("PHP: not available", {
|
||||||
|
"Required for your configured Intelephense language server.",
|
||||||
|
})
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
php_version = vim.trim(php_version)
|
||||||
|
if php_version:match("^8%.") then
|
||||||
|
report_ok(("PHP: `%s`"):format(php_version))
|
||||||
|
else
|
||||||
|
report_warn(("PHP: `%s`"):format(php_version), {
|
||||||
|
"PHP 8.x is recommended for your configured Intelephense language server.",
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.check()
|
||||||
|
report_start("mason.nvim")
|
||||||
|
report_ok("Using local health override to skip unused language runtimes.")
|
||||||
|
report_ok("Skipped checks for Go, Rust/Cargo, LuaRocks, and Java.")
|
||||||
|
|
||||||
|
report_start("mason.nvim [Required runtimes]")
|
||||||
|
check_executable("node", "node", "Required for your configured TypeScript, ESLint, HTML, CSS, Emmet, and Intelephense language servers.")
|
||||||
|
check_executable("npm", "npm", "Required to install and manage the Mason packages used by your configured language servers.")
|
||||||
|
check_php()
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
require("tracer.options")
|
require("tracer.options")
|
||||||
require("tracer.plugins")
|
require("tracer.plugins")
|
||||||
pcall(require, "tracer.plugins.telescope")
|
pcall(require, "tracer.plugins.telescope")
|
||||||
require("tracer.statusline")
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ opt.laststatus = 2
|
|||||||
opt.termguicolors = true
|
opt.termguicolors = true
|
||||||
opt.autoread = true
|
opt.autoread = true
|
||||||
opt.mouse = "a"
|
opt.mouse = "a"
|
||||||
|
opt.clipboard:append("unnamedplus")
|
||||||
opt.expandtab = true
|
opt.expandtab = true
|
||||||
opt.shiftwidth = 4
|
opt.shiftwidth = 4
|
||||||
opt.tabstop = 4
|
opt.tabstop = 4
|
||||||
@@ -15,24 +16,7 @@ opt.smartindent = true
|
|||||||
opt.wrap = false
|
opt.wrap = false
|
||||||
opt.wildmode = "longest:full,full"
|
opt.wildmode = "longest:full,full"
|
||||||
opt.title = true
|
opt.title = true
|
||||||
|
opt.signcolumn = 'yes:1'
|
||||||
vim.cmd.colorscheme("slate")
|
|
||||||
|
|
||||||
local normalfloat_hl = vim.api.nvim_get_hl(0, { name = "NormalFloat", link = false })
|
|
||||||
if normalfloat_hl.bg then
|
|
||||||
vim.api.nvim_set_hl(0, "FloatBorder", {
|
|
||||||
fg = normalfloat_hl.bg,
|
|
||||||
bg = normalfloat_hl.bg,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
|
|
||||||
if cursorline_hl.bg then
|
|
||||||
vim.api.nvim_set_hl(0, "CursorLineBg", {
|
|
||||||
fg = cursorline_hl.bg,
|
|
||||||
bg = cursorline_hl.bg,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local autoread_group = vim.api.nvim_create_augroup("tracer_autoread", { clear = true })
|
local autoread_group = vim.api.nvim_create_augroup("tracer_autoread", { clear = true })
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
local ensure_packer = function()
|
local ensure_packer = function()
|
||||||
local fn = vim.fn
|
local fn = vim.fn
|
||||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||||
@@ -41,6 +44,39 @@ require("packer").startup(function(use)
|
|||||||
use("tpope/vim-sleuth")
|
use("tpope/vim-sleuth")
|
||||||
-- Allow plugins to enable repeating of commands.
|
-- Allow plugins to enable repeating of commands.
|
||||||
use("tpope/vim-repeat")
|
use("tpope/vim-repeat")
|
||||||
|
-- One Dark theme.
|
||||||
|
use({
|
||||||
|
"jessarcher/onedark.nvim",
|
||||||
|
config = function()
|
||||||
|
vim.cmd.colorscheme("onedark")
|
||||||
|
|
||||||
|
local normalfloat_hl = vim.api.nvim_get_hl(0, { name = "NormalFloat", link = false })
|
||||||
|
if normalfloat_hl.bg then
|
||||||
|
vim.api.nvim_set_hl(0, "FloatBorder", {
|
||||||
|
fg = normalfloat_hl.bg,
|
||||||
|
bg = normalfloat_hl.bg,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local cursorline_hl = vim.api.nvim_get_hl(0, { name = "CursorLine", link = false })
|
||||||
|
if cursorline_hl.bg then
|
||||||
|
vim.api.nvim_set_hl(0, "CursorLineBg", {
|
||||||
|
fg = cursorline_hl.bg,
|
||||||
|
bg = cursorline_hl.bg,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "NvimTreeIndentMarker", { fg = "#30323E" })
|
||||||
|
|
||||||
|
local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine", link = false })
|
||||||
|
vim.api.nvim_set_hl(0, "StatusLineNonText", {
|
||||||
|
fg = "#5C6370",
|
||||||
|
bg = statusline_hl.bg,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "IndentBlanklineChar", { fg = "#2F313C" })
|
||||||
|
end,
|
||||||
|
})
|
||||||
-- Add more languages.
|
-- Add more languages.
|
||||||
use("sheerun/vim-polyglot")
|
use("sheerun/vim-polyglot")
|
||||||
-- Navigate seamlessly between Vim windows and Tmux panes.
|
-- Navigate seamlessly between Vim windows and Tmux panes.
|
||||||
@@ -104,18 +140,96 @@ require("packer").startup(function(use)
|
|||||||
vim.g.pasta_disabled_filetypes = { "fugitive" }
|
vim.g.pasta_disabled_filetypes = { "fugitive" }
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
-- Git integration.
|
||||||
|
use({
|
||||||
|
"lewis6991/gitsigns.nvim",
|
||||||
|
config = function()
|
||||||
|
require("gitsigns").setup({ current_line_blame = true })
|
||||||
|
|
||||||
|
vim.keymap.set("n", "]h", ":Gitsigns next_hunk<CR>")
|
||||||
|
vim.keymap.set("n", "[h", ":Gitsigns prev_hunk<CR>")
|
||||||
|
vim.keymap.set("n", "gs", ":Gitsigns stage_hunk<CR>")
|
||||||
|
vim.keymap.set("n", "gS", ":Gitsigns undo_stage_hunk<CR>")
|
||||||
|
vim.keymap.set("n", "gp", ":Gitsigns preview_hunk<CR>")
|
||||||
|
vim.keymap.set("n", "gb", ":Gitsigns blame_line<CR>")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- Git commands.
|
||||||
|
use({
|
||||||
|
"tpope/vim-fugitive",
|
||||||
|
requires = "tpope/vim-rhubarb",
|
||||||
|
config = function()
|
||||||
|
require("tracer.plugins.fugitive").setup()
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- Improved syntax highlighting.
|
||||||
|
use({
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
run = function()
|
||||||
|
require("nvim-treesitter.install").update({ with_sync = true })
|
||||||
|
end,
|
||||||
|
requires = {
|
||||||
|
"JoosepAlviste/nvim-ts-context-commentstring",
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
pcall(require, "tracer.plugins.treesitter")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- Language Server Protocol.
|
||||||
|
use({
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
requires = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
pcall(require, "tracer.plugins.lspconfig")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Fuzzy finder
|
-- Fuzzy finder
|
||||||
use({
|
use({
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
|
tag = "0.2.2",
|
||||||
requires = {
|
requires = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"kyazdani42/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
"nvim-telescope/telescope-live-grep-args.nvim",
|
"nvim-telescope/telescope-live-grep-args.nvim",
|
||||||
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("tracer.plugins.telescope")
|
require("tracer.plugins.telescope")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- A status line.
|
||||||
|
use({
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
requires = "nvim-tree/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
require("tracer.plugins.lualine")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Display buffers as tabs.
|
||||||
|
use({
|
||||||
|
"akinsho/bufferline.nvim",
|
||||||
|
requires = "nvim-tree/nvim-web-devicons",
|
||||||
|
after = "onedark.nvim",
|
||||||
|
config = function()
|
||||||
|
require("tracer.plugins.bufferline")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- File tree sidebar for project-style navigation.
|
||||||
|
use({
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
requires = {
|
||||||
|
"nvim-tree/nvim-web-devicons",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
require("tracer.plugins.nvim-tree")
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
79
nvim/lua/tracer/plugins/bufferline.lua
Normal file
79
nvim/lua/tracer/plugins/bufferline.lua
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
require("bufferline").setup({
|
||||||
|
options = {
|
||||||
|
indicator = {
|
||||||
|
icon = " ",
|
||||||
|
},
|
||||||
|
show_close_icon = false,
|
||||||
|
tab_size = 0,
|
||||||
|
max_name_length = 25,
|
||||||
|
offsets = {
|
||||||
|
{
|
||||||
|
filetype = "NvimTree",
|
||||||
|
text = " Files",
|
||||||
|
highlight = "StatusLine",
|
||||||
|
text_align = "left",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
separator_style = "slant",
|
||||||
|
modified_icon = "",
|
||||||
|
custom_areas = {
|
||||||
|
left = function()
|
||||||
|
return {
|
||||||
|
{ text = " ", fg = "#8fff6d" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
highlights = {
|
||||||
|
fill = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
background = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
tab = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
tab_close = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
close_button = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
fg = { attribute = "fg", highlight = "StatusLineNonText" },
|
||||||
|
},
|
||||||
|
close_button_visible = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
fg = { attribute = "fg", highlight = "StatusLineNonText" },
|
||||||
|
},
|
||||||
|
close_button_selected = {
|
||||||
|
fg = { attribute = "fg", highlight = "StatusLineNonText" },
|
||||||
|
},
|
||||||
|
buffer_visible = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
modified = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
modified_visible = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
duplicate = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
duplicate_visible = {
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
separator = {
|
||||||
|
fg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
separator_selected = {
|
||||||
|
fg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "Normal" },
|
||||||
|
},
|
||||||
|
separator_visible = {
|
||||||
|
fg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
bg = { attribute = "bg", highlight = "StatusLine" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
90
nvim/lua/tracer/plugins/fugitive.lua
Normal file
90
nvim/lua/tracer/plugins/fugitive.lua
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
local function homepage_for_remote(remote)
|
||||||
|
local patterns = {
|
||||||
|
"^gitea@([^:]+):(.+)%.git$",
|
||||||
|
"^git@([^:]+):(.+)%.git$",
|
||||||
|
"^ssh://git@([^/]+)/(.+)%.git$",
|
||||||
|
"^https?://([^/]+)/(.+)%.git$",
|
||||||
|
"^https?://([^/]+)/(.+)$",
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, pattern in ipairs(patterns) do
|
||||||
|
local host, repo = remote:match(pattern)
|
||||||
|
if host and repo then
|
||||||
|
return ("https://%s/%s"):format(host, repo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local function url_escape(value)
|
||||||
|
return (value:gsub("#", "%%23"):gsub(" ", "%%20"))
|
||||||
|
end
|
||||||
|
|
||||||
|
local function gitea_browse(opts)
|
||||||
|
local root = homepage_for_remote(opts.remote or "")
|
||||||
|
if not root then
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local path = (opts.path or ""):gsub("^/", "")
|
||||||
|
local ref = (opts.path or ""):match("^/?%.git/(refs/.*)")
|
||||||
|
|
||||||
|
if ref and ref:match("^refs/heads/") then
|
||||||
|
local branch = ref:gsub("^refs/heads/", "")
|
||||||
|
return root .. "/commits/branch/" .. url_escape(branch)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ref and ref:match("^refs/tags/") then
|
||||||
|
local tag = ref:gsub("^refs/tags/", "")
|
||||||
|
return root .. "/releases/tag/" .. url_escape(tag)
|
||||||
|
end
|
||||||
|
|
||||||
|
if ref and ref:match("^refs/remotes/[^/]+/.+") then
|
||||||
|
local branch = ref:match("^refs/remotes/[^/]+/(.+)$")
|
||||||
|
return root .. "/commits/branch/" .. url_escape(branch)
|
||||||
|
end
|
||||||
|
|
||||||
|
if (opts.path or ""):match("^/?%.git") then
|
||||||
|
return root
|
||||||
|
end
|
||||||
|
|
||||||
|
local commit = url_escape(opts.commit or "HEAD")
|
||||||
|
local url
|
||||||
|
|
||||||
|
if opts.type == "tree" or path:match("/$") then
|
||||||
|
url = root .. "/src/commit/" .. commit
|
||||||
|
if path ~= "" then
|
||||||
|
url = url .. "/" .. url_escape(path):gsub("/$", "")
|
||||||
|
end
|
||||||
|
elseif opts.type == "blob" or path:match("[^/]$") then
|
||||||
|
url = root .. "/src/commit/" .. commit
|
||||||
|
if path ~= "" then
|
||||||
|
url = url .. "/" .. url_escape(path)
|
||||||
|
end
|
||||||
|
|
||||||
|
if opts.line2 and opts.line1 and opts.line1 > 0 and opts.line1 == opts.line2 then
|
||||||
|
url = url .. "#L" .. opts.line1
|
||||||
|
elseif opts.line1 and opts.line2 and opts.line1 > 0 and opts.line2 > 0 then
|
||||||
|
url = url .. "#L" .. opts.line1 .. "-L" .. opts.line2
|
||||||
|
end
|
||||||
|
else
|
||||||
|
url = root .. "/commit/" .. commit
|
||||||
|
end
|
||||||
|
|
||||||
|
return url
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.setup()
|
||||||
|
if vim.g.tracer_fugitive_gitea_handler_loaded then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.g.tracer_fugitive_gitea_handler_loaded = true
|
||||||
|
vim.g.fugitive_browse_handlers = vim.g.fugitive_browse_handlers or {}
|
||||||
|
table.insert(vim.g.fugitive_browse_handlers, 1, gitea_browse)
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
34
nvim/lua/tracer/plugins/lspconfig.lua
Normal file
34
nvim/lua/tracer/plugins/lspconfig.lua
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
-- Setup Mason to automatically install LSP servers
|
||||||
|
require("mason").setup()
|
||||||
|
|
||||||
|
require("mason-lspconfig").setup({ automatic_installation = true })
|
||||||
|
|
||||||
|
-- Keymaps
|
||||||
|
vim.keymap.set("n", "<Leader>d", vim.diagnostic.open_float)
|
||||||
|
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev)
|
||||||
|
vim.keymap.set("n", "]d", vim.diagnostic.goto_next)
|
||||||
|
vim.keymap.set("n", "gd", vim.lsp.buf.definition)
|
||||||
|
vim.keymap.set("n", "gi", "<cmd>Telescope lsp_implementations<CR>")
|
||||||
|
vim.keymap.set("n", "gr", "<cmd>Telescope lsp_references<CR>")
|
||||||
|
vim.keymap.set("n", "K", vim.lsp.buf.hover)
|
||||||
|
vim.keymap.set("n", "<Leader>rn", vim.lsp.buf.rename)
|
||||||
|
|
||||||
|
-- Emmet for HTML and JSX-style markup editing
|
||||||
|
vim.lsp.config("emmet_language_server", {
|
||||||
|
filetypes = {
|
||||||
|
"css",
|
||||||
|
"html",
|
||||||
|
"javascriptreact",
|
||||||
|
"less",
|
||||||
|
"sass",
|
||||||
|
"scss",
|
||||||
|
"typescriptreact",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.enable("intelephense")
|
||||||
|
vim.lsp.enable("ts_ls")
|
||||||
|
vim.lsp.enable("eslint")
|
||||||
|
vim.lsp.enable("html")
|
||||||
|
vim.lsp.enable("cssls")
|
||||||
|
vim.lsp.enable("emmet_language_server")
|
||||||
76
nvim/lua/tracer/plugins/lualine.lua
Normal file
76
nvim/lua/tracer/plugins/lualine.lua
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
local separator = {
|
||||||
|
"|",
|
||||||
|
color = "StatusLineNonText",
|
||||||
|
}
|
||||||
|
|
||||||
|
local non_text_hl = vim.api.nvim_get_hl(0, { name = "NonText" })
|
||||||
|
local statusline_hl = vim.api.nvim_get_hl(0, { name = "StatusLine" })
|
||||||
|
|
||||||
|
vim.api.nvim_set_hl(0, "StatusLineNonText", {
|
||||||
|
fg = non_text_hl.fg,
|
||||||
|
bg = statusline_hl.bg,
|
||||||
|
})
|
||||||
|
|
||||||
|
local function lsp_clients()
|
||||||
|
local clients = vim.lsp.get_clients({ bufnr = 0 })
|
||||||
|
|
||||||
|
if #clients == 0 then
|
||||||
|
return ""
|
||||||
|
end
|
||||||
|
|
||||||
|
local names = {}
|
||||||
|
|
||||||
|
for _, client in ipairs(clients) do
|
||||||
|
names[#names + 1] = client.name
|
||||||
|
end
|
||||||
|
|
||||||
|
return "LSP: " .. table.concat(names, ", ")
|
||||||
|
end
|
||||||
|
|
||||||
|
require("lualine").setup({
|
||||||
|
options = {
|
||||||
|
section_separators = '',
|
||||||
|
component_separators = "",
|
||||||
|
globalstatus = true,
|
||||||
|
theme = {
|
||||||
|
normal = {
|
||||||
|
a = "StatusLine",
|
||||||
|
b = "StatusLine",
|
||||||
|
c = "StatusLine",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
sections = {
|
||||||
|
lualine_a = {
|
||||||
|
"mode",
|
||||||
|
separator,
|
||||||
|
},
|
||||||
|
lualine_b = {
|
||||||
|
"branch",
|
||||||
|
"diff",
|
||||||
|
separator,
|
||||||
|
lsp_clients,
|
||||||
|
{ "diagnostics", sources = { "nvim_diagnostic" } },
|
||||||
|
separator,
|
||||||
|
},
|
||||||
|
lualine_c = {
|
||||||
|
"filename",
|
||||||
|
},
|
||||||
|
lualine_x = {
|
||||||
|
"filetype",
|
||||||
|
"encoding",
|
||||||
|
"fileformat",
|
||||||
|
},
|
||||||
|
lualine_y = {
|
||||||
|
separator,
|
||||||
|
function()
|
||||||
|
return (vim.bo.expandtab and "s" or "t") .. " • " .. vim.bo.shiftwidth
|
||||||
|
end,
|
||||||
|
separator,
|
||||||
|
},
|
||||||
|
lualine_z = {
|
||||||
|
"location",
|
||||||
|
"progress",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
53
nvim/lua/tracer/plugins/nvim-tree.lua
Normal file
53
nvim/lua/tracer/plugins/nvim-tree.lua
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
require("nvim-tree").setup({
|
||||||
|
git = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
hijack_cursor = true,
|
||||||
|
sync_root_with_cwd = false,
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
update_root = false,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
width = 36,
|
||||||
|
preserve_window_proportions = true,
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
group_empty = true,
|
||||||
|
icons = {
|
||||||
|
show = {
|
||||||
|
folder_arrow = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
indent_markers = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
open_file = {
|
||||||
|
resize_window = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeToggle<CR>", { silent = true })
|
||||||
|
vim.keymap.set("n", "<leader>t", ":NvimTreeFindFileToggle<CR>")
|
||||||
|
|
||||||
|
local project_tree_group = vim.api.nvim_create_augroup("tracer_project_tree", { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
|
group = project_tree_group,
|
||||||
|
callback = function(data)
|
||||||
|
if vim.fn.argc() ~= 1 or vim.fn.isdirectory(data.file) ~= 1 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.cmd.cd(data.file)
|
||||||
|
vim.cmd.enew()
|
||||||
|
vim.cmd.bwipeout(data.buf)
|
||||||
|
require("nvim-tree.api").tree.open()
|
||||||
|
end,
|
||||||
|
})
|
||||||
30
nvim/lua/tracer/plugins/treesitter.lua
Normal file
30
nvim/lua/tracer/plugins/treesitter.lua
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
local ok, configs = pcall(require, "nvim-treesitter.configs")
|
||||||
|
if not ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
configs.setup({
|
||||||
|
ensure_installed = "all",
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = true,
|
||||||
|
},
|
||||||
|
context_commentstring = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
|
keymaps = {
|
||||||
|
["if"] = "@function.inner",
|
||||||
|
["af"] = "@function.outer",
|
||||||
|
["ia"] = "@parameter.inner",
|
||||||
|
["aa"] = "@parameter.outer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -47,6 +47,9 @@ bind m if -F '#{mouse}' \
|
|||||||
'set -g mouse off; display-message "mouse: off"' \
|
'set -g mouse off; display-message "mouse: off"' \
|
||||||
'set -g mouse on; display-message "mouse: on"'
|
'set -g mouse on; display-message "mouse: on"'
|
||||||
|
|
||||||
|
# Move current window left/right like tabs
|
||||||
|
bind -n S-Left swap-window -t -1
|
||||||
|
bind -n S-Right swap-window -t +1
|
||||||
|
|
||||||
set -g status-right ""
|
set -g status-right ""
|
||||||
# Tmux Plugin Manager
|
# Tmux Plugin Manager
|
||||||
@@ -54,7 +57,6 @@ set -g @plugin 'tmux-plugins/tpm'
|
|||||||
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
set -g @plugin 'tmux-plugins/tmux-resurrect'
|
||||||
set -g @plugin 'tmux-plugins/tmux-continuum'
|
set -g @plugin 'tmux-plugins/tmux-continuum'
|
||||||
|
|
||||||
|
|
||||||
# Continuum settings
|
# Continuum settings
|
||||||
set -g @continuum-restore 'on' # Auto-restore on tmux startup
|
set -g @continuum-restore 'on' # Auto-restore on tmux startup
|
||||||
set -g @continuum-save-interval '15' # Auto-save every 15 minutes
|
set -g @continuum-save-interval '15' # Auto-save every 15 minutes
|
||||||
|
|||||||
Reference in New Issue
Block a user