mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-01 19:47:41 +00:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6f854ddbfd | |||
| 748e5bb561 | |||
| 67867b57cd | |||
| 91734ffa15 | |||
| 5364bef678 | |||
| 50b4f5c60f | |||
| 7cd508a727 | |||
| bf2c665433 | |||
| f5b1bf0915 | |||
| e0c6d7e4f4 | |||
| 1937e72f17 | |||
| 228ba78341 | |||
| c8c34dcc81 | |||
| 3d65fdee43 | |||
| 1897f49906 | |||
| d86785ad47 | |||
| 1c3c04a6f3 | |||
| debb79ee09 | |||
| c1dda8a230 | |||
| 5c74383dda | |||
| da1473547a | |||
| 43df368ec1 | |||
| 6f3f977100 | |||
| ab8e654c2a | |||
| 1a4113e3cd | |||
| b3445d7e7a | |||
| 50fc1ea279 | |||
| d61f53196d | |||
| 7769af68b5 | |||
| 05aa4ba092 | |||
| a26f160326 | |||
| 00de4a7b83 | |||
| 020012eb60 | |||
| cf92bc9a69 | |||
| 1c17ee28cb | |||
| 0919a9732e | |||
| 52a941f0fa | |||
| e661f6d942 | |||
| b5160bbbfa | |||
| 2df27d2a0e | |||
|
|
0c0f3823e4 | ||
|
|
5fb433f7ac | ||
| 0fc08678a2 | |||
| ff83bc9ef1 | |||
| 492cb4dbd8 | |||
| bc608cd578 | |||
| acae4fec73 | |||
| 446d8971e7 | |||
| 2f917c9285 | |||
| 1d851708eb | |||
|
|
c3d4b51927 | ||
| 6d8c04977c | |||
| 64fc8a13d3 |
@@ -19,7 +19,7 @@ indent_size = 1
|
|||||||
indent_size = 1
|
indent_size = 1
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
[local/bin/*]
|
[{local/bin/*,**/*.sh,**/zshrc}]
|
||||||
shell_variant = bash # --language-variant
|
shell_variant = bash # --language-variant
|
||||||
binary_next_line = true
|
binary_next_line = true
|
||||||
switch_case_indent = true # --case-indent
|
switch_case_indent = true # --case-indent
|
||||||
|
|||||||
24
.github/README.md
vendored
24
.github/README.md
vendored
@@ -23,20 +23,14 @@ fork or download the repo as a zip and go from there with your own configs.
|
|||||||
|
|
||||||
## The looks
|
## The looks
|
||||||
|
|
||||||
## tmux with powerlevel10k, the default view
|

|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## tmux + nvim (astronvim) editing this repository
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## Interesting files and locations
|
## Interesting files and locations
|
||||||
|
|
||||||
### Interesting folders
|
### Interesting folders
|
||||||
|
|
||||||
| Path | Description |
|
| Path | Description |
|
||||||
|---------------------|----------------------------------------------|
|
| ------------------- | -------------------------------------------- |
|
||||||
| `.github` | GitHub Repository configuration files. |
|
| `.github` | GitHub Repository configuration files. |
|
||||||
| `hosts/{hostname}/` | Configs that should apply to that host only. |
|
| `hosts/{hostname}/` | Configs that should apply to that host only. |
|
||||||
| `local/bin` | Helper scripts that I've collected or wrote. |
|
| `local/bin` | Helper scripts that I've collected or wrote. |
|
||||||
@@ -45,7 +39,7 @@ fork or download the repo as a zip and go from there with your own configs.
|
|||||||
### dotfile folders
|
### dotfile folders
|
||||||
|
|
||||||
| Repo | Destination | Description |
|
| Repo | Destination | Description |
|
||||||
|-----------|-------------|---------------------------------------------|
|
| --------- | ----------- | ------------------------------------------- |
|
||||||
| `base/` | `.*` | `$HOME` level files. |
|
| `base/` | `.*` | `$HOME` level files. |
|
||||||
| `config/` | `.config/` | Configurations for applications. |
|
| `config/` | `.config/` | Configurations for applications. |
|
||||||
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
||||||
@@ -62,7 +56,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
|||||||
### XDG Variables
|
### XDG Variables
|
||||||
|
|
||||||
| Env | Default | Short description |
|
| Env | Default | Short description |
|
||||||
|--------------------|----------------------|------------------------------------------------|
|
| ------------------ | -------------------- | ---------------------------------------------- |
|
||||||
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
|
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
|
||||||
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
|
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
|
||||||
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
|
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
|
||||||
@@ -79,7 +73,7 @@ environment variable, at an appropriate place.
|
|||||||
#### XDG_DATA_HOME (`$HOME/.local/share`)
|
#### XDG_DATA_HOME (`$HOME/.local/share`)
|
||||||
|
|
||||||
`$XDG_DATA_HOME` defines the base directory relative to which
|
`$XDG_DATA_HOME` defines the base directory relative to which
|
||||||
user-specific *data files* should be stored.
|
user-specific _data files_ should be stored.
|
||||||
|
|
||||||
If `$XDG_DATA_HOME` is either not set or empty,
|
If `$XDG_DATA_HOME` is either not set or empty,
|
||||||
a default equal to `$HOME/.local/share` should be used.
|
a default equal to `$HOME/.local/share` should be used.
|
||||||
@@ -87,7 +81,7 @@ a default equal to `$HOME/.local/share` should be used.
|
|||||||
#### XDG_CONFIG_HOME (`$HOME/.config`)
|
#### XDG_CONFIG_HOME (`$HOME/.config`)
|
||||||
|
|
||||||
`$XDG_CONFIG_HOME` defines the base directory relative to which
|
`$XDG_CONFIG_HOME` defines the base directory relative to which
|
||||||
user-specific *configuration files* should be stored.
|
user-specific _configuration files_ should be stored.
|
||||||
|
|
||||||
If `$XDG_CONFIG_HOME` is either not set or empty,
|
If `$XDG_CONFIG_HOME` is either not set or empty,
|
||||||
a default equal to `$HOME/.config` should be used.
|
a default equal to `$HOME/.config` should be used.
|
||||||
@@ -95,13 +89,13 @@ a default equal to `$HOME/.config` should be used.
|
|||||||
#### XDG_STATE_HOME (`$HOME/.local/state`)
|
#### XDG_STATE_HOME (`$HOME/.local/state`)
|
||||||
|
|
||||||
`$XDG_STATE_HOME` defines the base directory relative to which
|
`$XDG_STATE_HOME` defines the base directory relative to which
|
||||||
user-specific *state files* should be stored.
|
user-specific _state files_ should be stored.
|
||||||
|
|
||||||
If `$XDG_STATE_HOME` is either not set or empty,
|
If `$XDG_STATE_HOME` is either not set or empty,
|
||||||
a default equal to `$HOME/.local/state` should be used.
|
a default equal to `$HOME/.local/state` should be used.
|
||||||
|
|
||||||
The `$XDG_STATE_HOME` contains *state data* that should
|
The `$XDG_STATE_HOME` contains _state data_ that should
|
||||||
*persist between (application) restarts*, but that is not important or
|
_persist between (application) restarts_, but that is not important or
|
||||||
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
|
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
|
||||||
|
|
||||||
- It may contain:
|
- It may contain:
|
||||||
|
|||||||
BIN
.github/screenshots/tmux-nvim.png
vendored
Normal file
BIN
.github/screenshots/tmux-nvim.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
2
.github/workflows/changelog.yml
vendored
2
.github/workflows/changelog.yml
vendored
@@ -5,7 +5,7 @@ jobs:
|
|||||||
debug-changelog:
|
debug-changelog:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Create changelog text
|
- name: Create changelog text
|
||||||
id: changelog
|
id: changelog
|
||||||
uses: loopwerk/tag-changelog@v1
|
uses: loopwerk/tag-changelog@v1
|
||||||
|
|||||||
2
.github/workflows/linters.yml
vendored
2
.github/workflows/linters.yml
vendored
@@ -5,7 +5,7 @@ jobs:
|
|||||||
name: Linters
|
name: Linters
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: GitHub Actions
|
- name: GitHub Actions
|
||||||
uses: reviewdog/action-actionlint@v1
|
uses: reviewdog/action-actionlint@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/new-release.yml
vendored
2
.github/workflows/new-release.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
created: ${{ steps.daily-version.outputs.created }}
|
created: ${{ steps.daily-version.outputs.created }}
|
||||||
version: ${{ steps.daily-version.outputs.version }}
|
version: ${{ steps.daily-version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3 # Checkout our working repository
|
- uses: actions/checkout@v4 # Checkout our working repository
|
||||||
- name: Create tag if necessary
|
- name: Create tag if necessary
|
||||||
uses: fregante/daily-version-action@v2
|
uses: fregante/daily-version-action@v2
|
||||||
id: daily-version
|
id: daily-version
|
||||||
|
|||||||
2
.github/workflows/update-submodules.yml
vendored
2
.github/workflows/update-submodules.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,4 +13,5 @@ ssh/local.d/*
|
|||||||
!ssh/local.d/.gitkeep
|
!ssh/local.d/.gitkeep
|
||||||
!.gitkeep
|
!.gitkeep
|
||||||
.env
|
.env
|
||||||
|
local/share/fonts/NerdFonts
|
||||||
|
|
||||||
|
|||||||
30
.gitmodules
vendored
30
.gitmodules
vendored
@@ -26,24 +26,12 @@
|
|||||||
[submodule "tmux/catppuccin"]
|
[submodule "tmux/catppuccin"]
|
||||||
path = config/tmux/plugins/tmux
|
path = config/tmux/plugins/tmux
|
||||||
url = https://github.com/catppuccin/tmux.git
|
url = https://github.com/catppuccin/tmux.git
|
||||||
[submodule "tmux/tmux-1password"]
|
|
||||||
path = config/tmux/plugins/tmux-1password
|
|
||||||
url = https://github.com/yardnsm/tmux-1password.git
|
|
||||||
[submodule "tmux/tmux-autoreload"]
|
|
||||||
path = config/tmux/plugins/tmux-autoreload
|
|
||||||
url = https://github.com/b0o/tmux-autoreload.git
|
|
||||||
[submodule "tmux/tmux-continuum"]
|
[submodule "tmux/tmux-continuum"]
|
||||||
path = config/tmux/plugins/tmux-continuum
|
path = config/tmux/plugins/tmux-continuum
|
||||||
url = https://github.com/tmux-plugins/tmux-continuum
|
url = https://github.com/tmux-plugins/tmux-continuum
|
||||||
[submodule "tmux/tmux-fzf"]
|
|
||||||
path = config/tmux/plugins/tmux-fzf
|
|
||||||
url = https://github.com/sainnhe/tmux-fzf.git
|
|
||||||
[submodule "tmux/tmux-menus"]
|
[submodule "tmux/tmux-menus"]
|
||||||
path = config/tmux/plugins/tmux-menus
|
path = config/tmux/plugins/tmux-menus
|
||||||
url = https://github.com/jaclu/tmux-menus.git
|
url = https://github.com/jaclu/tmux-menus.git
|
||||||
[submodule "tmux/tmux-notify"]
|
|
||||||
path = config/tmux/plugins/tmux-notify
|
|
||||||
url = https://github.com/ChanderG/tmux-notify.git
|
|
||||||
[submodule "tmux/tmux-resurrect"]
|
[submodule "tmux/tmux-resurrect"]
|
||||||
path = config/tmux/plugins/tmux-resurrect
|
path = config/tmux/plugins/tmux-resurrect
|
||||||
url = https://github.com/tmux-plugins/tmux-resurrect
|
url = https://github.com/tmux-plugins/tmux-resurrect
|
||||||
@@ -53,12 +41,18 @@
|
|||||||
[submodule "tmux/tmux-sessionist"]
|
[submodule "tmux/tmux-sessionist"]
|
||||||
path = config/tmux/plugins/tmux-sessionist
|
path = config/tmux/plugins/tmux-sessionist
|
||||||
url = https://github.com/tmux-plugins/tmux-sessionist.git
|
url = https://github.com/tmux-plugins/tmux-sessionist.git
|
||||||
[submodule "tmux/tmux-suspend"]
|
|
||||||
path = config/tmux/plugins/tmux-suspend
|
|
||||||
url = https://github.com/MunifTanjim/tmux-suspend.git
|
|
||||||
[submodule "tmux/tmux-yank"]
|
[submodule "tmux/tmux-yank"]
|
||||||
path = config/tmux/plugins/tmux-yank
|
path = config/tmux/plugins/tmux-yank
|
||||||
url = https://github.com/tmux-plugins/tmux-yank.git
|
url = https://github.com/tmux-plugins/tmux-yank.git
|
||||||
[submodule "tmux/vim-tmux-navigator"]
|
[submodule "tmux/tmux-window-name"]
|
||||||
path = config/tmux/plugins/vim-tmux-navigator
|
path = config/tmux/plugins/tmux-window-name
|
||||||
url = https://github.com/christoomey/vim-tmux-navigator.git
|
url = https://github.com/ofirgall/tmux-window-name.git
|
||||||
|
[submodule "dotbot-crontab"]
|
||||||
|
path = tools/dotbot-crontab
|
||||||
|
url = https://github.com/codekansas/dotbot-crontab.git
|
||||||
|
[submodule "dotbot-snap"]
|
||||||
|
path = tools/dotbot-snap
|
||||||
|
url = https://github.com/DrDynamic/dotbot-snap.git
|
||||||
|
[submodule "dotbot-pip"]
|
||||||
|
path = tools/dotbot-pip
|
||||||
|
url = https://github.com/sobolevn/dotbot-pip.git
|
||||||
|
|||||||
@@ -5,3 +5,22 @@
|
|||||||
external-sources=true
|
external-sources=true
|
||||||
includeAllWorkspaceSymbols=true
|
includeAllWorkspaceSymbols=true
|
||||||
|
|
||||||
|
# SC2039: In POSIX sh, 'local' is undefined.
|
||||||
|
# https://github.com/koalaman/shellcheck/wiki/SC2039
|
||||||
|
disable=SC2039
|
||||||
|
|
||||||
|
# SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined.
|
||||||
|
# https://github.com/koalaman/shellcheck/wiki/SC2166
|
||||||
|
disable=SC2166
|
||||||
|
|
||||||
|
# SC2154: Variable is referenced but not assigned
|
||||||
|
# https://github.com/koalaman/shellcheck/wiki/SC2154
|
||||||
|
disable=SC2154
|
||||||
|
|
||||||
|
# SC1091: Not following <file>
|
||||||
|
# https://github.com/koalaman/shellcheck/wiki/SC1091
|
||||||
|
disable=SC1091
|
||||||
|
|
||||||
|
# SC2174: When used with -p, -m only applies to the deepest directory.
|
||||||
|
# https://github.com/koalaman/shellcheck/wiki/SC2174
|
||||||
|
disable=SC2174
|
||||||
|
|||||||
5
.yamlfmt
5
.yamlfmt
@@ -18,7 +18,4 @@ include:
|
|||||||
- ./**/*.{yml,yaml}
|
- ./**/*.{yml,yaml}
|
||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
- ./tools/dotbot/**
|
- ./tools/**
|
||||||
- ./tools/dotbot-*/**
|
|
||||||
- ./config/astronvim/**
|
|
||||||
- ./config/nvim/**
|
|
||||||
|
|||||||
@@ -1,36 +1,39 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
git submodule add --name dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot
|
# dotbot and plugins
|
||||||
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
|
git submodule add --name dotbot \
|
||||||
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
-f https://github.com/anishathalye/dotbot.git tools/dotbot
|
||||||
git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
|
git submodule add --name dotbot-brew \
|
||||||
|
-f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
|
||||||
|
git submodule add --name dotbot-include \
|
||||||
|
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
||||||
|
git submodule add --name dotbot-crontab \
|
||||||
|
-f https://github.com/codekansas/dotbot-crontab.git tools/dotbot-crontab
|
||||||
|
git submodule add --name dotbot-snap \
|
||||||
|
-f https://github.com/DrDynamic/dotbot-snap.git tools/dotbot-snap
|
||||||
|
git submodule add --name dotbot-pip \
|
||||||
|
-f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip
|
||||||
|
|
||||||
|
# other repos
|
||||||
|
git submodule add --name cheat-community \
|
||||||
|
-f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
|
||||||
|
|
||||||
# tmux plugin manager and plugins
|
# tmux plugin manager and plugins
|
||||||
git submodule add --name tmux/tpm \
|
git submodule add --name tmux/tpm \
|
||||||
-f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
|
-f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
|
||||||
git submodule add --name tmux/catppuccin \
|
git submodule add --name tmux/catppuccin \
|
||||||
-f https://github.com/catppuccin/tmux.git config/tmux/plugins/tmux
|
-f https://github.com/catppuccin/tmux.git config/tmux/plugins/tmux
|
||||||
git submodule add --name tmux/tmux-1password \
|
|
||||||
-f https://github.com/yardnsm/tmux-1password.git config/tmux/plugins/tmux-1password
|
|
||||||
git submodule add --name tmux/tmux-autoreload \
|
|
||||||
-f https://github.com/b0o/tmux-autoreload.git config/tmux/plugins/tmux-autoreload
|
|
||||||
git submodule add --name tmux/tmux-continuum \
|
git submodule add --name tmux/tmux-continuum \
|
||||||
-f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum
|
-f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum
|
||||||
git submodule add --name tmux/tmux-fzf \
|
|
||||||
-f https://github.com/sainnhe/tmux-fzf.git config/tmux/plugins/tmux-fzf
|
|
||||||
git submodule add --name tmux/tmux-menus \
|
git submodule add --name tmux/tmux-menus \
|
||||||
-f https://github.com/jaclu/tmux-menus.git config/tmux/plugins/tmux-menus
|
-f https://github.com/jaclu/tmux-menus.git config/tmux/plugins/tmux-menus
|
||||||
git submodule add --name tmux/tmux-notify \
|
|
||||||
-f https://github.com/ChanderG/tmux-notify.git config/tmux/plugins/tmux-notify
|
|
||||||
git submodule add --name tmux/tmux-resurrect \
|
git submodule add --name tmux/tmux-resurrect \
|
||||||
-f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect
|
-f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect
|
||||||
git submodule add --name tmux/tmux-sensible \
|
git submodule add --name tmux/tmux-sensible \
|
||||||
-f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible
|
-f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible
|
||||||
git submodule add --name tmux/tmux-sessionist \
|
git submodule add --name tmux/tmux-sessionist \
|
||||||
-f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist
|
-f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist
|
||||||
git submodule add --name tmux/tmux-suspend \
|
git submodule add --name tmux/tmux-window-name \
|
||||||
-f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend
|
-f https://github.com/ofirgall/tmux-window-name.git config/tmux/plugins/tmux-window-name
|
||||||
git submodule add --name tmux/tmux-yank \
|
git submodule add --name tmux/tmux-yank \
|
||||||
-f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank
|
-f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank
|
||||||
git submodule add --name tmux/vim-tmux-navigator \
|
|
||||||
-f https://github.com/christoomey/vim-tmux-navigator.git config/tmux/plugins/vim-tmux-navigator
|
|
||||||
|
|||||||
24
base/bashrc
Normal file → Executable file
24
base/bashrc
Normal file → Executable file
@@ -7,19 +7,27 @@ export DOTFILES="$HOME/.dotfiles"
|
|||||||
# Run x-load-configs in your terminal to reload the files.
|
# Run x-load-configs in your terminal to reload the files.
|
||||||
function x-load-configs()
|
function x-load-configs()
|
||||||
{
|
{
|
||||||
|
# Load the shell dotfiles, and then some:
|
||||||
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
HOST="$(hostname -s)"
|
HOST="$(hostname -s)"
|
||||||
# Load the shell dotfiles, and then some:
|
# global (exports|alias|functions) file for all hosts
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
# shellcheck source=../config/exports
|
||||||
[ -r "$file" ] && source "$file"
|
[ -r "$file" ] && source "$file"
|
||||||
[ -r "$file-secret" ] && source "$file-secret"
|
# global secret file, git ignored
|
||||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
# shellcheck source=../config/exports-secret
|
||||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
[ -r "$file-secret" ] && source "$file-secret"
|
||||||
done
|
# host specific (exports|alias|functions) file
|
||||||
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||||
|
# host specific (exports|alias|functions) file, git ignored
|
||||||
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
x-load-configs
|
||||||
|
|
||||||
# Import ssh keys in keychain
|
# Import ssh keys in keychain
|
||||||
ssh-add -A 2>/dev/null;
|
ssh-add -A 2> /dev/null
|
||||||
|
|
||||||
# shellcheck source=../config/fzf/fzf.bash
|
# shellcheck source=../config/fzf/fzf.bash
|
||||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
|
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
|
||||||
|
|||||||
24
base/vuerc
24
base/vuerc
@@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"useTaobaoRegistry": false,
|
|
||||||
"presets": {
|
|
||||||
"v2-router-vuex-scss-prettier": {
|
|
||||||
"useConfigFiles": false,
|
|
||||||
"plugins": {
|
|
||||||
"@vue/cli-plugin-babel": {},
|
|
||||||
"@vue/cli-plugin-router": {
|
|
||||||
"historyMode": false
|
|
||||||
},
|
|
||||||
"@vue/cli-plugin-vuex": {},
|
|
||||||
"@vue/cli-plugin-eslint": {
|
|
||||||
"config": "prettier",
|
|
||||||
"lintOn": [
|
|
||||||
"save"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"vueVersion": "2",
|
|
||||||
"cssPreprocessor": "dart-sass"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
35
base/zshrc
Normal file → Executable file
35
base/zshrc
Normal file → Executable file
@@ -1,10 +1,3 @@
|
|||||||
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
|
|
||||||
# Initialization code that may require console input (password prompts, [y/n]
|
|
||||||
# confirmations, etc.) must go above this block; everything else may go below.
|
|
||||||
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
|
|
||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# this is my zsh config. there are many like it, but this one is mine.
|
# this is my zsh config. there are many like it, but this one is mine.
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
@@ -20,10 +13,19 @@ function x-load-configs()
|
|||||||
{
|
{
|
||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
|
HOST="$(hostname -s)"
|
||||||
|
# global (exports|alias|functions) file for all hosts
|
||||||
|
# shellcheck source=../config/exports
|
||||||
[ -r "$file" ] && source "$file"
|
[ -r "$file" ] && source "$file"
|
||||||
|
# global secret file, git ignored
|
||||||
|
# shellcheck source=../config/exports-secret
|
||||||
[ -r "$file-secret" ] && source "$file-secret"
|
[ -r "$file-secret" ] && source "$file-secret"
|
||||||
[ -r "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
# host specific (exports|alias|functions) file
|
||||||
[ -r "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||||
|
# host specific (exports|alias|functions) file, git ignored
|
||||||
|
# shellcheck source=../config/exports
|
||||||
|
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
x-load-configs
|
||||||
@@ -32,7 +34,6 @@ export HISTFILE="$XDG_STATE_HOME"/zsh/history
|
|||||||
|
|
||||||
autoload -U colors zsh/terminfo
|
autoload -U colors zsh/terminfo
|
||||||
colors
|
colors
|
||||||
setopt correct
|
|
||||||
|
|
||||||
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
|
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
|
||||||
x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
|
x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
|
||||||
@@ -41,18 +42,15 @@ x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
|
|||||||
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
|
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
|
||||||
autoload -Uz compinit
|
autoload -Uz compinit
|
||||||
|
|
||||||
if type brew &>/dev/null
|
if type brew &> /dev/null; then
|
||||||
then
|
|
||||||
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
||||||
|
|
||||||
# Import ssh keys in keychain
|
|
||||||
ssh-add -A 2>/dev/null;
|
|
||||||
|
|
||||||
# Try to load antigen, if present
|
# Try to load antigen, if present
|
||||||
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||||
|
# shellcheck source=../../.local/bin/antigen.zsh
|
||||||
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||||
|
|
||||||
# antigen is present
|
# antigen is present
|
||||||
@@ -69,8 +67,5 @@ have antigen && {
|
|||||||
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
||||||
&& source "${DOTFILES}/config/fzf/fzf.zsh"
|
&& source "${DOTFILES}/config/fzf/fzf.zsh"
|
||||||
|
|
||||||
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
|
# Start starship
|
||||||
# shellcheck source=config/zsh/p10k.zsh
|
eval "$(starship init zsh)"
|
||||||
export P10K_LOCATION="$XDG_CONFIG_HOME/zsh/p10k.zsh"
|
|
||||||
[[ ! -f $P10K_LOCATION ]] || source "$P10K_LOCATION"
|
|
||||||
|
|
||||||
|
|||||||
310
config/alacritty/alacritty.yml
Normal file
310
config/alacritty/alacritty.yml
Normal file
@@ -0,0 +1,310 @@
|
|||||||
|
---
|
||||||
|
# Configuration for Alacritty, the GPU enhanced terminal emulator
|
||||||
|
|
||||||
|
# Any items in the `env` entry below will be added as
|
||||||
|
# environment variables. Some entries may override variables
|
||||||
|
# set by alacritty it self.
|
||||||
|
env:
|
||||||
|
# TERM env customization.
|
||||||
|
#
|
||||||
|
# If this property is not set, alacritty will set it to xterm-256color.
|
||||||
|
#
|
||||||
|
# Note that some xterm terminfo databases don't declare support for italics.
|
||||||
|
# You can verify this by checking for the presence of `smso` and `sitm` in
|
||||||
|
# `infocmp xterm-256color`.
|
||||||
|
TERM: xterm-256color
|
||||||
|
|
||||||
|
# Window dimensions in character columns and lines
|
||||||
|
# (changes require restart)
|
||||||
|
window:
|
||||||
|
dimensions:
|
||||||
|
columns: 130
|
||||||
|
lines: 40
|
||||||
|
|
||||||
|
# Adds this many blank pixels of padding around the window
|
||||||
|
# Units are physical pixels; this is not DPI aware.
|
||||||
|
# (change requires restart)
|
||||||
|
padding:
|
||||||
|
x: 5
|
||||||
|
y: 5
|
||||||
|
|
||||||
|
decorations: buttonless
|
||||||
|
|
||||||
|
opacity: 0.97
|
||||||
|
|
||||||
|
# When true, bold text is drawn using the bright variant of colors.
|
||||||
|
draw_bold_text_with_bright_colors: true
|
||||||
|
|
||||||
|
# Font configuration (changes require restart)
|
||||||
|
font:
|
||||||
|
# The normal (roman) font face to use.
|
||||||
|
normal:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
# Style can be specified to pick a specific face.
|
||||||
|
style: ExtraLight
|
||||||
|
|
||||||
|
# The bold font face
|
||||||
|
bold:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
# Style can be specified to pick a specific face.
|
||||||
|
style: Bold
|
||||||
|
|
||||||
|
# The italic font face
|
||||||
|
italic:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
# Style can be specified to pick a specific face.
|
||||||
|
style: Italic
|
||||||
|
|
||||||
|
# Point size of the font
|
||||||
|
size: 14.0
|
||||||
|
|
||||||
|
# Offset is the extra space around each character. offset.y can be thought of
|
||||||
|
# as modifying the linespacing, and offset.x as modifying the letter spacing.
|
||||||
|
offset:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
|
||||||
|
# Glyph offset determines the locations of the glyphs within their cells with
|
||||||
|
# the default being at the bottom. Increase the x offset to move the glyph to
|
||||||
|
# the right, increase the y offset to move the glyph upward.
|
||||||
|
glyph_offset:
|
||||||
|
x: 0
|
||||||
|
y: 0
|
||||||
|
|
||||||
|
# Should display the render timer
|
||||||
|
debug.render_timer: false
|
||||||
|
|
||||||
|
# https://github.com/catppuccin/alacritty
|
||||||
|
colors:
|
||||||
|
primary:
|
||||||
|
background: "#1E1E2E" # base
|
||||||
|
foreground: "#CDD6F4" # text
|
||||||
|
# Bright and dim foreground colors
|
||||||
|
dim_foreground: "#CDD6F4" # text
|
||||||
|
bright_foreground: "#CDD6F4" # text
|
||||||
|
|
||||||
|
# Cursor colors
|
||||||
|
cursor:
|
||||||
|
text: "#1E1E2E" # base
|
||||||
|
cursor: "#F5E0DC" # rosewater
|
||||||
|
vi_mode_cursor:
|
||||||
|
text: "#1E1E2E" # base
|
||||||
|
cursor: "#B4BEFE" # lavender
|
||||||
|
|
||||||
|
# Search colors
|
||||||
|
search:
|
||||||
|
matches:
|
||||||
|
foreground: "#1E1E2E" # base
|
||||||
|
background: "#A6ADC8" # subtext0
|
||||||
|
focused_match:
|
||||||
|
foreground: "#1E1E2E" # base
|
||||||
|
background: "#A6E3A1" # green
|
||||||
|
footer_bar:
|
||||||
|
foreground: "#1E1E2E" # base
|
||||||
|
background: "#A6ADC8" # subtext0
|
||||||
|
|
||||||
|
# Keyboard regex hints
|
||||||
|
hints:
|
||||||
|
start:
|
||||||
|
foreground: "#1E1E2E" # base
|
||||||
|
background: "#F9E2AF" # yellow
|
||||||
|
end:
|
||||||
|
foreground: "#1E1E2E" # base
|
||||||
|
background: "#A6ADC8" # subtext0
|
||||||
|
|
||||||
|
# Selection colors
|
||||||
|
selection:
|
||||||
|
text: "#1E1E2E" # base
|
||||||
|
background: "#F5E0DC" # rosewater
|
||||||
|
|
||||||
|
# Normal colors
|
||||||
|
normal:
|
||||||
|
black: "#45475A" # surface1
|
||||||
|
red: "#F38BA8" # red
|
||||||
|
green: "#A6E3A1" # green
|
||||||
|
yellow: "#F9E2AF" # yellow
|
||||||
|
blue: "#89B4FA" # blue
|
||||||
|
magenta: "#F5C2E7" # pink
|
||||||
|
cyan: "#94E2D5" # teal
|
||||||
|
white: "#BAC2DE" # subtext1
|
||||||
|
|
||||||
|
# Bright colors
|
||||||
|
bright:
|
||||||
|
black: "#585B70" # surface2
|
||||||
|
red: "#F38BA8" # red
|
||||||
|
green: "#A6E3A1" # green
|
||||||
|
yellow: "#F9E2AF" # yellow
|
||||||
|
blue: "#89B4FA" # blue
|
||||||
|
magenta: "#F5C2E7" # pink
|
||||||
|
cyan: "#94E2D5" # teal
|
||||||
|
white: "#A6ADC8" # subtext0
|
||||||
|
|
||||||
|
# Dim colors
|
||||||
|
dim:
|
||||||
|
black: "#45475A" # surface1
|
||||||
|
red: "#F38BA8" # red
|
||||||
|
green: "#A6E3A1" # green
|
||||||
|
yellow: "#F9E2AF" # yellow
|
||||||
|
blue: "#89B4FA" # blue
|
||||||
|
magenta: "#F5C2E7" # pink
|
||||||
|
cyan: "#94E2D5" # teal
|
||||||
|
white: "#BAC2DE" # subtext1
|
||||||
|
|
||||||
|
indexed_colors:
|
||||||
|
- { index: 16, color: "#FAB387" }
|
||||||
|
- { index: 17, color: "#F5E0DC" }
|
||||||
|
|
||||||
|
# Visual Bell
|
||||||
|
#
|
||||||
|
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
|
||||||
|
# rung, the terminal background will be set to white and transition back to the
|
||||||
|
# default background color. You can control the rate of this transition by
|
||||||
|
# setting the `duration` property (represented in milliseconds). You can also
|
||||||
|
# configure the transition function by setting the `animation` property.
|
||||||
|
#
|
||||||
|
# Possible values for `animation`
|
||||||
|
# `Ease`
|
||||||
|
# `EaseOut`
|
||||||
|
# `EaseOutSine`
|
||||||
|
# `EaseOutQuad`
|
||||||
|
# `EaseOutCubic`
|
||||||
|
# `EaseOutQuart`
|
||||||
|
# `EaseOutQuint`
|
||||||
|
# `EaseOutExpo`
|
||||||
|
# `EaseOutCirc`
|
||||||
|
# `Linear`
|
||||||
|
#
|
||||||
|
# To completely disable the visual bell, set its duration to 0.
|
||||||
|
#
|
||||||
|
# visual_bell:
|
||||||
|
# animation: EaseOutExpo
|
||||||
|
# duration: 0
|
||||||
|
|
||||||
|
# Key bindings
|
||||||
|
#
|
||||||
|
# Each binding is defined as an object with some properties. Most of the
|
||||||
|
# properties are optional. All of the alphabetical keys should have a letter for
|
||||||
|
# the `key` value such as `V`. Function keys are probably what you would expect
|
||||||
|
# as well (F1, F2, ..). The number keys above the main keyboard are encoded as
|
||||||
|
# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`,
|
||||||
|
# etc. These all match the glutin::VirtualKeyCode variants.
|
||||||
|
#
|
||||||
|
# Possible values for `mods`
|
||||||
|
# `Command`, `Super` refer to the super/command/windows key
|
||||||
|
# `Control` for the control key
|
||||||
|
# `Shift` for the Shift key
|
||||||
|
# `Alt` and `Option` refer to alt/option
|
||||||
|
#
|
||||||
|
# mods may be combined with a `|`. For example, requiring control and shift
|
||||||
|
# looks like:
|
||||||
|
#
|
||||||
|
# mods: Control|Shift
|
||||||
|
#
|
||||||
|
# The parser is currently quite sensitive to whitespace and capitalization -
|
||||||
|
# capitalization must match exactly, and piped items must not have whitespace
|
||||||
|
# around them.
|
||||||
|
#
|
||||||
|
# Either an `action`, `chars`, or `command` field must be present.
|
||||||
|
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
|
||||||
|
# `chars` writes the specified string every time that binding is activated.
|
||||||
|
# These should generally be escape sequences, but they can be configured to
|
||||||
|
# send arbitrary strings of bytes.
|
||||||
|
# `command` must be a map containing a `program` string, and `args` array of
|
||||||
|
# strings. For example:
|
||||||
|
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
|
||||||
|
key_bindings:
|
||||||
|
- { key: V, mods: Command, action: Paste }
|
||||||
|
- { key: C, mods: Command, action: Copy }
|
||||||
|
- { key: Q, mods: Command, action: Quit }
|
||||||
|
- { key: W, mods: Command, action: Quit }
|
||||||
|
- { key: N, mods: Command, action: SpawnNewInstance }
|
||||||
|
- { key: Home, chars: "\eOH", mode: AppCursor }
|
||||||
|
- { key: Home, chars: "\e[1~", mode: ~AppCursor }
|
||||||
|
- { key: End, chars: "\eOF", mode: AppCursor }
|
||||||
|
- { key: End, chars: "\e[4~", mode: ~AppCursor }
|
||||||
|
- { key: PageUp, mods: Shift, chars: "\e[5;2~" }
|
||||||
|
- { key: PageUp, mods: Control, chars: "\e[5;5~" }
|
||||||
|
- { key: PageUp, chars: "\e[5~" }
|
||||||
|
- { key: PageDown, mods: Shift, chars: "\e[6;2~" }
|
||||||
|
- { key: PageDown, mods: Control, chars: "\e[6;5~" }
|
||||||
|
- { key: PageDown, chars: "\e[6~" }
|
||||||
|
- { key: Left, mods: Shift, chars: "\e[1;2D" }
|
||||||
|
- { key: Left, mods: Control, chars: "\e[1;5D" }
|
||||||
|
- { key: Left, mods: Alt, chars: "\e[1;3D" }
|
||||||
|
- { key: Left, chars: "\e[D", mode: ~AppCursor }
|
||||||
|
- { key: Left, chars: "\eOD", mode: AppCursor }
|
||||||
|
- { key: Right, mods: Shift, chars: "\e[1;2C" }
|
||||||
|
- { key: Right, mods: Control, chars: "\e[1;5C" }
|
||||||
|
- { key: Right, mods: Alt, chars: "\e[1;3C" }
|
||||||
|
- { key: Right, chars: "\e[C", mode: ~AppCursor }
|
||||||
|
- { key: Right, chars: "\eOC", mode: AppCursor }
|
||||||
|
- { key: Up, mods: Shift, chars: "\e[1;2A" }
|
||||||
|
- { key: Up, mods: Control, chars: "\e[1;5A" }
|
||||||
|
- { key: Up, mods: Alt, chars: "\e[1;3A" }
|
||||||
|
- { key: Up, chars: "\e[A", mode: ~AppCursor }
|
||||||
|
- { key: Up, chars: "\eOA", mode: AppCursor }
|
||||||
|
- { key: Down, mods: Shift, chars: "\e[1;2B" }
|
||||||
|
- { key: Down, mods: Control, chars: "\e[1;5B" }
|
||||||
|
- { key: Down, mods: Alt, chars: "\e[1;3B" }
|
||||||
|
- { key: Down, chars: "\e[B", mode: ~AppCursor }
|
||||||
|
- { key: Down, chars: "\eOB", mode: AppCursor }
|
||||||
|
- { key: Tab, mods: Shift, chars: "\e[Z" }
|
||||||
|
- { key: F1, chars: "\eOP" }
|
||||||
|
- { key: F2, chars: "\eOQ" }
|
||||||
|
- { key: F3, chars: "\eOR" }
|
||||||
|
- { key: F4, chars: "\eOS" }
|
||||||
|
- { key: F5, chars: "\e[15~" }
|
||||||
|
- { key: F6, chars: "\e[17~" }
|
||||||
|
- { key: F7, chars: "\e[18~" }
|
||||||
|
- { key: F8, chars: "\e[19~" }
|
||||||
|
- { key: F9, chars: "\e[20~" }
|
||||||
|
- { key: F10, chars: "\e[21~" }
|
||||||
|
- { key: F11, chars: "\e[23~" }
|
||||||
|
- { key: F12, chars: "\e[24~" }
|
||||||
|
- { key: Back, chars: "" }
|
||||||
|
- { key: Back, mods: Alt, chars: "\e" }
|
||||||
|
- { key: Insert, chars: "\e[2~" }
|
||||||
|
- { key: Delete, chars: "\e[3~" }
|
||||||
|
|
||||||
|
# shortcuts for tmux. the leader key is control-b (0x02)
|
||||||
|
- { key: W, mods: Command, chars: "\x02&" } # close tab (kill)
|
||||||
|
- { key: T, mods: Command, chars: "\x02c" } # new tab
|
||||||
|
- { key: RBracket, mods: Command|Shift, chars: "\x02n" } # select next tab
|
||||||
|
- { key: LBracket, mods: Command|Shift, chars: "\x02p" } # select previous tab
|
||||||
|
- { key: RBracket, mods: Command, chars: "\x02o" } # select next pane
|
||||||
|
- { key: LBracket, mods: Command, chars: "\x02;" } # select last (previously used) pane
|
||||||
|
- { key: F, mods: Command, chars: "\x02/" } # search (upwards) (see tmux.conf)
|
||||||
|
|
||||||
|
# Mouse bindings
|
||||||
|
#
|
||||||
|
# Currently doesn't support modifiers. Both the `mouse` and `action` fields must
|
||||||
|
# be specified.
|
||||||
|
#
|
||||||
|
# Values for `mouse`:
|
||||||
|
# - Middle
|
||||||
|
# - Left
|
||||||
|
# - Right
|
||||||
|
# - Numeric identifier such as `5`
|
||||||
|
#
|
||||||
|
# Values for `action`:
|
||||||
|
# - Paste
|
||||||
|
# - PasteSelection
|
||||||
|
# - Copy (TODO)
|
||||||
|
mouse_bindings:
|
||||||
|
- { mouse: Middle, action: PasteSelection }
|
||||||
|
|
||||||
|
mouse:
|
||||||
|
double_click: { threshold: 300 }
|
||||||
|
triple_click: { threshold: 300 }
|
||||||
|
|
||||||
|
selection:
|
||||||
|
semantic_escape_chars: ',│`|:"'' ()[]{}<>'
|
||||||
|
# Shell
|
||||||
|
#
|
||||||
|
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish.
|
||||||
|
# Entries in shell.args are passed unmodified as arguments to the shell.
|
||||||
|
#
|
||||||
|
#shell:
|
||||||
|
# program: /bin/bash
|
||||||
|
# args:
|
||||||
|
# - --login
|
||||||
54
config/alias
54
config/alias
@@ -55,6 +55,60 @@ if [[ $(uname) == 'Darwin' ]]; then
|
|||||||
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Be nice
|
||||||
|
alias please="sudo "
|
||||||
|
|
||||||
|
! have eza && alias ls='ls --color=auto'
|
||||||
|
have eza && {
|
||||||
|
alias ls='eza -h -s=type --git --icons --group-directories-first'
|
||||||
|
}
|
||||||
|
|
||||||
|
# Easier navigation: .., ..., ....
|
||||||
|
alias ..="cd .."
|
||||||
|
alias ...="cd ../.."
|
||||||
|
alias ....="cd ../../.."
|
||||||
|
|
||||||
|
# Colors for ls
|
||||||
|
alias ll="ls -l"
|
||||||
|
alias l="ls"
|
||||||
|
|
||||||
|
# Prevent common typos
|
||||||
|
alias cd..="cd .."
|
||||||
|
alias sl="ls"
|
||||||
|
|
||||||
|
# List only directories
|
||||||
|
alias lsd="ls -lF | grep '^d'"
|
||||||
|
|
||||||
|
# Recursively delete `.pyc` files
|
||||||
|
alias rmpyc="find . -type f -name '*.pyc' -ls -delete"
|
||||||
|
|
||||||
|
# Recursively delete `.DS_Store` files
|
||||||
|
alias rmds="find . -type f -name '*.DS_Store' -ls -delete"
|
||||||
|
|
||||||
|
# IP addresses
|
||||||
|
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
|
||||||
|
alias localip="ipconfig getifaddr en1"
|
||||||
|
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
|
||||||
|
|
||||||
|
# Show/hide hidden files in Finder
|
||||||
|
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder"
|
||||||
|
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false; killall Finder"
|
||||||
|
|
||||||
|
# Pipe public key to clipboard.
|
||||||
|
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
|
||||||
|
|
||||||
|
# Flush Directory Service cache
|
||||||
|
alias flush="dscacheutil -flushcache"
|
||||||
|
|
||||||
|
# Update locatedb
|
||||||
|
alias updatedb="sudo /usr/libexec/locate.updatedb"
|
||||||
|
|
||||||
|
# Always return full history
|
||||||
|
alias history="history 1"
|
||||||
|
|
||||||
|
alias pip="pip3 "
|
||||||
|
alias python="python3 "
|
||||||
|
|
||||||
# tmux: automatically attach or create session with name 'main'
|
# tmux: automatically attach or create session with name 'main'
|
||||||
alias tmux='tmux new-session -A -s main'
|
alias tmux='tmux new-session -A -s main'
|
||||||
# tmux: attach or create new session
|
# tmux: attach or create new session
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck shell=zsh
|
# shellcheck shell=bash
|
||||||
# vim: filetype=zsh
|
# vim: filetype=zsh
|
||||||
|
|
||||||
export DOTFILES="$HOME/.dotfiles"
|
export DOTFILES="$HOME/.dotfiles"
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ have gem && path_append "$(gem environment gemdir)/bin"
|
|||||||
have rbenv && eval "$(rbenv init - zsh)"
|
have rbenv && eval "$(rbenv init - zsh)"
|
||||||
|
|
||||||
# Rust / cargo
|
# Rust / cargo
|
||||||
|
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||||
path_append "$CARGO_HOME/bin"
|
path_append "$CARGO_HOME/bin"
|
||||||
|
|
||||||
|
|||||||
7
config/exports-lakka
Normal file
7
config/exports-lakka
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# lakka exports
|
||||||
|
|
||||||
|
## LUA
|
||||||
|
have luarocks && $(luarocks path --bin)
|
||||||
|
|
||||||
|
path_append "$HOME/.local/go/bin"
|
||||||
|
|
||||||
@@ -61,16 +61,17 @@ scheduler()
|
|||||||
# Defines default antigen bundles
|
# Defines default antigen bundles
|
||||||
x-default-antigen-bundles()
|
x-default-antigen-bundles()
|
||||||
{
|
{
|
||||||
export ZSH_TMUX_AUTOSTART=true
|
export ZSH_TMUX_AUTOSTART=false
|
||||||
export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
|
export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
|
||||||
export ZSH_TMUX_UNICODE=true
|
export ZSH_TMUX_UNICODE=true
|
||||||
|
export ZSH_TMUX_AUTOQUIT=false
|
||||||
|
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
|
||||||
|
|
||||||
# these should be always available
|
# these should be always available
|
||||||
antigen bundle tmux
|
antigen bundle tmux
|
||||||
antigen bundle colored-man-pages
|
antigen bundle colored-man-pages
|
||||||
antigen bundle command-not-found
|
antigen bundle command-not-found
|
||||||
antigen bundle ssh-agent
|
antigen bundle ssh-agent
|
||||||
# antigen bundle MichaelAquilina/zsh-you-should-use
|
|
||||||
antigen bundle jreese/zsh-titles
|
antigen bundle jreese/zsh-titles
|
||||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||||
antigen bundle zsh-users/zsh-completions
|
antigen bundle zsh-users/zsh-completions
|
||||||
@@ -78,12 +79,9 @@ x-default-antigen-bundles()
|
|||||||
|
|
||||||
# these should be available if there's need
|
# these should be available if there's need
|
||||||
have brew && antigen bundle brew
|
have brew && antigen bundle brew
|
||||||
have nvm && antigen bundle nvm
|
# have nvm && antigen bundle nvm
|
||||||
have nvm && antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use"
|
have nvm && antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use"
|
||||||
have php && antigen bundle php
|
have php && antigen bundle php
|
||||||
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||||
have rvm && antigen bundle unixorn/rvm-plugin
|
have rvm && antigen bundle unixorn/rvm-plugin
|
||||||
|
|
||||||
# the theme to use
|
|
||||||
antigen theme romkatv/powerlevel10k
|
|
||||||
}
|
}
|
||||||
|
|||||||
19
config/gh-changelog/config.yaml
Normal file
19
config/gh-changelog/config.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
check_for_updates: true
|
||||||
|
excluded_labels:
|
||||||
|
- maintenance
|
||||||
|
- dependencies
|
||||||
|
file_name: CHANGELOG.md
|
||||||
|
logger: spinner
|
||||||
|
no_color: false
|
||||||
|
sections:
|
||||||
|
added:
|
||||||
|
- feature
|
||||||
|
- enhancement
|
||||||
|
changed:
|
||||||
|
- backwards-incompatible
|
||||||
|
fixed:
|
||||||
|
- bug
|
||||||
|
- bugfix
|
||||||
|
- documentation
|
||||||
|
show_unreleased: true
|
||||||
|
skip_entries_without_label: false
|
||||||
54
config/gh-dash/config.yml
Normal file
54
config/gh-dash/config.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
prSections:
|
||||||
|
- title: My Pull Requests
|
||||||
|
filters: is:open author:@me
|
||||||
|
- title: Needs My Review
|
||||||
|
filters: is:open review-requested:@me
|
||||||
|
- title: Involved
|
||||||
|
filters: is:open involves:@me -author:@me
|
||||||
|
issuesSections:
|
||||||
|
- title: My Issues
|
||||||
|
filters: is:open author:@me
|
||||||
|
- title: Assigned
|
||||||
|
filters: is:open assignee:@me
|
||||||
|
- title: Involved
|
||||||
|
filters: is:open involves:@me -author:@me
|
||||||
|
defaults:
|
||||||
|
preview:
|
||||||
|
open: true
|
||||||
|
width: 50
|
||||||
|
prsLimit: 20
|
||||||
|
issuesLimit: 20
|
||||||
|
view: prs
|
||||||
|
layout:
|
||||||
|
prs:
|
||||||
|
updatedAt:
|
||||||
|
width: 7
|
||||||
|
repo:
|
||||||
|
width: 15
|
||||||
|
author:
|
||||||
|
width: 15
|
||||||
|
assignees:
|
||||||
|
width: 20
|
||||||
|
hidden: true
|
||||||
|
base:
|
||||||
|
width: 15
|
||||||
|
hidden: true
|
||||||
|
lines:
|
||||||
|
width: 16
|
||||||
|
issues:
|
||||||
|
updatedAt:
|
||||||
|
width: 7
|
||||||
|
repo:
|
||||||
|
width: 15
|
||||||
|
creator:
|
||||||
|
width: 10
|
||||||
|
assignees:
|
||||||
|
width: 20
|
||||||
|
hidden: true
|
||||||
|
refetchIntervalMinutes: 30
|
||||||
|
keybindings:
|
||||||
|
issues: []
|
||||||
|
prs: []
|
||||||
|
repoPaths: {}
|
||||||
|
pager:
|
||||||
|
diff: ""
|
||||||
3
config/gh/hosts.yml
Normal file
3
config/gh/hosts.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
github.com:
|
||||||
|
user: ivuorinen
|
||||||
|
git_protocol: https
|
||||||
@@ -5,3 +5,6 @@
|
|||||||
name = Ismo Vuorinen
|
name = Ismo Vuorinen
|
||||||
email = ismo@ivuorinen.net
|
email = ismo@ivuorinen.net
|
||||||
|
|
||||||
|
[include]
|
||||||
|
path = ~/.config/git/overrides/config
|
||||||
|
|
||||||
|
|||||||
2
config/git/overrides/.gitignore
vendored
Normal file
2
config/git/overrides/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
!.gitkeep
|
||||||
|
config
|
||||||
@@ -18,8 +18,6 @@ tap "xwmx/taps"
|
|||||||
brew "act"
|
brew "act"
|
||||||
# Mozilla CA certificate store
|
# Mozilla CA certificate store
|
||||||
brew "ca-certificates"
|
brew "ca-certificates"
|
||||||
# Cryptography and SSL/TLS Toolkit
|
|
||||||
brew "openssl@3"
|
|
||||||
# Interpreted, interactive, object-oriented programming language
|
# Interpreted, interactive, object-oriented programming language
|
||||||
brew "python@3.11"
|
brew "python@3.11"
|
||||||
# YAML Parser
|
# YAML Parser
|
||||||
@@ -68,6 +66,8 @@ brew "awscli"
|
|||||||
brew "bash"
|
brew "bash"
|
||||||
# Clone of cat(1) with syntax highlighting and Git integration
|
# Clone of cat(1) with syntax highlighting and Git integration
|
||||||
brew "bat"
|
brew "bat"
|
||||||
|
# C/C++ and Java libraries for Unicode and globalization
|
||||||
|
brew "icu4c"
|
||||||
# Yet another cross-platform graphical process/system monitor
|
# Yet another cross-platform graphical process/system monitor
|
||||||
brew "bottom"
|
brew "bottom"
|
||||||
# Switch Apache / Valet / CLI configs between PHP versions
|
# Switch Apache / Valet / CLI configs between PHP versions
|
||||||
@@ -102,8 +102,14 @@ brew "dnsmasq"
|
|||||||
brew "dog"
|
brew "dog"
|
||||||
# Lightning-fast linter for .env files written in Rust
|
# Lightning-fast linter for .env files written in Rust
|
||||||
brew "dotenv-linter"
|
brew "dotenv-linter"
|
||||||
|
# Tool to verify that your files are in harmony with your .editorconfig
|
||||||
|
brew "editorconfig-checker"
|
||||||
# Useful examples at the command-line
|
# Useful examples at the command-line
|
||||||
brew "eg-examples"
|
brew "eg-examples"
|
||||||
|
# OpenType text shaping engine
|
||||||
|
brew "harfbuzz"
|
||||||
|
# Development kit for the Java programming language
|
||||||
|
brew "openjdk"
|
||||||
# Run arbitrary commands when files change
|
# Run arbitrary commands when files change
|
||||||
brew "entr"
|
brew "entr"
|
||||||
# Perl lib for reading and writing EXIF metadata
|
# Perl lib for reading and writing EXIF metadata
|
||||||
@@ -152,10 +158,6 @@ brew "gpgme"
|
|||||||
brew "gpg-tui"
|
brew "gpg-tui"
|
||||||
# Image manipulation
|
# Image manipulation
|
||||||
brew "netpbm"
|
brew "netpbm"
|
||||||
# C/C++ and Java libraries for Unicode and globalization
|
|
||||||
brew "icu4c"
|
|
||||||
# OpenType text shaping engine
|
|
||||||
brew "harfbuzz"
|
|
||||||
# Framework for layout and rendering of i18n text
|
# Framework for layout and rendering of i18n text
|
||||||
brew "pango"
|
brew "pango"
|
||||||
# Library to render SVG files using Cairo
|
# Library to render SVG files using Cairo
|
||||||
@@ -210,8 +212,6 @@ brew "nvm"
|
|||||||
brew "openjdk@11"
|
brew "openjdk@11"
|
||||||
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
|
# Generate clients, server & docs from an OpenAPI spec (v2, v3)
|
||||||
brew "openapi-generator"
|
brew "openapi-generator"
|
||||||
# Development kit for the Java programming language
|
|
||||||
brew "openjdk"
|
|
||||||
# Swiss-army knife of markup format conversion
|
# Swiss-army knife of markup format conversion
|
||||||
brew "pandoc"
|
brew "pandoc"
|
||||||
# Highly capable, feature-rich programming language
|
# Highly capable, feature-rich programming language
|
||||||
@@ -278,6 +278,8 @@ brew "virtualenv"
|
|||||||
brew "wakatime-cli"
|
brew "wakatime-cli"
|
||||||
# Executes a program periodically, showing output fullscreen
|
# Executes a program periodically, showing output fullscreen
|
||||||
brew "watch"
|
brew "watch"
|
||||||
|
# Watch files and take action when they change
|
||||||
|
brew "watchman"
|
||||||
# Internet file retriever
|
# Internet file retriever
|
||||||
brew "wget"
|
brew "wget"
|
||||||
# Personal information dashboard for your terminal
|
# Personal information dashboard for your terminal
|
||||||
@@ -314,8 +316,10 @@ brew "shivammathur/php/php@7.4"
|
|||||||
brew "shivammathur/php/php@8.0"
|
brew "shivammathur/php/php@8.0"
|
||||||
# Ookla Speedtest
|
# Ookla Speedtest
|
||||||
brew "teamookla/speedtest/speedtest"
|
brew "teamookla/speedtest/speedtest"
|
||||||
# Command-line helper for the 1Password password manager
|
# Command-line interface for 1Password
|
||||||
cask "1password-cli"
|
cask "1password-cli"
|
||||||
|
# GPU-accelerated terminal emulator
|
||||||
|
cask "alacritty"
|
||||||
# Turn audio CDs and files into audiobooks
|
# Turn audio CDs and files into audiobooks
|
||||||
cask "audiobook-builder"
|
cask "audiobook-builder"
|
||||||
# Text editor
|
# Text editor
|
||||||
@@ -414,6 +418,7 @@ mas "Keynote", id: 409183694
|
|||||||
mas "LastPass", id: 926036361
|
mas "LastPass", id: 926036361
|
||||||
mas "Numbers", id: 409203825
|
mas "Numbers", id: 409203825
|
||||||
mas "Pages", id: 409201541
|
mas "Pages", id: 409201541
|
||||||
|
mas "Pixelmator Pro", id: 1289583905
|
||||||
mas "Tailscale", id: 1475387142
|
mas "Tailscale", id: 1475387142
|
||||||
mas "Xcode", id: 497799835
|
mas "Xcode", id: 497799835
|
||||||
vscode "akamud.vscode-theme-onelight"
|
vscode "akamud.vscode-theme-onelight"
|
||||||
@@ -435,6 +440,7 @@ vscode "esbenp.prettier-vscode"
|
|||||||
vscode "formulahendry.auto-close-tag"
|
vscode "formulahendry.auto-close-tag"
|
||||||
vscode "formulahendry.auto-rename-tag"
|
vscode "formulahendry.auto-rename-tag"
|
||||||
vscode "formulahendry.code-runner"
|
vscode "formulahendry.code-runner"
|
||||||
|
vscode "foxundermoon.shell-format"
|
||||||
vscode "gencer.html-slim-scss-css-class-completion"
|
vscode "gencer.html-slim-scss-css-class-completion"
|
||||||
vscode "github.vscode-github-actions"
|
vscode "github.vscode-github-actions"
|
||||||
vscode "GitHub.vscode-pull-request-github"
|
vscode "GitHub.vscode-pull-request-github"
|
||||||
@@ -473,6 +479,7 @@ vscode "phiter.phpstorm-snippets"
|
|||||||
vscode "sibiraj-s.vscode-scss-formatter"
|
vscode "sibiraj-s.vscode-scss-formatter"
|
||||||
vscode "SonarSource.sonarlint-vscode"
|
vscode "SonarSource.sonarlint-vscode"
|
||||||
vscode "stylelint.vscode-stylelint"
|
vscode "stylelint.vscode-stylelint"
|
||||||
|
vscode "sumneko.lua"
|
||||||
vscode "syler.sass-indented"
|
vscode "syler.sass-indented"
|
||||||
vscode "timonwong.shellcheck"
|
vscode "timonwong.shellcheck"
|
||||||
vscode "tootone.org-mode"
|
vscode "tootone.org-mode"
|
||||||
@@ -481,6 +488,7 @@ vscode "Vue.volar"
|
|||||||
vscode "Vue.vscode-typescript-vue-plugin"
|
vscode "Vue.vscode-typescript-vue-plugin"
|
||||||
vscode "WakaTime.vscode-wakatime"
|
vscode "WakaTime.vscode-wakatime"
|
||||||
vscode "wix.vscode-import-cost"
|
vscode "wix.vscode-import-cost"
|
||||||
|
vscode "XadillaX.viml"
|
||||||
vscode "xdebug.php-debug"
|
vscode "xdebug.php-debug"
|
||||||
vscode "xdebug.php-pack"
|
vscode "xdebug.php-pack"
|
||||||
vscode "yinfei.luahelper"
|
vscode "yinfei.luahelper"
|
||||||
|
|||||||
9
config/nvim/.gitignore
vendored
9
config/nvim/.gitignore
vendored
@@ -1 +1,8 @@
|
|||||||
session.vim
|
tt.*
|
||||||
|
.tests
|
||||||
|
doc/tags
|
||||||
|
debug
|
||||||
|
.repro
|
||||||
|
foo.*
|
||||||
|
*.log
|
||||||
|
data
|
||||||
|
|||||||
15
config/nvim/.neoconf.json
Normal file
15
config/nvim/.neoconf.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"neodev": {
|
||||||
|
"library": {
|
||||||
|
"enabled": true,
|
||||||
|
"plugins": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neoconf": {
|
||||||
|
"plugins": {
|
||||||
|
"lua_ls": {
|
||||||
|
"enabled": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
column_width = 160
|
|
||||||
line_endings = "Unix"
|
|
||||||
indent_type = "Spaces"
|
|
||||||
indent_width = 2
|
|
||||||
quote_style = "AutoPreferDouble"
|
|
||||||
call_parentheses = "Always"
|
|
||||||
collapse_simple_statement = "Always"
|
|
||||||
|
|
||||||
[sort_requires]
|
|
||||||
enabled = true
|
|
||||||
4
config/nvim/README.md
Normal file
4
config/nvim/README.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# 💤 LazyVim
|
||||||
|
|
||||||
|
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
|
||||||
|
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
|
||||||
@@ -1 +0,0 @@
|
|||||||
vim.api.nvim_command("set formatoptions-=cro")
|
|
||||||
@@ -1,31 +1,2 @@
|
|||||||
-- luacheck: globals vim
|
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||||
local key = vim.api.nvim_set_keymap
|
require("config.lazy")
|
||||||
local remap = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
-- Set with normal Vim opts, 'Space' as mapleader
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
vim.g.maplocalleader = " "
|
|
||||||
|
|
||||||
-- Set 'Space' as <NOP> key to leadermap key
|
|
||||||
key("n", "<Space>", "<NOP>", remap)
|
|
||||||
|
|
||||||
-- Filetype specialties.
|
|
||||||
require("filetype")
|
|
||||||
|
|
||||||
-- Global, windows options of neovim:
|
|
||||||
require("options")
|
|
||||||
|
|
||||||
-- To adminstrate packages:
|
|
||||||
require("plugin-manager")
|
|
||||||
|
|
||||||
-- LSP for editing.
|
|
||||||
require("lsp")
|
|
||||||
|
|
||||||
-- Autocmd commands from Vimscript
|
|
||||||
require("autocmd")
|
|
||||||
|
|
||||||
-- Personal Keymaps of neovim:
|
|
||||||
require("keymappings")
|
|
||||||
|
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
|
||||||
|
|||||||
@@ -1,68 +1,69 @@
|
|||||||
{
|
{
|
||||||
"LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" },
|
"LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" },
|
||||||
"barbecue.nvim": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
"LuaSnip": { "branch": "master", "commit": "1fd22fa96c11573248f9fdd09f25e724c7bb3dd4" },
|
||||||
|
"SchemaStore.nvim": { "branch": "main", "commit": "d2a3d1da007549c921f7b0e22521d1c20d09c8a7" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
|
||||||
|
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
|
||||||
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||||
"catppuccin": { "branch": "main", "commit": "2e3e5ebcdc24ef0d5b14a0a999dbbe7936512c46" },
|
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
|
||||||
"close-buffers.nvim": { "branch": "master", "commit": "3acbcad1211572342632a6c0151f839e7dead27f" },
|
"catppuccin": { "branch": "main", "commit": "3d9a5ed556e289bce6c1fb0af89ec838360641b2" },
|
||||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
"cmp-calc": { "branch": "main", "commit": "ce91d14d2e7a8b3f6ad86d85e34d41c1ae6268d9" },
|
|
||||||
"cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" },
|
|
||||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
|
||||||
"cmp-look": { "branch": "master", "commit": "b39c50bcdf6199dddda56adc466c2bd9c951a960" },
|
|
||||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
|
|
||||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
|
||||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
|
|
||||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||||
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
|
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
|
||||||
"dressing.nvim": { "branch": "master", "commit": "c7b035de7f91bb6b62b4308f105c56d1a968b8c5" },
|
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
|
||||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
"edgy.nvim": { "branch": "main", "commit": "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4" },
|
||||||
"friendly-snippets": { "branch": "main", "commit": "00e191fea2cfbbdd378243f35b5953296537a116" },
|
"flash.nvim": { "branch": "main", "commit": "cc8c7e03987134997d74ee87e55a5717279f2d05" },
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "d927caa075df63bf301d92f874efb72fd22fd3b4" },
|
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" },
|
||||||
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
|
||||||
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" },
|
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "6148b51db945b55b3b725da39eaea6441e59dff8" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "2451adb9bdb0fd32140bf3aa8dbc17ff60050db3" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "0942198fb9a998b6ccee36fb8dd7495eb8ba659c" },
|
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
|
||||||
"mini.nvim": { "branch": "main", "commit": "296ebbbd3e5ba5e43f5125efe18ad76fe3b632cc" },
|
"middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" },
|
||||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
|
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
|
||||||
"neodev.nvim": { "branch": "main", "commit": "183f5a7357397260b631d6cccceccc3621b50f78" },
|
"mini.animate": { "branch": "main", "commit": "989ac014933ab5cd14ab83f2fce4b9a08ca6d81e" },
|
||||||
|
"mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" },
|
||||||
|
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
|
||||||
|
"mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" },
|
||||||
|
"mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" },
|
||||||
|
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
|
||||||
|
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
|
||||||
|
"neoconf.nvim": { "branch": "main", "commit": "360805250fe45391d30b96b6640d03e2c35597ee" },
|
||||||
|
"neodev.nvim": { "branch": "main", "commit": "ddf29935af5a510307850919d6772ea6a4e2c008" },
|
||||||
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
|
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "aa1b4c1e05983ff7debd2b4b2788651db099de2f" },
|
"noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
|
||||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "31e1ece773e10448dcb616d5144290946a6264b7" },
|
"nvim-lspconfig": { "branch": "master", "commit": "ede4114e1fd41acb121c70a27e1b026ac68c42d6" },
|
||||||
"nvim-dap-go": { "branch": "main", "commit": "1b508e9db330108d3b5d62a6d9cc01fe6bbdd4e0" },
|
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
|
||||||
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
|
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "a27356f1ef9c11e1f459cc96a3fcac5c265e72d6" },
|
|
||||||
"nvim-navic": { "branch": "master", "commit": "9c89730da6a05acfeb6a197e212dfadf5aa60ca0" },
|
|
||||||
"nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
|
|
||||||
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
|
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "0d6882635817a2677749a330127d12ac30a4f3c8" },
|
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "17b943e7c5cc2b2db3ac7b5720fbd42e75a00d8d" },
|
"nvim-treesitter": { "branch": "master", "commit": "0960322686bfa38afd4f1e0b9660473cf77e24b6" },
|
||||||
"nvim-treesitter-context": { "branch": "master", "commit": "31692b26d76ff1f7c6e0ab51814dd55e7417e96c" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
|
||||||
"nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" },
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
|
||||||
"nvim-window-picker": { "branch": "main", "commit": "1b1bb834b0acb9eebb11a61664efc665757f1ba2" },
|
"nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" },
|
||||||
"plenary.nvim": { "branch": "master", "commit": "0dbe561ae023f02c2fb772b879e905055b939ce3" },
|
"nvim-web-devicons": { "branch": "master", "commit": "480a756df82a0c231622c9bf2173bb6634713716" },
|
||||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
|
||||||
"refactoring.nvim": { "branch": "master", "commit": "2ec9bc0fb5f3c8c6a0f776f0159dd2a3b1663554" },
|
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
|
||||||
"restoreview": { "branch": "main", "commit": "03d00d59a9ba640db6b44192ed0fcc9d7261dcd2" },
|
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
|
||||||
"schemastore.nvim": { "branch": "main", "commit": "a6759df4dcfc052246ee7a6cccfdb37d2180d617" },
|
"stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" },
|
||||||
"smartcolumn.nvim": { "branch": "main", "commit": "4aa00ad766f3c0f0e2561e0eb42df3ea3743c135" },
|
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
|
||||||
"stickybuf.nvim": { "branch": "master", "commit": "4c667bc837e5e3fec5a8857ee99f1a229fc76df9" },
|
"telescope.nvim": { "branch": "master", "commit": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8" },
|
||||||
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
|
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
|
||||||
"tabnine": { "branch": "master", "commit": "dcca6d2f9e8bbcde36aab87b9b87890810e4056d" },
|
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" },
|
||||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" },
|
"transparent.nvim": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" },
|
||||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
|
||||||
"telescope.nvim": { "branch": "master", "commit": "2c1ed33a6f6f2db3b69f5421f6b405eda1b07748" },
|
|
||||||
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
|
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
|
||||||
"twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" },
|
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
|
||||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },
|
||||||
"vim-vsnip": { "branch": "master", "commit": "7753ba9c10429c29d25abfd11b4c60b76718c438" },
|
"vim-illuminate": { "branch": "master", "commit": "6acf7d4a18255a3ddc43770866c8e148fe85af7b" },
|
||||||
"vim-vsnip-integ": { "branch": "master", "commit": "1914e72cf3de70df7f5dde476cd299aba2440aef" },
|
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
||||||
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
|
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
|
||||||
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
|
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
|
||||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
|
"windows.nvim": { "branch": "main", "commit": "c7492552b23d0ab30325e90b56066ec51242adc8" }
|
||||||
}
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
local vim = vim
|
|
||||||
local api = vim.api
|
|
||||||
local M = {}
|
|
||||||
|
|
||||||
--- function to create a list of commands and convert them to autocommands
|
|
||||||
--- This function is taken from https://github.com/norcalli/nvim_utils
|
|
||||||
function M.nvim_create_augroups(definitions)
|
|
||||||
for group_name, definition in pairs(definitions) do
|
|
||||||
api.nvim_command("augroup " .. group_name)
|
|
||||||
api.nvim_command("autocmd!")
|
|
||||||
for _, def in ipairs(definition) do
|
|
||||||
local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ")
|
|
||||||
api.nvim_command(command)
|
|
||||||
end
|
|
||||||
api.nvim_command("augroup END")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local autoCommands = {
|
|
||||||
-- To save the current session (may be restored later).
|
|
||||||
-- autocmd! VimLeavePre * :mks! ~/.config/nvim/session.vim
|
|
||||||
save_session = {
|
|
||||||
{ "VimLeavePre", "*", ":mks! ~/.local/state/nvim/session.vim" },
|
|
||||||
},
|
|
||||||
-- other autocommands
|
|
||||||
open_folds = {
|
|
||||||
{ "BufReadPost,FileReadPost", "*", "normal zR<cr>" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
M.nvim_create_augroups(autoCommands)
|
|
||||||
3
config/nvim/lua/config/autocmds.lua
Normal file
3
config/nvim/lua/config/autocmds.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
-- Autocmds are automatically loaded on the VeryLazy event
|
||||||
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||||
|
-- Add any additional autocmds here
|
||||||
19
config/nvim/lua/config/keymaps.lua
Normal file
19
config/nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
-- Keymaps are automatically loaded on the VeryLazy event
|
||||||
|
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||||
|
-- Add any additional keymaps here
|
||||||
|
|
||||||
|
local keymap = vim.keymap.set
|
||||||
|
|
||||||
|
-- ╭──────────────────────────────────────────────────────────╮
|
||||||
|
-- │ Comment box │
|
||||||
|
-- ╰──────────────────────────────────────────────────────────╯
|
||||||
|
local cb = require("comment-box")
|
||||||
|
|
||||||
|
-- left aligned fixed size box with left aligned text
|
||||||
|
keymap({ "n", "v" }, "<Leader>bcb", cb.lbox, { desc = "Comment: Left aligned" })
|
||||||
|
-- centered adapted box with centered text
|
||||||
|
keymap({ "n", "v" }, "<Leader>bcc", cb.ccbox, { desc = "Comment: Centered" })
|
||||||
|
|
||||||
|
-- centered line
|
||||||
|
keymap("n", "<Leader>bcl", cb.cline, { desc = "Comment: Centered line" })
|
||||||
|
keymap("i", "<M-l>", cb.cline, { desc = "Comment: Centered line" })
|
||||||
61
config/nvim/lua/config/lazy.lua
Normal file
61
config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
-- bootstrap lazy.nvim
|
||||||
|
-- stylua: ignore
|
||||||
|
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||||
|
|
||||||
|
require("lazy").setup({
|
||||||
|
spec = {
|
||||||
|
-- add LazyVim and import its plugins
|
||||||
|
{
|
||||||
|
"LazyVim/LazyVim",
|
||||||
|
import = "lazyvim.plugins",
|
||||||
|
opts = {
|
||||||
|
colorscheme = "catppuccin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- import any extras modules here
|
||||||
|
{ import = "lazyvim.plugins.extras.formatting.prettier" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.docker" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.go" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.terraform" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.yaml" },
|
||||||
|
{ import = "lazyvim.plugins.extras.linting.eslint" },
|
||||||
|
{ import = "lazyvim.plugins.extras.ui.edgy" },
|
||||||
|
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
|
||||||
|
-- import/override with your plugins
|
||||||
|
{ import = "plugins" },
|
||||||
|
},
|
||||||
|
defaults = {
|
||||||
|
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||||
|
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||||
|
lazy = false,
|
||||||
|
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||||
|
-- have outdated releases, which may break your Neovim install.
|
||||||
|
version = false, -- always use the latest git commit
|
||||||
|
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||||
|
},
|
||||||
|
install = { colorscheme = { "catppuccin" } },
|
||||||
|
checker = { enabled = true }, -- automatically check for plugin updates
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
-- disable some rtp plugins
|
||||||
|
disabled_plugins = {
|
||||||
|
"gzip",
|
||||||
|
-- "matchit",
|
||||||
|
-- "matchparen",
|
||||||
|
-- "netrwPlugin",
|
||||||
|
"tarPlugin",
|
||||||
|
"tohtml",
|
||||||
|
"tutor",
|
||||||
|
"zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
13
config/nvim/lua/config/options.lua
Normal file
13
config/nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
-- Options are automatically loaded before lazy.nvim startup
|
||||||
|
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||||
|
-- Add any additional options here
|
||||||
|
|
||||||
|
local opt = vim.opt
|
||||||
|
|
||||||
|
opt.number = true
|
||||||
|
opt.relativenumber = true
|
||||||
|
opt.modeline = true
|
||||||
|
opt.spelllang = { "en", "fi" }
|
||||||
|
|
||||||
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||||
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
-- To be used anywhere.
|
|
||||||
local function job(command) vim.api.nvim_command("call jobstart('" .. command .. "')") end
|
|
||||||
|
|
||||||
local function format()
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
|
||||||
pattern = "<buffer>",
|
|
||||||
callback = function() vim.lsp.buf.format() end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function yaml_ft(path, bufnr)
|
|
||||||
-- get content of buffer as string
|
|
||||||
local content = vim.filetype.getlines(bufnr)
|
|
||||||
if type(content) == "table" then content = table.concat(content, "\n") end
|
|
||||||
|
|
||||||
-- check if file is in roles, tasks, or handlers folder
|
|
||||||
local path_regex = vim.regex("(tasks\\|roles\\|handlers)/")
|
|
||||||
if path_regex and path_regex:match_str(path) then return "yaml.ansible" end
|
|
||||||
-- check for known ansible playbook text and if found, return yaml.ansible
|
|
||||||
local regex = vim.regex("hosts:\\|tasks:")
|
|
||||||
if regex and regex:match_str(content) then return "yaml.ansible" end
|
|
||||||
|
|
||||||
-- return yaml if nothing else
|
|
||||||
return "yaml"
|
|
||||||
end
|
|
||||||
|
|
||||||
-- In init.lua or filetype.nvim's config file
|
|
||||||
vim.filetype.add({
|
|
||||||
extension = {
|
|
||||||
|
|
||||||
h = function()
|
|
||||||
-- Use a lazy heuristic that #including a C++ header means it's a
|
|
||||||
-- C++ header
|
|
||||||
if vim.fn.search("\\C^#include <[^>.]\\+>$", "nw") == 1 then return "cpp" end
|
|
||||||
return "c"
|
|
||||||
end,
|
|
||||||
|
|
||||||
-- Spelling fix.
|
|
||||||
md = function() vim.api.nvim_command("setlocal spell!") end,
|
|
||||||
|
|
||||||
yml = yaml_ft,
|
|
||||||
yaml = yaml_ft,
|
|
||||||
|
|
||||||
--
|
|
||||||
csv = "csv",
|
|
||||||
cl = "opencl",
|
|
||||||
env = "env",
|
|
||||||
sh = "zsh",
|
|
||||||
--
|
|
||||||
},
|
|
||||||
pattern = {
|
|
||||||
|
|
||||||
-- Go to root configuration of some projects.
|
|
||||||
-- [".*config/nvim/.*"] = function() vim.api.nvim_command "cd ~/.config/nvim/" end,
|
|
||||||
|
|
||||||
---- Typescript Projects
|
|
||||||
[".*/src/.*ts"] = function() format() end,
|
|
||||||
[".*/src/.*json"] = function() format() end,
|
|
||||||
[".*/src/.*scss"] = function() format() end,
|
|
||||||
[".*/src/.*html"] = function() format() end,
|
|
||||||
|
|
||||||
--[".*Code/ivuorinen/[project]/src/.*ts"] = function()
|
|
||||||
-- vim.api.nvim_command('cd ~/Code/ivuorinen/[project]/')
|
|
||||||
-- build('ts index')
|
|
||||||
--end,
|
|
||||||
},
|
|
||||||
|
|
||||||
filename = {
|
|
||||||
-- For eslint_d configuration file.
|
|
||||||
[".eslintrc"] = "jsonc",
|
|
||||||
|
|
||||||
-- For Typescript projects.
|
|
||||||
["tsconfig.json"] = "json5",
|
|
||||||
|
|
||||||
[".ignore"] = "gitignore",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,258 +0,0 @@
|
|||||||
--[[
|
|
||||||
Keymappings for nvim experience.
|
|
||||||
|
|
||||||
I use combination of both nvim default vim.api.nvim_set_keymap
|
|
||||||
and WhichKey register. Slowly migrating to the WhichKey system,
|
|
||||||
and tweaking the groupings as I go.
|
|
||||||
--]]
|
|
||||||
|
|
||||||
local key = vim.api.nvim_set_keymap
|
|
||||||
local remap = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
local wk = require("which-key")
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ Register keybindings │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
|
|
||||||
-- Register in all modes, prefix <leader>
|
|
||||||
wk.register({
|
|
||||||
b = {
|
|
||||||
name = "Buffer",
|
|
||||||
n = {
|
|
||||||
"<cmd>tabnew<cr>",
|
|
||||||
"New tab",
|
|
||||||
},
|
|
||||||
c = {
|
|
||||||
name = "Comments",
|
|
||||||
b = {
|
|
||||||
"<cmd>lua require('comment-box').lbox()<cr>",
|
|
||||||
"Left aligned fixed size box with left aligned text",
|
|
||||||
},
|
|
||||||
c = {
|
|
||||||
"<cmd>lua require('comment-box').ccbox()<cr>",
|
|
||||||
desc = "Centered adapted box with centered text",
|
|
||||||
},
|
|
||||||
l = {
|
|
||||||
"<cmd>lua require('comment-box').cline()<cr>",
|
|
||||||
desc = "Centered line",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
d = {
|
|
||||||
name = "Delete buffers",
|
|
||||||
h = {
|
|
||||||
"<CMD>lua require('close_buffers').delete({type = 'hidden'})<CR>",
|
|
||||||
"Delete hidden buffers",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
g = {
|
|
||||||
name = "[g]oto buffer",
|
|
||||||
["1"] = { "<cmd>buffer! 1<cr>", "Buffer 1" },
|
|
||||||
["2"] = { "<cmd>buffer! 2<cr>", "Buffer 2" },
|
|
||||||
["3"] = { "<cmd>buffer! 3<cr>", "Buffer 3" },
|
|
||||||
["4"] = { "<cmd>buffer! 4<cr>", "Buffer 4" },
|
|
||||||
["5"] = { "<cmd>buffer! 5<cr>", "Buffer 5" },
|
|
||||||
["6"] = { "<cmd>buffer! 6<cr>", "Buffer 6" },
|
|
||||||
["7"] = { "<cmd>buffer! 7<cr>", "Buffer 7" },
|
|
||||||
["8"] = { "<cmd>buffer! 8<cr>", "Buffer 8" },
|
|
||||||
["9"] = { "<cmd>buffer! 9<cr>", "Buffer 9" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
D = {
|
|
||||||
name = "[D]iagnostics (Trouble)",
|
|
||||||
t = { ":TroubleToggle<CR>", "[D]iagnostics [t]oggle" },
|
|
||||||
-- Quick navigation between diagonostics.
|
|
||||||
f = { ":lua vim.diagnostic.open_float()<CR>", "[D]iagnostics: Open [f]loat" },
|
|
||||||
n = { ":lua vim.diagnostic.goto_next()<CR>", "[D]iagnostics: [n]ext" },
|
|
||||||
p = { ":lua vim.diagnostic.goto_prev()<CR>", "[D]iagnostics: [p]rev" },
|
|
||||||
},
|
|
||||||
e = {
|
|
||||||
function() vim.cmd("Neotree focus source=filesystem position=left") end,
|
|
||||||
"Toggle the sidebar tree of the root folder.",
|
|
||||||
},
|
|
||||||
f = {
|
|
||||||
name = "[f]ind",
|
|
||||||
-- Find recursively files across the root folder subfiles.
|
|
||||||
f = { ':lua require("telescope.builtin").find_files()<cr>', "[f]ind [f]iles" },
|
|
||||||
-- Find recursively a text across the root folder subfiles.
|
|
||||||
g = { ':lua require("telescope.builtin").live_grep()<cr>', "[f]ind text with [g]rep" },
|
|
||||||
},
|
|
||||||
G = {
|
|
||||||
-- defined in plugins/gitsigns.lua
|
|
||||||
name = "Git",
|
|
||||||
b = {
|
|
||||||
name = "blame",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
h = {
|
|
||||||
name = "[h]arpoon",
|
|
||||||
a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "[h]arpoon: [A]dd file" },
|
|
||||||
r = { "<cmd>lua require('harpoon.mark').rm_file()<cr>", "[h]arpoon: [r]emove file" },
|
|
||||||
m = { "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", "[h]arpoon: harpoon [m]enu" },
|
|
||||||
n = { "<cmd>lua require('harpoon.ui').nav_next()<cr>", "[h]arpoon: [n]ext file" },
|
|
||||||
p = { "<cmd>lua require('harpoon.ui').nav_prev()<cr>", "[h]arpoon: [p]revious file" },
|
|
||||||
["1"] = { "<cmd> lua require('harpoon.ui').nav_file(1)<cr>", "[h]arpoon: file 1" },
|
|
||||||
["2"] = { "<cmd> lua require('harpoon.ui').nav_file(2)<cr>", "[h]arpoon: file 2" },
|
|
||||||
["3"] = { "<cmd> lua require('harpoon.ui').nav_file(3)<cr>", "[h]arpoon: file 3" },
|
|
||||||
},
|
|
||||||
--- Remap debugging to "H" from LV default of "h"
|
|
||||||
H = {
|
|
||||||
name = "[H]elp/Conceal/Treesitter",
|
|
||||||
c = {
|
|
||||||
name = "[c]onceal",
|
|
||||||
h = { ":set conceallevel=1<cr>", "hide/conceal" },
|
|
||||||
s = { ":set conceallevel=0<cr>", "show/unconceal" },
|
|
||||||
},
|
|
||||||
t = {
|
|
||||||
name = "Treesitter",
|
|
||||||
t = { vim.treesitter.inspect_tree, "show tree" },
|
|
||||||
c = { ":=vim.treesitter.get_captures_at_cursor()<cr>", "show capture" },
|
|
||||||
n = { ":=vim.treesitter.get_node():type()<cr>", "show node" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
p = {
|
|
||||||
name = "[p]lugins",
|
|
||||||
i = { function() require("lazy").install() end, "[p]lugins [i]nstall" },
|
|
||||||
s = { function() require("lazy").home() end, "[p]lugins [s]tatus" },
|
|
||||||
S = { function() require("lazy").sync() end, "[p]lugins [S]ync" },
|
|
||||||
u = { function() require("lazy").check() end, "[p]lugins Check [u]pdates" },
|
|
||||||
U = { function() require("lazy").update() end, "[p]lugins [U]pdate" },
|
|
||||||
},
|
|
||||||
q = {
|
|
||||||
name = "[q]uit",
|
|
||||||
q = { ":qa<cr>", "[q]uit: [q]uit all" },
|
|
||||||
f = { ":qa!<cr>", "[q]uit: all with [f]orce" },
|
|
||||||
},
|
|
||||||
r = {
|
|
||||||
-- defined in plugins/refactoring-nvim.lua
|
|
||||||
name = "[r]efactor",
|
|
||||||
},
|
|
||||||
t = {
|
|
||||||
name = "[t]elescope",
|
|
||||||
-- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles.
|
|
||||||
t = { ":TodoTelescope<cr>", "[t]elescope: [t]odo" },
|
|
||||||
},
|
|
||||||
x = { ":Bdelete<CR>", "[x]: Close current buffer" },
|
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ Normal mode, prefix <leader> │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
wk.register({
|
|
||||||
b = { name = "Buffer" },
|
|
||||||
}, { mode = "n", prefix = "<leader>" })
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ Insert mode, prefix <leader> │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
wk.register({
|
|
||||||
b = { name = "Buffer" },
|
|
||||||
}, { mode = "i", prefix = "<leader>" })
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ Insert mode, no prefix │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
wk.register({
|
|
||||||
["<C-s>"] = { "<cmd>w<cr>", "Save file" },
|
|
||||||
["<C-Home>"] = { "<Home>", "Do just Home on CTRL + Home" },
|
|
||||||
}, { mode = "i", prefix = "" })
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ All modes, no prefix │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
wk.register({
|
|
||||||
["<C-s>"] = { "<cmd>w<cr>", "Save file" },
|
|
||||||
["<C-End>"] = { "<End>", "Do just End on CTRL + End" },
|
|
||||||
}, { prefix = "" })
|
|
||||||
|
|
||||||
-- Go to the next block.
|
|
||||||
--key('n', '<C-Down>', 'g%', remap )
|
|
||||||
|
|
||||||
-- Loop through brackets blocks.
|
|
||||||
--key('n', '<C-Up>', 'z%', remap )
|
|
||||||
|
|
||||||
-- Highlight the word after pressing enter.
|
|
||||||
key(
|
|
||||||
"n",
|
|
||||||
"<CR>",
|
|
||||||
[[:let searchTerm = '\v<'.expand("<cword>").'>' <bar> let @/ = searchTerm <bar> echo '/'.@/ <bar> call histadd("search", searchTerm) <bar> set hls<cr>]],
|
|
||||||
remap
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Highlight the visual selection after pressing enter.
|
|
||||||
key(
|
|
||||||
"v",
|
|
||||||
"<CR>",
|
|
||||||
[["*y:silent! let searchTerm = '\V'.substitute(escape(@*, '\/'), "\n", '\\n', "g") <bar> let @/ = searchTerm <bar> echo '/'.@/ <bar> call histadd("search", searchTerm) <bar> set hls<cr>]],
|
|
||||||
remap
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Toggle highlight of search
|
|
||||||
key("n", "<C-c>", ":set hlsearch!<CR>", remap)
|
|
||||||
|
|
||||||
-- Try to correct the current word.
|
|
||||||
key("i", "<C-b>", "ea<C-x><C-s>", remap)
|
|
||||||
|
|
||||||
-- Toggle built-in nvim spell checking.
|
|
||||||
key("n", "<F5>", ":setlocal spell!<CR>", remap)
|
|
||||||
|
|
||||||
-- Move lines normally like an IDE when line wraps
|
|
||||||
key("i", "<Down>", [[v:count ? 'j' : '<c-o>gj']], { expr = true, noremap = true, silent = true })
|
|
||||||
key("i", "<Up>", [[v:count ? 'k' : '<c-o>gk']], { expr = true, noremap = true, silent = true })
|
|
||||||
key("n", "<Down>", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true })
|
|
||||||
key("n", "<Up>", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true })
|
|
||||||
|
|
||||||
-- Set 'CTRL + v' as 'paster'
|
|
||||||
-- key('', '<C-v>', 'map"_d<Esc>i', remap )
|
|
||||||
key("v", "<C-v>", "p", remap)
|
|
||||||
|
|
||||||
-- Set 'CTRL + x' as 'cut'
|
|
||||||
key("v", "<C-x>", "mad`ai<Right>", { silent = true })
|
|
||||||
|
|
||||||
-- Set 'CTRL + c' as 'copier'
|
|
||||||
key("v", "<C-c>", "may`ai", remap)
|
|
||||||
key("i", "<C-v>", "<Esc>:Registers<CR>", remap)
|
|
||||||
|
|
||||||
-- Create mark.
|
|
||||||
key("n", "'", "`", remap)
|
|
||||||
|
|
||||||
-- Move normaly bottom and up with C+Up and C+Down.
|
|
||||||
key("i", "<C-Up>", "<C-o>gk", remap)
|
|
||||||
key("i", "<C-Down>", "<C-o>gj", remap)
|
|
||||||
key("n", "<C-Up>", "gk", remap)
|
|
||||||
key("n", "<C-Down>", "gj", remap)
|
|
||||||
|
|
||||||
-- Set 'CTRL + z' as 'undo'
|
|
||||||
key("i", "<C-z>", "<Esc>ui", remap)
|
|
||||||
|
|
||||||
-- Set 'CTRL + y' as 'redo'
|
|
||||||
key("i", "<C-y>", "<Esc><C-r>", remap)
|
|
||||||
|
|
||||||
-- Set 'SHIFT + arrows' as 'select' like modern text-editor.
|
|
||||||
key("n", "<S-Up>", "v<Up>", remap)
|
|
||||||
key("n", "<S-Down>", "v<Down>", remap)
|
|
||||||
key("n", "<S-Left>", "v<Left>", remap)
|
|
||||||
key("n", "<S-Right>", "v<Right>", remap)
|
|
||||||
key("v", "<S-Up>", "<Up>", remap)
|
|
||||||
key("v", "<S-Down>", "<Down>", remap)
|
|
||||||
key("v", "<S-Left>", "<Left>", remap)
|
|
||||||
key("v", "<S-Right>", "<Right>", remap)
|
|
||||||
key("i", "<S-Up>", "<Esc>v<Up>", remap)
|
|
||||||
key("i", "<S-Down>", "<C-o>v<Down>", remap)
|
|
||||||
key("i", "<S-Left>", "<Esc>v<Left>", remap)
|
|
||||||
key("i", "<S-Right>", "<C-o>v<Right>", remap)
|
|
||||||
|
|
||||||
-- Set 'SHIFT + special-keys' as 'select' like a modern text editor.
|
|
||||||
key("i", "<S-Home>", "<Esc>v<Home>", remap)
|
|
||||||
key("i", "<S-End>", "<C-o>v<End><Left>", remap)
|
|
||||||
key("n", "<S-Home>", "v<Home>", remap)
|
|
||||||
key("n", "<S-End>", "v<End><Left>", remap)
|
|
||||||
key("n", "<S-PageUp>", "", remap)
|
|
||||||
key("n", "<S-PageDown>", "<Esc>:call Visual_Scroll_Down()<CR>i<Right><Left>", remap)
|
|
||||||
|
|
||||||
-- Indent the current visual selection.
|
|
||||||
key("v", "<", "<gv", remap)
|
|
||||||
key("v", ">", ">gv", remap)
|
|
||||||
|
|
||||||
-- Set 'Backspace' as 'delete selection' for the visual selection.
|
|
||||||
key("v", "<BS>", '"_di', remap)
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
-- Completion for snippets.
|
|
||||||
-- luacheck: globals vim CAPABILITIES
|
|
||||||
CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
CAPABILITIES = require("cmp_nvim_lsp").default_capabilities(CAPABILITIES)
|
|
||||||
CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
|
|
||||||
|
|
||||||
--CAPABILITIES.offsetEncoding = 'utf-8'
|
|
||||||
|
|
||||||
-- [[ Configure LSP ]]
|
|
||||||
-- This function gets run when an LSP connects to a particular buffer.
|
|
||||||
local on_attach = function(_, bufnr)
|
|
||||||
local nmap = function(keys, func, desc)
|
|
||||||
if desc then desc = "LSP: " .. desc end
|
|
||||||
|
|
||||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
|
||||||
end
|
|
||||||
|
|
||||||
local wk = require("which-key")
|
|
||||||
|
|
||||||
wk.register({
|
|
||||||
l = {
|
|
||||||
name = "LSP",
|
|
||||||
n = { vim.lsp.buf.rename, "Rename" },
|
|
||||||
c = { vim.lsp.buf.code_action, "Code Action" },
|
|
||||||
f = { "<cmd>Format", "Format current buffer with LSP" },
|
|
||||||
D = { vim.lsp.buf.declaration, "[G]oto [D]eclaration" },
|
|
||||||
w = {
|
|
||||||
name = "[w]orkspace",
|
|
||||||
a = { vim.lsp.buf.add_workspace_folder, "[w]orkspace: [a]dd folder" },
|
|
||||||
r = { vim.lsp.buf.remove_workspace_folder, "[w]orkspace: [r]emove folder" },
|
|
||||||
l = {
|
|
||||||
function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,
|
|
||||||
"[w]orkspace [l]ist folders",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
g = {
|
|
||||||
name = "Goto",
|
|
||||||
d = { vim.lsp.buf.definition, "[G]oto [D]efinition" },
|
|
||||||
r = { require("telescope.builtin").lsp_references, "[G]oto [R]eferences" },
|
|
||||||
I = { vim.lsp.buf.implementation, "[G]oto [I]mplementation" },
|
|
||||||
D = { vim.lsp.buf.type_definition, "Type [D]efinition" },
|
|
||||||
s = { require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols" },
|
|
||||||
w = { require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols" },
|
|
||||||
},
|
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
|
|
||||||
-- See `:help K` for why this keymap
|
|
||||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
|
||||||
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
|
||||||
|
|
||||||
-- Create a command `:Format` local to the LSP buffer
|
|
||||||
vim.api.nvim_buf_create_user_command(
|
|
||||||
bufnr,
|
|
||||||
"Format",
|
|
||||||
function(_) vim.lsp.buf.format() end,
|
|
||||||
{ desc = "Format current buffer with LSP" }
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Enable the following language servers
|
|
||||||
-- Feel free to add/remove any LSPs that you want here.
|
|
||||||
-- They will automatically be installed.
|
|
||||||
--
|
|
||||||
-- Add any additional override configuration in the following
|
|
||||||
-- tables. They will be passed to the `settings` field of the
|
|
||||||
-- server config. You must look up that documentation yourself.
|
|
||||||
--
|
|
||||||
-- If you want to override the default filetypes that your
|
|
||||||
-- language server will attach to you can define the property
|
|
||||||
-- 'filetypes' to the map in question.
|
|
||||||
local servers = {
|
|
||||||
ansiblels = {},
|
|
||||||
bashls = {},
|
|
||||||
clangd = {},
|
|
||||||
docker_compose_language_service = {},
|
|
||||||
dockerls = {},
|
|
||||||
eslint = {},
|
|
||||||
gopls = {},
|
|
||||||
html = { filetypes = { "html", "twig", "hbs" } },
|
|
||||||
intelephense = {},
|
|
||||||
jsonls = {},
|
|
||||||
lua_ls = {
|
|
||||||
Lua = {
|
|
||||||
workspace = { checkThirdParty = false },
|
|
||||||
telemetry = { enable = false },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
marksman = {},
|
|
||||||
pyright = {},
|
|
||||||
rust_analyzer = {},
|
|
||||||
terraformls = {},
|
|
||||||
tsserver = {},
|
|
||||||
vuels = {},
|
|
||||||
yamlls = {},
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Setup neovim lua configuration
|
|
||||||
require("neodev").setup()
|
|
||||||
|
|
||||||
-- nvim-cmp supports additional completion capabilities,
|
|
||||||
-- so broadcast that to servers
|
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
||||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
|
||||||
|
|
||||||
-- Ensure the servers above are installed
|
|
||||||
local mason_lspconfig = require("mason-lspconfig")
|
|
||||||
|
|
||||||
mason_lspconfig.setup({
|
|
||||||
ensure_installed = vim.tbl_keys(servers),
|
|
||||||
automatic_installation = true,
|
|
||||||
})
|
|
||||||
|
|
||||||
mason_lspconfig.setup_handlers({
|
|
||||||
function(server_name)
|
|
||||||
require("lspconfig")[server_name].setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
on_attach = on_attach,
|
|
||||||
settings = servers[server_name],
|
|
||||||
filetypes = (servers[server_name] or {}).filetypes,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Bash Language Server
|
|
||||||
require("lsp.bash")
|
|
||||||
|
|
||||||
-- eslint_d + prettierd
|
|
||||||
-- require 'lsp.eslint_d_prettierd'
|
|
||||||
|
|
||||||
-- HTML
|
|
||||||
require("lsp.html")
|
|
||||||
|
|
||||||
-- JSON
|
|
||||||
require("lsp.json")
|
|
||||||
|
|
||||||
-- Python
|
|
||||||
require("lsp.python")
|
|
||||||
|
|
||||||
-- CSS + Less + SCSS
|
|
||||||
require("lsp.scss")
|
|
||||||
|
|
||||||
-- rome
|
|
||||||
require("lsp.rome")
|
|
||||||
|
|
||||||
-- Typescript + Javascript
|
|
||||||
require("lsp.typescript")
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
require("lspconfig").bashls.setup({
|
|
||||||
cmd = {
|
|
||||||
"bash-language-server",
|
|
||||||
"start",
|
|
||||||
},
|
|
||||||
filetypes = { "sh", "zsh" },
|
|
||||||
capabilities = CAPABILITIES,
|
|
||||||
})
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
local eslint = require("eslint")
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
-- local sources = { null_ls.builtins.formatting.prettierd }
|
|
||||||
|
|
||||||
null_ls.setup()
|
|
||||||
|
|
||||||
eslint.setup({
|
|
||||||
bin = "eslint_d",
|
|
||||||
code_actions = {
|
|
||||||
enable = true,
|
|
||||||
apply_on_save = {
|
|
||||||
enable = true,
|
|
||||||
types = { "directive", "problem", "suggestion", "layout" },
|
|
||||||
},
|
|
||||||
disable_rule_comment = {
|
|
||||||
enable = true,
|
|
||||||
location = "separate_line", -- or `same_line`
|
|
||||||
},
|
|
||||||
},
|
|
||||||
diagnostics = {
|
|
||||||
enable = true,
|
|
||||||
report_unused_disable_directives = false,
|
|
||||||
run_on = "type", -- or `save`
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("lspconfig").html.setup({ capabilities = CAPABILITIES })
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
require("lspconfig").jsonls.setup({
|
|
||||||
settings = {
|
|
||||||
json = {
|
|
||||||
schemas = require("schemastore").json.schemas(),
|
|
||||||
validate = { enable = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
capabilities = CAPABILITIES,
|
|
||||||
})
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
require("lspconfig").pylsp.setup({})
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
local util = require("lspconfig.util")
|
|
||||||
-- local config = require 'lspconfig.configs'
|
|
||||||
|
|
||||||
-- This duplicate exec is just a workaruond, if don't execute at first,
|
|
||||||
-- the nvim will stuck when you first init rome socket
|
|
||||||
-- local rome_cmd = { 'rome', 'lsp-proxy' }
|
|
||||||
|
|
||||||
-- local merged_table = vim.tbl_extend("keep", {
|
|
||||||
-- textDocument = {
|
|
||||||
-- formatting = {
|
|
||||||
-- dynamicRegistration = true
|
|
||||||
-- }
|
|
||||||
-- }
|
|
||||||
-- }, capabilities);
|
|
||||||
--
|
|
||||||
require("lspconfig").rome.setup({
|
|
||||||
-- cmd = rome_cmd,
|
|
||||||
-- filetypes = {
|
|
||||||
-- 'javascript',
|
|
||||||
-- 'javascriptreact',
|
|
||||||
-- 'typescript',
|
|
||||||
-- 'typescriptreact',
|
|
||||||
-- 'json'
|
|
||||||
-- },
|
|
||||||
root_dir = util.root_pattern("rome.json"),
|
|
||||||
single_file_support = true,
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
|
||||||
end,
|
|
||||||
capabilities = CAPABILITIES,
|
|
||||||
})
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
-- CSS + Less + SASS Language Server
|
|
||||||
require("lspconfig").cssls.setup({
|
|
||||||
cmd = { "vscode-css-language-server", "--stdio" },
|
|
||||||
filetypes = { "css", "scss", "less" },
|
|
||||||
-- root_dir = root_pattern("package.json", ".git") or bufdir,
|
|
||||||
settings = {
|
|
||||||
css = {
|
|
||||||
validate = true,
|
|
||||||
},
|
|
||||||
less = {
|
|
||||||
validate = true,
|
|
||||||
},
|
|
||||||
scss = {
|
|
||||||
validate = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
single_file_support = true,
|
|
||||||
capabilities = CAPABILITIES,
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
require("lspconfig").tsserver.setup({
|
|
||||||
capabilities = CAPABILITIES,
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
-- Signature for LSP
|
|
||||||
|
|
||||||
return {
|
|
||||||
"ray-x/lsp_signature.nvim",
|
|
||||||
config = {
|
|
||||||
debug = false, -- set to true to enable debug logging
|
|
||||||
verbose = false, -- show debug line number
|
|
||||||
|
|
||||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
|
||||||
-- If you want to hook lspsaga or other signature handler, pls set to false
|
|
||||||
doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
|
||||||
-- set to 0 if you DO NOT want any API comments be shown
|
|
||||||
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
|
||||||
-- mode, 10 by default
|
|
||||||
|
|
||||||
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
|
||||||
|
|
||||||
floating_window_above_cur_line = false, -- try to place the floating above the current line when possible Note:
|
|
||||||
-- will set to true when fully tested, set to false will use whichever side has more space
|
|
||||||
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
|
||||||
close_timeout = 4000, -- close floating window after ms when laster parameter is entered
|
|
||||||
hint_enable = true, -- virtual hint enable
|
|
||||||
hint_prefix = "🐼", -- Panda for parameter
|
|
||||||
hint_scheme = "String",
|
|
||||||
use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
|
||||||
|
|
||||||
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
|
||||||
|
|
||||||
max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down
|
|
||||||
-- to view the hiding contents
|
|
||||||
max_width = 90, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
|
||||||
wrap = true,
|
|
||||||
handler_opts = {
|
|
||||||
border = "shadow", -- double, rounded, single, shadow, none
|
|
||||||
},
|
|
||||||
|
|
||||||
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
|
||||||
|
|
||||||
floating_window_off_x = 0, -- adjust float windows x position.
|
|
||||||
-- can be either a number or function
|
|
||||||
floating_window_off_y = 2, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
|
|
||||||
-- can be either number or function, see examples
|
|
||||||
|
|
||||||
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
|
||||||
extra_trigger_chars = { "(", ",", ";", ")", "{", "}" }, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
|
||||||
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
|
||||||
|
|
||||||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
|
||||||
|
|
||||||
transparency = 20, -- disabled by default, allow floating win transparent value 1~100
|
|
||||||
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
|
||||||
shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
|
||||||
timer_interval = 50, -- default timer check interval set to lower value if you want to reduce latency
|
|
||||||
toggle_key = "<C-n>", -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
|
|
||||||
|
|
||||||
select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
|
|
||||||
move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
-- luacheck: globals vim
|
|
||||||
|
|
||||||
-- Fix moving through lines 'gk' and 'gj'
|
|
||||||
vim.wo.linebreak = true
|
|
||||||
|
|
||||||
-- Enable break indent
|
|
||||||
vim.o.breakindent = true
|
|
||||||
|
|
||||||
-- Use the new FileType system of Neovim.
|
|
||||||
-- let g:do_filetype_lua = 1
|
|
||||||
|
|
||||||
-- Save undo history
|
|
||||||
vim.o.undofile = true
|
|
||||||
|
|
||||||
-- Show lines number (hybrid)
|
|
||||||
vim.wo.number = true
|
|
||||||
vim.wo.relativenumber = true
|
|
||||||
|
|
||||||
-- Keep signcolumn on by default
|
|
||||||
vim.wo.signcolumn = "yes"
|
|
||||||
|
|
||||||
-- Case-insensitive searching UNLESS \C or capital in search
|
|
||||||
vim.o.ignorecase = true
|
|
||||||
vim.o.smartcase = true
|
|
||||||
|
|
||||||
-- To have a extra line :)
|
|
||||||
vim.o.cmdheight = 0
|
|
||||||
|
|
||||||
-- Set wrap for words
|
|
||||||
vim.wo.wrap = true
|
|
||||||
|
|
||||||
-- Always show tabs
|
|
||||||
vim.o.showtabline = 2
|
|
||||||
|
|
||||||
-- Show xtra spaces
|
|
||||||
vim.opt.list = true
|
|
||||||
|
|
||||||
-- Set wildmenu for later use
|
|
||||||
vim.o.wildmenu = true
|
|
||||||
|
|
||||||
-- Highlighting search
|
|
||||||
vim.o.hlsearch = true
|
|
||||||
|
|
||||||
-- Set ruler for better look
|
|
||||||
vim.o.ruler = true
|
|
||||||
|
|
||||||
-- No nice message
|
|
||||||
vim.o.hidden = true
|
|
||||||
|
|
||||||
-- Partial commands only in the screen
|
|
||||||
vim.o.showcmd = true
|
|
||||||
|
|
||||||
-- Match braces when inserting new ones :)
|
|
||||||
vim.o.showmatch = true
|
|
||||||
|
|
||||||
-- Cursor line
|
|
||||||
---- Cursor column
|
|
||||||
vim.o.cursorline = true
|
|
||||||
vim.wo.cursorline = true
|
|
||||||
vim.o.cursorcolumn = true
|
|
||||||
vim.wo.cursorcolumn = true
|
|
||||||
|
|
||||||
-- Off scroll when moving through the buffer
|
|
||||||
vim.o.scrolloff = 40
|
|
||||||
|
|
||||||
-- For terminal RGB colours
|
|
||||||
vim.go.termguicolors = true
|
|
||||||
|
|
||||||
-- Colours, I believe
|
|
||||||
vim.go.t_Co = "256"
|
|
||||||
vim.go.t_ut = ""
|
|
||||||
|
|
||||||
-- Space for tabs
|
|
||||||
vim.o.laststatus = 3
|
|
||||||
|
|
||||||
-- Space for tabs
|
|
||||||
vim.o.softtabstop = 2
|
|
||||||
|
|
||||||
-- Expand tab to use spaces instead
|
|
||||||
vim.o.expandtab = true
|
|
||||||
|
|
||||||
-- Space for tabs
|
|
||||||
vim.o.tabstop = 2
|
|
||||||
|
|
||||||
-- Space for tabs
|
|
||||||
vim.bo.shiftwidth = 2
|
|
||||||
|
|
||||||
-- Space for tabs
|
|
||||||
vim.o.shiftwidth = 2
|
|
||||||
|
|
||||||
-- Format options to not create new lines with comments
|
|
||||||
vim.o.formatoptions = "tqj"
|
|
||||||
|
|
||||||
-- Mouse working with neovim
|
|
||||||
vim.o.mouse = "a"
|
|
||||||
|
|
||||||
-- viminfo file
|
|
||||||
-- vim.o.viminfo = vim.o.viminfo .. '~/.config/nvim/viminfo'
|
|
||||||
|
|
||||||
-- Spell language to English (UK)
|
|
||||||
vim.o.spelllang = "en_gb"
|
|
||||||
vim.bo.spelllang = "en_gb"
|
|
||||||
|
|
||||||
-- Global statusline.
|
|
||||||
vim.opt.laststatus = 2
|
|
||||||
|
|
||||||
-- When "on" the commands listed below move the cursor to the first non-blank
|
|
||||||
-- of the line. When off the cursor is kept in the same column (if possible).
|
|
||||||
-- https://neovim.io/doc/user/options.html#'startofline'
|
|
||||||
vim.opt.startofline = true
|
|
||||||
|
|
||||||
-- Columns line "limit"
|
|
||||||
-- vim.o.cc = '85'
|
|
||||||
|
|
||||||
-- Set path for better searching across the system
|
|
||||||
-- vim.o.path = vim.o.path .. '**'
|
|
||||||
|
|
||||||
-- Complete options
|
|
||||||
vim.o.completeopt = "menuone,longest,noselect"
|
|
||||||
vim.o.shortmess = vim.o.shortmess .. "c"
|
|
||||||
|
|
||||||
-- Menu Transparency.
|
|
||||||
vim.go.pumblend = 10
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ Variables │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
|
|
||||||
vim.api.nvim_set_var("one_allow_itali:set cursorlinec:set cursorlines", 1)
|
|
||||||
vim.api.nvim_set_var("do_filetype_lua", 1)
|
|
||||||
vim.api.nvim_set_var("MRU_File", "~/.cache/vim_mru_files")
|
|
||||||
|
|
||||||
-- ╭──────────────────────────────────────────────────────────╮
|
|
||||||
-- │ API │
|
|
||||||
-- ╰──────────────────────────────────────────────────────────╯
|
|
||||||
|
|
||||||
-- Change title accordingly.
|
|
||||||
vim.api.nvim_set_option("title", true)
|
|
||||||
|
|
||||||
-- Set clipboard to be global across the system
|
|
||||||
vim.api.nvim_set_option("clipboard", "unnamedplus")
|
|
||||||
|
|
||||||
-- Basic fold column
|
|
||||||
vim.api.nvim_set_option("foldcolumn", "1")
|
|
||||||
|
|
||||||
-- Set dictionary to language spell
|
|
||||||
vim.api.nvim_set_option("dictionary", "/usr/share/dict/words")
|
|
||||||
|
|
||||||
-- Wildignore for when opening files :0
|
|
||||||
vim.api.nvim_set_option(
|
|
||||||
"wildignore",
|
|
||||||
"*/tmp*/,*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,~$,*/.log"
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Folding
|
|
||||||
vim.api.nvim_set_option("foldmethod", "syntax")
|
|
||||||
vim.api.nvim_set_option('foldenable', false)
|
|
||||||
vim.api.nvim_set_option('foldminlines', 5)
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
-- Package manager https://github.com/folke/lazy.nvim
|
|
||||||
-- :help lazy.nvim.txt
|
|
||||||
|
|
||||||
-- To install lazy.nvim automatically.
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
|
||||||
|
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
|
||||||
vim.fn.system({
|
|
||||||
"git",
|
|
||||||
"clone",
|
|
||||||
"--filter=blob:none",
|
|
||||||
"https://github.com/folke/lazy.nvim.git",
|
|
||||||
"--branch=stable", -- latest stable release
|
|
||||||
lazypath,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.opt.rtp:prepend(lazypath)
|
|
||||||
|
|
||||||
-- Plugins start here:
|
|
||||||
require("lazy").setup("plugins")
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
-- Winbar with context.
|
|
||||||
return {
|
|
||||||
"utilyre/barbecue.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
"SmiteshP/nvim-navic",
|
|
||||||
"kyazdani42/nvim-web-devicons", -- Optional
|
|
||||||
},
|
|
||||||
config = {
|
|
||||||
theme = "catppuccin",
|
|
||||||
|
|
||||||
-- If you set this to false, floating windows will look weird
|
|
||||||
exclude_float = true,
|
|
||||||
|
|
||||||
-- Instead of excluding countless number of filetypes, barbecue tries to only show on some buftypes
|
|
||||||
-- "": file buffer
|
|
||||||
-- "nofile": e.g. nvim-tree and nvim-dap-ui
|
|
||||||
-- "prompt": e.g. telescope.nvim and nvim-fzf
|
|
||||||
-- "terminal": e.g. fterm.nvim and toggleterm.nvim
|
|
||||||
-- ...
|
|
||||||
include_buftypes = { "" },
|
|
||||||
|
|
||||||
---Filetypes not to enable winbar in.
|
|
||||||
---
|
|
||||||
---@type string[]
|
|
||||||
exclude_filetypes = {
|
|
||||||
"",
|
|
||||||
"txt",
|
|
||||||
"markdown",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- :help events
|
|
||||||
-- :help [event] (like :help BufWinEnter)
|
|
||||||
update_events = {
|
|
||||||
"BufWinEnter",
|
|
||||||
"BufWritePost",
|
|
||||||
"CursorMoved",
|
|
||||||
"CursorMovedI",
|
|
||||||
"TextChanged",
|
|
||||||
"TextChangedI",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Show `~ ...` instead of `/ home user ...`
|
|
||||||
tilde_home = true,
|
|
||||||
|
|
||||||
-- Your winbar will have a little padding from the edge
|
|
||||||
prefix = " ",
|
|
||||||
|
|
||||||
-- The sign between each entry
|
|
||||||
separator = " ",
|
|
||||||
|
|
||||||
-- Show if lsp context is available but there is nothing to show
|
|
||||||
no_info_indicator = "…",
|
|
||||||
|
|
||||||
-- Symbol to show if file has been modified (not saved). It's usually `[+]` in vim
|
|
||||||
-- `nil` to disable
|
|
||||||
modified_indicator = nil,
|
|
||||||
|
|
||||||
-- Icons passed to nvim-navic
|
|
||||||
icons = {
|
|
||||||
File = " ",
|
|
||||||
Module = " ",
|
|
||||||
Namespace = " ",
|
|
||||||
Package = " ",
|
|
||||||
Class = " ",
|
|
||||||
Method = " ",
|
|
||||||
Property = " ",
|
|
||||||
Field = " ",
|
|
||||||
Constructor = " ",
|
|
||||||
Enum = "練",
|
|
||||||
Interface = "練",
|
|
||||||
Function = " ",
|
|
||||||
Variable = " ",
|
|
||||||
Constant = " ",
|
|
||||||
String = " ",
|
|
||||||
Number = " ",
|
|
||||||
Boolean = "◩ ",
|
|
||||||
Array = " ",
|
|
||||||
Object = " ",
|
|
||||||
Key = " ",
|
|
||||||
Null = "ﳠ ",
|
|
||||||
EnumMember = " ",
|
|
||||||
Struct = " ",
|
|
||||||
Event = " ",
|
|
||||||
Operator = " ",
|
|
||||||
TypeParameter = " ",
|
|
||||||
Define = " ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
91
config/nvim/lua/plugins/coding.lua
Normal file
91
config/nvim/lua/plugins/coding.lua
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
return {
|
||||||
|
-- A better annotation generator. Supports multiple languages and annotation conventions.
|
||||||
|
-- https://github.com/danymat/neogen
|
||||||
|
{
|
||||||
|
"danymat/neogen",
|
||||||
|
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||||
|
version = "*",
|
||||||
|
cmd = "Neogen",
|
||||||
|
opts = {
|
||||||
|
snippet_engine = "luasnip",
|
||||||
|
languages = {
|
||||||
|
lua = { template = { annotation_convention = "ldoc" } },
|
||||||
|
typescript = { template = { annotation_convention = "tsdoc" } },
|
||||||
|
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"<leader>baa",
|
||||||
|
function()
|
||||||
|
require("neogen").generate({ type = "current" })
|
||||||
|
end,
|
||||||
|
desc = "Current",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>bac",
|
||||||
|
function()
|
||||||
|
require("neogen").generate({ type = "class" })
|
||||||
|
end,
|
||||||
|
desc = "Class",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>baf",
|
||||||
|
function()
|
||||||
|
require("neogen").generate({ type = "func" })
|
||||||
|
end,
|
||||||
|
desc = "Function",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>bat",
|
||||||
|
function()
|
||||||
|
require("neogen").generate({ type = "type" })
|
||||||
|
end,
|
||||||
|
desc = "Type",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>baF",
|
||||||
|
function()
|
||||||
|
require("neogen").generate({ type = "file" })
|
||||||
|
end,
|
||||||
|
desc = "File",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Describe the regexp under the cursor
|
||||||
|
-- https://github.com/bennypowers/nvim-regexplainer
|
||||||
|
{
|
||||||
|
"bennypowers/nvim-regexplainer",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
"MunifTanjim/nui.nvim",
|
||||||
|
},
|
||||||
|
opts = {
|
||||||
|
-- automatically show the explainer when the cursor enters a regexp
|
||||||
|
auto = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Clarify and beautify your comments using boxes and lines.
|
||||||
|
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||||
|
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
||||||
|
|
||||||
|
-- Tabnine Client for Neovim
|
||||||
|
-- https://github.com/codota/tabnine-nvim
|
||||||
|
{
|
||||||
|
"codota/tabnine-nvim",
|
||||||
|
name = "tabnine",
|
||||||
|
enabled = false,
|
||||||
|
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
|
||||||
|
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
|
||||||
|
event = "User",
|
||||||
|
opts = {
|
||||||
|
accept_keymap = "<C-e>",
|
||||||
|
dismiss_keymap = "<C-Esc>",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
||||||
|
-- https://github.com/wakatime/vim-wakatime
|
||||||
|
{ "wakatime/vim-wakatime", lazy = false, enabled = true },
|
||||||
|
}
|
||||||
266
config/nvim/lua/plugins/example.lua
Normal file
266
config/nvim/lua/plugins/example.lua
Normal file
@@ -0,0 +1,266 @@
|
|||||||
|
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||||
|
-- stylua: ignore
|
||||||
|
if true then return {} end
|
||||||
|
|
||||||
|
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||||
|
--
|
||||||
|
-- In your plugin files, you can:
|
||||||
|
-- * add extra plugins
|
||||||
|
-- * disable/enabled LazyVim plugins
|
||||||
|
-- * override the configuration of LazyVim plugins
|
||||||
|
return {
|
||||||
|
-- add gruvbox
|
||||||
|
{ "ellisonleao/gruvbox.nvim" },
|
||||||
|
|
||||||
|
-- Configure LazyVim to load gruvbox
|
||||||
|
{
|
||||||
|
"LazyVim/LazyVim",
|
||||||
|
opts = {
|
||||||
|
colorscheme = "gruvbox",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- change trouble config
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
-- opts will be merged with the parent spec
|
||||||
|
opts = { use_diagnostic_signs = true },
|
||||||
|
},
|
||||||
|
|
||||||
|
-- disable trouble
|
||||||
|
{ "folke/trouble.nvim", enabled = false },
|
||||||
|
|
||||||
|
-- add symbols-outline
|
||||||
|
{
|
||||||
|
"simrat39/symbols-outline.nvim",
|
||||||
|
cmd = "SymbolsOutline",
|
||||||
|
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- override nvim-cmp and add cmp-emoji
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = { "hrsh7th/cmp-emoji" },
|
||||||
|
---@param opts cmp.ConfigSchema
|
||||||
|
opts = function(_, opts)
|
||||||
|
local cmp = require("cmp")
|
||||||
|
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- change some telescope options and a keymap to browse plugin files
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
keys = {
|
||||||
|
-- add a keymap to browse plugin files
|
||||||
|
-- stylua: ignore
|
||||||
|
{
|
||||||
|
"<leader>fp",
|
||||||
|
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||||
|
desc = "Find Plugin File",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- change some options
|
||||||
|
opts = {
|
||||||
|
defaults = {
|
||||||
|
layout_strategy = "horizontal",
|
||||||
|
layout_config = { prompt_position = "top" },
|
||||||
|
sorting_strategy = "ascending",
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add telescope-fzf-native
|
||||||
|
{
|
||||||
|
"telescope.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
build = "make",
|
||||||
|
config = function()
|
||||||
|
require("telescope").load_extension("fzf")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add pyright to lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
---@class PluginLspOpts
|
||||||
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||||
|
pyright = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
dependencies = {
|
||||||
|
"jose-elias-alvarez/typescript.nvim",
|
||||||
|
init = function()
|
||||||
|
require("lazyvim.util").on_attach(function(_, buffer)
|
||||||
|
-- stylua: ignore
|
||||||
|
vim.keymap.set("n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||||
|
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
---@class PluginLspOpts
|
||||||
|
opts = {
|
||||||
|
---@type lspconfig.options
|
||||||
|
servers = {
|
||||||
|
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||||
|
tsserver = {},
|
||||||
|
},
|
||||||
|
-- you can do any additional lsp server setup here
|
||||||
|
-- return true if you don't want this server to be setup with lspconfig
|
||||||
|
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||||
|
setup = {
|
||||||
|
-- example to setup with typescript.nvim
|
||||||
|
tsserver = function(_, opts)
|
||||||
|
require("typescript").setup({ server = opts })
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
-- Specify * to use this function as a fallback for any server
|
||||||
|
-- ["*"] = function(server, opts) end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||||
|
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||||
|
|
||||||
|
-- add more treesitter parsers
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"python",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||||
|
-- would overwrite `ensure_installed` with the new value.
|
||||||
|
-- If you'd rather extend the default config, use the code below instead:
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
-- add tsx and treesitter
|
||||||
|
vim.list_extend(opts.ensure_installed, {
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- the opts function can also be used to change the default opts:
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function(_, opts)
|
||||||
|
table.insert(opts.sections.lualine_x, "😄")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- or you can return new options to override all the defaults
|
||||||
|
{
|
||||||
|
"nvim-lualine/lualine.nvim",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = function()
|
||||||
|
return {
|
||||||
|
--[[add your custom lualine config here]]
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- use mini.starter instead of alpha
|
||||||
|
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||||
|
|
||||||
|
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||||
|
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||||
|
|
||||||
|
-- add any tools you want to have installed below
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"stylua",
|
||||||
|
"shellcheck",
|
||||||
|
"shfmt",
|
||||||
|
"flake8",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Use <tab> for completion and snippets (supertab)
|
||||||
|
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
||||||
|
{
|
||||||
|
"L3MON4D3/LuaSnip",
|
||||||
|
keys = function()
|
||||||
|
return {}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- then: setup supertab in cmp
|
||||||
|
{
|
||||||
|
"hrsh7th/nvim-cmp",
|
||||||
|
dependencies = {
|
||||||
|
"hrsh7th/cmp-emoji",
|
||||||
|
},
|
||||||
|
---@param opts cmp.ConfigSchema
|
||||||
|
opts = function(_, opts)
|
||||||
|
local has_words_before = function()
|
||||||
|
unpack = unpack or table.unpack
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||||
|
-- this way you will only jump inside the snippet region
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
-- Show signs of GIT written in lua
|
|
||||||
return {
|
|
||||||
"lewis6991/gitsigns.nvim",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
|
||||||
config = {
|
|
||||||
signs = {
|
|
||||||
add = { hl = "GitSignsAdd", text = "┃", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
|
||||||
change = { hl = "GitSignsChange", text = "┃", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
|
||||||
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
|
||||||
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
|
||||||
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
|
||||||
},
|
|
||||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
|
||||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
|
||||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
|
||||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
|
||||||
on_attach = function(bufnr)
|
|
||||||
local gs = package.loaded.gitsigns
|
|
||||||
|
|
||||||
local function map(mode, l, r, opts)
|
|
||||||
opts = opts or {}
|
|
||||||
opts.buffer = bufnr
|
|
||||||
vim.keymap.set(mode, l, r, opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Navigation
|
|
||||||
map("n", "]c", function()
|
|
||||||
if vim.wo.diff then return "]c" end
|
|
||||||
vim.schedule(function() gs.next_hunk() end)
|
|
||||||
return "<Ignore>"
|
|
||||||
end, { expr = true })
|
|
||||||
|
|
||||||
map("n", "[c", function()
|
|
||||||
if vim.wo.diff then return "[c" end
|
|
||||||
vim.schedule(function() gs.prev_hunk() end)
|
|
||||||
return "<Ignore>"
|
|
||||||
end, { expr = true })
|
|
||||||
|
|
||||||
-- Actions
|
|
||||||
map("n", "<leader>Ghs", gs.stage_hunk, { desc = "Stage Hunk" })
|
|
||||||
map("n", "<leader>Ghr", gs.reset_hunk, { desc = "Reset Hunk" })
|
|
||||||
map("v", "<leader>Ghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
|
||||||
map("v", "<leader>Ghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
|
||||||
map("n", "<leader>GhS", gs.stage_buffer, { desc = "Stage Buffer" })
|
|
||||||
map("n", "<leader>Ghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
|
|
||||||
map("n", "<leader>GhR", gs.reset_buffer, { desc = "Reset Buffer" })
|
|
||||||
map("n", "<leader>Ghp", gs.preview_hunk, { desc = "Preview Hunk" })
|
|
||||||
map("n", "<leader>Gbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
|
|
||||||
map("n", "<leader>Gbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
|
|
||||||
map("n", "<leader>Ghd", gs.diffthis, { desc = "Diff This" })
|
|
||||||
map("n", "<leader>GhD", function() gs.diffthis("~") end)
|
|
||||||
map("n", "<leader>Gtd", gs.toggle_deleted, { desc = "Toggle Deleted" })
|
|
||||||
|
|
||||||
-- Text object
|
|
||||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
|
|
||||||
end,
|
|
||||||
watch_gitdir = {
|
|
||||||
interval = 1000,
|
|
||||||
follow_files = true,
|
|
||||||
},
|
|
||||||
attach_to_untracked = true,
|
|
||||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
|
||||||
current_line_blame_opts = {
|
|
||||||
virt_text = true,
|
|
||||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
|
||||||
delay = 1000,
|
|
||||||
},
|
|
||||||
current_line_blame_formatter_opts = {
|
|
||||||
relative_time = false,
|
|
||||||
},
|
|
||||||
sign_priority = 6,
|
|
||||||
update_debounce = 100,
|
|
||||||
status_formatter = nil, -- Use default
|
|
||||||
max_file_length = 40000,
|
|
||||||
preview_config = {
|
|
||||||
-- Options passed to nvim_open_win
|
|
||||||
border = "single",
|
|
||||||
style = "minimal",
|
|
||||||
relative = "cursor",
|
|
||||||
row = 0,
|
|
||||||
col = 1,
|
|
||||||
},
|
|
||||||
yadm = {
|
|
||||||
enable = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
47
config/nvim/lua/plugins/lang-php.lua
Normal file
47
config/nvim/lua/plugins/lang-php.lua
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
vim.list_extend(opts.ensure_installed, {
|
||||||
|
"php",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
vim.list_extend(opts.ensure_installed, {
|
||||||
|
"phpactor",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"neovim/nvim-lspconfig",
|
||||||
|
opts = {
|
||||||
|
servers = {
|
||||||
|
phpactor = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
optional = true,
|
||||||
|
dependencies = {
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
if type(opts.ensure_installed) == "table" then
|
||||||
|
table.insert(opts.ensure_installed, "php-debug-adapter")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
opts = function()
|
||||||
|
local dap = require("dap")
|
||||||
|
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
|
||||||
|
dap.adapters.php = {
|
||||||
|
type = "executable",
|
||||||
|
command = "node",
|
||||||
|
args = { path .. "/extension/out/phpDebug.js" },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,250 +0,0 @@
|
|||||||
-- luacheck: globals vim
|
|
||||||
|
|
||||||
return {
|
|
||||||
-- plenary: full; complete; entire; absolute; unqualified.
|
|
||||||
-- All the lua functions I don't want to write twice.
|
|
||||||
-- https://github.com/nvim-lua/plenary.nvim
|
|
||||||
{ "nvim-lua/plenary.nvim", lazy = true },
|
|
||||||
|
|
||||||
-- lua `fork` of vim-web-devicons for neovim
|
|
||||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
|
||||||
{ "kyazdani42/nvim-web-devicons" },
|
|
||||||
|
|
||||||
-- The theme of choise, catppuccin
|
|
||||||
-- https://github.com/catppuccin/nvim
|
|
||||||
{
|
|
||||||
"catppuccin/nvim",
|
|
||||||
name = "catppuccin",
|
|
||||||
priority = 10000,
|
|
||||||
enabled = true,
|
|
||||||
lazy = false,
|
|
||||||
config = function() vim.cmd.colorscheme("catppuccin") end,
|
|
||||||
opts = {
|
|
||||||
flavour = "mocha",
|
|
||||||
transparent_background = true,
|
|
||||||
dim_inactive = {
|
|
||||||
enabled = true,
|
|
||||||
shade = "dark",
|
|
||||||
percentage = 0.15,
|
|
||||||
},
|
|
||||||
integrations = {
|
|
||||||
aerial = true,
|
|
||||||
barbecue = {
|
|
||||||
-- directory name is dimmed by default
|
|
||||||
dim_dirname = true,
|
|
||||||
bold_basename = true,
|
|
||||||
dim_context = false,
|
|
||||||
alt_background = false,
|
|
||||||
},
|
|
||||||
cmp = true,
|
|
||||||
dap = { enabled = true, enable_ui = true },
|
|
||||||
gitsigns = true,
|
|
||||||
harpoon = true,
|
|
||||||
indent_blankline = {
|
|
||||||
enabled = true,
|
|
||||||
colored_indent_levels = false,
|
|
||||||
},
|
|
||||||
mason = true,
|
|
||||||
neotree = true,
|
|
||||||
notify = true,
|
|
||||||
native_lsp = {
|
|
||||||
enabled = true,
|
|
||||||
virtual_text = {
|
|
||||||
errors = { "italic" },
|
|
||||||
hints = { "italic" },
|
|
||||||
warnings = { "italic" },
|
|
||||||
information = { "italic" },
|
|
||||||
},
|
|
||||||
underlines = {
|
|
||||||
errors = { "underline" },
|
|
||||||
hints = { "underline" },
|
|
||||||
warnings = { "underline" },
|
|
||||||
information = { "underline" },
|
|
||||||
},
|
|
||||||
inlay_hints = {
|
|
||||||
background = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
semantic_tokens = true,
|
|
||||||
symbols_outline = true,
|
|
||||||
telescope = {
|
|
||||||
enabled = true,
|
|
||||||
style = "catppuccin",
|
|
||||||
},
|
|
||||||
treesitter = true,
|
|
||||||
lsp_trouble = true,
|
|
||||||
which_key = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Notifications as a popup
|
|
||||||
-- https://github.com/rcarriga/nvim-notify
|
|
||||||
{
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>un",
|
|
||||||
function() require("notify").dismiss({ silent = true, pending = true }) end,
|
|
||||||
desc = "Dismiss all Notifications",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
timeout = 3000,
|
|
||||||
max_height = function() return math.floor(vim.o.lines * 0.75) end,
|
|
||||||
max_width = function() return math.floor(vim.o.columns * 0.75) end,
|
|
||||||
},
|
|
||||||
init = function() vim.notify = require("notify") end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- vscode-like pictograms for neovim lsp completion items
|
|
||||||
-- https://github.com/onsails/lspkind.nvim
|
|
||||||
{ "onsails/lspkind-nvim" },
|
|
||||||
|
|
||||||
-- Save and restore Vim views automatically
|
|
||||||
-- https://github.com/senderle/restoreview
|
|
||||||
{ "senderle/restoreview" },
|
|
||||||
|
|
||||||
-- Create key bindings that stick. WhichKey is a lua plugin for Neovim that
|
|
||||||
-- displays a popup with possible keybindings of the command you started typing.
|
|
||||||
-- https://github.com/folke/which-key.nvim
|
|
||||||
{
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
enabled = true,
|
|
||||||
lazy = false,
|
|
||||||
init = function()
|
|
||||||
vim.o.timeout = true
|
|
||||||
vim.o.timeoutlen = 300
|
|
||||||
end,
|
|
||||||
opts = {
|
|
||||||
plugins = { spelling = true, marks = true, registers = true },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Neovim plugin to improve the default vim.ui interfaces
|
|
||||||
-- https://github.com/stevearc/dressing.nvim
|
|
||||||
{
|
|
||||||
"stevearc/dressing.nvim",
|
|
||||||
lazy = true,
|
|
||||||
init = function()
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
vim.ui.select = function(...)
|
|
||||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
|
||||||
return vim.ui.select(...)
|
|
||||||
end
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
vim.ui.input = function(...)
|
|
||||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
|
||||||
return vim.ui.input(...)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Add/change/delete surrounding delimiter pairs with ease.
|
|
||||||
-- https://github.com/kylechui/nvim-surround
|
|
||||||
{
|
|
||||||
--[[
|
|
||||||
Old text Command New text
|
|
||||||
------------------------------------------------------------------
|
|
||||||
surround_words ysiw) (surround_words)
|
|
||||||
make strings ys$" "make strings"
|
|
||||||
[delete ar*ound me!] ds] delete around me!
|
|
||||||
"change quot*es" cs'" "change quotes"
|
|
||||||
<b>or tag* types</b> csth1<CR> <h1>or tag types</h1>
|
|
||||||
delete(functi*on calls) dsf function calls
|
|
||||||
]]
|
|
||||||
"kylechui/nvim-surround",
|
|
||||||
version = "*", -- Use for stability; omit to use `main` branch for the latest features
|
|
||||||
event = "VeryLazy",
|
|
||||||
config = function()
|
|
||||||
require("nvim-surround").setup()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- A tree like view for symbols in Neovim using the LSP.
|
|
||||||
-- https://github.com/simrat39/symbols-outline.nvim
|
|
||||||
{
|
|
||||||
"simrat39/symbols-outline.nvim",
|
|
||||||
cmd = "SymbolsOutline",
|
|
||||||
keys = { { "<leader>bs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
|
||||||
opts = {
|
|
||||||
-- add your options that should be passed to the setup() function here
|
|
||||||
position = "right",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Getting you where you want with the fewest keystrokes.
|
|
||||||
-- https://github.com/ThePrimeagen/harpoon
|
|
||||||
{ "ThePrimeagen/harpoon" },
|
|
||||||
|
|
||||||
-- A Neovim plugin hiding your colorcolumn when unneeded.
|
|
||||||
-- https://github.com/m4xshen/smartcolumn.nvim
|
|
||||||
{
|
|
||||||
"m4xshen/smartcolumn.nvim",
|
|
||||||
opts = {
|
|
||||||
colorcolumn = { "80", "100", "120" },
|
|
||||||
disabled_filetypes = { "help", "text", "markdown", "json", "lazy", "starter", "neo-tree" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Status information for LSP.
|
|
||||||
-- https://github.com/j-hui/fidget.nvim
|
|
||||||
{ "j-hui/fidget.nvim" },
|
|
||||||
|
|
||||||
-- Close buffer without messing up with the window.
|
|
||||||
-- https://github.com/famiu/bufdelete.nvim
|
|
||||||
{ "famiu/bufdelete.nvim" },
|
|
||||||
|
|
||||||
-- Delete multiple vim buffers based on different conditions
|
|
||||||
-- https://github.com/kazhala/close-buffers.nvim
|
|
||||||
{ "kazhala/close-buffers.nvim" },
|
|
||||||
|
|
||||||
-- JSONLS
|
|
||||||
-- https://github.com/b0o/schemastore.nvim
|
|
||||||
{ "b0o/schemastore.nvim" },
|
|
||||||
|
|
||||||
-- sleuth.vim: Heuristically set buffer options
|
|
||||||
-- https://github.com/tpope/vim-sleuth
|
|
||||||
{ "tpope/vim-sleuth" },
|
|
||||||
|
|
||||||
-- Neovim plugin for locking a buffer to a window
|
|
||||||
-- https://github.com/stevearc/stickybuf.nvim
|
|
||||||
{ "stevearc/stickybuf.nvim", opts = {} },
|
|
||||||
|
|
||||||
-- Describe the regexp under the cursor
|
|
||||||
-- https://github.com/bennypowers/nvim-regexplainer
|
|
||||||
{
|
|
||||||
"bennypowers/nvim-regexplainer",
|
|
||||||
requires = {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
-- automatically show the explainer when the cursor enters a regexp
|
|
||||||
auto = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Clarify and beautify your comments using boxes and lines.
|
|
||||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
|
||||||
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
|
||||||
|
|
||||||
-- Tabnine Client for Neovim
|
|
||||||
-- https://github.com/codota/tabnine-nvim
|
|
||||||
{
|
|
||||||
"codota/tabnine-nvim",
|
|
||||||
name = "tabnine",
|
|
||||||
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
|
|
||||||
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
|
|
||||||
event = "User",
|
|
||||||
opts = { accept_keymap = "<C-e>" },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
|
||||||
-- https://github.com/wakatime/vim-wakatime
|
|
||||||
{
|
|
||||||
"wakatime/vim-wakatime",
|
|
||||||
lazy = false,
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
return {
|
|
||||||
"echasnovski/mini.nvim",
|
|
||||||
version = "*",
|
|
||||||
config = function()
|
|
||||||
-- Common configuration presets
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-basics.md
|
|
||||||
require("mini.basics").setup()
|
|
||||||
|
|
||||||
-- Fast and flexible start screen
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-starter.md
|
|
||||||
local starter = require("mini.starter")
|
|
||||||
starter.setup({
|
|
||||||
header = table.concat({
|
|
||||||
" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
|
|
||||||
" ▄▀░░░░░░░░░░░░▄░░░░░░░▀▄ ",
|
|
||||||
" █░░▄░░░░▄░░░░░░░░░░░░░░█ ",
|
|
||||||
" █░░░░░░░░░░░░▄█▄▄░░▄░░░█ ▄▄▄ ",
|
|
||||||
"▄▄▄▄▄ █░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██ ",
|
|
||||||
"██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██ ",
|
|
||||||
" ▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██",
|
|
||||||
" ▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██",
|
|
||||||
" ▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██",
|
|
||||||
" ▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀ ",
|
|
||||||
" █▀▀█████████▀▀▀▀████████████▀ ",
|
|
||||||
" ████▀ ███▀ ▀███ ▀██▀ ",
|
|
||||||
}, "\n"),
|
|
||||||
evaluate_single = true,
|
|
||||||
items = {
|
|
||||||
starter.sections.telescope(),
|
|
||||||
starter.sections.builtin_actions(),
|
|
||||||
starter.sections.recent_files(5, true, true),
|
|
||||||
},
|
|
||||||
content_hooks = {
|
|
||||||
starter.gen_hook.adding_bullet(),
|
|
||||||
starter.gen_hook.aligning("center", "center"),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Miscellaneous useful functions
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-misc.md
|
|
||||||
require("mini.misc").setup()
|
|
||||||
|
|
||||||
-- Extend and create a/i textobjects
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-ai.md
|
|
||||||
require("mini.ai").setup()
|
|
||||||
|
|
||||||
-- Align text interactively
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-align.md
|
|
||||||
require("mini.align").setup()
|
|
||||||
|
|
||||||
-- Animate common Neovim actions
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-animate.md
|
|
||||||
require("mini.animate").setup()
|
|
||||||
|
|
||||||
-- Go forward/backward with square brackets
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md
|
|
||||||
require("mini.bracketed").setup()
|
|
||||||
|
|
||||||
-- Comment lines
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md
|
|
||||||
require("mini.comment").setup()
|
|
||||||
|
|
||||||
-- Autocompletion and signature help plugin
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md
|
|
||||||
require("mini.completion").setup()
|
|
||||||
|
|
||||||
-- Automatic highlighting of word under cursor
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-cursorword.md
|
|
||||||
require("mini.cursorword").setup()
|
|
||||||
|
|
||||||
-- Highlight patterns in text
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md
|
|
||||||
local hipatterns = require("mini.hipatterns")
|
|
||||||
hipatterns.setup({
|
|
||||||
highlighters = {
|
|
||||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
|
||||||
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
|
|
||||||
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
|
|
||||||
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
|
|
||||||
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },
|
|
||||||
|
|
||||||
-- Highlight hex color strings (`#rrggbb`) using that color
|
|
||||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Visualize and work with indent scope
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-indentscope.md
|
|
||||||
require("mini.indentscope").setup()
|
|
||||||
|
|
||||||
-- Jump to next/previous single character
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump.md
|
|
||||||
require("mini.jump").setup()
|
|
||||||
|
|
||||||
-- Jump within visible lines via iterative label filtering
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump2d.md
|
|
||||||
require("mini.jump2d").setup()
|
|
||||||
|
|
||||||
-- Window with buffer text overview, scrollbar, and highlights
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-map.md
|
|
||||||
require("mini.map").setup()
|
|
||||||
|
|
||||||
-- Move any selection in any direction
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md
|
|
||||||
require("mini.move").setup()
|
|
||||||
|
|
||||||
-- Text edit operators
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-operators.md
|
|
||||||
-- require("mini.operators").setup()
|
|
||||||
|
|
||||||
-- Minimal and fast autopairs
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
|
||||||
require("mini.pairs").setup()
|
|
||||||
|
|
||||||
-- Split and join arguments
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-splitjoin.md
|
|
||||||
require("mini.splitjoin").setup()
|
|
||||||
|
|
||||||
-- Minimal and fast statusline module with opinionated default look
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-statusline.md
|
|
||||||
require("mini.statusline").setup()
|
|
||||||
|
|
||||||
-- Minimal and fast tabline showing listed buffers
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-tabline.md
|
|
||||||
require("mini.tabline").setup()
|
|
||||||
|
|
||||||
-- Work with trailing whitespace
|
|
||||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-trailspace.md
|
|
||||||
require("mini.trailspace").setup()
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,463 +0,0 @@
|
|||||||
-- File-tree manager.
|
|
||||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
|
||||||
-- luacheck: globals vim
|
|
||||||
|
|
||||||
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
|
||||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
|
||||||
|
|
||||||
return {
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"kyazdani42/nvim-web-devicons",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
{
|
|
||||||
-- only needed if you want to use the commands with "_with_window_picker" suffix
|
|
||||||
"s1n7ax/nvim-window-picker",
|
|
||||||
config = function()
|
|
||||||
require("window-picker").setup({
|
|
||||||
autoselect_one = true,
|
|
||||||
include_current = false,
|
|
||||||
filter_rules = {
|
|
||||||
-- filter using buffer options
|
|
||||||
bo = {
|
|
||||||
-- if the file type is one of following, the window will be ignored
|
|
||||||
filetype = { "neo-tree", "neo-tree-popup", "notify" },
|
|
||||||
|
|
||||||
-- if the buffer type is one of following, the window will be ignored
|
|
||||||
buftype = { "terminal", "quickfix" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
other_win_hl_color = "#e35e4f",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
|
|
||||||
vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
|
|
||||||
vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" })
|
|
||||||
vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
|
|
||||||
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
|
||||||
|
|
||||||
require("neo-tree").setup({
|
|
||||||
-- Close Neo-tree if it is the last window left in the tab
|
|
||||||
close_if_last_window = true,
|
|
||||||
-- "double", "none", "rounded", "shadow", "single" or "solid"
|
|
||||||
popup_border_style = "rounded",
|
|
||||||
enable_git_status = true,
|
|
||||||
enable_diagnostics = true,
|
|
||||||
-- Enable normal mode for input dialogs.
|
|
||||||
enable_normal_mode_for_inputs = false,
|
|
||||||
|
|
||||||
-- when opening files, do not use windows containing these filetypes or buftypes
|
|
||||||
open_files_do_not_replace_types = { "terminal", "trouble", "qf" },
|
|
||||||
|
|
||||||
-- popup_border_style is for input and confirmation dialogs.
|
|
||||||
-- Configurtaion of floating window is done in the individual source sections.
|
|
||||||
-- "NC" is a special style that works well with NormalNC set
|
|
||||||
close_floats_on_escape_key = true,
|
|
||||||
default_source = "filesystem",
|
|
||||||
git_status_async = true,
|
|
||||||
-- "trace", "debug", "info", "warn", "error", "fatal"
|
|
||||||
log_level = "info",
|
|
||||||
-- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
|
|
||||||
log_to_file = false,
|
|
||||||
-- false = open files in top left window
|
|
||||||
open_files_in_last_window = true,
|
|
||||||
-- in ms, needed for containers to redraw right aligned and faded content
|
|
||||||
resize_timer_interval = 100,
|
|
||||||
-- used when sorting files and directories in the tree
|
|
||||||
sort_case_insensitive = true,
|
|
||||||
-- If false, inputs will use vim.ui.input() instead of custom floats.
|
|
||||||
use_popups_for_input = false,
|
|
||||||
-- use a custom function for sorting files and directories in the tree
|
|
||||||
sort_function = nil,
|
|
||||||
|
|
||||||
event_handlers = {
|
|
||||||
-- {
|
|
||||||
-- event = "before_render",
|
|
||||||
-- handler = function (state)
|
|
||||||
-- -- add something to the state that can be used by custom components
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- event = "file_opened",
|
|
||||||
-- handler = function(file_path)
|
|
||||||
-- --auto close
|
|
||||||
-- require("neo-tree").close_all()
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- event = "file_opened",
|
|
||||||
-- handler = function(file_path)
|
|
||||||
-- --clear search after opening a file
|
|
||||||
-- require("neo-tree.sources.filesystem").reset_search()
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- event = "file_renamed",
|
|
||||||
-- handler = function(args)
|
|
||||||
-- -- fix references to file
|
|
||||||
-- print(args.source, " renamed to ", args.destination)
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
-- {
|
|
||||||
-- event = "file_moved",
|
|
||||||
-- handler = function(args)
|
|
||||||
-- -- fix references to file
|
|
||||||
-- print(args.source, " moved to ", args.destination)
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
{
|
|
||||||
event = "neo_tree_buffer_enter",
|
|
||||||
handler = function()
|
|
||||||
vim.cmd("set winbar=")
|
|
||||||
vim.cmd("highlight CursorLine gui='bold'")
|
|
||||||
vim.cmd("highlight CursorColumn guibg=NONE")
|
|
||||||
--vim.cmd("set guicursor+=a:InvisibleCursor")
|
|
||||||
--vim.cmd("highlight InvisibleCursor gui=reverse blend=100")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
event = "neo_tree_buffer_leave",
|
|
||||||
handler = function()
|
|
||||||
--vim.cmd("set guicursor-=a:InvisibleCursor")
|
|
||||||
vim.cmd("highlight CursorLine gui=NONE")
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
default_component_configs = {
|
|
||||||
container = {
|
|
||||||
enable_character_fade = true,
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
indent_size = 2,
|
|
||||||
-- extra padding on left hand side
|
|
||||||
padding = 1,
|
|
||||||
-- indent guides
|
|
||||||
with_markers = true,
|
|
||||||
indent_marker = "│",
|
|
||||||
last_indent_marker = "└",
|
|
||||||
highlight = "NeoTreeIndentMarker",
|
|
||||||
-- expander config, needed for nesting files
|
|
||||||
-- if nil and file nesting is enabled, will enable expanders
|
|
||||||
with_expanders = true,
|
|
||||||
expander_collapsed = "",
|
|
||||||
expander_expanded = "",
|
|
||||||
expander_highlight = "NeoTreeExpander",
|
|
||||||
},
|
|
||||||
icon = {
|
|
||||||
folder_closed = "",
|
|
||||||
folder_open = "",
|
|
||||||
folder_empty = "-",
|
|
||||||
-- The next two settings are only a fallback,
|
|
||||||
-- if you use nvim-web-devicons and configure default icons there
|
|
||||||
-- then these will never be used.
|
|
||||||
default = "*",
|
|
||||||
highlight = "NeoTreeFileIcon",
|
|
||||||
},
|
|
||||||
modified = {
|
|
||||||
symbol = "[+]",
|
|
||||||
highlight = "NeoTreeModified",
|
|
||||||
},
|
|
||||||
name = {
|
|
||||||
trailing_slash = true,
|
|
||||||
use_git_status_colors = false,
|
|
||||||
highlight = "NeoTreeFileName",
|
|
||||||
},
|
|
||||||
git_status = {
|
|
||||||
symbols = {
|
|
||||||
-- Change type
|
|
||||||
added = "˖",
|
|
||||||
modified = "±",
|
|
||||||
deleted = "✕",
|
|
||||||
renamed = "↪",
|
|
||||||
-- Status type
|
|
||||||
untracked = "?",
|
|
||||||
ignored = "⍨",
|
|
||||||
unstaged = "·",
|
|
||||||
staged = "✓",
|
|
||||||
conflict = "",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
renderers = {
|
|
||||||
directory = {
|
|
||||||
{ "indent" },
|
|
||||||
{ "icon" },
|
|
||||||
{ "current_filter" },
|
|
||||||
{
|
|
||||||
"container",
|
|
||||||
width = "100%",
|
|
||||||
right_padding = 0,
|
|
||||||
--max_width = 60,
|
|
||||||
content = {
|
|
||||||
{ "name", zindex = 10 },
|
|
||||||
-- {
|
|
||||||
-- "symlink_target",
|
|
||||||
-- zindex = 10,
|
|
||||||
-- highlight = "NeoTreeSymbolicLinkTarget",
|
|
||||||
-- },
|
|
||||||
{ "clipboard", zindex = 10 },
|
|
||||||
{ "diagnostics", errors_only = true, zindex = 20, align = "right" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
file = {
|
|
||||||
{ "indent" },
|
|
||||||
{ "icon" },
|
|
||||||
{
|
|
||||||
"container",
|
|
||||||
width = "100%",
|
|
||||||
right_padding = 0,
|
|
||||||
--max_width = 60,
|
|
||||||
content = {
|
|
||||||
{
|
|
||||||
"name",
|
|
||||||
use_git_status_colors = false,
|
|
||||||
zindex = 10,
|
|
||||||
},
|
|
||||||
-- {
|
|
||||||
-- "symlink_target",
|
|
||||||
-- zindex = 10,
|
|
||||||
-- highlight = "NeoTreeSymbolicLinkTarget",
|
|
||||||
-- },
|
|
||||||
{ "clipboard", zindex = 10 },
|
|
||||||
{ "bufnr", zindex = 10 },
|
|
||||||
-- { "harpoon_index" }, --> This is what actually adds the component in where you want it
|
|
||||||
{ "modified", zindex = 20, align = "right" },
|
|
||||||
{ "diagnostics", zindex = 20, align = "right" },
|
|
||||||
{ "git_status", zindex = 20, align = "right" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- A list of functions, each representing a global custom command
|
|
||||||
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
|
|
||||||
-- see `:h neo-tree-custom-commands-global`
|
|
||||||
commands = {},
|
|
||||||
window = {
|
|
||||||
-- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
|
|
||||||
-- possible options. These can also be functions that return these options.
|
|
||||||
|
|
||||||
-- left, right, float, current
|
|
||||||
position = "left",
|
|
||||||
-- applies to left and right positions
|
|
||||||
width = 40,
|
|
||||||
mapping_options = {
|
|
||||||
noremap = true,
|
|
||||||
nowait = true,
|
|
||||||
},
|
|
||||||
-- settings that apply to float position only
|
|
||||||
popup = {
|
|
||||||
size = {
|
|
||||||
height = "80%",
|
|
||||||
width = "50%",
|
|
||||||
},
|
|
||||||
position = "50%", -- 50% means center it
|
|
||||||
-- you can also specify border here, if you want a different setting from
|
|
||||||
-- the global popup_border_style.
|
|
||||||
},
|
|
||||||
-- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands.
|
|
||||||
-- You can also create your own commands by providing a function instead of a string.
|
|
||||||
mappings = {
|
|
||||||
["<space>"] = {
|
|
||||||
"toggle_node",
|
|
||||||
-- disable `nowait` if you have existing combos
|
|
||||||
-- starting with this char that you want to use
|
|
||||||
nowait = false,
|
|
||||||
},
|
|
||||||
["<2-LeftMouse>"] = "open",
|
|
||||||
["<cr>"] = "open",
|
|
||||||
-- close preview or floating neo-tree window
|
|
||||||
["<esc>"] = "cancel",
|
|
||||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
|
||||||
["l"] = "focus_preview",
|
|
||||||
["S"] = "open_split",
|
|
||||||
["s"] = "open_vsplit",
|
|
||||||
-- ["S"] = "split_with_window_picker",
|
|
||||||
-- ["s"] = "vsplit_with_window_picker",
|
|
||||||
["t"] = "open_tabnew",
|
|
||||||
-- ["<cr>"] = "open_drop",
|
|
||||||
-- ["t"] = "open_tab_drop",
|
|
||||||
["w"] = "open_with_window_picker",
|
|
||||||
-- -- enter preview mode, which shows the current node without focusing
|
|
||||||
--["P"] = "toggle_preview",
|
|
||||||
["C"] = "close_node",
|
|
||||||
-- ['C'] = 'close_all_subnodes',
|
|
||||||
["z"] = "close_all_nodes",
|
|
||||||
--["Z"] = "expand_all_nodes",
|
|
||||||
["a"] = {
|
|
||||||
"add",
|
|
||||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc).
|
|
||||||
-- see `:h neo-tree-file-actions` for details
|
|
||||||
-- some commands may take optional config options,
|
|
||||||
-- see `:h neo-tree-mappings` for details
|
|
||||||
config = {
|
|
||||||
-- "none", "relative", "absolute"
|
|
||||||
show_path = "relative",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
-- also accepts the optional config.show_path option like "add".
|
|
||||||
-- this also supports BASH style brace expansion.
|
|
||||||
["A"] = "add_directory",
|
|
||||||
["d"] = "delete",
|
|
||||||
["r"] = "rename",
|
|
||||||
["y"] = "copy_to_clipboard",
|
|
||||||
["x"] = "cut_to_clipboard",
|
|
||||||
["p"] = "paste_from_clipboard",
|
|
||||||
-- takes text input for destination, also accepts the optional config.show_path option like "add":
|
|
||||||
-- ["c"] = {
|
|
||||||
-- "copy",
|
|
||||||
-- config = {
|
|
||||||
-- show_path = "none" -- "none", "relative", "absolute"
|
|
||||||
-- }
|
|
||||||
--}
|
|
||||||
["c"] = "copy",
|
|
||||||
-- takes text input for destination, also accepts the optional config.show_path option like "add".
|
|
||||||
["m"] = "move",
|
|
||||||
["q"] = "close_window",
|
|
||||||
["R"] = "refresh",
|
|
||||||
["?"] = "show_help",
|
|
||||||
["<"] = "prev_source",
|
|
||||||
[">"] = "next_source",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
nesting_rules = {},
|
|
||||||
filesystem = {
|
|
||||||
-- Add a custom command or override a global one using the same function name
|
|
||||||
commands = {},
|
|
||||||
components = {
|
|
||||||
harpoon_index = function(config, node, _)
|
|
||||||
local Marked = require("harpoon.mark")
|
|
||||||
local path = node:get_id()
|
|
||||||
local succuss, index = pcall(Marked.get_index_of, path)
|
|
||||||
if succuss and index and index > 0 then
|
|
||||||
return {
|
|
||||||
text = string.format(" ⥤ %d", index), -- <-- Add your favorite harpoon like arrow here
|
|
||||||
highlight = config.highlight or "NeoTreeDirectoryIcon",
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return {}
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
filtered_items = {
|
|
||||||
-- when true, they will just be displayed differently than normal items
|
|
||||||
visible = false,
|
|
||||||
hide_dotfiles = false,
|
|
||||||
hide_gitignored = false,
|
|
||||||
-- only works on Windows for hidden files/directories
|
|
||||||
hide_hidden = true,
|
|
||||||
hide_by_name = {
|
|
||||||
".git",
|
|
||||||
".DS_Store",
|
|
||||||
"thumbs.db",
|
|
||||||
".idea",
|
|
||||||
".mypy_cache",
|
|
||||||
"node_modules",
|
|
||||||
},
|
|
||||||
-- uses glob style patterns
|
|
||||||
hide_by_pattern = {
|
|
||||||
--"*.meta",
|
|
||||||
--"*/src/*/tsconfig.json",
|
|
||||||
"*-cache",
|
|
||||||
"*.cache",
|
|
||||||
".null-ls_*",
|
|
||||||
},
|
|
||||||
never_show = { -- remains hidden even if visible is toggled to true
|
|
||||||
".DS_Store",
|
|
||||||
"thumbs.db",
|
|
||||||
},
|
|
||||||
always_show = { -- remains visible even if other settings would normally hide it
|
|
||||||
".gitignore",
|
|
||||||
".gitkeep",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
find_by_full_path_words = true,
|
|
||||||
-- when true, empty folders will be grouped together
|
|
||||||
group_empty_dirs = false,
|
|
||||||
-- true creates a 2-way binding between vim's cwd and neo-tree's root
|
|
||||||
bind_to_cwd = false,
|
|
||||||
-- max number of search results when using filters
|
|
||||||
search_limit = 50,
|
|
||||||
follow_current_file = {
|
|
||||||
-- This will find and focus the file in the active buffer every time
|
|
||||||
-- the current file is changed while the tree is open.
|
|
||||||
enabled = false,
|
|
||||||
-- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
|
||||||
leave_dirs_open = false,
|
|
||||||
},
|
|
||||||
-- netrw disabled, opening a directory opens neo-tree
|
|
||||||
-- in whatever position is specified in window.position
|
|
||||||
-- "open_current", -- netrw disabled, opening a directory opens within the
|
|
||||||
-- window like netrw would, regardless of window.position
|
|
||||||
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
|
|
||||||
hijack_netrw_behavior = "open_default",
|
|
||||||
-- This will use the OS level file watchers to detect changes
|
|
||||||
-- instead of relying on nvim autocmd events.
|
|
||||||
use_libuv_file_watcher = true,
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["."] = "set_root",
|
|
||||||
["/"] = "fuzzy_finder",
|
|
||||||
-- fuzzy sorting using the fzy algorithm
|
|
||||||
["#"] = "fuzzy_sorter",
|
|
||||||
["<bs>"] = "navigate_up",
|
|
||||||
["<c-up>"] = "navigate_up",
|
|
||||||
["<c-x>"] = "clear_filter",
|
|
||||||
["D"] = "fuzzy_finder_directory",
|
|
||||||
["f"] = "filter_on_submit",
|
|
||||||
["gn"] = "next_git_modified",
|
|
||||||
["gp"] = "prev_git_modified",
|
|
||||||
["H"] = "toggle_hidden",
|
|
||||||
},
|
|
||||||
-- define keymaps for filter popup window in fuzzy_finder_mode
|
|
||||||
fuzzy_finder_mappings = {
|
|
||||||
["<down>"] = "move_cursor_down",
|
|
||||||
["<C-n>"] = "move_cursor_down",
|
|
||||||
["<up>"] = "move_cursor_up",
|
|
||||||
["<C-p>"] = "move_cursor_up",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
buffers = {
|
|
||||||
follow_current_file = {
|
|
||||||
-- This will find and focus the file in the active buffer every time
|
|
||||||
-- the current file is changed while the tree is open.
|
|
||||||
enabled = true,
|
|
||||||
-- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
|
||||||
leave_dirs_open = true,
|
|
||||||
},
|
|
||||||
-- when true, empty folders will be grouped together
|
|
||||||
group_empty_dirs = true,
|
|
||||||
show_unloaded = true,
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["bd"] = "buffer_delete",
|
|
||||||
["<bs>"] = "navigate_up",
|
|
||||||
["."] = "set_root",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
git_status = {
|
|
||||||
window = {
|
|
||||||
position = "float",
|
|
||||||
mappings = {
|
|
||||||
["A"] = "git_add_all",
|
|
||||||
["gu"] = "git_unstage_file",
|
|
||||||
["ga"] = "git_add_file",
|
|
||||||
["gr"] = "git_revert_file",
|
|
||||||
["gc"] = "git_commit",
|
|
||||||
["gp"] = "git_push",
|
|
||||||
["gg"] = "git_commit_and_push",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
-- A better annotation generator. Supports multiple languages and annotation conventions.
|
|
||||||
-- https://github.com/danymat/neogen
|
|
||||||
return {
|
|
||||||
"danymat/neogen",
|
|
||||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
|
||||||
version = "*",
|
|
||||||
cmd = "Neogen",
|
|
||||||
opts = {
|
|
||||||
snippet_engine = "luasnip",
|
|
||||||
languages = {
|
|
||||||
lua = { template = { annotation_convention = "ldoc" } },
|
|
||||||
typescript = { template = { annotation_convention = "tsdoc" } },
|
|
||||||
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ "<leader>aa", function() require("neogen").generate({ type = "current" }) end, desc = "Current" },
|
|
||||||
{ "<leader>ac", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
|
|
||||||
{ "<leader>af", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
|
|
||||||
{ "<leader>at", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
|
|
||||||
{ "<leader>aF", function() require("neogen").generate({ type = "file" }) end, desc = "File" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
return {
|
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
|
||||||
config = function()
|
|
||||||
local null_ls = require("null-ls")
|
|
||||||
-- Check supported formatters and linters
|
|
||||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
|
||||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
|
||||||
|
|
||||||
-- Register any number of sources simultaneously
|
|
||||||
null_ls.setup({
|
|
||||||
-- filetypes = { "markdown", "text" },
|
|
||||||
sources = {
|
|
||||||
|
|
||||||
-- Code Actions
|
|
||||||
null_ls.builtins.code_actions.eslint,
|
|
||||||
null_ls.builtins.code_actions.gitsigns,
|
|
||||||
null_ls.builtins.code_actions.refactoring,
|
|
||||||
null_ls.builtins.code_actions.shellcheck,
|
|
||||||
|
|
||||||
-- Diagnostics
|
|
||||||
null_ls.builtins.diagnostics.actionlint,
|
|
||||||
null_ls.builtins.diagnostics.alex,
|
|
||||||
null_ls.builtins.diagnostics.ansiblelint,
|
|
||||||
null_ls.builtins.diagnostics.dotenv_linter,
|
|
||||||
null_ls.builtins.diagnostics.editorconfig_checker,
|
|
||||||
null_ls.builtins.diagnostics.eslint,
|
|
||||||
null_ls.builtins.diagnostics.jsonlint,
|
|
||||||
null_ls.builtins.diagnostics.luacheck,
|
|
||||||
null_ls.builtins.diagnostics.php,
|
|
||||||
null_ls.builtins.diagnostics.phpcs,
|
|
||||||
null_ls.builtins.diagnostics.phpstan,
|
|
||||||
null_ls.builtins.diagnostics.psalm,
|
|
||||||
null_ls.builtins.diagnostics.semgrep,
|
|
||||||
null_ls.builtins.diagnostics.shellcheck,
|
|
||||||
null_ls.builtins.diagnostics.stylelint,
|
|
||||||
null_ls.builtins.diagnostics.tfsec,
|
|
||||||
null_ls.builtins.diagnostics.trail_space,
|
|
||||||
null_ls.builtins.diagnostics.tsc,
|
|
||||||
null_ls.builtins.diagnostics.write_good,
|
|
||||||
null_ls.builtins.diagnostics.zsh,
|
|
||||||
|
|
||||||
-- Formatting
|
|
||||||
null_ls.builtins.formatting.clang_format,
|
|
||||||
null_ls.builtins.formatting.fixjson,
|
|
||||||
null_ls.builtins.formatting.isort,
|
|
||||||
null_ls.builtins.formatting.jq,
|
|
||||||
null_ls.builtins.formatting.phpcsfixer,
|
|
||||||
null_ls.builtins.formatting.prettier,
|
|
||||||
null_ls.builtins.formatting.rome,
|
|
||||||
null_ls.builtins.formatting.shfmt.with({
|
|
||||||
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" },
|
|
||||||
}),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,259 +0,0 @@
|
|||||||
-- luacheck: globals vim
|
|
||||||
-- Completion menu.
|
|
||||||
|
|
||||||
-- Icons to display.
|
|
||||||
local icons = {
|
|
||||||
Text = " ",
|
|
||||||
Method = " ",
|
|
||||||
Function = " ",
|
|
||||||
Constructor = " ",
|
|
||||||
Field = " ﰠ ",
|
|
||||||
Variable = " ",
|
|
||||||
Class = " ﴯ ",
|
|
||||||
Interface = " ",
|
|
||||||
Module = " ",
|
|
||||||
Property = " ﰠ ",
|
|
||||||
Unit = " 塞 ",
|
|
||||||
Value = " ",
|
|
||||||
Enum = " ",
|
|
||||||
Keyword = " ",
|
|
||||||
Snippet = " ",
|
|
||||||
Color = " ",
|
|
||||||
File = " ",
|
|
||||||
Reference = " ",
|
|
||||||
Folder = " ",
|
|
||||||
EnumMember = " ",
|
|
||||||
Constant = " ",
|
|
||||||
Struct = " פּ ",
|
|
||||||
Event = " ",
|
|
||||||
Operator = " ",
|
|
||||||
TypeParameter = " T ",
|
|
||||||
Book = " ",
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Load loaders from VSCode.
|
|
||||||
--require("luasnip.loaders.from_vscode").lazy_load({
|
|
||||||
-- paths = { "~/.local/share/lazy/friendly-snippets" }
|
|
||||||
--})
|
|
||||||
|
|
||||||
return {
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
dependencies = {
|
|
||||||
{ "octaltree/cmp-look" },
|
|
||||||
--
|
|
||||||
{ "hrsh7th/cmp-nvim-lsp" },
|
|
||||||
--
|
|
||||||
{ "hrsh7th/cmp-nvim-lua" },
|
|
||||||
-- Buffer words.
|
|
||||||
{ "hrsh7th/cmp-buffer" },
|
|
||||||
-- Path autocompletion.
|
|
||||||
{ "hrsh7th/cmp-path" },
|
|
||||||
--
|
|
||||||
{ "hrsh7th/cmp-cmdline" },
|
|
||||||
--
|
|
||||||
{ "saadparwaiz1/cmp_luasnip" },
|
|
||||||
--
|
|
||||||
{ "hrsh7th/vim-vsnip" },
|
|
||||||
--
|
|
||||||
{ "rafamadriz/friendly-snippets" },
|
|
||||||
-- Snippets for lua.
|
|
||||||
{ "L3MON4D3/LuaSnip" }, --config = "luasnip" },
|
|
||||||
--
|
|
||||||
{ "hrsh7th/cmp-vsnip" },
|
|
||||||
--
|
|
||||||
-- Signature for functions.
|
|
||||||
--{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
|
|
||||||
--
|
|
||||||
{ "hrsh7th/vim-vsnip-integ" },
|
|
||||||
-- Make arimathetic operations.
|
|
||||||
{ "hrsh7th/cmp-calc" },
|
|
||||||
-- Emoji.
|
|
||||||
{ "hrsh7th/cmp-emoji" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local luasnip = require("luasnip")
|
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
luasnip.config.setup({})
|
|
||||||
|
|
||||||
-- Load specialities from LuaSnip.
|
|
||||||
-- Set it with VSCode-like mode.
|
|
||||||
luasnip.config.set_config({
|
|
||||||
history = true,
|
|
||||||
updateevents = "TextChanged,TextChangedI",
|
|
||||||
})
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
|
|
||||||
-- Window documentation, for defining its dimensions.
|
|
||||||
window = {
|
|
||||||
-- Max 10 items on display for documentation.
|
|
||||||
max_height = 10,
|
|
||||||
completion = {
|
|
||||||
side_padding = 0,
|
|
||||||
col_offset = 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Snippet support.
|
|
||||||
snippet = {
|
|
||||||
expand = function(args) require("luasnip").lsp_expand(args.body) end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- How the match works based on the input.
|
|
||||||
matching = {
|
|
||||||
-- Whethever we allow fuzzy matching or not.
|
|
||||||
disallow_fuzzy_matching = false,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Mapping each keybind.
|
|
||||||
mapping = {
|
|
||||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
|
||||||
|
|
||||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.close(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
}),
|
|
||||||
["<Tab>"] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif require("luasnip").expand_or_jumpable() then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-expand-or-jump", true, true, true), "")
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
["<S-Tab>"] = function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif require("luasnip").jumpable(-1) then
|
|
||||||
vim.fn.feedkeys(vim.api.nvim_replace_termcodes("<Plug>luasnip-jump-prev", true, true, true), "")
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Formatting the menu display.
|
|
||||||
formatting = {
|
|
||||||
expandable_indicator = true,
|
|
||||||
fields = { "kind", "abbr", "menu" },
|
|
||||||
format = function(_, vim_item)
|
|
||||||
vim_item.menu = vim_item.kind
|
|
||||||
|
|
||||||
-- load lspkind icons
|
|
||||||
--vim_item.kind = string.format(
|
|
||||||
-- "%s %s",
|
|
||||||
-- icons[vim_item.kind],
|
|
||||||
-- vim_item.kind
|
|
||||||
--)
|
|
||||||
vim_item.kind = icons[vim_item.kind]
|
|
||||||
|
|
||||||
--vim_item.menu = string.format(
|
|
||||||
-- "%s %s",
|
|
||||||
-- ({
|
|
||||||
-- nvim_lsp = "力",
|
|
||||||
-- nvim_lua = "",
|
|
||||||
-- luasnip = icons.Color,
|
|
||||||
-- path = "",
|
|
||||||
-- buffer = " ",
|
|
||||||
-- look = icons.Book,
|
|
||||||
-- emoji = "😎",
|
|
||||||
-- })[entry.source.name],
|
|
||||||
-- name
|
|
||||||
--)
|
|
||||||
|
|
||||||
return vim_item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Experimental features.
|
|
||||||
experimental = {
|
|
||||||
|
|
||||||
-- It will type a shadow text of the intended completion.
|
|
||||||
ghost_text = { hl_group = "Comment" },
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Sources for completion, since it is modular; cmp accepts
|
|
||||||
-- Multiple modules.
|
|
||||||
sources = {
|
|
||||||
|
|
||||||
-- Simple signature, normally outside an object.
|
|
||||||
--{ name = 'nvim_lsp_signature_help', priority = 15 },
|
|
||||||
|
|
||||||
-- More snippets.
|
|
||||||
-- For all types of languages.
|
|
||||||
{
|
|
||||||
name = "friendly-snippets",
|
|
||||||
priority = 11,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- For the Nvim lua specifics commands.
|
|
||||||
{
|
|
||||||
name = "nvim_lua",
|
|
||||||
priority = 8,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Support with the current active LSP.
|
|
||||||
-- Anything that LSP supports and can share with CMP.
|
|
||||||
{
|
|
||||||
name = "nvim_lsp",
|
|
||||||
priority = 11,
|
|
||||||
max_item_count = 10,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Snippets in general to facilitate life.
|
|
||||||
-- Type a often typed methods, like for in C.
|
|
||||||
-- { name = "luasnip", priority = 6 },
|
|
||||||
|
|
||||||
-- Show path based on the backslashes.
|
|
||||||
-- Type any path, relatively or globally.
|
|
||||||
{
|
|
||||||
name = "path",
|
|
||||||
priority = 9,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Words from buffer.
|
|
||||||
{
|
|
||||||
name = "buffer",
|
|
||||||
priority = 4,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Max item count.
|
|
||||||
|
|
||||||
-- Dictionary for words.
|
|
||||||
-- Type any word that is on the /usr/share/dict/words
|
|
||||||
--{
|
|
||||||
-- name = 'look',
|
|
||||||
-- priority = 1,
|
|
||||||
-- keyword_length = 3,
|
|
||||||
-- max_item_count = 4,
|
|
||||||
-- option = {
|
|
||||||
-- convert_case = true,
|
|
||||||
-- loud = true,
|
|
||||||
-- dict = '/usr/share/dict/words'
|
|
||||||
-- },
|
|
||||||
--},
|
|
||||||
|
|
||||||
-- Emoji.
|
|
||||||
-- Activate with ":".
|
|
||||||
{ name = "emoji", priority = 2, option = { insert = true } },
|
|
||||||
|
|
||||||
-- Calculate expressions based on the current line.
|
|
||||||
-- Activate with something like "4 + 5".
|
|
||||||
{
|
|
||||||
name = "calc",
|
|
||||||
priority = 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
--
|
|
||||||
-- Shows how to use the DAP plugin to debug your code.
|
|
||||||
--
|
|
||||||
-- https://github.com/mfussenegger/nvim-dap
|
|
||||||
-- luacheck: globals vim
|
|
||||||
return {
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
dependencies = {
|
|
||||||
-- Creates a beautiful debugger UI
|
|
||||||
"rcarriga/nvim-dap-ui",
|
|
||||||
|
|
||||||
-- Installs the debug adapters for you
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"jay-babu/mason-nvim-dap.nvim",
|
|
||||||
|
|
||||||
-- Add your own debuggers here
|
|
||||||
"leoluz/nvim-dap-go",
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local dap = require("dap")
|
|
||||||
local dapui = require("dapui")
|
|
||||||
|
|
||||||
require("mason-nvim-dap").setup({
|
|
||||||
-- Makes a best effort to setup the various debuggers with
|
|
||||||
-- reasonable debug configurations
|
|
||||||
automatic_setup = true,
|
|
||||||
automatic_installation = true,
|
|
||||||
|
|
||||||
-- You can provide additional configuration to the handlers,
|
|
||||||
-- see mason-nvim-dap README for more information
|
|
||||||
-- handlers = {},
|
|
||||||
|
|
||||||
-- You'll need to check that you have the required things installed
|
|
||||||
-- online, please don't ask me how to install them :)
|
|
||||||
ensure_installed = {
|
|
||||||
-- Update this to ensure that you have the debuggers for the langs you want
|
|
||||||
"bash",
|
|
||||||
"delve",
|
|
||||||
"js",
|
|
||||||
"lua",
|
|
||||||
"php",
|
|
||||||
"python",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Basic debugging keymaps, feel free to change to your liking!
|
|
||||||
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Debug: Start/Continue" })
|
|
||||||
vim.keymap.set("n", "<F1>", dap.step_into, { desc = "Debug: Step Into" })
|
|
||||||
vim.keymap.set("n", "<F2>", dap.step_over, { desc = "Debug: Step Over" })
|
|
||||||
vim.keymap.set("n", "<F3>", dap.step_out, { desc = "Debug: Step Out" })
|
|
||||||
vim.keymap.set("n", "<leader>Db", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
|
|
||||||
vim.keymap.set(
|
|
||||||
"n",
|
|
||||||
"<leader>DB",
|
|
||||||
function() dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) end,
|
|
||||||
{ desc = "Debug: Set Breakpoint" }
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Dap UI setup
|
|
||||||
-- For more information, see |:help nvim-dap-ui|
|
|
||||||
dapui.setup({
|
|
||||||
-- Set icons to characters that are more likely to work in every terminal.
|
|
||||||
-- Feel free to remove or use ones that you like more! :)
|
|
||||||
-- Don't feel like these are good choices.
|
|
||||||
icons = { expanded = "▾", collapsed = "▸", current_frame = "*" },
|
|
||||||
controls = {
|
|
||||||
icons = {
|
|
||||||
pause = "⏸",
|
|
||||||
play = "▶",
|
|
||||||
step_into = "⏎",
|
|
||||||
step_over = "⏭",
|
|
||||||
step_out = "⏮",
|
|
||||||
step_back = "b",
|
|
||||||
run_last = "▶▶",
|
|
||||||
terminate = "⏹",
|
|
||||||
disconnect = "⏏",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
|
||||||
vim.keymap.set("n", "<F7>", dapui.toggle, { desc = "Debug: See last session result." })
|
|
||||||
|
|
||||||
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
|
|
||||||
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
|
|
||||||
dap.listeners.before.event_exited["dapui_config"] = dapui.close
|
|
||||||
|
|
||||||
-- Install golang specific config
|
|
||||||
require("dap-go").setup()
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,82 +1,20 @@
|
|||||||
return {
|
return {
|
||||||
-- LSP auto-complete.
|
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
opts = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
servers = {
|
||||||
{ "williamboman/mason.nvim", config = true },
|
eslint = {},
|
||||||
{ "williamboman/mason-lspconfig.nvim" },
|
tflint = {},
|
||||||
|
},
|
||||||
-- Useful status updates for LSP
|
setup = {
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
eslint = function()
|
||||||
-- NOTE: using tag legacy, fidget is being re-written completely
|
require("lazyvim.util").on_attach(function(client)
|
||||||
{ "j-hui/fidget.nvim", event = "LspAttach", tag = "legacy", opts = {} },
|
if client.name == "eslint" then
|
||||||
|
client.server_capabilities.documentFormattingProvider = true
|
||||||
-- Additional lua configuration, makes nvim stuff amazing!
|
elseif client.name == "tsserver" then
|
||||||
{ "folke/neodev.nvim" },
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
},
|
end
|
||||||
init = function()
|
end)
|
||||||
-- disable lsp watcher. Too slow on linux
|
|
||||||
local ok, wf = pcall(require, "vim.lsp._watchfiles")
|
|
||||||
if ok then wf._watchfunc = function()
|
|
||||||
return function() end
|
|
||||||
end end
|
|
||||||
end,
|
|
||||||
config = function()
|
|
||||||
-- Switch for controlling whether you want autoformatting.
|
|
||||||
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
|
||||||
local format_is_enabled = true
|
|
||||||
vim.api.nvim_create_user_command("KickstartFormatToggle", function()
|
|
||||||
format_is_enabled = not format_is_enabled
|
|
||||||
print("Setting autoformatting to: " .. tostring(format_is_enabled))
|
|
||||||
end, {})
|
|
||||||
|
|
||||||
-- Create an augroup that is used for managing our formatting autocmds.
|
|
||||||
-- We need one augroup per client to make sure that multiple clients
|
|
||||||
-- can attach to the same buffer without interfering with each other.
|
|
||||||
local _augroups = {}
|
|
||||||
local get_augroup = function(client)
|
|
||||||
if not _augroups[client.id] then
|
|
||||||
local group_name = "kickstart-lsp-format-" .. client.name
|
|
||||||
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
|
|
||||||
_augroups[client.id] = id
|
|
||||||
end
|
|
||||||
|
|
||||||
return _augroups[client.id]
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Whenever an LSP attaches to a buffer, we will run this function.
|
|
||||||
--
|
|
||||||
-- See `:help LspAttach` for more information about this autocmd event.
|
|
||||||
vim.api.nvim_create_autocmd("LspAttach", {
|
|
||||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach-format", { clear = true }),
|
|
||||||
-- This is where we attach the autoformatting for reasonable clients
|
|
||||||
callback = function(args)
|
|
||||||
local client_id = args.data.client_id
|
|
||||||
local client = vim.lsp.get_client_by_id(client_id)
|
|
||||||
local bufnr = args.buf
|
|
||||||
|
|
||||||
-- Only attach to clients that support document formatting
|
|
||||||
if not client.server_capabilities.documentFormattingProvider then return end
|
|
||||||
|
|
||||||
-- Tsserver usually works poorly. Sorry you work with bad languages
|
|
||||||
-- You can remove this line if you know what you're doing :)
|
|
||||||
if client.name == "tsserver" then return end
|
|
||||||
|
|
||||||
-- Create an autocmd that will run *before* we save the buffer.
|
|
||||||
-- Run the formatting command for the LSP that has just attached.
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
group = get_augroup(client),
|
|
||||||
buffer = bufnr,
|
|
||||||
callback = function()
|
|
||||||
if not format_is_enabled then return end
|
|
||||||
|
|
||||||
vim.lsp.buf.format({
|
|
||||||
async = false,
|
|
||||||
filter = function(c) return c.id == client.id end,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
})
|
},
|
||||||
end,
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,133 +0,0 @@
|
|||||||
-- Nvim Treesitter configurations and abstraction layer
|
|
||||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
|
||||||
-- luacheck: globals vim
|
|
||||||
return {
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
build = ":TSUpdate",
|
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
|
||||||
sync_install = false,
|
|
||||||
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
|
||||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
-- List of parsers to ignore installing (or "all")
|
|
||||||
ignore_install = {},
|
|
||||||
|
|
||||||
modules = {},
|
|
||||||
|
|
||||||
-- Add languages to be installed here that you want installed for treesitter
|
|
||||||
ensure_installed = {
|
|
||||||
"bash",
|
|
||||||
"c",
|
|
||||||
"cmake",
|
|
||||||
"comment",
|
|
||||||
"diff",
|
|
||||||
"dockerfile",
|
|
||||||
"gitignore",
|
|
||||||
"go",
|
|
||||||
"graphql",
|
|
||||||
"html",
|
|
||||||
"javascript",
|
|
||||||
"json",
|
|
||||||
"json5",
|
|
||||||
"latex",
|
|
||||||
"lua",
|
|
||||||
"markdown",
|
|
||||||
"php",
|
|
||||||
"phpdoc",
|
|
||||||
"python",
|
|
||||||
"regex",
|
|
||||||
"scss",
|
|
||||||
"terraform",
|
|
||||||
"todotxt",
|
|
||||||
"toml",
|
|
||||||
"tsx",
|
|
||||||
"typescript",
|
|
||||||
"vim",
|
|
||||||
"vimdoc",
|
|
||||||
"vue",
|
|
||||||
"yaml",
|
|
||||||
},
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
disable = {},
|
|
||||||
--injections = {
|
|
||||||
-- python = {
|
|
||||||
-- docstrings: "markdown",
|
|
||||||
-- },
|
|
||||||
--}
|
|
||||||
},
|
|
||||||
indent = { enable = true },
|
|
||||||
incremental_selection = {
|
|
||||||
enable = true,
|
|
||||||
keymaps = {
|
|
||||||
init_selection = "<c-space>",
|
|
||||||
node_incremental = "<c-space>",
|
|
||||||
scope_incremental = "<c-s>",
|
|
||||||
node_decremental = "<M-space>",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
textobjects = {
|
|
||||||
select = {
|
|
||||||
enable = true,
|
|
||||||
-- Automatically jump forward to textobj, similar to targets.vim
|
|
||||||
lookahead = true,
|
|
||||||
keymaps = {
|
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
|
||||||
["aa"] = "@parameter.outer",
|
|
||||||
["ia"] = "@parameter.inner",
|
|
||||||
["af"] = "@function.outer",
|
|
||||||
["if"] = "@function.inner",
|
|
||||||
["ac"] = "@class.outer",
|
|
||||||
["ic"] = "@class.inner",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
move = {
|
|
||||||
enable = true,
|
|
||||||
-- whether to set jumps in the jumplist
|
|
||||||
set_jumps = true,
|
|
||||||
goto_next_start = {
|
|
||||||
["]m"] = "@function.outer",
|
|
||||||
["]]"] = "@class.outer",
|
|
||||||
},
|
|
||||||
goto_next_end = {
|
|
||||||
["]M"] = "@function.outer",
|
|
||||||
["]["] = "@class.outer",
|
|
||||||
},
|
|
||||||
goto_previous_start = {
|
|
||||||
["[m"] = "@function.outer",
|
|
||||||
["[["] = "@class.outer",
|
|
||||||
},
|
|
||||||
goto_previous_end = {
|
|
||||||
["[M"] = "@function.outer",
|
|
||||||
["[]"] = "@class.outer",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
swap = {
|
|
||||||
enable = true,
|
|
||||||
swap_next = {
|
|
||||||
["<leader>a"] = "@parameter.inner",
|
|
||||||
},
|
|
||||||
swap_previous = {
|
|
||||||
["<leader>A"] = "@parameter.inner",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
|
||||||
lazy = false,
|
|
||||||
enabled = true,
|
|
||||||
opts = {
|
|
||||||
enable = true,
|
|
||||||
mode = "cursor", -- cursor, or topline
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
return {
|
|
||||||
"ThePrimeagen/refactoring.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
},
|
|
||||||
cmd = { "Refactor" },
|
|
||||||
opts = {},
|
|
||||||
keys = {
|
|
||||||
{
|
|
||||||
"<leader>re",
|
|
||||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
mode = {
|
|
||||||
"v",
|
|
||||||
"x",
|
|
||||||
},
|
|
||||||
desc = "Extract Function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rf",
|
|
||||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
mode = {
|
|
||||||
"v",
|
|
||||||
"x",
|
|
||||||
},
|
|
||||||
desc = "Extract Function To File",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rv",
|
|
||||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
mode = {
|
|
||||||
"v",
|
|
||||||
"x",
|
|
||||||
},
|
|
||||||
desc = "Extract Variable",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>ri",
|
|
||||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
mode = {
|
|
||||||
"n",
|
|
||||||
"v",
|
|
||||||
"x",
|
|
||||||
},
|
|
||||||
desc = "Inline Variable",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rb",
|
|
||||||
function() require("refactoring").refactor("Extract Block") end,
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
mode = {
|
|
||||||
"n",
|
|
||||||
},
|
|
||||||
desc = "Extract Block",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rbf",
|
|
||||||
function() require("refactoring").refactor("Extract Block To File") end,
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
mode = {
|
|
||||||
"n",
|
|
||||||
},
|
|
||||||
desc = "Extract Block To File",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rr",
|
|
||||||
function() require("refactoring").select_refactor() end,
|
|
||||||
{ silent = true, expr = false },
|
|
||||||
desc = "Select Refactor",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rp",
|
|
||||||
function() require("refactoring").debug.printf({ below = false }) end,
|
|
||||||
mode = { "n" },
|
|
||||||
desc = "Debug: Print Function",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rd",
|
|
||||||
function() require("refactoring").debug.print_var({ normal = true, below = false }) end,
|
|
||||||
mode = { "n" },
|
|
||||||
desc = "Debug: Print Variable",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rd",
|
|
||||||
function() require("refactoring").debug.print_var({ below = false }) end,
|
|
||||||
mode = { "v" },
|
|
||||||
desc = "Debug: Print Variable",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"<leader>rc",
|
|
||||||
function() require("refactoring").debug.cleanup({}) end,
|
|
||||||
mode = { "n" },
|
|
||||||
desc = "Debug: Clean Up",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,155 +0,0 @@
|
|||||||
-- Telescope, a see-all-through file manager.
|
|
||||||
-- vim: ts=2 sw=2 si et
|
|
||||||
-- luacheck: globals vim
|
|
||||||
return {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
{ "nvim-lua/plenary.nvim" },
|
|
||||||
{ "nvim-lua/popup.nvim" },
|
|
||||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
|
||||||
-- Only load if `make` is available. Make sure you have the system
|
|
||||||
-- requirements installed.
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
|
||||||
-- NOTE: If you are having trouble with this installation,
|
|
||||||
-- refer to the README for telescope-fzf-native for more instructions.
|
|
||||||
build = "make",
|
|
||||||
cond = function() return vim.fn.executable("make") == 1 end,
|
|
||||||
},
|
|
||||||
{ "nvim-telescope/telescope-file-browser.nvim" },
|
|
||||||
},
|
|
||||||
config = function()
|
|
||||||
local actions = require("telescope.actions")
|
|
||||||
local sorters = require("telescope.sorters")
|
|
||||||
local previewers = require("telescope.previewers")
|
|
||||||
|
|
||||||
require("telescope").setup({
|
|
||||||
defaults = {
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<ESC>"] = actions.close,
|
|
||||||
["<C-u>"] = false,
|
|
||||||
["<C-d>"] = false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
vimgrep_arguments = {
|
|
||||||
"rg",
|
|
||||||
"-L",
|
|
||||||
"--color=never",
|
|
||||||
"--no-heading",
|
|
||||||
"--with-filename",
|
|
||||||
"--line-number",
|
|
||||||
"--column",
|
|
||||||
"--smart-case",
|
|
||||||
},
|
|
||||||
|
|
||||||
prompt_prefix = " ",
|
|
||||||
selection_caret = " ",
|
|
||||||
entry_prefix = " ",
|
|
||||||
initial_mode = "insert",
|
|
||||||
selection_strategy = "reset",
|
|
||||||
sorting_strategy = "ascending",
|
|
||||||
layout_strategy = "horizontal",
|
|
||||||
layout_config = {
|
|
||||||
horizontal = {
|
|
||||||
prompt_position = "top",
|
|
||||||
preview_width = 0.55,
|
|
||||||
results_width = 0.8,
|
|
||||||
},
|
|
||||||
vertical = {
|
|
||||||
mirror = false,
|
|
||||||
},
|
|
||||||
width = 0.87,
|
|
||||||
height = 0.80,
|
|
||||||
preview_cutoff = 120,
|
|
||||||
},
|
|
||||||
file_sorter = sorters.get_fuzzy_file,
|
|
||||||
file_ignore_patterns = { "node_modules", "dotbot" },
|
|
||||||
generic_sorter = sorters.get_generic_fuzzy_sorter,
|
|
||||||
path_display = { "truncate" },
|
|
||||||
winblend = 0,
|
|
||||||
border = {},
|
|
||||||
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
|
||||||
color_devicons = true,
|
|
||||||
use_less = true,
|
|
||||||
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
|
||||||
file_previewer = previewers.vim_buffer_cat.new,
|
|
||||||
grep_previewer = previewers.vim_buffer_vimgrep.new,
|
|
||||||
qflist_previewer = previewers.vim_buffer_qflist.new,
|
|
||||||
-- Developer configurations: Not meant for general override
|
|
||||||
buffer_previewer_maker = previewers.buffer_previewer_maker,
|
|
||||||
},
|
|
||||||
pickers = {
|
|
||||||
buffers = {
|
|
||||||
mappings = {
|
|
||||||
i = {
|
|
||||||
["<c-d>"] = actions.delete_buffer + actions.move_to_top,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
extensions_list = { "themes", "terms" },
|
|
||||||
})
|
|
||||||
|
|
||||||
pcall(require("telescope").load_extension, "fzf")
|
|
||||||
pcall(require("telescope").load_extension, "file_browser")
|
|
||||||
pcall(require("telescope").load_extension, "harpoon")
|
|
||||||
|
|
||||||
-- See `:help telescope.builtin`
|
|
||||||
local tbi = require("telescope.builtin")
|
|
||||||
local wk = require("which-key")
|
|
||||||
wk.register({
|
|
||||||
["?"] = {
|
|
||||||
function() tbi.oldfiles() end,
|
|
||||||
"[?] Find recently opened files",
|
|
||||||
},
|
|
||||||
["<space>"] = {
|
|
||||||
function() tbi.buffers() end,
|
|
||||||
"[ ] Find existing buffers",
|
|
||||||
},
|
|
||||||
["/"] = {
|
|
||||||
function()
|
|
||||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
|
||||||
tbi.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
|
||||||
winblend = 10,
|
|
||||||
previewer = false,
|
|
||||||
}))
|
|
||||||
end,
|
|
||||||
"[/] Fuzzily search in current buffer",
|
|
||||||
},
|
|
||||||
|
|
||||||
t = {
|
|
||||||
b = {
|
|
||||||
"<cmd>Telescope file_browser<CR>",
|
|
||||||
"[T]elescope: File [B]rowser",
|
|
||||||
},
|
|
||||||
d = {
|
|
||||||
function() tbi.diagnostics() end,
|
|
||||||
"[T]elescope: Search [D]iagnostics",
|
|
||||||
},
|
|
||||||
|
|
||||||
f = {
|
|
||||||
function() tbi.find_files() end,
|
|
||||||
"[T]elescope: Search [F]iles",
|
|
||||||
},
|
|
||||||
g = {
|
|
||||||
function() tbi.git_files() end,
|
|
||||||
"[T]elescope: Search [G]it files",
|
|
||||||
},
|
|
||||||
h = {
|
|
||||||
function() tbi.help_tags() end,
|
|
||||||
"[T]elescope: Search [H]elp",
|
|
||||||
},
|
|
||||||
r = {
|
|
||||||
function() tbi.live_grep() end,
|
|
||||||
"[T]elescope: Search by G[r]ep",
|
|
||||||
},
|
|
||||||
w = {
|
|
||||||
function() tbi.grep_string() end,
|
|
||||||
"[T]elescope: Search current [W]ord",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
24
config/nvim/lua/plugins/tools.lua
Normal file
24
config/nvim/lua/plugins/tools.lua
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"williamboman/mason.nvim",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"actionlint",
|
||||||
|
"ansible-lint",
|
||||||
|
"bash-language-server",
|
||||||
|
"commitlint",
|
||||||
|
"flake8",
|
||||||
|
"intelephense",
|
||||||
|
"jsonlint",
|
||||||
|
"luacheck",
|
||||||
|
"phpcs",
|
||||||
|
"phpmd",
|
||||||
|
"shellcheck",
|
||||||
|
"shfmt",
|
||||||
|
"stylelint",
|
||||||
|
"stylua",
|
||||||
|
"yamllint",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
23
config/nvim/lua/plugins/treesitter.lua
Normal file
23
config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = {
|
||||||
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"html",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"lua",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"python",
|
||||||
|
"query",
|
||||||
|
"regex",
|
||||||
|
"tsx",
|
||||||
|
"typescript",
|
||||||
|
"vim",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
-- A pretty diagnostics, references, telescope results,
|
|
||||||
-- quickfix and location list to help you solve all
|
|
||||||
-- the trouble your code is causing.
|
|
||||||
-- https://github.com/folke/trouble.nvim
|
|
||||||
return {
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
dependencies = "kyazdani42/nvim-web-devicons",
|
|
||||||
config = {
|
|
||||||
-- position of the list can be: bottom, top, left, right
|
|
||||||
position = "bottom",
|
|
||||||
-- height of the trouble list when position is top or bottom
|
|
||||||
height = 10,
|
|
||||||
-- width of the list when position is left or right
|
|
||||||
width = 50,
|
|
||||||
-- use devicons for filenames
|
|
||||||
icons = true,
|
|
||||||
-- "workspace_diagnostics", "document_diagnostics",
|
|
||||||
-- "quickfix", "lsp_references", "loclist"
|
|
||||||
mode = "workspace_diagnostics",
|
|
||||||
-- icon used for open folds
|
|
||||||
fold_open = "",
|
|
||||||
-- icon used for closed folds
|
|
||||||
fold_closed = "",
|
|
||||||
-- group results by file
|
|
||||||
group = true,
|
|
||||||
-- add an extra new line on top of the list
|
|
||||||
padding = true,
|
|
||||||
-- key mappings for actions in the trouble list
|
|
||||||
action_keys = {
|
|
||||||
-- map to {} to remove a mapping, for example:
|
|
||||||
-- close = {},
|
|
||||||
|
|
||||||
-- close the list
|
|
||||||
close = "q",
|
|
||||||
-- cancel the preview and get back to your last window / buffer / cursor
|
|
||||||
cancel = "<esc>",
|
|
||||||
-- manually refresh
|
|
||||||
refresh = "r",
|
|
||||||
-- jump to the diagnostic or open / close folds
|
|
||||||
jump = { "<cr>", "<tab>" },
|
|
||||||
-- open buffer in new split
|
|
||||||
open_split = { "<c-x>" },
|
|
||||||
-- open buffer in new vsplit
|
|
||||||
open_vsplit = { "<c-v>" },
|
|
||||||
-- open buffer in new tab
|
|
||||||
open_tab = { "<c-t>" },
|
|
||||||
-- jump to the diagnostic and close the list
|
|
||||||
jump_close = { "o" },
|
|
||||||
-- toggle between "workspace" and "document" diagnostics mode
|
|
||||||
toggle_mode = "m",
|
|
||||||
-- toggle auto_preview
|
|
||||||
toggle_preview = "P",
|
|
||||||
-- opens a small popup with the full multiline message
|
|
||||||
hover = "K",
|
|
||||||
-- preview the diagnostic location
|
|
||||||
preview = "p",
|
|
||||||
-- close all folds
|
|
||||||
close_folds = { "zM", "zm" },
|
|
||||||
-- open all folds
|
|
||||||
open_folds = { "zR", "zr" },
|
|
||||||
-- toggle fold of current file
|
|
||||||
toggle_fold = { "zA", "za" },
|
|
||||||
-- preview item
|
|
||||||
previous = "k",
|
|
||||||
-- next item
|
|
||||||
next = "j",
|
|
||||||
},
|
|
||||||
-- add an indent guide below the fold icons
|
|
||||||
indent_lines = true,
|
|
||||||
-- automatically open the list when you have diagnostics
|
|
||||||
auto_open = true,
|
|
||||||
-- automatically close the list when you have no diagnostics
|
|
||||||
auto_close = true,
|
|
||||||
-- automatically preview the location of the diagnostic.
|
|
||||||
-- <esc> to close preview and go back to last window
|
|
||||||
auto_preview = true,
|
|
||||||
-- automatically fold a file trouble list at creation
|
|
||||||
auto_fold = false,
|
|
||||||
-- for the given modes, automatically jump if there is only a single result
|
|
||||||
auto_jump = { "lsp_definitions" },
|
|
||||||
signs = {
|
|
||||||
-- icons / text used for a diagnostic
|
|
||||||
error = "",
|
|
||||||
warning = "",
|
|
||||||
hint = "",
|
|
||||||
information = "",
|
|
||||||
other = "",
|
|
||||||
},
|
|
||||||
-- enabling this will use the signs defined in your lsp client
|
|
||||||
use_diagnostic_signs = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
-- Twilight dims inactive portions of the
|
|
||||||
-- code you're editing using TreeSitter
|
|
||||||
-- https://github.com/folke/twilight.nvim
|
|
||||||
return {
|
|
||||||
"folke/twilight.nvim",
|
|
||||||
config = {
|
|
||||||
dimming = {
|
|
||||||
alpha = 0.5, -- amount of dimming
|
|
||||||
inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer)
|
|
||||||
},
|
|
||||||
context = 3, -- amount of lines we will try to show around the current line
|
|
||||||
treesitter = true, -- use treesitter when available for the filetype
|
|
||||||
-- treesitter is used to automatically expand the visible text,
|
|
||||||
-- but you can further control the types of nodes that should always be fully expanded
|
|
||||||
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
|
|
||||||
"function",
|
|
||||||
"while_statement",
|
|
||||||
"for_statement",
|
|
||||||
"switch_statement",
|
|
||||||
"method",
|
|
||||||
"table",
|
|
||||||
"if_statement",
|
|
||||||
},
|
|
||||||
exclude = {}, -- exclude these filetypes
|
|
||||||
},
|
|
||||||
}
|
|
||||||
137
config/nvim/lua/plugins/ui.lua
Normal file
137
config/nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,137 @@
|
|||||||
|
-- luacheck: globals vim
|
||||||
|
return {
|
||||||
|
-- The theme of choise, catppuccin
|
||||||
|
-- https://github.com/catppuccin/nvim
|
||||||
|
{
|
||||||
|
"catppuccin/nvim",
|
||||||
|
name = "catppuccin",
|
||||||
|
priority = 1000,
|
||||||
|
enabled = true,
|
||||||
|
config = function()
|
||||||
|
vim.cmd.colorscheme("catppuccin")
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
flavour = "mocha",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Remove all background colors to make nvim transparent
|
||||||
|
-- https://github.com/xiyaowong/transparent.nvim
|
||||||
|
{
|
||||||
|
"xiyaowong/transparent.nvim",
|
||||||
|
lazy = false,
|
||||||
|
enabled = true,
|
||||||
|
config = function()
|
||||||
|
vim.g.transparent_groups = vim.list_extend(
|
||||||
|
vim.g.transparent_groups or {},
|
||||||
|
vim.tbl_map(function(v)
|
||||||
|
return v.hl_group
|
||||||
|
end, vim.tbl_values(require("bufferline.config").highlights))
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- A fancy, configurable, notification manager for NeoVim
|
||||||
|
-- https://github.com/rcarriga/nvim-notify
|
||||||
|
{
|
||||||
|
"rcarriga/nvim-notify",
|
||||||
|
opts = {
|
||||||
|
-- Set background color to black so transparent doesn't mess stuff up
|
||||||
|
background_colour = "#000000",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Not UFO in the sky, but an ultra fold in Neovim.
|
||||||
|
-- https://github.com/kevinhwang91/nvim-ufo/
|
||||||
|
{
|
||||||
|
"kevinhwang91/nvim-ufo",
|
||||||
|
lazy = false,
|
||||||
|
enabled = true,
|
||||||
|
dependencies = {
|
||||||
|
"kevinhwang91/promise-async",
|
||||||
|
{ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" },
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
||||||
|
vim.o.foldcolumn = "1" -- '0' is not bad
|
||||||
|
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
|
||||||
|
vim.o.foldlevelstart = 99
|
||||||
|
vim.o.foldenable = true
|
||||||
|
end,
|
||||||
|
opts = {
|
||||||
|
open_fold_hl_timeout = 150,
|
||||||
|
close_fold_kinds = { "imports", "comment" },
|
||||||
|
preview = {
|
||||||
|
win_config = {
|
||||||
|
border = { "", "─", "", "", "", "─", "", "" },
|
||||||
|
winhighlight = "Normal:Folded",
|
||||||
|
winblend = 0,
|
||||||
|
},
|
||||||
|
mappings = {
|
||||||
|
scrollU = "<C-u>",
|
||||||
|
scrollD = "<C-d>",
|
||||||
|
jumpTop = "[",
|
||||||
|
jumpBot = "]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
provider_selector = function(bufnr, filetype, buftype)
|
||||||
|
return { "treesitter", "indent" }
|
||||||
|
end,
|
||||||
|
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
|
||||||
|
local newVirtText = {}
|
||||||
|
local suffix = (" %d "):format(endLnum - lnum)
|
||||||
|
local sufWidth = vim.fn.strdisplaywidth(suffix)
|
||||||
|
local targetWidth = width - sufWidth
|
||||||
|
local curWidth = 0
|
||||||
|
for _, chunk in ipairs(virtText) do
|
||||||
|
local chunkText = chunk[1]
|
||||||
|
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
|
if targetWidth > curWidth + chunkWidth then
|
||||||
|
table.insert(newVirtText, chunk)
|
||||||
|
else
|
||||||
|
chunkText = truncate(chunkText, targetWidth - curWidth)
|
||||||
|
local hlGroup = chunk[2]
|
||||||
|
table.insert(newVirtText, { chunkText, hlGroup })
|
||||||
|
chunkWidth = vim.fn.strdisplaywidth(chunkText)
|
||||||
|
-- str width returned from truncate() may less than 2nd argument, need padding
|
||||||
|
if curWidth + chunkWidth < targetWidth then
|
||||||
|
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
|
||||||
|
end
|
||||||
|
break
|
||||||
|
end
|
||||||
|
curWidth = curWidth + chunkWidth
|
||||||
|
end
|
||||||
|
table.insert(newVirtText, { suffix, "MoreMsg" })
|
||||||
|
return newVirtText
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- Indent guides for Neovim
|
||||||
|
-- https://github.com/lukas-reineke/indent-blankline.nvim
|
||||||
|
{ "lukas-reineke/indent-blankline.nvim" },
|
||||||
|
-- Git integration for buffers
|
||||||
|
-- https://github.com/lewis6991/gitsigns.nvim
|
||||||
|
{ "lewis6991/gitsigns.nvim" },
|
||||||
|
-- Getting you where you want with the fewest keystrokes.
|
||||||
|
-- https://github.com/ThePrimeagen/harpoon
|
||||||
|
{ "ThePrimeagen/harpoon" },
|
||||||
|
-- Close buffer without messing up with the window.
|
||||||
|
-- https://github.com/famiu/bufdelete.nvim
|
||||||
|
{ "famiu/bufdelete.nvim" },
|
||||||
|
-- Neovim plugin for locking a buffer to a window
|
||||||
|
-- https://github.com/stevearc/stickybuf.nvim
|
||||||
|
{ "stevearc/stickybuf.nvim", opts = {} },
|
||||||
|
-- Automatically expand width of the current window.
|
||||||
|
-- Maximizes and restore it. And all this with nice animations!
|
||||||
|
-- https://github.com/anuvyklack/windows.nvim
|
||||||
|
{
|
||||||
|
"anuvyklack/windows.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"anuvyklack/middleclass",
|
||||||
|
"anuvyklack/animation.nvim",
|
||||||
|
},
|
||||||
|
config = function()
|
||||||
|
vim.o.winwidth = 15
|
||||||
|
vim.o.winminwidth = 10
|
||||||
|
vim.o.equalalways = false
|
||||||
|
require("windows").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
-- A more adventurous wildmenu
|
|
||||||
-- https://github.com/gelguy/wilder.nvim
|
|
||||||
|
|
||||||
return {
|
|
||||||
'gelguy/wilder.nvim',
|
|
||||||
config = function()
|
|
||||||
local wilder = require('wilder')
|
|
||||||
wilder.setup({ modes = { ':', '/', '?' } })
|
|
||||||
|
|
||||||
local gradient = {
|
|
||||||
'#f4468f', '#fd4a85', '#ff507a', '#ff566f', '#ff5e63',
|
|
||||||
'#ff6658', '#ff704e', '#ff7a45', '#ff843d', '#ff9036',
|
|
||||||
'#f89b31', '#efa72f', '#e6b32e', '#dcbe30', '#d2c934',
|
|
||||||
'#c8d43a', '#bfde43', '#b6e84e', '#aff05b'
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, fg in ipairs(gradient) do
|
|
||||||
gradient[i] = wilder.make_hl('WilderGradient' .. i, 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = fg } })
|
|
||||||
end
|
|
||||||
|
|
||||||
wilder.set_option('renderer', wilder.popupmenu_renderer({
|
|
||||||
highlights = {
|
|
||||||
gradient = gradient, -- must be set
|
|
||||||
-- selected_gradient key can be set to apply gradient highlighting for the selected candidate.
|
|
||||||
},
|
|
||||||
highlighter = wilder.highlighter_with_gradient({
|
|
||||||
wilder.basic_highlighter(), -- or wilder.lua_fzy_highlighter(),
|
|
||||||
}),
|
|
||||||
}))
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
3
config/nvim/stylua.toml
Normal file
3
config/nvim/stylua.toml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
column_width = 120
|
||||||
153
config/starship.toml
Normal file
153
config/starship.toml
Normal file
@@ -0,0 +1,153 @@
|
|||||||
|
# Get editor completions based on the config schema
|
||||||
|
"$schema" = 'https://starship.rs/config-schema.json'
|
||||||
|
|
||||||
|
format = """
|
||||||
|
$os\
|
||||||
|
$directory\
|
||||||
|
$git_branch\
|
||||||
|
$git_state\
|
||||||
|
$git_status\
|
||||||
|
$fill \
|
||||||
|
$battery\
|
||||||
|
$username\
|
||||||
|
$hostname\
|
||||||
|
$aws\
|
||||||
|
$gcloud\
|
||||||
|
$conda\
|
||||||
|
$golang\
|
||||||
|
$nodejs\
|
||||||
|
$php\
|
||||||
|
$python\
|
||||||
|
$package\
|
||||||
|
$line_break\
|
||||||
|
$character"""
|
||||||
|
|
||||||
|
# Timeout for commands executed by starship (in milliseconds).
|
||||||
|
command_timeout = 1500
|
||||||
|
|
||||||
|
[character]
|
||||||
|
success_symbol = "[→](bold green)"
|
||||||
|
error_symbol = "[→](red)"
|
||||||
|
vimcmd_symbol = "[←](green)"
|
||||||
|
|
||||||
|
[aws]
|
||||||
|
symbol = " "
|
||||||
|
format = '[$symbol($profile )(\($region\) )(\[$duration\] )]($style)'
|
||||||
|
|
||||||
|
[cmd_duration]
|
||||||
|
disabled = true
|
||||||
|
|
||||||
|
[directory]
|
||||||
|
read_only = " "
|
||||||
|
style = "blue"
|
||||||
|
|
||||||
|
[docker_context]
|
||||||
|
symbol = " "
|
||||||
|
format = '[$symbol$context]($style) '
|
||||||
|
|
||||||
|
[fill]
|
||||||
|
symbol = '·'
|
||||||
|
style = 'bold black'
|
||||||
|
|
||||||
|
[gcloud]
|
||||||
|
format = '[($symbol)$account(@$domain)(\($region\))]($style) '
|
||||||
|
|
||||||
|
[git_branch]
|
||||||
|
symbol = " "
|
||||||
|
format = '[$symbol$branch(:$remote_branch)]($style) '
|
||||||
|
truncation_length = 20
|
||||||
|
truncation_symbol = '…'
|
||||||
|
ignore_branches = ['master', 'main']
|
||||||
|
|
||||||
|
[git_status]
|
||||||
|
up_to_date = '✓'
|
||||||
|
staged = '[++\($count\)](green)'
|
||||||
|
|
||||||
|
[git_state]
|
||||||
|
format = '\([$state( $progress_current/$progress_total)]($style)\) '
|
||||||
|
style = "bright-black"
|
||||||
|
|
||||||
|
[git_metrics]
|
||||||
|
added_style = 'bold blue'
|
||||||
|
format = '[+$added]($added_style)/[-$deleted]($deleted_style) '
|
||||||
|
disabled = false
|
||||||
|
|
||||||
|
[golang]
|
||||||
|
symbol = " "
|
||||||
|
format = '[$symbol($version )]($style) '
|
||||||
|
|
||||||
|
[hostname]
|
||||||
|
ssh_symbol = " "
|
||||||
|
ssh_only = false
|
||||||
|
format = '[$ssh_symbol](bold blue)[$hostname](bold red) '
|
||||||
|
|
||||||
|
[lua]
|
||||||
|
format = '[$symbol($version )]($style)'
|
||||||
|
|
||||||
|
[nodejs]
|
||||||
|
symbol = " "
|
||||||
|
format = '[$symbol($version )]($style)'
|
||||||
|
version_format = '${major}.${minor}'
|
||||||
|
|
||||||
|
[os]
|
||||||
|
format = "[$symbol]($style) "
|
||||||
|
style = "bold blue"
|
||||||
|
disabled = false
|
||||||
|
|
||||||
|
[os.symbols]
|
||||||
|
Alpaquita = " "
|
||||||
|
Alpine = " "
|
||||||
|
Amazon = " "
|
||||||
|
Android = " "
|
||||||
|
Arch = " "
|
||||||
|
Artix = " "
|
||||||
|
CentOS = " "
|
||||||
|
Debian = " "
|
||||||
|
DragonFly = " "
|
||||||
|
Emscripten = " "
|
||||||
|
EndeavourOS = " "
|
||||||
|
Fedora = " "
|
||||||
|
FreeBSD = " "
|
||||||
|
Garuda = " "
|
||||||
|
Gentoo = " "
|
||||||
|
HardenedBSD = " "
|
||||||
|
Illumos = " "
|
||||||
|
Linux = " "
|
||||||
|
Mabox = " "
|
||||||
|
Macos = " "
|
||||||
|
Manjaro = " "
|
||||||
|
Mariner = " "
|
||||||
|
MidnightBSD = " "
|
||||||
|
Mint = " "
|
||||||
|
NetBSD = " "
|
||||||
|
NixOS = " "
|
||||||
|
OpenBSD = " "
|
||||||
|
openSUSE = " "
|
||||||
|
OracleLinux = " "
|
||||||
|
Pop = " "
|
||||||
|
Raspbian = " "
|
||||||
|
Redhat = " "
|
||||||
|
RedHatEnterprise = " "
|
||||||
|
Redox = " "
|
||||||
|
Solus = " "
|
||||||
|
SUSE = " "
|
||||||
|
Ubuntu = " "
|
||||||
|
Unknown = " "
|
||||||
|
Windows = " "
|
||||||
|
|
||||||
|
[package]
|
||||||
|
symbol = " "
|
||||||
|
format = '[$symbol($version )]($style)'
|
||||||
|
version_format = '${major}.${minor}'
|
||||||
|
|
||||||
|
[php]
|
||||||
|
format = '[$symbol($version )]($style)'
|
||||||
|
version_format = '${major}.${minor}'
|
||||||
|
|
||||||
|
[python]
|
||||||
|
symbol = " "
|
||||||
|
format = "[$virtualenv]($style) "
|
||||||
|
|
||||||
|
[username]
|
||||||
|
format = "[$user]($style) "
|
||||||
|
|
||||||
Submodule config/tmux/plugins/tmux-1password deleted from bb1bbd2acf
Submodule config/tmux/plugins/tmux-autoreload deleted from f8a8318844
Submodule config/tmux/plugins/tmux-fzf deleted from 2397bd699e
Submodule config/tmux/plugins/tmux-notify deleted from 9abae514be
Submodule config/tmux/plugins/tmux-suspend deleted from 1a2f806666
1
config/tmux/plugins/tmux-window-name
Submodule
1
config/tmux/plugins/tmux-window-name
Submodule
Submodule config/tmux/plugins/tmux-window-name added at f89e9c9d71
Submodule config/tmux/plugins/vim-tmux-navigator deleted from 85b8e5f60c
@@ -4,34 +4,9 @@
|
|||||||
# - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html
|
# - https://tmuxguide.readthedocs.io/en/latest/tmux/tmux.html
|
||||||
# - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf
|
# - https://github.com/dreamsofcode-io/tmux/blob/main/tmux.conf
|
||||||
|
|
||||||
# Set plugins install dir
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/config/tmux/plugins'
|
# │ Bindings │
|
||||||
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
## Install plugins, starting with plugin manager
|
|
||||||
set -g @tpm_plugins ' \
|
|
||||||
tmux-plugins/tpm \
|
|
||||||
b0o/tmux-autoreload \
|
|
||||||
catppuccin/tmux \
|
|
||||||
ChanderG/tmux-notify \
|
|
||||||
christoomey/vim-tmux-navigator \
|
|
||||||
yardnsm/tmux-1password \
|
|
||||||
jaclu/tmux-menus \
|
|
||||||
sainnhe/tmux-fzf \
|
|
||||||
MunifTanjim/tmux-suspend \
|
|
||||||
tmux-plugins/tmux-continuum \
|
|
||||||
tmux-plugins/tmux-resurrect \
|
|
||||||
tmux-plugins/tmux-sensible \
|
|
||||||
tmux-plugins/tmux-sessionist \
|
|
||||||
tmux-plugins/tmux-yank \
|
|
||||||
'
|
|
||||||
|
|
||||||
set-option -sa terminal-overrides ",xterm*:Tc"
|
|
||||||
|
|
||||||
# Mouse support
|
|
||||||
set -g mouse on
|
|
||||||
|
|
||||||
# Make delay shorter
|
|
||||||
set -sg escape-time 0
|
|
||||||
|
|
||||||
# Set <prefix> to Control + Space
|
# Set <prefix> to Control + Space
|
||||||
unbind C-b
|
unbind C-b
|
||||||
@@ -44,92 +19,27 @@ bind j select-pane -D
|
|||||||
bind k select-pane -U
|
bind k select-pane -U
|
||||||
bind l select-pane -R
|
bind l select-pane -R
|
||||||
|
|
||||||
# Start windows and panes at 1, not 0
|
|
||||||
set -g base-index 1
|
|
||||||
set -g pane-base-index 1
|
|
||||||
set-window-option -g pane-base-index 1
|
|
||||||
set-option -g renumber-windows on
|
|
||||||
|
|
||||||
# Use Alt-arrow keys without prefix key to switch panes
|
# Use Alt-arrow keys without prefix key to switch panes
|
||||||
bind -n M-Left select-pane -L
|
bind -n M-Left select-pane -L
|
||||||
bind -n M-Right select-pane -R
|
bind -n M-Right select-pane -R
|
||||||
bind -n M-Up select-pane -U
|
bind -n M-Up select-pane -U
|
||||||
bind -n M-Down select-pane -D
|
bind -n M-Down select-pane -D
|
||||||
|
|
||||||
# Control-Tab & Control-Shift-Tab to switch windows
|
# Control-Tab & Control-Shift-Tab to switch windows
|
||||||
bind -n C-Tab previous-window
|
bind -n C-Tab previous-window
|
||||||
bind -n C-S-Tab next-window
|
bind -n C-S-Tab next-window
|
||||||
|
|
||||||
# Shift Alt vim keys to switch windows
|
|
||||||
bind -n M-H previous-window
|
|
||||||
bind -n M-L next-window
|
|
||||||
|
|
||||||
# Reload tmux config with <prefix> + r
|
# Reload tmux config with <prefix> + r
|
||||||
bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!"
|
bind r source-file ~/.dotfiles/config/tmux/tmux.conf \; display "tmux cfg reloaded!"
|
||||||
|
|
||||||
# Open a new window with <prefix> + N
|
# Open a new window with <prefix> + N
|
||||||
bind N new-window
|
bind N new-window
|
||||||
|
|
||||||
# Plugins related configurations
|
# Set default directory for new windows in this session to current directory:
|
||||||
|
bind M-c attach-session -c "#{pane_current_path}"
|
||||||
|
|
||||||
## https://github.com/jaclu/tmux-menus
|
# Open a new window in the current directory
|
||||||
set -g @menus_trigger 'm'
|
bind C new-window -c "#{pane_current_path}"
|
||||||
|
|
||||||
## https://github.com/jaclu/tmux-1password
|
|
||||||
set -g @1password-key 'x'
|
|
||||||
|
|
||||||
## https://github.com/catppuccin/tmux
|
|
||||||
set -g @catppuccin_flavour 'mocha' # latte/frappe/macchiato/mocha
|
|
||||||
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
|
|
||||||
set -g @catppuccin_window_status_enable "yes"
|
|
||||||
|
|
||||||
set -g @catppuccin_window_right_separator "█ "
|
|
||||||
set -g @catppuccin_window_number_position "right"
|
|
||||||
set -g @catppuccin_window_middle_separator " | "
|
|
||||||
set -g @catppuccin_window_default_fill "none"
|
|
||||||
set -g @catppuccin_window_current_fill "all"
|
|
||||||
set -g @catppuccin_status_modules "application session date_time"
|
|
||||||
set -g @catppuccin_status_left_separator "█"
|
|
||||||
set -g @catppuccin_status_right_separator "█"
|
|
||||||
set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M"
|
|
||||||
|
|
||||||
## https://github.com/MunifTanjim/tmux-mode-indicator
|
|
||||||
set -g status-right '%Y-%m-%d %H:%M #{tmux_mode_indicator}'
|
|
||||||
set -g @mode_indicator_prefix_prompt ' WAIT '
|
|
||||||
set -g @mode_indicator_copy_prompt ' COPY '
|
|
||||||
set -g @mode_indicator_sync_prompt ' SYNC '
|
|
||||||
set -g @mode_indicator_empty_prompt ' TMUX '
|
|
||||||
set -g @mode_indicator_prefix_mode_style 'bg=blue,fg=black'
|
|
||||||
set -g @mode_indicator_copy_mode_style 'bg=yellow,fg=black'
|
|
||||||
set -g @mode_indicator_sync_mode_style 'bg=red,fg=black'
|
|
||||||
set -g @mode_indicator_empty_mode_style 'bg=cyan,fg=black'
|
|
||||||
|
|
||||||
## https://github.com/MunifTanjim/tmux-suspend
|
|
||||||
set -g @suspend_key 'F12'
|
|
||||||
set -g @suspend_suspended_options " \
|
|
||||||
@mode_indicator_custom_prompt:: ---- , \
|
|
||||||
@mode_indicator_custom_mode_style::bg=brightblack\\,fg=black, \
|
|
||||||
"
|
|
||||||
|
|
||||||
## https://github.com/tmux-plugins/tmux-continuum
|
|
||||||
set -g @continuum-restore 'on'
|
|
||||||
set -g @continuum-boot 'on'
|
|
||||||
set -g @continuum-boot-options 'iterm'
|
|
||||||
|
|
||||||
## https://github.com/tmux-plugins/tmux-resurrect
|
|
||||||
set -g @resurrect-strategy-nvim 'session'
|
|
||||||
|
|
||||||
## https://github.com/b0o/tmux-autoreload
|
|
||||||
set-option -g @tmux-autoreload-configs '~/.dotfiles/config/tmux/tmux.conf'
|
|
||||||
|
|
||||||
## https://github.com/sainnhe/tmux-fzf
|
|
||||||
TMUX_FZF_LAUNCH_KEY="l"
|
|
||||||
|
|
||||||
## https://github.com/ChanderG/tmux-notify
|
|
||||||
set -g @tnotify-verbose 'on'
|
|
||||||
|
|
||||||
# set vi-mode
|
|
||||||
set-window-option -g mode-keys vi
|
|
||||||
|
|
||||||
# keybindings
|
# keybindings
|
||||||
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
bind-key -T copy-mode-vi v send-keys -X begin-selection
|
||||||
@@ -153,5 +63,81 @@ bind Escape copy-mode
|
|||||||
unbind p
|
unbind p
|
||||||
bind p paste-buffer
|
bind p paste-buffer
|
||||||
|
|
||||||
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
|
# │ Settings │
|
||||||
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
# Mouse support
|
||||||
|
set -g mouse on
|
||||||
|
|
||||||
|
# Make delay shorter
|
||||||
|
set -sg escape-time 0
|
||||||
|
|
||||||
|
# Start windows and panes at 1, not 0
|
||||||
|
set -g base-index 1
|
||||||
|
set -g pane-base-index 1
|
||||||
|
set-window-option -g pane-base-index 1
|
||||||
|
set-option -g renumber-windows on
|
||||||
|
|
||||||
|
# set vi-mode
|
||||||
|
set-window-option -g mode-keys vi
|
||||||
|
|
||||||
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
|
# │ Plugins │
|
||||||
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
# Set plugins install dir
|
||||||
|
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/config/tmux/plugins'
|
||||||
|
|
||||||
|
## Install plugins, starting with plugin manager
|
||||||
|
set -g @tpm_plugins ' \
|
||||||
|
catppuccin/tmux \
|
||||||
|
tmux-plugins/tmux-continuum \
|
||||||
|
jaclu/tmux-menus \
|
||||||
|
ofirgall/tmux-window-name \
|
||||||
|
tmux-plugins/tmux-resurrect \
|
||||||
|
tmux-plugins/tmux-sensible \
|
||||||
|
tmux-plugins/tmux-sessionist \
|
||||||
|
tmux-plugins/tmux-yank \
|
||||||
|
tmux-plugins/tpm \
|
||||||
|
'
|
||||||
|
|
||||||
|
# ╭──────────────────────────────────────────────────────────╮
|
||||||
|
# │ Plugins related configurations │
|
||||||
|
# ╰──────────────────────────────────────────────────────────╯
|
||||||
|
|
||||||
|
## https://github.com/jaclu/tmux-menus
|
||||||
|
set -g @menus_trigger 'm'
|
||||||
|
|
||||||
|
## A plugin to name your tmux windows smartly.
|
||||||
|
## https://github.com/ofirgall/tmux-window-name
|
||||||
|
### Maximum name length of a window
|
||||||
|
set -g @tmux_window_name_max_name_len "20"
|
||||||
|
### Replace $HOME with ~ in window names
|
||||||
|
set -g @tmux_window_name_use_tilde "True"
|
||||||
|
|
||||||
|
## https://github.com/catppuccin/tmux
|
||||||
|
set -g @catppuccin_flavour "mocha" # latte/frappe/macchiato/mocha
|
||||||
|
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs
|
||||||
|
set -g @catppuccin_window_status_enable "yes"
|
||||||
|
|
||||||
|
## set -g @catppuccin_window_right_separator "█"
|
||||||
|
set -g @catppuccin_window_number_position "left"
|
||||||
|
set -g @catppuccin_window_middle_separator ": "
|
||||||
|
set -g @catppuccin_window_default_fill "none"
|
||||||
|
set -g @catppuccin_window_current_fill "all"
|
||||||
|
set -g @catppuccin_status_modules "application session date_time"
|
||||||
|
set -g @catppuccin_status_left_separator "█"
|
||||||
|
set -g @catppuccin_status_right_separator "█"
|
||||||
|
set -g @catppuccin_date_time_text "%Y-%m-%d %H:%M"
|
||||||
|
|
||||||
|
## https://github.com/tmux-plugins/tmux-continuum
|
||||||
|
set -g @continuum-restore 'on'
|
||||||
|
set -g @continuum-boot 'on'
|
||||||
|
|
||||||
|
## https://github.com/tmux-plugins/tmux-resurrect
|
||||||
|
set -g @resurrect-strategy-nvim 'session'
|
||||||
|
set -g @resurrect-dir '$HOME/.local/state/tmux/tmux-resurrect'
|
||||||
|
|
||||||
# Finally run the tmux plugin manager
|
# Finally run the tmux plugin manager
|
||||||
run '~/.dotfiles/config/tmux/plugins/tpm/tpm'
|
run '~/.dotfiles/config/tmux/plugins/tpm/tpm'
|
||||||
|
|||||||
@@ -1,177 +0,0 @@
|
|||||||
#compdef _git-profile git-profile
|
|
||||||
|
|
||||||
# zsh completion for git-profile -*- shell-script -*-
|
|
||||||
|
|
||||||
__git-profile_debug()
|
|
||||||
{
|
|
||||||
local file="$BASH_COMP_DEBUG_FILE"
|
|
||||||
if [[ -n ${file} ]]; then
|
|
||||||
echo "$*" >> "${file}"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_git-profile()
|
|
||||||
{
|
|
||||||
local shellCompDirectiveError=1
|
|
||||||
local shellCompDirectiveNoSpace=2
|
|
||||||
local shellCompDirectiveNoFileComp=4
|
|
||||||
local shellCompDirectiveFilterFileExt=8
|
|
||||||
local shellCompDirectiveFilterDirs=16
|
|
||||||
|
|
||||||
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace
|
|
||||||
local -a completions
|
|
||||||
|
|
||||||
__git-profile_debug "\n========= starting completion logic =========="
|
|
||||||
__git-profile_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}"
|
|
||||||
|
|
||||||
# The user could have moved the cursor backwards on the command-line.
|
|
||||||
# We need to trigger completion from the $CURRENT location, so we need
|
|
||||||
# to truncate the command-line ($words) up to the $CURRENT location.
|
|
||||||
# (We cannot use $CURSOR as its value does not work when a command is an alias.)
|
|
||||||
words=("${=words[1,CURRENT]}")
|
|
||||||
__git-profile_debug "Truncated words[*]: ${words[*]},"
|
|
||||||
|
|
||||||
lastParam=${words[-1]}
|
|
||||||
lastChar=${lastParam[-1]}
|
|
||||||
__git-profile_debug "lastParam: ${lastParam}, lastChar: ${lastChar}"
|
|
||||||
|
|
||||||
# For zsh, when completing a flag with an = (e.g., git-profile -n=<TAB>)
|
|
||||||
# completions must be prefixed with the flag
|
|
||||||
setopt local_options BASH_REMATCH
|
|
||||||
if [[ "${lastParam}" =~ '-.*=' ]]; then
|
|
||||||
# We are dealing with a flag with an =
|
|
||||||
flagPrefix="-P ${BASH_REMATCH}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Prepare the command to obtain completions
|
|
||||||
requestComp="${words[1]} __complete ${words[2,-1]}"
|
|
||||||
if [ "${lastChar}" = "" ]; then
|
|
||||||
# If the last parameter is complete (there is a space following it)
|
|
||||||
# We add an extra empty parameter so we can indicate this to the go completion code.
|
|
||||||
__git-profile_debug "Adding extra empty parameter"
|
|
||||||
requestComp="${requestComp} \"\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
__git-profile_debug "About to call: eval ${requestComp}"
|
|
||||||
|
|
||||||
# Use eval to handle any environment variables and such
|
|
||||||
out=$(eval ${requestComp} 2>/dev/null)
|
|
||||||
__git-profile_debug "completion output: ${out}"
|
|
||||||
|
|
||||||
# Extract the directive integer following a : from the last line
|
|
||||||
local lastLine
|
|
||||||
while IFS='\n' read -r line; do
|
|
||||||
lastLine=${line}
|
|
||||||
done < <(printf "%s\n" "${out[@]}")
|
|
||||||
__git-profile_debug "last line: ${lastLine}"
|
|
||||||
|
|
||||||
if [ "${lastLine[1]}" = : ]; then
|
|
||||||
directive=${lastLine[2,-1]}
|
|
||||||
# Remove the directive including the : and the newline
|
|
||||||
local suffix
|
|
||||||
(( suffix=${#lastLine}+2))
|
|
||||||
out=${out[1,-$suffix]}
|
|
||||||
else
|
|
||||||
# There is no directive specified. Leave $out as is.
|
|
||||||
__git-profile_debug "No directive found. Setting do default"
|
|
||||||
directive=0
|
|
||||||
fi
|
|
||||||
|
|
||||||
__git-profile_debug "directive: ${directive}"
|
|
||||||
__git-profile_debug "completions: ${out}"
|
|
||||||
__git-profile_debug "flagPrefix: ${flagPrefix}"
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
|
|
||||||
__git-profile_debug "Completion received error. Ignoring completions."
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
while IFS='\n' read -r comp; do
|
|
||||||
if [ -n "$comp" ]; then
|
|
||||||
# If requested, completions are returned with a description.
|
|
||||||
# The description is preceded by a TAB character.
|
|
||||||
# For zsh's _describe, we need to use a : instead of a TAB.
|
|
||||||
# We first need to escape any : as part of the completion itself.
|
|
||||||
comp=${comp//:/\\:}
|
|
||||||
|
|
||||||
local tab=$(printf '\t')
|
|
||||||
comp=${comp//$tab/:}
|
|
||||||
|
|
||||||
__git-profile_debug "Adding completion: ${comp}"
|
|
||||||
completions+=${comp}
|
|
||||||
lastComp=$comp
|
|
||||||
fi
|
|
||||||
done < <(printf "%s\n" "${out[@]}")
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
|
|
||||||
__git-profile_debug "Activating nospace."
|
|
||||||
noSpace="-S ''"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
|
|
||||||
# File extension filtering
|
|
||||||
local filteringCmd
|
|
||||||
filteringCmd='_files'
|
|
||||||
for filter in ${completions[@]}; do
|
|
||||||
if [ ${filter[1]} != '*' ]; then
|
|
||||||
# zsh requires a glob pattern to do file filtering
|
|
||||||
filter="\*.$filter"
|
|
||||||
fi
|
|
||||||
filteringCmd+=" -g $filter"
|
|
||||||
done
|
|
||||||
filteringCmd+=" ${flagPrefix}"
|
|
||||||
|
|
||||||
__git-profile_debug "File filtering command: $filteringCmd"
|
|
||||||
_arguments '*:filename:'"$filteringCmd"
|
|
||||||
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
|
|
||||||
# File completion for directories only
|
|
||||||
local subdir
|
|
||||||
subdir="${completions[1]}"
|
|
||||||
if [ -n "$subdir" ]; then
|
|
||||||
__git-profile_debug "Listing directories in $subdir"
|
|
||||||
pushd "${subdir}" >/dev/null 2>&1
|
|
||||||
else
|
|
||||||
__git-profile_debug "Listing directories in ."
|
|
||||||
fi
|
|
||||||
|
|
||||||
local result
|
|
||||||
_arguments '*:dirname:_files -/'" ${flagPrefix}"
|
|
||||||
result=$?
|
|
||||||
if [ -n "$subdir" ]; then
|
|
||||||
popd >/dev/null 2>&1
|
|
||||||
fi
|
|
||||||
return $result
|
|
||||||
else
|
|
||||||
__git-profile_debug "Calling _describe"
|
|
||||||
if eval _describe "completions" completions $flagPrefix $noSpace; then
|
|
||||||
__git-profile_debug "_describe found some completions"
|
|
||||||
|
|
||||||
# Return the success of having called _describe
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
__git-profile_debug "_describe did not find completions."
|
|
||||||
__git-profile_debug "Checking if we should do file completion."
|
|
||||||
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
|
|
||||||
__git-profile_debug "deactivating file completion"
|
|
||||||
|
|
||||||
# We must return an error code here to let zsh know that there were no
|
|
||||||
# completions found by _describe; this is what will trigger other
|
|
||||||
# matching algorithms to attempt to find completions.
|
|
||||||
# For example zsh can match letters in the middle of words.
|
|
||||||
return 1
|
|
||||||
else
|
|
||||||
# Perform file completion
|
|
||||||
__git-profile_debug "Activating file completion"
|
|
||||||
|
|
||||||
# We must return the result of this command, so it must be the
|
|
||||||
# last command, or else we must store its result to return it.
|
|
||||||
_arguments '*:filename:_files'" ${flagPrefix}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# don't run the completion function when being source-ed or eval-ed
|
|
||||||
if [ "$funcstack[1]" = "_git-profile" ]; then
|
|
||||||
_git-profile
|
|
||||||
fi
|
|
||||||
1713
config/zsh/p10k.zsh
1713
config/zsh/p10k.zsh
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@ bind-key -T copy-mode P send-keys -X toggle-position
|
|||||||
bind-key -T copy-mode R send-keys -X rectangle-toggle
|
bind-key -T copy-mode R send-keys -X rectangle-toggle
|
||||||
bind-key -T copy-mode T command-prompt -1 -p "(jump to backward)" { send-keys -X jump-to-backward "%%" }
|
bind-key -T copy-mode T command-prompt -1 -p "(jump to backward)" { send-keys -X jump-to-backward "%%" }
|
||||||
bind-key -T copy-mode X send-keys -X set-mark
|
bind-key -T copy-mode X send-keys -X set-mark
|
||||||
bind-key -T copy-mode Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer -p"
|
bind-key -T copy-mode Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
|
||||||
bind-key -T copy-mode f command-prompt -1 -p "(jump forward)" { send-keys -X jump-forward "%%" }
|
bind-key -T copy-mode f command-prompt -1 -p "(jump forward)" { send-keys -X jump-forward "%%" }
|
||||||
bind-key -T copy-mode g command-prompt -p "(goto line)" { send-keys -X goto-line "%%" }
|
bind-key -T copy-mode g command-prompt -p "(goto line)" { send-keys -X goto-line "%%" }
|
||||||
bind-key -T copy-mode n send-keys -X search-again
|
bind-key -T copy-mode n send-keys -X search-again
|
||||||
@@ -41,7 +41,7 @@ bind-key -T copy-mode t command-prompt -1 -p "(jump to
|
|||||||
bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel pbcopy
|
bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel pbcopy
|
||||||
bind-key -T copy-mode MouseDown1Pane select-pane
|
bind-key -T copy-mode MouseDown1Pane select-pane
|
||||||
bind-key -T copy-mode MouseDrag1Pane select-pane \; send-keys -X begin-selection
|
bind-key -T copy-mode MouseDrag1Pane select-pane \; send-keys -X begin-selection
|
||||||
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel pbcopy
|
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
|
||||||
bind-key -T copy-mode WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
|
bind-key -T copy-mode WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
|
||||||
bind-key -T copy-mode WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
|
bind-key -T copy-mode WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
|
||||||
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
|
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
|
||||||
@@ -75,7 +75,7 @@ bind-key -T copy-mode M-r send-keys -X middle-line
|
|||||||
bind-key -T copy-mode M-v send-keys -X page-up
|
bind-key -T copy-mode M-v send-keys -X page-up
|
||||||
bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel
|
bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel
|
||||||
bind-key -T copy-mode M-x send-keys -X jump-to-mark
|
bind-key -T copy-mode M-x send-keys -X jump-to-mark
|
||||||
bind-key -T copy-mode M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer -p"
|
bind-key -T copy-mode M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer"
|
||||||
bind-key -T copy-mode "M-{" send-keys -X previous-paragraph
|
bind-key -T copy-mode "M-{" send-keys -X previous-paragraph
|
||||||
bind-key -T copy-mode "M-}" send-keys -X next-paragraph
|
bind-key -T copy-mode "M-}" send-keys -X next-paragraph
|
||||||
bind-key -T copy-mode M-Up send-keys -X halfpage-up
|
bind-key -T copy-mode M-Up send-keys -X halfpage-up
|
||||||
@@ -87,16 +87,13 @@ bind-key -T copy-mode-vi C-c send-keys -X cancel
|
|||||||
bind-key -T copy-mode-vi C-d send-keys -X halfpage-down
|
bind-key -T copy-mode-vi C-d send-keys -X halfpage-down
|
||||||
bind-key -T copy-mode-vi C-e send-keys -X scroll-down
|
bind-key -T copy-mode-vi C-e send-keys -X scroll-down
|
||||||
bind-key -T copy-mode-vi C-f send-keys -X page-down
|
bind-key -T copy-mode-vi C-f send-keys -X page-down
|
||||||
bind-key -T copy-mode-vi C-h select-pane -L
|
bind-key -T copy-mode-vi C-h send-keys -X cursor-left
|
||||||
bind-key -T copy-mode-vi C-j select-pane -D
|
bind-key -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel
|
||||||
bind-key -T copy-mode-vi C-k select-pane -U
|
|
||||||
bind-key -T copy-mode-vi C-l select-pane -R
|
|
||||||
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel
|
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel
|
||||||
bind-key -T copy-mode-vi C-u send-keys -X halfpage-up
|
bind-key -T copy-mode-vi C-u send-keys -X halfpage-up
|
||||||
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
|
||||||
bind-key -T copy-mode-vi C-y send-keys -X scroll-up
|
bind-key -T copy-mode-vi C-y send-keys -X scroll-up
|
||||||
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
|
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
|
||||||
bind-key -T copy-mode-vi C-\ select-pane -l
|
|
||||||
bind-key -T copy-mode-vi Space send-keys -X begin-selection
|
bind-key -T copy-mode-vi Space send-keys -X begin-selection
|
||||||
bind-key -T copy-mode-vi ! send-keys -X copy-pipe-and-cancel "tr -d '
|
bind-key -T copy-mode-vi ! send-keys -X copy-pipe-and-cancel "tr -d '
|
||||||
' | pbcopy"
|
' | pbcopy"
|
||||||
@@ -136,7 +133,7 @@ bind-key -T copy-mode-vi T command-prompt -1 -p "(jump to
|
|||||||
bind-key -T copy-mode-vi V send-keys -X select-line
|
bind-key -T copy-mode-vi V send-keys -X select-line
|
||||||
bind-key -T copy-mode-vi W send-keys -X next-space
|
bind-key -T copy-mode-vi W send-keys -X next-space
|
||||||
bind-key -T copy-mode-vi X send-keys -X set-mark
|
bind-key -T copy-mode-vi X send-keys -X set-mark
|
||||||
bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer -p"
|
bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
|
||||||
bind-key -T copy-mode-vi ^ send-keys -X back-to-indentation
|
bind-key -T copy-mode-vi ^ send-keys -X back-to-indentation
|
||||||
bind-key -T copy-mode-vi b send-keys -X previous-word
|
bind-key -T copy-mode-vi b send-keys -X previous-word
|
||||||
bind-key -T copy-mode-vi e send-keys -X next-word-end
|
bind-key -T copy-mode-vi e send-keys -X next-word-end
|
||||||
@@ -158,7 +155,7 @@ bind-key -T copy-mode-vi \{ send-keys -X previous-paragraph
|
|||||||
bind-key -T copy-mode-vi \} send-keys -X next-paragraph
|
bind-key -T copy-mode-vi \} send-keys -X next-paragraph
|
||||||
bind-key -T copy-mode-vi MouseDown1Pane select-pane
|
bind-key -T copy-mode-vi MouseDown1Pane select-pane
|
||||||
bind-key -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection
|
bind-key -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection
|
||||||
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel pbcopy
|
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
|
||||||
bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
|
bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
|
||||||
bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
|
bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
|
||||||
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
|
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
|
||||||
@@ -171,24 +168,15 @@ bind-key -T copy-mode-vi Down send-keys -X cursor-down
|
|||||||
bind-key -T copy-mode-vi Left send-keys -X cursor-left
|
bind-key -T copy-mode-vi Left send-keys -X cursor-left
|
||||||
bind-key -T copy-mode-vi Right send-keys -X cursor-right
|
bind-key -T copy-mode-vi Right send-keys -X cursor-right
|
||||||
bind-key -T copy-mode-vi M-x send-keys -X jump-to-mark
|
bind-key -T copy-mode-vi M-x send-keys -X jump-to-mark
|
||||||
bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer -p"
|
bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer"
|
||||||
bind-key -T copy-mode-vi C-Up send-keys -X scroll-up
|
bind-key -T copy-mode-vi C-Up send-keys -X scroll-up
|
||||||
bind-key -T copy-mode-vi C-Down send-keys -X scroll-down
|
bind-key -T copy-mode-vi C-Down send-keys -X scroll-down
|
||||||
bind-key -T join-pane \" run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
|
bind-key -T prefix C-Space send-prefix
|
||||||
bind-key -T join-pane \% run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
|
|
||||||
bind-key -T join-pane - run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
|
|
||||||
bind-key -T join-pane @ run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-b'"
|
|
||||||
bind-key -T join-pane f run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-b'"
|
|
||||||
bind-key -T join-pane h run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
|
|
||||||
bind-key -T join-pane v run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
|
|
||||||
bind-key -T join-pane | run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
|
|
||||||
bind-key -T prefix C-Space run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/promote_window.sh '#{session_name}' '#{window_id}' '#{window_name}' '#{pane_current_path}'"
|
|
||||||
bind-key -T prefix Enter run-shell -b "/Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/notify.sh false true"
|
|
||||||
bind-key -T prefix C-n next-window
|
bind-key -T prefix C-n next-window
|
||||||
bind-key -T prefix C-o rotate-window
|
bind-key -T prefix C-o rotate-window
|
||||||
bind-key -T prefix C-p previous-window
|
bind-key -T prefix C-p previous-window
|
||||||
bind-key -T prefix C-r run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-resurrect/scripts/restore.sh
|
bind-key -T prefix C-r run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/scripts/restore.sh
|
||||||
bind-key -T prefix C-s run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-resurrect/scripts/save.sh
|
bind-key -T prefix C-s run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/scripts/save.sh
|
||||||
bind-key -T prefix C-z suspend-client
|
bind-key -T prefix C-z suspend-client
|
||||||
bind-key -T prefix Escape copy-mode
|
bind-key -T prefix Escape copy-mode
|
||||||
bind-key -T prefix Space next-layout
|
bind-key -T prefix Space next-layout
|
||||||
@@ -196,7 +184,7 @@ bind-key -T prefix ! split-window -h -c "#{pane_curr
|
|||||||
bind-key -T prefix \" split-window -v -c "#{pane_current_path}"
|
bind-key -T prefix \" split-window -v -c "#{pane_current_path}"
|
||||||
bind-key -T prefix \# list-buffers
|
bind-key -T prefix \# list-buffers
|
||||||
bind-key -T prefix \$ command-prompt -I "#S" { rename-session "%%" }
|
bind-key -T prefix \$ command-prompt -I "#S" { rename-session "%%" }
|
||||||
bind-key -T prefix \% split-window -h -c "#{pane_current_path}"
|
bind-key -T prefix \% split-window -h
|
||||||
bind-key -T prefix & confirm-before -p "kill-window #W? (y/n)" kill-window
|
bind-key -T prefix & confirm-before -p "kill-window #W? (y/n)" kill-window
|
||||||
bind-key -T prefix \' command-prompt -T window-target -p index { select-window -t ":%%" }
|
bind-key -T prefix \' command-prompt -T window-target -p index { select-window -t ":%%" }
|
||||||
bind-key -T prefix ( switch-client -p
|
bind-key -T prefix ( switch-client -p
|
||||||
@@ -221,40 +209,42 @@ bind-key -T prefix < display-menu -T "#[align=centre
|
|||||||
bind-key -T prefix = choose-buffer -Z
|
bind-key -T prefix = choose-buffer -Z
|
||||||
bind-key -T prefix > display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -x P -y P "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
|
bind-key -T prefix > display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -x P -y P "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
|
||||||
bind-key -T prefix ? list-keys -N
|
bind-key -T prefix ? list-keys -N
|
||||||
bind-key -T prefix @ run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/promote_pane.sh '#{session_name}' '#{pane_id}' '#{pane_current_path}'"
|
bind-key -T prefix @ run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/promote_pane.sh '#{session_name}' '#{pane_id}' '#{pane_current_path}'"
|
||||||
bind-key -T prefix C run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/new_session_prompt.sh
|
bind-key -T prefix C run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/new_session_prompt.sh
|
||||||
bind-key -T prefix D choose-client -Z
|
bind-key -T prefix D choose-client -Z
|
||||||
bind-key -T prefix E select-layout -E
|
bind-key -T prefix E select-layout -E
|
||||||
bind-key -T prefix I run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/install_plugins
|
bind-key -T prefix I run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/install_plugins
|
||||||
bind-key -T prefix L switch-client -l
|
bind-key -T prefix L switch-client -l
|
||||||
bind-key -T prefix M run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/cancel.sh
|
bind-key -T prefix M select-pane -M
|
||||||
bind-key -T prefix N new-window
|
bind-key -T prefix N new-window
|
||||||
bind-key -T prefix R run-shell " tmux source-file /Users/ivuorinen/.config/tmux/tmux.conf > /dev/null; tmux display-message 'Sourced /Users/ivuorinen/.config/tmux/tmux.conf!'"
|
bind-key -T prefix R run-shell " \
|
||||||
|
tmux source-file ~/.tmux.conf > /dev/null; \
|
||||||
|
tmux display-message \"Sourced .tmux.conf!\""
|
||||||
bind-key -T prefix S switch-client -l
|
bind-key -T prefix S switch-client -l
|
||||||
bind-key -T prefix U run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/update_plugins
|
bind-key -T prefix U run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/update_plugins
|
||||||
bind-key -T prefix X run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/kill_session_prompt.sh '#{session_name}' '#{session_id}'"
|
bind-key -T prefix X run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/kill_session_prompt.sh '#{session_name}' '#{session_id}'"
|
||||||
bind-key -T prefix Y run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh
|
bind-key -T prefix Y run-shell -b $HOME/.dotfiles/config/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh
|
||||||
bind-key -T prefix ] paste-buffer -p
|
bind-key -T prefix ] paste-buffer -p
|
||||||
bind-key -T prefix c new-window
|
bind-key -T prefix c new-window
|
||||||
bind-key -T prefix d detach-client
|
bind-key -T prefix d detach-client
|
||||||
bind-key -T prefix f command-prompt { find-window -Z "%%" }
|
bind-key -T prefix f command-prompt { find-window -Z "%%" }
|
||||||
bind-key -T prefix g run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/goto_session.sh
|
bind-key -T prefix g run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/goto_session.sh
|
||||||
bind-key -T prefix h select-pane -L
|
bind-key -T prefix h select-pane -L
|
||||||
bind-key -T prefix i display-message
|
bind-key -T prefix i display-message
|
||||||
bind-key -T prefix j select-pane -D
|
bind-key -T prefix j select-pane -D
|
||||||
bind-key -T prefix k select-pane -U
|
bind-key -T prefix k select-pane -U
|
||||||
bind-key -T prefix l run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-fzf/main.sh
|
bind-key -T prefix l select-pane -R
|
||||||
bind-key -T prefix m run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-menus/items/main.sh
|
bind-key -T prefix m run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-menus/items/main.sh
|
||||||
bind-key -T prefix n next-window
|
bind-key -T prefix n next-window
|
||||||
bind-key -T prefix o select-pane -t :.+
|
bind-key -T prefix o select-pane -t :.+
|
||||||
bind-key -T prefix p paste-buffer
|
bind-key -T prefix p paste-buffer
|
||||||
bind-key -T prefix q display-panes
|
bind-key -T prefix q display-panes
|
||||||
bind-key -T prefix r source-file /Users/ivuorinen/.dotfiles/config/tmux/tmux.conf \; display-message "tmux cfg reloaded!"
|
bind-key -T prefix r source-file $HOME/.dotfiles/config/tmux/tmux.conf \; display-message "tmux cfg reloaded!"
|
||||||
bind-key -T prefix s choose-tree -Zs
|
bind-key -T prefix s choose-tree -Zs
|
||||||
bind-key -T prefix t run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh 'join-pane' '-b'"
|
bind-key -T prefix t clock-mode
|
||||||
bind-key -T prefix w choose-tree -Zw
|
bind-key -T prefix w choose-tree -Zw
|
||||||
bind-key -T prefix x run-shell "tmux split-window -l 10 \"/Users/ivuorinen/.config/tmux/plugins/tmux-1password/scripts/main.sh '#{pane_id}'\""
|
bind-key -T prefix x confirm-before -p "kill-pane #P? (y/n)" kill-pane
|
||||||
bind-key -T prefix y run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-yank/scripts/copy_line.sh
|
bind-key -T prefix y run-shell -b $HOME/.dotfiles/config/tmux/plugins/tmux-yank/scripts/copy_line.sh
|
||||||
bind-key -T prefix z resize-pane -Z
|
bind-key -T prefix z resize-pane -Z
|
||||||
bind-key -T prefix \{ swap-pane -U
|
bind-key -T prefix \{ swap-pane -U
|
||||||
bind-key -T prefix \} swap-pane -D
|
bind-key -T prefix \} swap-pane -D
|
||||||
@@ -265,17 +255,16 @@ bind-key -r -T prefix Up select-pane -U
|
|||||||
bind-key -r -T prefix Down select-pane -D
|
bind-key -r -T prefix Down select-pane -D
|
||||||
bind-key -r -T prefix Left select-pane -L
|
bind-key -r -T prefix Left select-pane -L
|
||||||
bind-key -r -T prefix Right select-pane -R
|
bind-key -r -T prefix Right select-pane -R
|
||||||
bind-key -T prefix M-Enter run-shell -b "/Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/notify.sh true true"
|
|
||||||
bind-key -T prefix M-1 select-layout even-horizontal
|
bind-key -T prefix M-1 select-layout even-horizontal
|
||||||
bind-key -T prefix M-2 select-layout even-vertical
|
bind-key -T prefix M-2 select-layout even-vertical
|
||||||
bind-key -T prefix M-3 select-layout main-horizontal
|
bind-key -T prefix M-3 select-layout main-horizontal
|
||||||
bind-key -T prefix M-4 select-layout main-vertical
|
bind-key -T prefix M-4 select-layout main-vertical
|
||||||
bind-key -T prefix M-5 select-layout tiled
|
bind-key -T prefix M-5 select-layout tiled
|
||||||
bind-key -T prefix M-m run-shell -b "/Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/notify.sh true"
|
bind-key -T prefix M-c attach-session -c "#{pane_current_path}"
|
||||||
bind-key -T prefix M-n next-window -a
|
bind-key -T prefix M-n next-window -a
|
||||||
bind-key -T prefix M-o rotate-window -D
|
bind-key -T prefix M-o rotate-window -D
|
||||||
bind-key -T prefix M-p previous-window -a
|
bind-key -T prefix M-p previous-window -a
|
||||||
bind-key -T prefix M-u run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/clean_plugins
|
bind-key -T prefix M-u run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/clean_plugins
|
||||||
bind-key -r -T prefix M-Up resize-pane -U 5
|
bind-key -r -T prefix M-Up resize-pane -U 5
|
||||||
bind-key -r -T prefix M-Down resize-pane -D 5
|
bind-key -r -T prefix M-Down resize-pane -D 5
|
||||||
bind-key -r -T prefix M-Left resize-pane -L 5
|
bind-key -r -T prefix M-Left resize-pane -L 5
|
||||||
@@ -288,11 +277,6 @@ bind-key -r -T prefix S-Up refresh-client -U 10
|
|||||||
bind-key -r -T prefix S-Down refresh-client -D 10
|
bind-key -r -T prefix S-Down refresh-client -D 10
|
||||||
bind-key -r -T prefix S-Left refresh-client -L 10
|
bind-key -r -T prefix S-Left refresh-client -L 10
|
||||||
bind-key -r -T prefix S-Right refresh-client -R 10
|
bind-key -r -T prefix S-Right refresh-client -R 10
|
||||||
bind-key -T root C-h if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-h" "select-pane -L"
|
|
||||||
bind-key -T root C-j if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-j" "select-pane -D"
|
|
||||||
bind-key -T root C-k if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-k" "select-pane -U"
|
|
||||||
bind-key -T root C-l if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-l" "select-pane -R"
|
|
||||||
bind-key -T root C-\ if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(S+/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-\\" "select-pane -l"
|
|
||||||
bind-key -T root MouseDown1Pane select-pane -t = \; send-keys -M
|
bind-key -T root MouseDown1Pane select-pane -t = \; send-keys -M
|
||||||
bind-key -T root MouseDown1Status select-window -t =
|
bind-key -T root MouseDown1Status select-window -t =
|
||||||
bind-key -T root MouseDown2Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { paste-buffer -p }
|
bind-key -T root MouseDown2Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { paste-buffer -p }
|
||||||
@@ -306,16 +290,12 @@ bind-key -T root WheelUpStatus previous-window
|
|||||||
bind-key -T root WheelDownStatus next-window
|
bind-key -T root WheelDownStatus next-window
|
||||||
bind-key -T root DoubleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-word ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
|
bind-key -T root DoubleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-word ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
|
||||||
bind-key -T root TripleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
|
bind-key -T root TripleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
|
||||||
bind-key -T root F12 run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-suspend/scripts/suspend.sh \"\" \" @mode_indicator_custom_prompt:: ---- , @mode_indicator_custom_mode_style::bg=brightblack\,fg=black, \""
|
|
||||||
bind-key -T root M-H previous-window
|
|
||||||
bind-key -T root M-L next-window
|
|
||||||
bind-key -T root M-MouseDown3Pane display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
|
bind-key -T root M-MouseDown3Pane display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
|
||||||
bind-key -T root M-Up select-pane -U
|
bind-key -T root M-Up select-pane -U
|
||||||
bind-key -T root M-Down select-pane -D
|
bind-key -T root M-Down select-pane -D
|
||||||
bind-key -T root M-Left select-pane -L
|
bind-key -T root M-Left select-pane -L
|
||||||
bind-key -T root M-Right select-pane -R
|
bind-key -T root M-Right select-pane -R
|
||||||
bind-key -T root S-Left previous-window
|
bind-key -T root C-Tab previous-window
|
||||||
bind-key -T root S-Right next-window
|
bind-key -T root C-S-Tab next-window
|
||||||
bind-key -T suspended F12 run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-suspend/scripts/resume.sh \"\""
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -12,10 +12,15 @@ function x-load-configs()
|
|||||||
HOST="$(hostname -s)"
|
HOST="$(hostname -s)"
|
||||||
# Load the shell dotfiles, and then some:
|
# Load the shell dotfiles, and then some:
|
||||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||||
[ -r "$file" ] && source "$file"
|
# global (exports|alias|functions) file for all hosts
|
||||||
[ -r "$file-secret" ] && source "$file-secret"
|
# shellcheck source=../../../config/exports
|
||||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
[ -r "$file" ] && source "$file"
|
||||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
# shellcheck source=../../../config/exports
|
||||||
|
[ -r "$file-secret" ] && source "$file-secret"
|
||||||
|
# shellcheck source=../../../config/exports
|
||||||
|
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||||
|
# shellcheck source=../../../config/exports
|
||||||
|
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
x-load-configs
|
||||||
@@ -25,14 +30,16 @@ export LC_ALL=fi_FI.utf8
|
|||||||
|
|
||||||
export RVM_PATH="$HOME/.rvm"
|
export RVM_PATH="$HOME/.rvm"
|
||||||
export PATH="$RVM_PATH/bin:$PATH"
|
export PATH="$RVM_PATH/bin:$PATH"
|
||||||
|
# shellcheck source=$HOME/.rvm/scripts/rvm
|
||||||
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||||
|
|
||||||
# Try to load antigen, if present
|
# Try to load antigen, if present
|
||||||
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||||
|
# shellcheck source=$HOME/.local/bin/antigen.zsh
|
||||||
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||||
|
|
||||||
# If antigen was loaded
|
# If antigen was loaded
|
||||||
if command -v antigen &> /dev/null; then
|
if command -v antigen &>/dev/null; then
|
||||||
antigen use oh-my-zsh
|
antigen use oh-my-zsh
|
||||||
|
|
||||||
# config/functions
|
# config/functions
|
||||||
@@ -48,4 +55,5 @@ alias nano='nano -wS -$'
|
|||||||
alias gpg=gpg2
|
alias gpg=gpg2
|
||||||
|
|
||||||
ACME_PATH="$HOME/.acme.sh"
|
ACME_PATH="$HOME/.acme.sh"
|
||||||
|
# shellcheck source=$HOME/.acme.sh/acme.sh.env
|
||||||
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
|
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
- include: "tools/dotbot-defaults.yaml"
|
- include: "tools/dotbot-defaults.yaml"
|
||||||
- shell:
|
- shell:
|
||||||
- echo "Configuring v"
|
- echo "Configuring v"
|
||||||
- brewfile:
|
|
||||||
- Brewfile
|
|
||||||
- link:
|
- link:
|
||||||
~/:
|
~/:
|
||||||
force: true
|
force: true
|
||||||
|
|||||||
12
install
12
install
@@ -10,14 +10,17 @@ BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
|
||||||
DOTBOT_HOST="$(hostname -s)"
|
DOTBOT_HOST="$(hostname -s)"
|
||||||
|
|
||||||
cd "$BASEDIR"
|
cd "${BASEDIR}"
|
||||||
git submodule sync --quiet --recursive
|
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||||
|
|
||||||
"${DOTBOT_BIN_PATH}" \
|
"${DOTBOT_BIN_PATH}" \
|
||||||
-d "${BASEDIR}" \
|
-d "${BASEDIR}" \
|
||||||
--plugin-dir=tools/dotbot-brew \
|
--plugin-dir=tools/dotbot-brew \
|
||||||
--plugin-dir=tools/dotbot-include \
|
--plugin-dir=tools/dotbot-include \
|
||||||
|
--plugin-dir=tools/dotbot-crontab \
|
||||||
|
--plugin-dir=tools/dotbot-snap \
|
||||||
|
--plugin-dir=tools/dotbot-pip \
|
||||||
-c "${CONFIG}" \
|
-c "${CONFIG}" \
|
||||||
"${@}"
|
"${@}"
|
||||||
|
|
||||||
@@ -30,6 +33,9 @@ if [ "${DOTBOT_HOST}" != "" ]; then
|
|||||||
-d "$BASEDIR" \
|
-d "$BASEDIR" \
|
||||||
--plugin-dir=tools/dotbot-brew \
|
--plugin-dir=tools/dotbot-brew \
|
||||||
--plugin-dir=tools/dotbot-include \
|
--plugin-dir=tools/dotbot-include \
|
||||||
|
--plugin-dir=tools/dotbot-crontab \
|
||||||
|
--plugin-dir=tools/dotbot-snap \
|
||||||
|
--plugin-dir=tools/dotbot-pip \
|
||||||
-c "$DOTBOT_HOST_CONFIG" \
|
-c "$DOTBOT_HOST_CONFIG" \
|
||||||
"${@}"
|
"${@}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -5,36 +5,66 @@
|
|||||||
recursive: true
|
recursive: true
|
||||||
~/.local:
|
~/.local:
|
||||||
recursive: true
|
recursive: true
|
||||||
|
~/.ssh:
|
||||||
|
recursive: true
|
||||||
- create:
|
- create:
|
||||||
~/.cache:
|
~/.cache:
|
||||||
~/.cache/git:
|
~/.cache/git:
|
||||||
~/.config:
|
~/.config:
|
||||||
~/.config/cheat/cheatsheets/personal:
|
|
||||||
~/.config/cheat/cheatsheets/pure-bash-bible:
|
|
||||||
~/.config/cheat/cheatsheets/tldr:
|
|
||||||
~/.local:
|
~/.local:
|
||||||
|
~/.local/bin:
|
||||||
~/.local/run:
|
~/.local/run:
|
||||||
~/.local/share:
|
~/.local/share:
|
||||||
~/.local/state:
|
~/.local/state:
|
||||||
~/.ssh:
|
~/.ssh:
|
||||||
mode: 0700
|
mode: 0700
|
||||||
|
~/.ssh/local.d:
|
||||||
|
mode: 0700
|
||||||
~/Code:
|
~/Code:
|
||||||
- link:
|
- link:
|
||||||
~/:
|
~/:
|
||||||
force: true
|
force: true
|
||||||
glob: true
|
glob: true
|
||||||
path: base/**
|
path: base/*
|
||||||
prefix: "."
|
prefix: "."
|
||||||
~/.config/:
|
~/.config/:
|
||||||
glob: true
|
glob: true
|
||||||
path: config/**
|
relink: true
|
||||||
~/.local/:
|
path: config/*
|
||||||
|
exclude: [config/nvm]
|
||||||
|
~/.config/nvm/default-packages:
|
||||||
|
create: true
|
||||||
|
relink: true
|
||||||
|
path: config/nvm/default-packages
|
||||||
|
~/.local/bin:
|
||||||
glob: true
|
glob: true
|
||||||
path: local/**
|
path: local/bin/*
|
||||||
|
~/.local/man:
|
||||||
|
glob: true
|
||||||
|
path: local/man/**
|
||||||
|
~/.local/share:
|
||||||
|
glob: true
|
||||||
|
path: local/share/*
|
||||||
~/.ssh/:
|
~/.ssh/:
|
||||||
glob: true
|
glob: true
|
||||||
mode: 0600
|
mode: 0600
|
||||||
path: ssh/**
|
path: ssh/*
|
||||||
- shell:
|
- shell:
|
||||||
- git submodule update --init --recursive --force
|
- git submodule update --init --recursive --force
|
||||||
- bash local/bin/dfm install all
|
- bash local/bin/dfm install all
|
||||||
|
- pipx:
|
||||||
|
file: tools/requirements-pipx.txt
|
||||||
|
stdout: false
|
||||||
|
stderr: true
|
||||||
|
- crontab:
|
||||||
|
- time: 0 5 * * *
|
||||||
|
command: brew update && brew upgrade
|
||||||
|
platform: darwin # Optional
|
||||||
|
- time: 0 5 * * *
|
||||||
|
command: apt update && apt upgrade
|
||||||
|
platform: linux # Optional
|
||||||
|
- time: 0 5 * * *
|
||||||
|
command: task sync
|
||||||
|
- snap:
|
||||||
|
- nvim:
|
||||||
|
classic: true
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
SCRIPT=$(basename "$0")
|
SCRIPT=$(basename "$0")
|
||||||
|
|
||||||
VERSION_NVM="v0.39.3"
|
VERSION_NVM="v0.39.5"
|
||||||
|
|
||||||
# shellcheck source=./../../scripts/shared.sh
|
# shellcheck source=./../../scripts/shared.sh
|
||||||
source "$SHARED_SCRIPT"
|
source "$SHARED_SCRIPT"
|
||||||
@@ -28,9 +28,11 @@ function section_install
|
|||||||
MENU=(
|
MENU=(
|
||||||
"all:Installs everything in the correct order"
|
"all:Installs everything in the correct order"
|
||||||
"antigen:Updates the antigen.zsh file"
|
"antigen:Updates the antigen.zsh file"
|
||||||
|
"cargo:Install rust/cargo packages"
|
||||||
"cheat-databases:Install cheat external cheatsheet databases"
|
"cheat-databases:Install cheat external cheatsheet databases"
|
||||||
"composer:Install composer"
|
"composer:Install composer"
|
||||||
"dotenv:Install dotenv-linter"
|
"dotenv:Install dotenv-linter"
|
||||||
|
"fonts:Install programming fonts"
|
||||||
"gh:Install GitHub CLI Extensions"
|
"gh:Install GitHub CLI Extensions"
|
||||||
"go:Install Go Packages"
|
"go:Install Go Packages"
|
||||||
"imagick:Install ImageMagick CLI"
|
"imagick:Install ImageMagick CLI"
|
||||||
@@ -40,14 +42,18 @@ function section_install
|
|||||||
"nvm:Install Node Version Manager (nvm)"
|
"nvm:Install Node Version Manager (nvm)"
|
||||||
"npm:Install NPM Packages"
|
"npm:Install NPM Packages"
|
||||||
"ntfy:Install ntfy"
|
"ntfy:Install ntfy"
|
||||||
|
"pip:Install pip/python packages"
|
||||||
"z:Install z"
|
"z:Install z"
|
||||||
)
|
)
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
all)
|
all)
|
||||||
$0 install macos
|
$0 install macos
|
||||||
|
$0 install fonts
|
||||||
$0 install antigen
|
$0 install antigen
|
||||||
$0 brew install
|
$0 brew install
|
||||||
|
$0 install pip
|
||||||
|
$0 install cargo
|
||||||
$0 install composer
|
$0 install composer
|
||||||
$0 install dotenv
|
$0 install dotenv
|
||||||
$0 install fzf
|
$0 install fzf
|
||||||
@@ -65,6 +71,10 @@ function section_install
|
|||||||
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
|
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
|
||||||
&& msg_yay "New antigen installed!"
|
&& msg_yay "New antigen installed!"
|
||||||
;;
|
;;
|
||||||
|
cargo)
|
||||||
|
bash "$DOTFILES/scripts/install-cargo-packages.sh" \
|
||||||
|
&& msg_yay "cargo packages installed!"
|
||||||
|
;;
|
||||||
cheat-databases)
|
cheat-databases)
|
||||||
for database in "$DOTFILES"/scripts/install-cheat-*; do
|
for database in "$DOTFILES"/scripts/install-cheat-*; do
|
||||||
bash "$database" \
|
bash "$database" \
|
||||||
@@ -81,6 +91,10 @@ function section_install
|
|||||||
| sh -s -- -b "$XDG_BIN_HOME" \
|
| sh -s -- -b "$XDG_BIN_HOME" \
|
||||||
&& msg_yay "dotenv-linter installed!"
|
&& msg_yay "dotenv-linter installed!"
|
||||||
;;
|
;;
|
||||||
|
fonts)
|
||||||
|
bash "$DOTFILES/scripts/install-fonts.sh" \
|
||||||
|
&& msg_yay "Installed fonts!"
|
||||||
|
;;
|
||||||
fzf)
|
fzf)
|
||||||
bash "$DOTFILES/scripts/install-fzf.sh" \
|
bash "$DOTFILES/scripts/install-fzf.sh" \
|
||||||
&& msg_yay "fzf installed!"
|
&& msg_yay "fzf installed!"
|
||||||
@@ -126,6 +140,10 @@ function section_install
|
|||||||
bash "$DOTFILES/scripts/install-ntfy.sh" \
|
bash "$DOTFILES/scripts/install-ntfy.sh" \
|
||||||
&& msg_yay "ntfy installed!"
|
&& msg_yay "ntfy installed!"
|
||||||
;;
|
;;
|
||||||
|
pip)
|
||||||
|
bash "$DOTFILES/scripts/install-pip-packages.sh" \
|
||||||
|
&& msg_yay "pip/python packages installed!"
|
||||||
|
;;
|
||||||
z)
|
z)
|
||||||
bash "$DOTFILES/scripts/install-z.sh" \
|
bash "$DOTFILES/scripts/install-z.sh" \
|
||||||
&& msg_yay "z has been installed!"
|
&& msg_yay "z has been installed!"
|
||||||
@@ -232,10 +250,8 @@ function section_dotfiles
|
|||||||
~/.local/share/nvim \
|
~/.local/share/nvim \
|
||||||
~/.local/state/nvim \
|
~/.local/state/nvim \
|
||||||
~/.cache/nvim \
|
~/.cache/nvim \
|
||||||
~/.config/astronvim \
|
|
||||||
~/.config/nvim
|
~/.config/nvim
|
||||||
msg_ok "Deleted old nvim files"
|
msg_ok "Deleted old nvim files (share, state and cache + config)"
|
||||||
ln -s "$DOTFILES/config/astronvim" ~/.config/astronvim
|
|
||||||
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
|
ln -s "$DOTFILES/config/nvim" ~/.config/nvim
|
||||||
msg_ok "Linked nvim and astronvim"
|
msg_ok "Linked nvim and astronvim"
|
||||||
have npm && $0 install npm
|
have npm && $0 install npm
|
||||||
@@ -249,18 +265,9 @@ function section_dotfiles
|
|||||||
;;
|
;;
|
||||||
shfmt)
|
shfmt)
|
||||||
# Format shell scripts according to following rules.
|
# Format shell scripts according to following rules.
|
||||||
find "$DOTFILES" \
|
fd --full-path "$DOTFILES" -tx \
|
||||||
-type f -executable \
|
-E '*.pl' -E '*.php' -E '*.py' -E '*.zsh' -E 'plugins' -E 'fzf' -E 'dotbot' \
|
||||||
-not -path '*/.git/*' \
|
-x shfmt \
|
||||||
-not -path '*dotbot*' \
|
|
||||||
-not -path '*config/fzf*' \
|
|
||||||
-not -path '*bin/fzf*' \
|
|
||||||
-not -path '*tmux/plugins*' \
|
|
||||||
-not -name '*.pl' \
|
|
||||||
-not -name '*.py' \
|
|
||||||
-not -name '*.php' \
|
|
||||||
-not -name '*.zsh' \
|
|
||||||
-exec shfmt \
|
|
||||||
--language-dialect bash \
|
--language-dialect bash \
|
||||||
--func-next-line --list --write \
|
--func-next-line --list --write \
|
||||||
--indent 2 --case-indent --space-redirects \
|
--indent 2 --case-indent --space-redirects \
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
# fzf-tmux: starts fzf in a tmux pane
|
# fzf-tmux: starts fzf in a tmux pane
|
||||||
# usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
|
# usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
|
||||||
|
|
||||||
fail() {
|
fail()
|
||||||
>&2 echo "$1"
|
{
|
||||||
|
echo >&2 "$1"
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,8 +20,9 @@ term=""
|
|||||||
[[ -n "$LINES" ]] && lines=$LINES || lines=$(tput lines) || lines=$(tmux display-message -p "#{pane_height}")
|
[[ -n "$LINES" ]] && lines=$LINES || lines=$(tput lines) || lines=$(tmux display-message -p "#{pane_height}")
|
||||||
[[ -n "$COLUMNS" ]] && columns=$COLUMNS || columns=$(tput cols) || columns=$(tmux display-message -p "#{pane_width}")
|
[[ -n "$COLUMNS" ]] && columns=$COLUMNS || columns=$(tput cols) || columns=$(tmux display-message -p "#{pane_width}")
|
||||||
|
|
||||||
help() {
|
help()
|
||||||
>&2 echo 'usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
|
{
|
||||||
|
echo >&2 'usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
|
||||||
|
|
||||||
LAYOUT OPTIONS:
|
LAYOUT OPTIONS:
|
||||||
(default layout: -d 50%)
|
(default layout: -d 50%)
|
||||||
@@ -55,7 +57,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
echo "fzf-tmux (with fzf $("$fzf" --version))"
|
echo "fzf-tmux (with fzf $("$fzf" --version))"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
-p*|-w*|-h*|-x*|-y*|-d*|-u*|-r*|-l*)
|
-p* | -w* | -h* | -x* | -y* | -d* | -u* | -r* | -l*)
|
||||||
if [[ "$arg" =~ ^-[pwhxy] ]]; then
|
if [[ "$arg" =~ ^-[pwhxy] ]]; then
|
||||||
[[ "$opt" =~ "-E" ]] || opt="-E"
|
[[ "$opt" =~ "-E" ]] || opt="-E"
|
||||||
elif [[ "$arg" =~ ^.[lr] ]]; then
|
elif [[ "$arg" =~ ^.[lr] ]]; then
|
||||||
@@ -93,9 +95,9 @@ while [[ $# -gt 0 ]]; do
|
|||||||
elif [[ "$arg" =~ ^-[whxy] ]]; then
|
elif [[ "$arg" =~ ^-[whxy] ]]; then
|
||||||
opt="$opt ${arg:0:2}$size"
|
opt="$opt ${arg:0:2}$size"
|
||||||
elif [[ "$size" =~ %$ ]]; then
|
elif [[ "$size" =~ %$ ]]; then
|
||||||
size=${size:0:((${#size}-1))}
|
size=${size:0:((${#size} - 1))}
|
||||||
if [[ -n "$swap" ]]; then
|
if [[ -n "$swap" ]]; then
|
||||||
opt="$opt -p $(( 100 - size ))"
|
opt="$opt -p $((100 - size))"
|
||||||
else
|
else
|
||||||
opt="$opt -p $size"
|
opt="$opt -p $size"
|
||||||
fi
|
fi
|
||||||
@@ -106,7 +108,7 @@ while [[ $# -gt 0 ]]; do
|
|||||||
else
|
else
|
||||||
max=$lines
|
max=$lines
|
||||||
fi
|
fi
|
||||||
size=$(( max - size ))
|
size=$((max - size))
|
||||||
[[ $size -lt 0 ]] && size=0
|
[[ $size -lt 0 ]] && size=0
|
||||||
opt="$opt -l $size"
|
opt="$opt -l $size"
|
||||||
else
|
else
|
||||||
@@ -152,13 +154,14 @@ fifo1="${TMPDIR:-/tmp}/fzf-fifo1-$id"
|
|||||||
fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id"
|
fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id"
|
||||||
fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id"
|
fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id"
|
||||||
if tmux_win_opts=$(tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null); then
|
if tmux_win_opts=$(tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null); then
|
||||||
tmux_win_opts=( $(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts") )
|
tmux_win_opts=($(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts"))
|
||||||
tmux_off_opts='; set-option -p synchronize-panes off ; set-option -p remain-on-exit off'
|
tmux_off_opts='; set-option -p synchronize-panes off ; set-option -p remain-on-exit off'
|
||||||
else
|
else
|
||||||
tmux_win_opts=( $(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/') )
|
tmux_win_opts=($(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/'))
|
||||||
tmux_off_opts='; set-window-option synchronize-panes off ; set-window-option remain-on-exit off'
|
tmux_off_opts='; set-window-option synchronize-panes off ; set-window-option remain-on-exit off'
|
||||||
fi
|
fi
|
||||||
cleanup() {
|
cleanup()
|
||||||
|
{
|
||||||
\rm -f $argsf $fifo1 $fifo2 $fifo3
|
\rm -f $argsf $fifo1 $fifo2 $fifo3
|
||||||
|
|
||||||
# Restore tmux window options
|
# Restore tmux window options
|
||||||
@@ -196,7 +199,7 @@ if [[ "$opt" =~ "-E" ]]; then
|
|||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
[[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")"
|
[[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")"
|
||||||
[[ -n "$FZF_DEFAULT_COMMAND" ]] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")"
|
[[ -n "$FZF_DEFAULT_COMMAND" ]] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")"
|
||||||
[[ -n "$RUNEWIDTH_EASTASIAN" ]] && envs="$envs RUNEWIDTH_EASTASIAN=$(printf %q "$RUNEWIDTH_EASTASIAN")"
|
[[ -n "$RUNEWIDTH_EASTASIAN" ]] && envs="$envs RUNEWIDTH_EASTASIAN=$(printf %q "$RUNEWIDTH_EASTASIAN")"
|
||||||
[[ -n "$BAT_THEME" ]] && envs="$envs BAT_THEME=$(printf %q "$BAT_THEME")"
|
[[ -n "$BAT_THEME" ]] && envs="$envs BAT_THEME=$(printf %q "$BAT_THEME")"
|
||||||
@@ -236,6 +239,9 @@ fi
|
|||||||
tmux \
|
tmux \
|
||||||
split-window -c "$PWD" $opt "bash -c 'exec -a fzf bash $argsf'" $swap \
|
split-window -c "$PWD" $opt "bash -c 'exec -a fzf bash $argsf'" $swap \
|
||||||
$tmux_off_opts \
|
$tmux_off_opts \
|
||||||
> /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; }
|
> /dev/null 2>&1 || {
|
||||||
|
"$fzf" "${args[@]}"
|
||||||
|
exit $?
|
||||||
|
}
|
||||||
cat $fifo2
|
cat $fifo2
|
||||||
exit "$(cat $fifo3)"
|
exit "$(cat $fifo3)"
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ KB=$(tmux list-keys)
|
|||||||
H="# tmux keybindings\n"
|
H="# tmux keybindings\n"
|
||||||
L="\n\nLeader: \`<ctrl><space>\`\n\n"
|
L="\n\nLeader: \`<ctrl><space>\`\n\n"
|
||||||
|
|
||||||
|
# Generalize expanded $HOME to "$HOME"
|
||||||
|
KB="${KB//$HOME/\$HOME}"
|
||||||
|
|
||||||
msg "Outputting tmux keybindings to $TMUX_KEYBINDINGS_DOCS"
|
msg "Outputting tmux keybindings to $TMUX_KEYBINDINGS_DOCS"
|
||||||
echo -e "${H}${L}${CB}${KB}${CB}" > "$TMUX_KEYBINDINGS_DOCS"
|
echo -e "${H}${L}${CB}${KB}${CB}" > "$TMUX_KEYBINDINGS_DOCS"
|
||||||
msg_done "Done!"
|
msg_done "Done!"
|
||||||
|
|||||||
@@ -1,136 +1,195 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Python script to find the largest files in a git repository.
|
# Python script to find the largest files in a git repository.
|
||||||
# The general method is based on the script in this blog post:
|
# The general method is based on the script in this blog post:
|
||||||
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
|
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
|
||||||
#
|
#
|
||||||
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
|
# The above script worked for me, but was very slow on my 11GB repository.
|
||||||
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
|
# This version has a bunch of changes to speed things up to a more
|
||||||
|
# reasonable time. It takes less than a minute on repos with 250K objects.
|
||||||
#
|
#
|
||||||
# The MIT License (MIT)
|
# The MIT License (MIT)
|
||||||
# Copyright (c) 2015 Nick Kocharhook
|
# Copyright (c) 2015 Nick Kocharhook
|
||||||
|
# Copyright (c) 2023 Ismo Vuorinen
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
# associated documentation files (the "Software"), to deal in the Software without restriction,
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
# in the Software without restriction, including without limitation the rights
|
||||||
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
# of the Software, and to permit persons to whom the Software is
|
||||||
# furnished to do so, subject to the following conditions:
|
# furnished to do so, subject to the following conditions:
|
||||||
#
|
#
|
||||||
# The above copyright notice and this permission notice shall be included in all copies or
|
# The above copyright notice and this permission notice shall be included in all copies
|
||||||
# substantial portions of the Software.
|
# or substantial portions of the Software.
|
||||||
#
|
#
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||||
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
||||||
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
||||||
|
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
# vim:tw=120:ts=4:ft=python:norl:
|
||||||
|
|
||||||
from subprocess import check_output, CalledProcessError, Popen, PIPE
|
from subprocess import check_output, Popen, PIPE
|
||||||
import argparse
|
import argparse
|
||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
sortByOnDiskSize = False
|
sortByOnDiskSize = False
|
||||||
|
|
||||||
|
class Blob(object):
|
||||||
|
sha1 = ''
|
||||||
|
size = 0
|
||||||
|
packedSize = 0
|
||||||
|
path = ''
|
||||||
|
|
||||||
|
def __init__(self, line):
|
||||||
|
cols = line.split()
|
||||||
|
self.sha1, self.size, self.packedSize = cols[0], int(cols[2]), int(cols[3])
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return '{} - {} - {} - {}'.format(
|
||||||
|
self.sha1, self.size, self.packedSize, self.path)
|
||||||
|
|
||||||
|
def __lt__(self, other):
|
||||||
|
if (sortByOnDiskSize):
|
||||||
|
return self.size < other.size
|
||||||
|
else:
|
||||||
|
return self.packedSize < other.packedSize
|
||||||
|
|
||||||
|
def csv_line(self):
|
||||||
|
return "{},{},{},{}".format(
|
||||||
|
self.size/1024, self.packedSize/1024, self.sha1, self.path)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
global sortByOnDiskSize
|
global sortByOnDiskSize
|
||||||
|
|
||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
|
|
||||||
args = parseArguments()
|
|
||||||
sortByOnDiskSize = args.sortByOnDiskSize
|
|
||||||
sizeLimit = 1024*args.filesExceeding
|
|
||||||
|
|
||||||
if args.filesExceeding > 0:
|
args = parse_arguments()
|
||||||
print "Finding objects larger than {}kB…".format(args.filesExceeding)
|
sortByOnDiskSize = args.sortByOnDiskSize
|
||||||
else:
|
sizeLimit = 1024*args.filesExceeding
|
||||||
print "Finding the {} largest objects…".format(args.matchCount)
|
|
||||||
|
|
||||||
blobs = getTopBlobs(args.matchCount, sizeLimit)
|
if args.filesExceeding > 0:
|
||||||
|
print("Finding objects larger than {}kB…".format(args.filesExceeding))
|
||||||
|
else:
|
||||||
|
print("Finding the {} largest objects…".format(args.matchCount))
|
||||||
|
|
||||||
populateBlobPaths(blobs)
|
blobs = get_top_blobs(args.matchCount, sizeLimit)
|
||||||
printOutBlobs(blobs)
|
|
||||||
|
|
||||||
def getTopBlobs(count, sizeLimit):
|
populate_blob_paths(blobs)
|
||||||
sortColumn = 4
|
print_out_blobs(blobs)
|
||||||
|
|
||||||
if sortByOnDiskSize:
|
|
||||||
sortColumn = 3
|
|
||||||
|
|
||||||
verifyPack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sortColumn)
|
|
||||||
output = check_output(verifyPack, shell=True).split("\n")[:-1]
|
|
||||||
|
|
||||||
blobs = dict()
|
|
||||||
compareBlob = Blob("a b {} {} c".format(sizeLimit, sizeLimit)) # use __lt__ to do the appropriate comparison
|
|
||||||
|
|
||||||
for objLine in output:
|
|
||||||
blob = Blob(objLine)
|
|
||||||
|
|
||||||
if sizeLimit > 0:
|
|
||||||
if compareBlob < blob:
|
|
||||||
blobs[blob.sha1] = blob
|
|
||||||
else:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
blobs[blob.sha1] = blob
|
|
||||||
|
|
||||||
if len(blobs) == count:
|
|
||||||
break
|
|
||||||
|
|
||||||
return blobs
|
|
||||||
|
|
||||||
|
|
||||||
def populateBlobPaths(blobs):
|
def get_top_blobs(count, sizeLimit):
|
||||||
if len(blobs):
|
"""Get top blobs from git repository
|
||||||
print "Finding object paths…"
|
|
||||||
|
|
||||||
# Only include revs which have a path. Other revs aren't blobs.
|
Args:
|
||||||
revList = "git rev-list --all --objects | awk '$2 {print}'"
|
count (int): How many items to return
|
||||||
allObjectLines = check_output(revList, shell=True).split("\n")[:-1]
|
sizeLimit (int): What is the size limit
|
||||||
|
|
||||||
outstandingKeys = blobs.keys()
|
Returns:
|
||||||
|
dict: Dictionary of Blobs
|
||||||
|
"""
|
||||||
|
sortColumn = 4
|
||||||
|
|
||||||
for line in allObjectLines:
|
if sortByOnDiskSize:
|
||||||
cols = line.split()
|
sortColumn = 3
|
||||||
sha1, path = cols[0], " ".join(cols[1:])
|
|
||||||
|
|
||||||
if (sha1 in outstandingKeys):
|
verifyPack = "git verify-pack -v `git rev-parse --git-dir`/objects/pack/pack-*.idx | grep blob | sort -k{}nr".format(sortColumn) # noqa: E501
|
||||||
outstandingKeys.remove(sha1)
|
output = check_output(verifyPack, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501
|
||||||
blobs[sha1].path = path
|
|
||||||
|
|
||||||
# short-circuit the search if we're done
|
blobs = dict()
|
||||||
if not len(outstandingKeys):
|
# use __lt__ to do the appropriate comparison
|
||||||
break
|
compareBlob = Blob("a b {} {} c".format(sizeLimit, sizeLimit))
|
||||||
|
for objLine in output:
|
||||||
|
blob = Blob(objLine)
|
||||||
|
|
||||||
|
if sizeLimit > 0:
|
||||||
|
if compareBlob < blob:
|
||||||
|
blobs[blob.sha1] = blob
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
blobs[blob.sha1] = blob
|
||||||
|
|
||||||
|
if len(blobs) == count:
|
||||||
|
break
|
||||||
|
|
||||||
|
return blobs
|
||||||
|
|
||||||
|
|
||||||
def printOutBlobs(blobs):
|
def populate_blob_paths(blobs):
|
||||||
if len(blobs):
|
"""Populate blob paths that only have a path
|
||||||
csvLines = ["size,pack,hash,path"]
|
|
||||||
|
|
||||||
for blob in sorted(blobs.values(), reverse=True):
|
Args:
|
||||||
csvLines.append(blob.csvLine())
|
blobs (Blob, dict): Dictionary of Blobs
|
||||||
|
"""
|
||||||
|
if len(blobs):
|
||||||
|
print("Finding object paths…")
|
||||||
|
|
||||||
p = Popen(["column", "-t", "-s", "','"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
# Only include revs which have a path. Other revs aren't blobs.
|
||||||
stdout, stderr = p.communicate("\n".join(csvLines)+"\n")
|
revList = "git rev-list --all --objects | awk '$2 {print}'"
|
||||||
|
all_object_lines = check_output(revList, shell=True).decode('utf-8').strip().split("\n")[:-1] # noqa: E501
|
||||||
|
outstanding_keys = list(blobs.keys())
|
||||||
|
|
||||||
print "\nAll sizes in kB. The pack column is the compressed size of the object inside the pack file.\n"
|
for line in all_object_lines:
|
||||||
print stdout.rstrip('\n')
|
cols = line.split()
|
||||||
else:
|
sha1, path = cols[0], " ".join(cols[1:])
|
||||||
print "No files found which match those criteria."
|
|
||||||
|
if (sha1 in outstanding_keys):
|
||||||
|
outstanding_keys.remove(sha1)
|
||||||
|
blobs[sha1].path = path
|
||||||
|
|
||||||
|
# short-circuit the search if we're done
|
||||||
|
if not len(outstanding_keys):
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def parseArguments():
|
def print_out_blobs(blobs):
|
||||||
parser = argparse.ArgumentParser(description='List the largest files in a git repository')
|
if len(blobs):
|
||||||
parser.add_argument('-c', '--match-count', dest='matchCount', type=int, default=10,
|
csvLines = ["size,pack,hash,path"]
|
||||||
help='The number of files to return. Default is 10. Ignored if --files-exceeding is used.')
|
|
||||||
parser.add_argument('--files-exceeding', dest='filesExceeding', type=int, default=0,
|
|
||||||
help='The cutoff amount, in KB. Files with a pack size (or pyhsical size, with -p) larger than this will be printed.')
|
|
||||||
parser.add_argument('-p', '--physical-sort', dest='sortByOnDiskSize', action='store_true', default=False,
|
|
||||||
help='Sort by the on-disk size of the files. Default is to sort by the pack size.')
|
|
||||||
|
|
||||||
return parser.parse_args()
|
for blob in sorted(blobs.values(), reverse=True):
|
||||||
|
csvLines.append(blob.csv_line())
|
||||||
|
|
||||||
|
command = ["column", "-t", "-s", ","]
|
||||||
|
p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE)
|
||||||
|
|
||||||
|
# Encode the input as bytes
|
||||||
|
input_data = ("\n".join(csvLines) + "\n").encode()
|
||||||
|
|
||||||
|
stdout, _ = p.communicate(input_data)
|
||||||
|
|
||||||
|
print("\nAll sizes in kB. The pack column is the compressed size of the object inside the pack file.\n") # noqa: E501
|
||||||
|
|
||||||
|
print(stdout.decode("utf-8").rstrip('\n'))
|
||||||
|
else:
|
||||||
|
print("No files found which match those criteria.")
|
||||||
|
|
||||||
|
|
||||||
|
def parse_arguments():
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
description='List the largest files in a git repository'
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-c', '--match-count', dest='matchCount', type=int, default=10,
|
||||||
|
help='Files to return. Default is 10. Ignored if --files-exceeding is used.'
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'--files-exceeding', dest='filesExceeding', type=int, default=0,
|
||||||
|
help='The cutoff amount, in KB. Files with a pack size (or physical size, with -p) larger than this will be printed.' # noqa: E501
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
'-p', '--physical-sort', dest='sortByOnDiskSize',
|
||||||
|
action='store_true', default=False,
|
||||||
|
help='Sort by the on-disk size. Default is to sort by the pack size.'
|
||||||
|
)
|
||||||
|
|
||||||
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
def signal_handler(signal, frame):
|
def signal_handler(signal, frame):
|
||||||
@@ -138,29 +197,6 @@ def signal_handler(signal, frame):
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
|
||||||
class Blob(object):
|
|
||||||
sha1 = ''
|
|
||||||
size = 0
|
|
||||||
packedSize = 0
|
|
||||||
path = ''
|
|
||||||
|
|
||||||
def __init__(self, line):
|
|
||||||
cols = line.split()
|
|
||||||
self.sha1, self.size, self.packedSize = cols[0], int(cols[2]), int(cols[3])
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return '{} - {} - {} - {}'.format(self.sha1, self.size, self.packedSize, self.path)
|
|
||||||
|
|
||||||
def __lt__(self, other):
|
|
||||||
if (sortByOnDiskSize):
|
|
||||||
return self.size < other.size
|
|
||||||
else:
|
|
||||||
return self.packedSize < other.packedSize
|
|
||||||
|
|
||||||
def csvLine(self):
|
|
||||||
return "{},{},{},{}".format(self.size/1024, self.packedSize/1024, self.sha1, self.path)
|
|
||||||
|
|
||||||
|
|
||||||
# Default function is main()
|
# Default function is main()
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
# Modified by Ismo Vuorinen <https://github.com/ivuorinen> 2023
|
# Modified by Ismo Vuorinen <https://github.com/ivuorinen> 2023
|
||||||
|
|
||||||
# Determine width of terminal
|
# Determine width of terminal
|
||||||
hr_col_count="$(tput cols)"
|
hr_col_count="$( (tput cols - 4))"
|
||||||
if [ -z "${hr_col_count+set}" ] || [ "$hr_col_count" -lt 1 ]; then
|
if [ -z "${hr_col_count+set}" ] || [ "$hr_col_count" -lt 1 ]; then
|
||||||
hr_col_count="${COLUMNS:-80}"
|
hr_col_count="${COLUMNS:-80}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
@@ -21,33 +21,21 @@ hr_color="${hr_color:=$CLR_RED}"
|
|||||||
hr_reset="\033[0m"
|
hr_reset="\033[0m"
|
||||||
|
|
||||||
# Prints the HR line
|
# Prints the HR line
|
||||||
hr_draw_char() {
|
hr_draw_char()
|
||||||
local CHAR="$1"
|
{
|
||||||
local LINE=''
|
local CHAR="$1"
|
||||||
LINE=$(printf "%*s" "$((hr_col_count - 2))")
|
local LINE=""
|
||||||
LINE="${LINE// /${CHAR}}"
|
LINE=$(printf "%*s" "$((hr_col_count - 3))" " ")
|
||||||
echo -e "◀${hr_color}${LINE:0:${hr_col_count}}${hr_reset}▶"
|
LINE="${LINE// /${CHAR}}"
|
||||||
|
echo -e "${hr_color}${LINE:0:${hr_col_count}}${hr_reset}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Passes param and calls hr()
|
# Passes param and calls hr()
|
||||||
hr() {
|
hr()
|
||||||
for WORD in "${@:--}"; do
|
{
|
||||||
hr_draw_char "$WORD"
|
for WORD in "${@:--}"; do
|
||||||
done
|
hr_draw_char "$WORD"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# Determine if file is being run directly or sourced
|
hr "$@"
|
||||||
(
|
|
||||||
[[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|
|
||||||
|| [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \
|
|
||||||
&& printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \
|
|
||||||
|| [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
|
|
||||||
) && sourced=1 || sourced=0
|
|
||||||
|
|
||||||
# Either instantiate immediately, or set alias for later
|
|
||||||
if [ "$sourced" -eq 0 ]; then
|
|
||||||
[ "$0" == "${BASH_SOURCE[0]}" ] && hr "$@"
|
|
||||||
else
|
|
||||||
export alias hr='hr'
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,21 +16,22 @@ COLOR_S='\033[0;36m'
|
|||||||
RESET='\033[0m'
|
RESET='\033[0m'
|
||||||
|
|
||||||
# Print time-based personalized message, using figlet & lolcat if availible
|
# Print time-based personalized message, using figlet & lolcat if availible
|
||||||
function welcome_greeting () {
|
function welcome_greeting()
|
||||||
|
{
|
||||||
h=$(date +%H)
|
h=$(date +%H)
|
||||||
if [ "$h" -lt 04 ] || [ "$h" -gt 22 ];
|
if [ "$h" -lt 04 ] || [ "$h" -gt 22 ]; then
|
||||||
then greeting="Good Night"
|
greeting="Good Night"
|
||||||
elif [ "$h" -lt 12 ];
|
elif [ "$h" -lt 12 ]; then
|
||||||
then greeting="Good morning"
|
greeting="Good morning"
|
||||||
elif [ "$h" -lt 18 ];
|
elif [ "$h" -lt 18 ]; then
|
||||||
then greeting="Good afternoon"
|
greeting="Good afternoon"
|
||||||
elif [ "$h" -lt 22 ];
|
elif [ "$h" -lt 22 ]; then
|
||||||
then greeting="Good evening"
|
greeting="Good evening"
|
||||||
else
|
else
|
||||||
greeting="Hello"
|
greeting="Hello"
|
||||||
fi
|
fi
|
||||||
WELCOME_MSG="$greeting $USER!"
|
WELCOME_MSG="$greeting $USER!"
|
||||||
if hash lolcat 2>/dev/null && hash figlet 2>/dev/null; then
|
if hash lolcat 2> /dev/null && hash figlet 2> /dev/null; then
|
||||||
echo "${WELCOME_MSG}" | figlet | lolcat
|
echo "${WELCOME_MSG}" | figlet | lolcat
|
||||||
else
|
else
|
||||||
echo -e "$COLOR_P${WELCOME_MSG}${RESET}\n"
|
echo -e "$COLOR_P${WELCOME_MSG}${RESET}\n"
|
||||||
@@ -38,8 +39,9 @@ function welcome_greeting () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Print system information with neofetch, if it's installed
|
# Print system information with neofetch, if it's installed
|
||||||
function welcome_sysinfo () {
|
function welcome_sysinfo()
|
||||||
if hash neofetch 2>/dev/null; then
|
{
|
||||||
|
if hash neofetch 2> /dev/null; then
|
||||||
neofetch --shell_version off \
|
neofetch --shell_version off \
|
||||||
--disable kernel distro shell resolution cpu gpu de wm wm_theme theme icons terminal \
|
--disable kernel distro shell resolution cpu gpu de wm wm_theme theme icons terminal \
|
||||||
--backend off \
|
--backend off \
|
||||||
@@ -50,7 +52,8 @@ function welcome_sysinfo () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Print todays info: Date, IP, weather, etc
|
# Print todays info: Date, IP, weather, etc
|
||||||
function welcome_today () {
|
function welcome_today()
|
||||||
|
{
|
||||||
timeout=1
|
timeout=1
|
||||||
echo -e "\033[1;34mToday\n------"
|
echo -e "\033[1;34mToday\n------"
|
||||||
|
|
||||||
@@ -62,7 +65,7 @@ function welcome_today () {
|
|||||||
echo -e "${RESET}"
|
echo -e "${RESET}"
|
||||||
|
|
||||||
# Print IP address
|
# Print IP address
|
||||||
if hash ip 2>/dev/null; then
|
if hash ip 2> /dev/null; then
|
||||||
ip_address=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
|
ip_address=$(ip route get 8.8.8.8 | awk -F"src " 'NR==1{split($2,a," ");print a[1]}')
|
||||||
ip_interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1{split($2,a," ");print a[1]}')
|
ip_interface=$(ip route get 8.8.8.8 | awk -F"dev " 'NR==1{split($2,a," ");print a[1]}')
|
||||||
echo -e "${COLOR_S}🌐 IP: $(curl -s -m $timeout 'https://ipinfo.io/ip') (${ip_address} on ${ip_interface})"
|
echo -e "${COLOR_S}🌐 IP: $(curl -s -m $timeout 'https://ipinfo.io/ip') (${ip_address} on ${ip_interface})"
|
||||||
@@ -71,23 +74,11 @@ function welcome_today () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Putting it all together
|
# Putting it all together
|
||||||
function welcome() {
|
function welcome()
|
||||||
|
{
|
||||||
welcome_greeting
|
welcome_greeting
|
||||||
welcome_sysinfo
|
welcome_sysinfo
|
||||||
welcome_today
|
welcome_today
|
||||||
}
|
}
|
||||||
|
|
||||||
# Determine if file is being run directly or sourced
|
welcome "$@"
|
||||||
([[ -n $ZSH_EVAL_CONTEXT && $ZSH_EVAL_CONTEXT =~ :file$ ]] \
|
|
||||||
|| [[ -n $KSH_VERSION && $(cd "$(dirname -- "$0")" \
|
|
||||||
&& printf '%s' "${PWD%/}/")$(basename -- "$0") != "${.sh.file}" ]] \
|
|
||||||
|| [[ -n $BASH_VERSION ]] && (return 0 2>/dev/null)
|
|
||||||
) && sourced=1 || sourced=0
|
|
||||||
|
|
||||||
# If script being called directly run immediately
|
|
||||||
if [ "$sourced" -eq 0 ]; then
|
|
||||||
welcome "$@"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# EOF
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user