mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-02 20:48:03 +00:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| cf92bc9a69 | |||
| 1c17ee28cb | |||
| 0919a9732e | |||
| 52a941f0fa | |||
| e661f6d942 | |||
| b5160bbbfa | |||
| 2df27d2a0e | |||
|
|
0c0f3823e4 | ||
|
|
5fb433f7ac | ||
| 0fc08678a2 | |||
| ff83bc9ef1 | |||
| 492cb4dbd8 | |||
| bc608cd578 | |||
| acae4fec73 | |||
| 446d8971e7 | |||
| 2f917c9285 | |||
| 1d851708eb | |||
|
|
c3d4b51927 | ||
| 6d8c04977c | |||
| 64fc8a13d3 | |||
| 73e6f8a321 | |||
| 68727e4869 | |||
| c10654c50a | |||
| 4de181e3b2 | |||
| 8eb0d2bcab | |||
| 3154fabe26 | |||
| fb9301c095 | |||
| 906487f939 | |||
| 11c0a05c84 | |||
| 1ced69d3d7 | |||
| 168194aa74 | |||
| 51afab44ef | |||
| 31e04ce865 | |||
| 6b76bc825c | |||
| 10994347aa | |||
| 76b2236c63 | |||
| 288e63c9d9 |
@@ -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
|
||||||
|
|||||||
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
@@ -4,7 +4,6 @@ Brewfile.lock.json
|
|||||||
*cache
|
*cache
|
||||||
.idea
|
.idea
|
||||||
.vscode
|
.vscode
|
||||||
config/fzf
|
|
||||||
config/cheat/cheatsheets/pure-bash-bible/*
|
config/cheat/cheatsheets/pure-bash-bible/*
|
||||||
config/cheat/cheatsheets/tldr/*
|
config/cheat/cheatsheets/tldr/*
|
||||||
config/git/credentials
|
config/git/credentials
|
||||||
|
|||||||
18
.gitmodules
vendored
18
.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,6 @@
|
|||||||
[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"]
|
|
||||||
path = config/tmux/plugins/vim-tmux-navigator
|
|
||||||
url = https://github.com/christoomey/vim-tmux-navigator.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
|
||||||
|
|||||||
4
.yamlfmt
4
.yamlfmt
@@ -18,7 +18,5 @@ include:
|
|||||||
- ./**/*.{yml,yaml}
|
- ./**/*.{yml,yaml}
|
||||||
|
|
||||||
exclude:
|
exclude:
|
||||||
- ./tools/dotbot/**
|
- ./tools/**
|
||||||
- ./tools/dotbot-*/**
|
|
||||||
- ./config/astronvim/**
|
|
||||||
- ./config/nvim/**
|
- ./config/nvim/**
|
||||||
|
|||||||
@@ -10,28 +10,15 @@ 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 \
|
|
||||||
-f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,12 +7,13 @@ 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()
|
||||||
{
|
{
|
||||||
|
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"
|
[ -r "$file" ] && source "$file"
|
||||||
[ -r "$file-secret" ] && source "$file-secret"
|
[ -r "$file-secret" ] && source "$file-secret"
|
||||||
[ -r "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||||
[ -r "$file-$HOSTNAME-secret" ] && source "$file-$HOSTNAME-secret"
|
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
x-load-configs
|
x-load-configs
|
||||||
@@ -20,6 +21,6 @@ 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
|
||||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
|
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
|
||||||
&& source "${DOTFILES}/config/fzf/fzf.bash"
|
&& source "${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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
25
base/zshrc
25
base/zshrc
@@ -13,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
|
||||||
@@ -25,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,11 +49,9 @@ 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
|
||||||
@@ -58,11 +64,10 @@ have antigen && {
|
|||||||
antigen apply
|
antigen apply
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# shellcheck source=../config/fzf/fzf.zsh
|
||||||
[ -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: Regular
|
||||||
|
|
||||||
|
# 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
|
||||||
4
config/alias-tunkki
Executable file
4
config/alias-tunkki
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Setting aliases for tunkki
|
||||||
|
|
||||||
|
alias nvim="/snap/nvim/current/usr/bin/nvim"
|
||||||
@@ -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"
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ have ansible && {
|
|||||||
|
|
||||||
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
||||||
|
|
||||||
|
export HOMEBREW_NO_ENV_HINTS=true
|
||||||
|
|
||||||
# composer, https://getcomposer.org/
|
# composer, https://getcomposer.org/
|
||||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
||||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||||
|
|||||||
@@ -61,12 +61,16 @@ 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
|
||||||
|
|
||||||
|
# Add keychain to ssh-agent args when on macOS
|
||||||
|
have brew && zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain
|
||||||
|
|
||||||
# these should be always available
|
# these should be always available
|
||||||
antigen bundle autoenv
|
|
||||||
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
|
||||||
@@ -79,12 +83,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
|
|
||||||
}
|
}
|
||||||
|
|||||||
382
config/fzf/completion.bash
Executable file
382
config/fzf/completion.bash
Executable file
@@ -0,0 +1,382 @@
|
|||||||
|
# ____ ____
|
||||||
|
# / __/___ / __/
|
||||||
|
# / /_/_ / / /_
|
||||||
|
# / __/ / /_/ __/
|
||||||
|
# /_/ /___/_/ completion.bash
|
||||||
|
#
|
||||||
|
# - $FZF_TMUX (default: 0)
|
||||||
|
# - $FZF_TMUX_OPTS (default: empty)
|
||||||
|
# - $FZF_COMPLETION_TRIGGER (default: '**')
|
||||||
|
# - $FZF_COMPLETION_OPTS (default: empty)
|
||||||
|
|
||||||
|
if [[ $- =~ i ]]; then
|
||||||
|
|
||||||
|
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
|
||||||
|
if ! declare -f _fzf_compgen_path > /dev/null; then
|
||||||
|
_fzf_compgen_path() {
|
||||||
|
echo "$1"
|
||||||
|
command find -L "$1" \
|
||||||
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
|
||||||
|
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! declare -f _fzf_compgen_dir > /dev/null; then
|
||||||
|
_fzf_compgen_dir() {
|
||||||
|
command find -L "$1" \
|
||||||
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \
|
||||||
|
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
# To redraw line after fzf closes (printf '\e[5n')
|
||||||
|
bind '"\e[0n": redraw-current-line' 2> /dev/null
|
||||||
|
|
||||||
|
__fzf_comprun() {
|
||||||
|
if [[ "$(type -t _fzf_comprun 2>&1)" = function ]]; then
|
||||||
|
_fzf_comprun "$@"
|
||||||
|
elif [[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; }; then
|
||||||
|
shift
|
||||||
|
fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- "$@"
|
||||||
|
else
|
||||||
|
shift
|
||||||
|
fzf "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
__fzf_orig_completion() {
|
||||||
|
local l comp f cmd
|
||||||
|
while read -r l; do
|
||||||
|
if [[ "$l" =~ ^(.*\ -F)\ *([^ ]*).*\ ([^ ]*)$ ]]; then
|
||||||
|
comp="${BASH_REMATCH[1]}"
|
||||||
|
f="${BASH_REMATCH[2]}"
|
||||||
|
cmd="${BASH_REMATCH[3]}"
|
||||||
|
[[ "$f" = _fzf_* ]] && continue
|
||||||
|
printf -v "_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}" "%s" "${comp} %s ${cmd} #${f}"
|
||||||
|
if [[ "$l" = *" -o nospace "* ]] && [[ ! "${__fzf_nospace_commands-}" = *" $cmd "* ]]; then
|
||||||
|
__fzf_nospace_commands="${__fzf_nospace_commands-} $cmd "
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_opts_completion() {
|
||||||
|
local cur prev opts
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
opts="
|
||||||
|
-x --extended
|
||||||
|
-e --exact
|
||||||
|
--algo
|
||||||
|
-i +i
|
||||||
|
-n --nth
|
||||||
|
--with-nth
|
||||||
|
-d --delimiter
|
||||||
|
+s --no-sort
|
||||||
|
--tac
|
||||||
|
--tiebreak
|
||||||
|
-m --multi
|
||||||
|
--no-mouse
|
||||||
|
--bind
|
||||||
|
--cycle
|
||||||
|
--no-hscroll
|
||||||
|
--jump-labels
|
||||||
|
--height
|
||||||
|
--literal
|
||||||
|
--reverse
|
||||||
|
--margin
|
||||||
|
--inline-info
|
||||||
|
--prompt
|
||||||
|
--pointer
|
||||||
|
--marker
|
||||||
|
--header
|
||||||
|
--header-lines
|
||||||
|
--ansi
|
||||||
|
--tabstop
|
||||||
|
--color
|
||||||
|
--no-bold
|
||||||
|
--history
|
||||||
|
--history-size
|
||||||
|
--preview
|
||||||
|
--preview-window
|
||||||
|
-q --query
|
||||||
|
-1 --select-1
|
||||||
|
-0 --exit-0
|
||||||
|
-f --filter
|
||||||
|
--print-query
|
||||||
|
--expect
|
||||||
|
--sync"
|
||||||
|
|
||||||
|
case "${prev}" in
|
||||||
|
--tiebreak)
|
||||||
|
COMPREPLY=( $(compgen -W "length begin end index" -- "$cur") )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--color)
|
||||||
|
COMPREPLY=( $(compgen -W "dark light 16 bw" -- "$cur") )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
--history)
|
||||||
|
COMPREPLY=()
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ "$cur" =~ ^-|\+ ]]; then
|
||||||
|
COMPREPLY=( $(compgen -W "${opts}" -- "$cur") )
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_handle_dynamic_completion() {
|
||||||
|
local cmd orig_var orig ret orig_cmd orig_complete
|
||||||
|
cmd="$1"
|
||||||
|
shift
|
||||||
|
orig_cmd="$1"
|
||||||
|
orig_var="_fzf_orig_completion_$cmd"
|
||||||
|
orig="${!orig_var-}"
|
||||||
|
orig="${orig##*#}"
|
||||||
|
if [[ -n "$orig" ]] && type "$orig" > /dev/null 2>&1; then
|
||||||
|
$orig "$@"
|
||||||
|
elif [[ -n "${_fzf_completion_loader-}" ]]; then
|
||||||
|
orig_complete=$(complete -p "$orig_cmd" 2> /dev/null)
|
||||||
|
_completion_loader "$@"
|
||||||
|
ret=$?
|
||||||
|
# _completion_loader may not have updated completion for the command
|
||||||
|
if [[ "$(complete -p "$orig_cmd" 2> /dev/null)" != "$orig_complete" ]]; then
|
||||||
|
__fzf_orig_completion < <(complete -p "$orig_cmd" 2> /dev/null)
|
||||||
|
if [[ "${__fzf_nospace_commands-}" = *" $orig_cmd "* ]]; then
|
||||||
|
eval "${orig_complete/ -F / -o nospace -F }"
|
||||||
|
else
|
||||||
|
eval "$orig_complete"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return $ret
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
__fzf_generic_path_completion() {
|
||||||
|
local cur base dir leftover matches trigger cmd
|
||||||
|
cmd="${COMP_WORDS[0]}"
|
||||||
|
if [[ $cmd == \\* ]]; then
|
||||||
|
cmd="${cmd:1}"
|
||||||
|
fi
|
||||||
|
cmd="${cmd//[^A-Za-z0-9_=]/_}"
|
||||||
|
COMPREPLY=()
|
||||||
|
trigger=${FZF_COMPLETION_TRIGGER-'**'}
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
if [[ "$cur" == *"$trigger" ]]; then
|
||||||
|
base=${cur:0:${#cur}-${#trigger}}
|
||||||
|
eval "base=$base"
|
||||||
|
|
||||||
|
dir=
|
||||||
|
[[ $base = *"/"* ]] && dir="$base"
|
||||||
|
while true; do
|
||||||
|
if [[ -z "$dir" ]] || [[ -d "$dir" ]]; then
|
||||||
|
leftover=${base/#"$dir"}
|
||||||
|
leftover=${leftover/#\/}
|
||||||
|
[[ -z "$dir" ]] && dir='.'
|
||||||
|
[[ "$dir" != "/" ]] && dir="${dir/%\//}"
|
||||||
|
matches=$(eval "$1 $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $2" __fzf_comprun "$4" -q "$leftover" | while read -r item; do
|
||||||
|
printf "%q " "${item%$3}$3"
|
||||||
|
done)
|
||||||
|
matches=${matches% }
|
||||||
|
[[ -z "$3" ]] && [[ "${__fzf_nospace_commands-}" = *" ${COMP_WORDS[0]} "* ]] && matches="$matches "
|
||||||
|
if [[ -n "$matches" ]]; then
|
||||||
|
COMPREPLY=( "$matches" )
|
||||||
|
else
|
||||||
|
COMPREPLY=( "$cur" )
|
||||||
|
fi
|
||||||
|
printf '\e[5n'
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
dir=$(dirname "$dir")
|
||||||
|
[[ "$dir" =~ /$ ]] || dir="$dir"/
|
||||||
|
done
|
||||||
|
else
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
_fzf_handle_dynamic_completion "$cmd" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete() {
|
||||||
|
# Split arguments around --
|
||||||
|
local args rest str_arg i sep
|
||||||
|
args=("$@")
|
||||||
|
sep=
|
||||||
|
for i in "${!args[@]}"; do
|
||||||
|
if [[ "${args[$i]}" = -- ]]; then
|
||||||
|
sep=$i
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ -n "$sep" ]]; then
|
||||||
|
str_arg=
|
||||||
|
rest=("${args[@]:$((sep + 1)):${#args[@]}}")
|
||||||
|
args=("${args[@]:0:$sep}")
|
||||||
|
else
|
||||||
|
str_arg=$1
|
||||||
|
args=()
|
||||||
|
shift
|
||||||
|
rest=("$@")
|
||||||
|
fi
|
||||||
|
|
||||||
|
local cur selected trigger cmd post
|
||||||
|
post="$(caller 0 | awk '{print $2}')_post"
|
||||||
|
type -t "$post" > /dev/null 2>&1 || post=cat
|
||||||
|
|
||||||
|
cmd="${COMP_WORDS[0]//[^A-Za-z0-9_=]/_}"
|
||||||
|
trigger=${FZF_COMPLETION_TRIGGER-'**'}
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
if [[ "$cur" == *"$trigger" ]]; then
|
||||||
|
cur=${cur:0:${#cur}-${#trigger}}
|
||||||
|
|
||||||
|
selected=$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $str_arg" __fzf_comprun "${rest[0]}" "${args[@]}" -q "$cur" | $post | tr '\n' ' ')
|
||||||
|
selected=${selected% } # Strip trailing space not to repeat "-o nospace"
|
||||||
|
if [[ -n "$selected" ]]; then
|
||||||
|
COMPREPLY=("$selected")
|
||||||
|
else
|
||||||
|
COMPREPLY=("$cur")
|
||||||
|
fi
|
||||||
|
printf '\e[5n'
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
_fzf_handle_dynamic_completion "$cmd" "${rest[@]}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_path_completion() {
|
||||||
|
__fzf_generic_path_completion _fzf_compgen_path "-m" "" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Deprecated. No file only completion.
|
||||||
|
_fzf_file_completion() {
|
||||||
|
_fzf_path_completion "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_dir_completion() {
|
||||||
|
__fzf_generic_path_completion _fzf_compgen_dir "" "/" "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_kill() {
|
||||||
|
_fzf_proc_completion "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_proc_completion() {
|
||||||
|
_fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <(
|
||||||
|
command ps -eo user,pid,ppid,start,time,command 2> /dev/null ||
|
||||||
|
command ps -eo user,pid,ppid,time,args # For BusyBox
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_proc_completion_post() {
|
||||||
|
awk '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_host_completion() {
|
||||||
|
_fzf_complete +m -- "$@" < <(
|
||||||
|
command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \
|
||||||
|
<(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \
|
||||||
|
<(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |
|
||||||
|
awk '{if (length($2) > 0) {print $2}}' | sort -u
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_var_completion() {
|
||||||
|
_fzf_complete -m -- "$@" < <(
|
||||||
|
declare -xp | sed -En 's|^declare [^ ]+ ([^=]+).*|\1|p'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_alias_completion() {
|
||||||
|
_fzf_complete -m -- "$@" < <(
|
||||||
|
alias | sed -En 's|^alias ([^=]+).*|\1|p'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
# fzf options
|
||||||
|
complete -o default -F _fzf_opts_completion fzf
|
||||||
|
# fzf-tmux is a thin fzf wrapper that has only a few more options than fzf
|
||||||
|
# itself. As a quick improvement we take fzf's completion. Adding the few extra
|
||||||
|
# fzf-tmux specific options (like `-w WIDTH`) are left as a future patch.
|
||||||
|
complete -o default -F _fzf_opts_completion fzf-tmux
|
||||||
|
|
||||||
|
d_cmds="${FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir}"
|
||||||
|
a_cmds="
|
||||||
|
awk bat cat diff diff3
|
||||||
|
emacs emacsclient ex file ftp g++ gcc gvim head hg hx java
|
||||||
|
javac ld less more mvim nvim patch perl python ruby
|
||||||
|
sed sftp sort source tail tee uniq vi view vim wc xdg-open
|
||||||
|
basename bunzip2 bzip2 chmod chown curl cp dirname du
|
||||||
|
find git grep gunzip gzip hg jar
|
||||||
|
ln ls mv open rm rsync scp
|
||||||
|
svn tar unzip zip"
|
||||||
|
|
||||||
|
# Preserve existing completion
|
||||||
|
__fzf_orig_completion < <(complete -p $d_cmds $a_cmds 2> /dev/null)
|
||||||
|
|
||||||
|
if type _completion_loader > /dev/null 2>&1; then
|
||||||
|
_fzf_completion_loader=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
__fzf_defc() {
|
||||||
|
local cmd func opts orig_var orig def
|
||||||
|
cmd="$1"
|
||||||
|
func="$2"
|
||||||
|
opts="$3"
|
||||||
|
orig_var="_fzf_orig_completion_${cmd//[^A-Za-z0-9_]/_}"
|
||||||
|
orig="${!orig_var-}"
|
||||||
|
if [[ -n "$orig" ]]; then
|
||||||
|
printf -v def "$orig" "$func"
|
||||||
|
eval "$def"
|
||||||
|
else
|
||||||
|
complete -F "$func" $opts "$cmd"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Anything
|
||||||
|
for cmd in $a_cmds; do
|
||||||
|
__fzf_defc "$cmd" _fzf_path_completion "-o default -o bashdefault"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Directory
|
||||||
|
for cmd in $d_cmds; do
|
||||||
|
__fzf_defc "$cmd" _fzf_dir_completion "-o nospace -o dirnames"
|
||||||
|
done
|
||||||
|
|
||||||
|
unset cmd d_cmds a_cmds
|
||||||
|
|
||||||
|
_fzf_setup_completion() {
|
||||||
|
local kind fn cmd
|
||||||
|
kind=$1
|
||||||
|
fn=_fzf_${1}_completion
|
||||||
|
if [[ $# -lt 2 ]] || ! type -t "$fn" > /dev/null; then
|
||||||
|
echo "usage: ${FUNCNAME[0]} path|dir|var|alias|host|proc COMMANDS..."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
shift
|
||||||
|
__fzf_orig_completion < <(complete -p "$@" 2> /dev/null)
|
||||||
|
for cmd in "$@"; do
|
||||||
|
case "$kind" in
|
||||||
|
dir) __fzf_defc "$cmd" "$fn" "-o nospace -o dirnames" ;;
|
||||||
|
var) __fzf_defc "$cmd" "$fn" "-o default -o nospace -v" ;;
|
||||||
|
alias) __fzf_defc "$cmd" "$fn" "-a" ;;
|
||||||
|
*) __fzf_defc "$cmd" "$fn" "-o default -o bashdefault" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
# Environment variables / Aliases / Hosts / Process
|
||||||
|
_fzf_setup_completion 'var' export unset printenv
|
||||||
|
_fzf_setup_completion 'alias' unalias
|
||||||
|
_fzf_setup_completion 'host' ssh telnet
|
||||||
|
_fzf_setup_completion 'proc' kill
|
||||||
|
|
||||||
|
fi
|
||||||
325
config/fzf/completion.zsh
Executable file
325
config/fzf/completion.zsh
Executable file
@@ -0,0 +1,325 @@
|
|||||||
|
# ____ ____
|
||||||
|
# / __/___ / __/
|
||||||
|
# / /_/_ / / /_
|
||||||
|
# / __/ / /_/ __/
|
||||||
|
# /_/ /___/_/ completion.zsh
|
||||||
|
#
|
||||||
|
# - $FZF_TMUX (default: 0)
|
||||||
|
# - $FZF_TMUX_OPTS (default: '-d 40%')
|
||||||
|
# - $FZF_COMPLETION_TRIGGER (default: '**')
|
||||||
|
# - $FZF_COMPLETION_OPTS (default: empty)
|
||||||
|
|
||||||
|
# Both branches of the following `if` do the same thing -- define
|
||||||
|
# __fzf_completion_options such that `eval $__fzf_completion_options` sets
|
||||||
|
# all options to the same values they currently have. We'll do just that at
|
||||||
|
# the bottom of the file after changing options to what we prefer.
|
||||||
|
#
|
||||||
|
# IMPORTANT: Until we get to the `emulate` line, all words that *can* be quoted
|
||||||
|
# *must* be quoted in order to prevent alias expansion. In addition, code must
|
||||||
|
# be written in a way works with any set of zsh options. This is very tricky, so
|
||||||
|
# careful when you change it.
|
||||||
|
#
|
||||||
|
# Start by loading the builtin zsh/parameter module. It provides `options`
|
||||||
|
# associative array that stores current shell options.
|
||||||
|
if 'zmodload' 'zsh/parameter' 2>'/dev/null' && (( ${+options} )); then
|
||||||
|
# This is the fast branch and it gets taken on virtually all Zsh installations.
|
||||||
|
#
|
||||||
|
# ${(kv)options[@]} expands to array of keys (option names) and values ("on"
|
||||||
|
# or "off"). The subsequent expansion# with (j: :) flag joins all elements
|
||||||
|
# together separated by spaces. __fzf_completion_options ends up with a value
|
||||||
|
# like this: "options=(shwordsplit off aliases on ...)".
|
||||||
|
__fzf_completion_options="options=(${(j: :)${(kv)options[@]}})"
|
||||||
|
else
|
||||||
|
# This branch is much slower because it forks to get the names of all
|
||||||
|
# zsh options. It's possible to eliminate this fork but it's not worth the
|
||||||
|
# trouble because this branch gets taken only on very ancient or broken
|
||||||
|
# zsh installations.
|
||||||
|
() {
|
||||||
|
# That `()` above defines an anonymous function. This is essentially a scope
|
||||||
|
# for local parameters. We use it to avoid polluting global scope.
|
||||||
|
'local' '__fzf_opt'
|
||||||
|
__fzf_completion_options="setopt"
|
||||||
|
# `set -o` prints one line for every zsh option. Each line contains option
|
||||||
|
# name, some spaces, and then either "on" or "off". We just want option names.
|
||||||
|
# Expansion with (@f) flag splits a string into lines. The outer expansion
|
||||||
|
# removes spaces and everything that follow them on every line. __fzf_opt
|
||||||
|
# ends up iterating over option names: shwordsplit, aliases, etc.
|
||||||
|
for __fzf_opt in "${(@)${(@f)$(set -o)}%% *}"; do
|
||||||
|
if [[ -o "$__fzf_opt" ]]; then
|
||||||
|
# Option $__fzf_opt is currently on, so remember to set it back on.
|
||||||
|
__fzf_completion_options+=" -o $__fzf_opt"
|
||||||
|
else
|
||||||
|
# Option $__fzf_opt is currently off, so remember to set it back off.
|
||||||
|
__fzf_completion_options+=" +o $__fzf_opt"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# The value of __fzf_completion_options here looks like this:
|
||||||
|
# "setopt +o shwordsplit -o aliases ..."
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Enable the default zsh options (those marked with <Z> in `man zshoptions`)
|
||||||
|
# but without `aliases`. Aliases in functions are expanded when functions are
|
||||||
|
# defined, so if we disable aliases here, we'll be sure to have no pesky
|
||||||
|
# aliases in any of our functions. This way we won't need prefix every
|
||||||
|
# command with `command` or to quote every word to defend against global
|
||||||
|
# aliases. Note that `aliases` is not the only option that's important to
|
||||||
|
# control. There are several others that could wreck havoc if they are set
|
||||||
|
# to values we don't expect. With the following `emulate` command we
|
||||||
|
# sidestep this issue entirely.
|
||||||
|
'emulate' 'zsh' '-o' 'no_aliases'
|
||||||
|
|
||||||
|
# This brace is the start of try-always block. The `always` part is like
|
||||||
|
# `finally` in lesser languages. We use it to *always* restore user options.
|
||||||
|
{
|
||||||
|
|
||||||
|
# Bail out if not interactive shell.
|
||||||
|
[[ -o interactive ]] || return 0
|
||||||
|
|
||||||
|
# To use custom commands instead of find, override _fzf_compgen_{path,dir}
|
||||||
|
if ! declare -f _fzf_compgen_path > /dev/null; then
|
||||||
|
_fzf_compgen_path() {
|
||||||
|
echo "$1"
|
||||||
|
command find -L "$1" \
|
||||||
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o \( -type d -o -type f -o -type l \) \
|
||||||
|
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! declare -f _fzf_compgen_dir > /dev/null; then
|
||||||
|
_fzf_compgen_dir() {
|
||||||
|
command find -L "$1" \
|
||||||
|
-name .git -prune -o -name .hg -prune -o -name .svn -prune -o -type d \
|
||||||
|
-a -not -path "$1" -print 2> /dev/null | sed 's@^\./@@'
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
__fzf_comprun() {
|
||||||
|
if [[ "$(type _fzf_comprun 2>&1)" =~ function ]]; then
|
||||||
|
_fzf_comprun "$@"
|
||||||
|
elif [ -n "${TMUX_PANE-}" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "${FZF_TMUX_OPTS-}" ]; }; then
|
||||||
|
shift
|
||||||
|
if [ -n "${FZF_TMUX_OPTS-}" ]; then
|
||||||
|
fzf-tmux ${(Q)${(Z+n+)FZF_TMUX_OPTS}} -- "$@"
|
||||||
|
else
|
||||||
|
fzf-tmux -d ${FZF_TMUX_HEIGHT:-40%} -- "$@"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
shift
|
||||||
|
fzf "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Extract the name of the command. e.g. foo=1 bar baz**<tab>
|
||||||
|
__fzf_extract_command() {
|
||||||
|
local token tokens
|
||||||
|
tokens=(${(z)1})
|
||||||
|
for token in $tokens; do
|
||||||
|
token=${(Q)token}
|
||||||
|
if [[ "$token" =~ [[:alnum:]] && ! "$token" =~ "=" ]]; then
|
||||||
|
echo "$token"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
echo "${tokens[1]}"
|
||||||
|
}
|
||||||
|
|
||||||
|
__fzf_generic_path_completion() {
|
||||||
|
local base lbuf cmd compgen fzf_opts suffix tail dir leftover matches
|
||||||
|
base=$1
|
||||||
|
lbuf=$2
|
||||||
|
cmd=$(__fzf_extract_command "$lbuf")
|
||||||
|
compgen=$3
|
||||||
|
fzf_opts=$4
|
||||||
|
suffix=$5
|
||||||
|
tail=$6
|
||||||
|
|
||||||
|
setopt localoptions nonomatch
|
||||||
|
eval "base=$base"
|
||||||
|
[[ $base = *"/"* ]] && dir="$base"
|
||||||
|
while [ 1 ]; do
|
||||||
|
if [[ -z "$dir" || -d ${dir} ]]; then
|
||||||
|
leftover=${base/#"$dir"}
|
||||||
|
leftover=${leftover/#\/}
|
||||||
|
[ -z "$dir" ] && dir='.'
|
||||||
|
[ "$dir" != "/" ] && dir="${dir/%\//}"
|
||||||
|
matches=$(eval "$compgen $(printf %q "$dir")" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-}" __fzf_comprun "$cmd" ${(Q)${(Z+n+)fzf_opts}} -q "$leftover" | while read item; do
|
||||||
|
item="${item%$suffix}$suffix"
|
||||||
|
echo -n "${(q)item} "
|
||||||
|
done)
|
||||||
|
matches=${matches% }
|
||||||
|
if [ -n "$matches" ]; then
|
||||||
|
LBUFFER="$lbuf$matches$tail"
|
||||||
|
fi
|
||||||
|
zle reset-prompt
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
dir=$(dirname "$dir")
|
||||||
|
dir=${dir%/}/
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_path_completion() {
|
||||||
|
__fzf_generic_path_completion "$1" "$2" _fzf_compgen_path \
|
||||||
|
"-m" "" " "
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_dir_completion() {
|
||||||
|
__fzf_generic_path_completion "$1" "$2" _fzf_compgen_dir \
|
||||||
|
"" "/" ""
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_feed_fifo() (
|
||||||
|
command rm -f "$1"
|
||||||
|
mkfifo "$1"
|
||||||
|
cat <&0 > "$1" &
|
||||||
|
)
|
||||||
|
|
||||||
|
_fzf_complete() {
|
||||||
|
setopt localoptions ksh_arrays
|
||||||
|
# Split arguments around --
|
||||||
|
local args rest str_arg i sep
|
||||||
|
args=("$@")
|
||||||
|
sep=
|
||||||
|
for i in {0..${#args[@]}}; do
|
||||||
|
if [[ "${args[$i]-}" = -- ]]; then
|
||||||
|
sep=$i
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ -n "$sep" ]]; then
|
||||||
|
str_arg=
|
||||||
|
rest=("${args[@]:$((sep + 1)):${#args[@]}}")
|
||||||
|
args=("${args[@]:0:$sep}")
|
||||||
|
else
|
||||||
|
str_arg=$1
|
||||||
|
args=()
|
||||||
|
shift
|
||||||
|
rest=("$@")
|
||||||
|
fi
|
||||||
|
|
||||||
|
local fifo lbuf cmd matches post
|
||||||
|
fifo="${TMPDIR:-/tmp}/fzf-complete-fifo-$$"
|
||||||
|
lbuf=${rest[0]}
|
||||||
|
cmd=$(__fzf_extract_command "$lbuf")
|
||||||
|
post="${funcstack[1]}_post"
|
||||||
|
type $post > /dev/null 2>&1 || post=cat
|
||||||
|
|
||||||
|
_fzf_feed_fifo "$fifo"
|
||||||
|
matches=$(FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_COMPLETION_OPTS-} $str_arg" __fzf_comprun "$cmd" "${args[@]}" -q "${(Q)prefix}" < "$fifo" | $post | tr '\n' ' ')
|
||||||
|
if [ -n "$matches" ]; then
|
||||||
|
LBUFFER="$lbuf$matches"
|
||||||
|
fi
|
||||||
|
command rm -f "$fifo"
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_telnet() {
|
||||||
|
_fzf_complete +m -- "$@" < <(
|
||||||
|
command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0' |
|
||||||
|
awk '{if (length($2) > 0) {print $2}}' | sort -u
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_ssh() {
|
||||||
|
_fzf_complete +m -- "$@" < <(
|
||||||
|
setopt localoptions nonomatch
|
||||||
|
command cat <(command tail -n +1 ~/.ssh/config ~/.ssh/config.d/* /etc/ssh/ssh_config 2> /dev/null | command grep -i '^\s*host\(name\)\? ' | awk '{for (i = 2; i <= NF; i++) print $1 " " $i}' | command grep -v '[*?%]') \
|
||||||
|
<(command grep -oE '^[[a-z0-9.,:-]+' ~/.ssh/known_hosts | tr ',' '\n' | tr -d '[' | awk '{ print $1 " " $1 }') \
|
||||||
|
<(command grep -v '^\s*\(#\|$\)' /etc/hosts | command grep -Fv '0.0.0.0') |
|
||||||
|
awk '{if (length($2) > 0) {print $2}}' | sort -u
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_export() {
|
||||||
|
_fzf_complete -m -- "$@" < <(
|
||||||
|
declare -xp | sed 's/=.*//' | sed 's/.* //'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_unset() {
|
||||||
|
_fzf_complete -m -- "$@" < <(
|
||||||
|
declare -xp | sed 's/=.*//' | sed 's/.* //'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_unalias() {
|
||||||
|
_fzf_complete +m -- "$@" < <(
|
||||||
|
alias | sed 's/=.*//'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_kill() {
|
||||||
|
_fzf_complete -m --header-lines=1 --preview 'echo {}' --preview-window down:3:wrap --min-height 15 -- "$@" < <(
|
||||||
|
command ps -eo user,pid,ppid,start,time,command 2> /dev/null ||
|
||||||
|
command ps -eo user,pid,ppid,time,args # For BusyBox
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
_fzf_complete_kill_post() {
|
||||||
|
awk '{print $2}'
|
||||||
|
}
|
||||||
|
|
||||||
|
fzf-completion() {
|
||||||
|
local tokens cmd prefix trigger tail matches lbuf d_cmds
|
||||||
|
setopt localoptions noshwordsplit noksh_arrays noposixbuiltins
|
||||||
|
|
||||||
|
# http://zsh.sourceforge.net/FAQ/zshfaq03.html
|
||||||
|
# http://zsh.sourceforge.net/Doc/Release/Expansion.html#Parameter-Expansion-Flags
|
||||||
|
tokens=(${(z)LBUFFER})
|
||||||
|
if [ ${#tokens} -lt 1 ]; then
|
||||||
|
zle ${fzf_default_completion:-expand-or-complete}
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
cmd=$(__fzf_extract_command "$LBUFFER")
|
||||||
|
|
||||||
|
# Explicitly allow for empty trigger.
|
||||||
|
trigger=${FZF_COMPLETION_TRIGGER-'**'}
|
||||||
|
[ -z "$trigger" -a ${LBUFFER[-1]} = ' ' ] && tokens+=("")
|
||||||
|
|
||||||
|
# When the trigger starts with ';', it becomes a separate token
|
||||||
|
if [[ ${LBUFFER} = *"${tokens[-2]-}${tokens[-1]}" ]]; then
|
||||||
|
tokens[-2]="${tokens[-2]-}${tokens[-1]}"
|
||||||
|
tokens=(${tokens[0,-2]})
|
||||||
|
fi
|
||||||
|
|
||||||
|
lbuf=$LBUFFER
|
||||||
|
tail=${LBUFFER:$(( ${#LBUFFER} - ${#trigger} ))}
|
||||||
|
|
||||||
|
# Trigger sequence given
|
||||||
|
if [ ${#tokens} -gt 1 -a "$tail" = "$trigger" ]; then
|
||||||
|
d_cmds=(${=FZF_COMPLETION_DIR_COMMANDS:-cd pushd rmdir})
|
||||||
|
|
||||||
|
[ -z "$trigger" ] && prefix=${tokens[-1]} || prefix=${tokens[-1]:0:-${#trigger}}
|
||||||
|
[ -n "${tokens[-1]}" ] && lbuf=${lbuf:0:-${#tokens[-1]}}
|
||||||
|
|
||||||
|
if eval "type _fzf_complete_${cmd} > /dev/null"; then
|
||||||
|
prefix="$prefix" eval _fzf_complete_${cmd} ${(q)lbuf}
|
||||||
|
zle reset-prompt
|
||||||
|
elif [ ${d_cmds[(i)$cmd]} -le ${#d_cmds} ]; then
|
||||||
|
_fzf_dir_completion "$prefix" "$lbuf"
|
||||||
|
else
|
||||||
|
_fzf_path_completion "$prefix" "$lbuf"
|
||||||
|
fi
|
||||||
|
# Fall back to default completion
|
||||||
|
else
|
||||||
|
zle ${fzf_default_completion:-expand-or-complete}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
[ -z "$fzf_default_completion" ] && {
|
||||||
|
binding=$(bindkey '^I')
|
||||||
|
[[ $binding =~ 'undefined-key' ]] || fzf_default_completion=$binding[(s: :w)2]
|
||||||
|
unset binding
|
||||||
|
}
|
||||||
|
|
||||||
|
zle -N fzf-completion
|
||||||
|
bindkey '^I' fzf-completion
|
||||||
|
|
||||||
|
} always {
|
||||||
|
# Restore the original options.
|
||||||
|
eval $__fzf_completion_options
|
||||||
|
'unset' '__fzf_completion_options'
|
||||||
|
}
|
||||||
9
config/fzf/fzf.bash
Normal file → Executable file
9
config/fzf/fzf.bash
Normal file → Executable file
@@ -1,13 +1,12 @@
|
|||||||
# Setup fzf
|
# Setup fzf
|
||||||
# ---------
|
# ---------
|
||||||
if [[ ! "$PATH" == */Users/ivuorinen/.config/fzf/bin* ]]; then
|
|
||||||
PATH="${PATH:+${PATH}:}/Users/ivuorinen/.config/fzf/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Auto-completion
|
# Auto-completion
|
||||||
# ---------------
|
# ---------------
|
||||||
[[ $- == *i* ]] && source "/Users/ivuorinen/.config/fzf/shell/completion.bash" 2> /dev/null
|
# shellcheck source=completion.bash
|
||||||
|
[[ $- == *i* ]] && source "$HOME/.dotfiles/config/fzf/completion.bash" 2> /dev/null
|
||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# ------------
|
# ------------
|
||||||
source "/Users/ivuorinen/.config/fzf/shell/key-bindings.bash"
|
# shellcheck source=key-bindings.bash
|
||||||
|
source "$HOME/.dotfiles/config/fzf/key-bindings.bash"
|
||||||
|
|||||||
9
config/fzf/fzf.zsh
Normal file → Executable file
9
config/fzf/fzf.zsh
Normal file → Executable file
@@ -1,13 +1,12 @@
|
|||||||
# Setup fzf
|
# Setup fzf
|
||||||
# ---------
|
# ---------
|
||||||
if [[ ! "$PATH" == *$HOME/.config/fzf/bin* ]]; then
|
|
||||||
PATH="${PATH:+${PATH}:}$HOME/.config/fzf/bin"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Auto-completion
|
# Auto-completion
|
||||||
# ---------------
|
# ---------------
|
||||||
[[ $- == *i* ]] && source "$HOME/.config/fzf/shell/completion.zsh" 2> /dev/null
|
# shellcheck source=completion.zsh
|
||||||
|
[[ $- == *i* ]] && source "$HOME/.dotfiles/config/fzf/completion.zsh" 2> /dev/null
|
||||||
|
|
||||||
# Key bindings
|
# Key bindings
|
||||||
# ------------
|
# ------------
|
||||||
source "$HOME/.config/fzf/shell/key-bindings.zsh"
|
# shellcheck source=key-bindings.zsh
|
||||||
|
source "$HOME/.dotfiles/config/fzf/key-bindings.zsh"
|
||||||
|
|||||||
103
config/fzf/key-bindings.bash
Executable file
103
config/fzf/key-bindings.bash
Executable file
@@ -0,0 +1,103 @@
|
|||||||
|
# ____ ____
|
||||||
|
# / __/___ / __/
|
||||||
|
# / /_/_ / / /_
|
||||||
|
# / __/ / /_/ __/
|
||||||
|
# /_/ /___/_/ key-bindings.bash
|
||||||
|
#
|
||||||
|
# - $FZF_TMUX_OPTS
|
||||||
|
# - $FZF_CTRL_T_COMMAND
|
||||||
|
# - $FZF_CTRL_T_OPTS
|
||||||
|
# - $FZF_CTRL_R_OPTS
|
||||||
|
# - $FZF_ALT_C_COMMAND
|
||||||
|
# - $FZF_ALT_C_OPTS
|
||||||
|
|
||||||
|
# Key bindings
|
||||||
|
# ------------
|
||||||
|
__fzf_select__() {
|
||||||
|
local cmd opts
|
||||||
|
cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
|
-o -type f -print \
|
||||||
|
-o -type d -print \
|
||||||
|
-o -type l -print 2> /dev/null | cut -b3-"}"
|
||||||
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-} -m"
|
||||||
|
eval "$cmd" |
|
||||||
|
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) "$@" |
|
||||||
|
while read -r item; do
|
||||||
|
printf '%q ' "$item" # escape special chars
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $- =~ i ]]; then
|
||||||
|
|
||||||
|
__fzfcmd() {
|
||||||
|
[[ -n "${TMUX_PANE-}" ]] && { [[ "${FZF_TMUX:-0}" != 0 ]] || [[ -n "${FZF_TMUX_OPTS-}" ]]; } &&
|
||||||
|
echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf"
|
||||||
|
}
|
||||||
|
|
||||||
|
fzf-file-widget() {
|
||||||
|
local selected="$(__fzf_select__ "$@")"
|
||||||
|
READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$selected${READLINE_LINE:$READLINE_POINT}"
|
||||||
|
READLINE_POINT=$(( READLINE_POINT + ${#selected} ))
|
||||||
|
}
|
||||||
|
|
||||||
|
__fzf_cd__() {
|
||||||
|
local cmd opts dir
|
||||||
|
cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
|
-o -type d -print 2> /dev/null | cut -b3-"}"
|
||||||
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore --reverse ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-} +m"
|
||||||
|
dir=$(set +o pipefail; eval "$cmd" | FZF_DEFAULT_OPTS="$opts" $(__fzfcmd)) && printf 'builtin cd -- %q' "$dir"
|
||||||
|
}
|
||||||
|
|
||||||
|
__fzf_history__() {
|
||||||
|
local output opts script
|
||||||
|
opts="--height ${FZF_TMUX_HEIGHT:-40%} --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort ${FZF_CTRL_R_OPTS-} +m --read0"
|
||||||
|
script='BEGIN { getc; $/ = "\n\t"; $HISTCOUNT = $ENV{last_hist} + 1 } s/^[ *]//; print $HISTCOUNT - $. . "\t$_" if !$seen{$_}++'
|
||||||
|
output=$(
|
||||||
|
set +o pipefail
|
||||||
|
builtin fc -lnr -2147483648 |
|
||||||
|
last_hist=$(HISTTIMEFORMAT='' builtin history 1) perl -n -l0 -e "$script" |
|
||||||
|
FZF_DEFAULT_OPTS="$opts" $(__fzfcmd) --query "$READLINE_LINE"
|
||||||
|
) || return
|
||||||
|
READLINE_LINE=${output#*$'\t'}
|
||||||
|
if [[ -z "$READLINE_POINT" ]]; then
|
||||||
|
echo "$READLINE_LINE"
|
||||||
|
else
|
||||||
|
READLINE_POINT=0x7fffffff
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Required to refresh the prompt after fzf
|
||||||
|
bind -m emacs-standard '"\er": redraw-current-line'
|
||||||
|
|
||||||
|
bind -m vi-command '"\C-z": emacs-editing-mode'
|
||||||
|
bind -m vi-insert '"\C-z": emacs-editing-mode'
|
||||||
|
bind -m emacs-standard '"\C-z": vi-editing-mode'
|
||||||
|
|
||||||
|
if (( BASH_VERSINFO[0] < 4 )); then
|
||||||
|
# CTRL-T - Paste the selected file path into the command line
|
||||||
|
bind -m emacs-standard '"\C-t": " \C-b\C-k \C-u`__fzf_select__`\e\C-e\er\C-a\C-y\C-h\C-e\e \C-y\ey\C-x\C-x\C-f"'
|
||||||
|
bind -m vi-command '"\C-t": "\C-z\C-t\C-z"'
|
||||||
|
bind -m vi-insert '"\C-t": "\C-z\C-t\C-z"'
|
||||||
|
|
||||||
|
# CTRL-R - Paste the selected command from history into the command line
|
||||||
|
bind -m emacs-standard '"\C-r": "\C-e \C-u\C-y\ey\C-u"$(__fzf_history__)"\e\C-e\er"'
|
||||||
|
bind -m vi-command '"\C-r": "\C-z\C-r\C-z"'
|
||||||
|
bind -m vi-insert '"\C-r": "\C-z\C-r\C-z"'
|
||||||
|
else
|
||||||
|
# CTRL-T - Paste the selected file path into the command line
|
||||||
|
bind -m emacs-standard -x '"\C-t": fzf-file-widget'
|
||||||
|
bind -m vi-command -x '"\C-t": fzf-file-widget'
|
||||||
|
bind -m vi-insert -x '"\C-t": fzf-file-widget'
|
||||||
|
|
||||||
|
# CTRL-R - Paste the selected command from history into the command line
|
||||||
|
bind -m emacs-standard -x '"\C-r": __fzf_history__'
|
||||||
|
bind -m vi-command -x '"\C-r": __fzf_history__'
|
||||||
|
bind -m vi-insert -x '"\C-r": __fzf_history__'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ALT-C - cd into the selected directory
|
||||||
|
bind -m emacs-standard '"\ec": " \C-b\C-k \C-u`__fzf_cd__`\e\C-e\er\C-m\C-y\C-h\e \C-y\ey\C-x\C-x\C-d"'
|
||||||
|
bind -m vi-command '"\ec": "\C-z\ec\C-z"'
|
||||||
|
bind -m vi-insert '"\ec": "\C-z\ec\C-z"'
|
||||||
|
|
||||||
|
fi
|
||||||
172
config/fzf/key-bindings.fish
Executable file
172
config/fzf/key-bindings.fish
Executable file
@@ -0,0 +1,172 @@
|
|||||||
|
# ____ ____
|
||||||
|
# / __/___ / __/
|
||||||
|
# / /_/_ / / /_
|
||||||
|
# / __/ / /_/ __/
|
||||||
|
# /_/ /___/_/ key-bindings.fish
|
||||||
|
#
|
||||||
|
# - $FZF_TMUX_OPTS
|
||||||
|
# - $FZF_CTRL_T_COMMAND
|
||||||
|
# - $FZF_CTRL_T_OPTS
|
||||||
|
# - $FZF_CTRL_R_OPTS
|
||||||
|
# - $FZF_ALT_C_COMMAND
|
||||||
|
# - $FZF_ALT_C_OPTS
|
||||||
|
|
||||||
|
# Key bindings
|
||||||
|
# ------------
|
||||||
|
function fzf_key_bindings
|
||||||
|
|
||||||
|
# Store current token in $dir as root for the 'find' command
|
||||||
|
function fzf-file-widget -d "List files and folders"
|
||||||
|
set -l commandline (__fzf_parse_commandline)
|
||||||
|
set -l dir $commandline[1]
|
||||||
|
set -l fzf_query $commandline[2]
|
||||||
|
set -l prefix $commandline[3]
|
||||||
|
|
||||||
|
# "-path \$dir'*/\\.*'" matches hidden files/folders inside $dir but not
|
||||||
|
# $dir itself, even if hidden.
|
||||||
|
test -n "$FZF_CTRL_T_COMMAND"; or set -l FZF_CTRL_T_COMMAND "
|
||||||
|
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
|
||||||
|
-o -type f -print \
|
||||||
|
-o -type d -print \
|
||||||
|
-o -type l -print 2> /dev/null | sed 's@^\./@@'"
|
||||||
|
|
||||||
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
|
begin
|
||||||
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS"
|
||||||
|
eval "$FZF_CTRL_T_COMMAND | "(__fzfcmd)' -m --query "'$fzf_query'"' | while read -l r; set result $result $r; end
|
||||||
|
end
|
||||||
|
if [ -z "$result" ]
|
||||||
|
commandline -f repaint
|
||||||
|
return
|
||||||
|
else
|
||||||
|
# Remove last token from commandline.
|
||||||
|
commandline -t ""
|
||||||
|
end
|
||||||
|
for i in $result
|
||||||
|
commandline -it -- $prefix
|
||||||
|
commandline -it -- (string escape $i)
|
||||||
|
commandline -it -- ' '
|
||||||
|
end
|
||||||
|
commandline -f repaint
|
||||||
|
end
|
||||||
|
|
||||||
|
function fzf-history-widget -d "Show command history"
|
||||||
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
|
begin
|
||||||
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT $FZF_DEFAULT_OPTS --scheme=history --bind=ctrl-r:toggle-sort,ctrl-z:ignore $FZF_CTRL_R_OPTS +m"
|
||||||
|
|
||||||
|
set -l FISH_MAJOR (echo $version | cut -f1 -d.)
|
||||||
|
set -l FISH_MINOR (echo $version | cut -f2 -d.)
|
||||||
|
|
||||||
|
# history's -z flag is needed for multi-line support.
|
||||||
|
# history's -z flag was added in fish 2.4.0, so don't use it for versions
|
||||||
|
# before 2.4.0.
|
||||||
|
if [ "$FISH_MAJOR" -gt 2 -o \( "$FISH_MAJOR" -eq 2 -a "$FISH_MINOR" -ge 4 \) ];
|
||||||
|
history -z | eval (__fzfcmd) --read0 --print0 -q '(commandline)' | read -lz result
|
||||||
|
and commandline -- $result
|
||||||
|
else
|
||||||
|
history | eval (__fzfcmd) -q '(commandline)' | read -l result
|
||||||
|
and commandline -- $result
|
||||||
|
end
|
||||||
|
end
|
||||||
|
commandline -f repaint
|
||||||
|
end
|
||||||
|
|
||||||
|
function fzf-cd-widget -d "Change directory"
|
||||||
|
set -l commandline (__fzf_parse_commandline)
|
||||||
|
set -l dir $commandline[1]
|
||||||
|
set -l fzf_query $commandline[2]
|
||||||
|
set -l prefix $commandline[3]
|
||||||
|
|
||||||
|
test -n "$FZF_ALT_C_COMMAND"; or set -l FZF_ALT_C_COMMAND "
|
||||||
|
command find -L \$dir -mindepth 1 \\( -path \$dir'*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' \\) -prune \
|
||||||
|
-o -type d -print 2> /dev/null | sed 's@^\./@@'"
|
||||||
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
|
begin
|
||||||
|
set -lx FZF_DEFAULT_OPTS "--height $FZF_TMUX_HEIGHT --reverse --bind=ctrl-z:ignore $FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS"
|
||||||
|
eval "$FZF_ALT_C_COMMAND | "(__fzfcmd)' +m --query "'$fzf_query'"' | read -l result
|
||||||
|
|
||||||
|
if [ -n "$result" ]
|
||||||
|
cd -- $result
|
||||||
|
|
||||||
|
# Remove last token from commandline.
|
||||||
|
commandline -t ""
|
||||||
|
commandline -it -- $prefix
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
commandline -f repaint
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fzfcmd
|
||||||
|
test -n "$FZF_TMUX"; or set FZF_TMUX 0
|
||||||
|
test -n "$FZF_TMUX_HEIGHT"; or set FZF_TMUX_HEIGHT 40%
|
||||||
|
if [ -n "$FZF_TMUX_OPTS" ]
|
||||||
|
echo "fzf-tmux $FZF_TMUX_OPTS -- "
|
||||||
|
else if [ $FZF_TMUX -eq 1 ]
|
||||||
|
echo "fzf-tmux -d$FZF_TMUX_HEIGHT -- "
|
||||||
|
else
|
||||||
|
echo "fzf"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
bind \ct fzf-file-widget
|
||||||
|
bind \cr fzf-history-widget
|
||||||
|
bind \ec fzf-cd-widget
|
||||||
|
|
||||||
|
if bind -M insert > /dev/null 2>&1
|
||||||
|
bind -M insert \ct fzf-file-widget
|
||||||
|
bind -M insert \cr fzf-history-widget
|
||||||
|
bind -M insert \ec fzf-cd-widget
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fzf_parse_commandline -d 'Parse the current command line token and return split of existing filepath, fzf query, and optional -option= prefix'
|
||||||
|
set -l commandline (commandline -t)
|
||||||
|
|
||||||
|
# strip -option= from token if present
|
||||||
|
set -l prefix (string match -r -- '^-[^\s=]+=' $commandline)
|
||||||
|
set commandline (string replace -- "$prefix" '' $commandline)
|
||||||
|
|
||||||
|
# eval is used to do shell expansion on paths
|
||||||
|
eval set commandline $commandline
|
||||||
|
|
||||||
|
if [ -z $commandline ]
|
||||||
|
# Default to current directory with no --query
|
||||||
|
set dir '.'
|
||||||
|
set fzf_query ''
|
||||||
|
else
|
||||||
|
set dir (__fzf_get_dir $commandline)
|
||||||
|
|
||||||
|
if [ "$dir" = "." -a (string sub -l 1 -- $commandline) != '.' ]
|
||||||
|
# if $dir is "." but commandline is not a relative path, this means no file path found
|
||||||
|
set fzf_query $commandline
|
||||||
|
else
|
||||||
|
# Also remove trailing slash after dir, to "split" input properly
|
||||||
|
set fzf_query (string replace -r "^$dir/?" -- '' "$commandline")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
echo $dir
|
||||||
|
echo $fzf_query
|
||||||
|
echo $prefix
|
||||||
|
end
|
||||||
|
|
||||||
|
function __fzf_get_dir -d 'Find the longest existing filepath from input string'
|
||||||
|
set dir $argv
|
||||||
|
|
||||||
|
# Strip all trailing slashes. Ignore if $dir is root dir (/)
|
||||||
|
if [ (string length -- $dir) -gt 1 ]
|
||||||
|
set dir (string replace -r '/*$' -- '' $dir)
|
||||||
|
end
|
||||||
|
|
||||||
|
# Iteratively check if dir exists and strip tail end of path
|
||||||
|
while [ ! -d "$dir" ]
|
||||||
|
# If path is absolute, this can keep going until ends up at /
|
||||||
|
# If path is relative, this can keep going until entire input is consumed, dirname returns "."
|
||||||
|
set dir (dirname -- "$dir")
|
||||||
|
end
|
||||||
|
|
||||||
|
echo $dir
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
120
config/fzf/key-bindings.zsh
Executable file
120
config/fzf/key-bindings.zsh
Executable file
@@ -0,0 +1,120 @@
|
|||||||
|
# ____ ____
|
||||||
|
# / __/___ / __/
|
||||||
|
# / /_/_ / / /_
|
||||||
|
# / __/ / /_/ __/
|
||||||
|
# /_/ /___/_/ key-bindings.zsh
|
||||||
|
#
|
||||||
|
# - $FZF_TMUX_OPTS
|
||||||
|
# - $FZF_CTRL_T_COMMAND
|
||||||
|
# - $FZF_CTRL_T_OPTS
|
||||||
|
# - $FZF_CTRL_R_OPTS
|
||||||
|
# - $FZF_ALT_C_COMMAND
|
||||||
|
# - $FZF_ALT_C_OPTS
|
||||||
|
|
||||||
|
# Key bindings
|
||||||
|
# ------------
|
||||||
|
|
||||||
|
# The code at the top and the bottom of this file is the same as in completion.zsh.
|
||||||
|
# Refer to that file for explanation.
|
||||||
|
if 'zmodload' 'zsh/parameter' 2>'/dev/null' && (( ${+options} )); then
|
||||||
|
__fzf_key_bindings_options="options=(${(j: :)${(kv)options[@]}})"
|
||||||
|
else
|
||||||
|
() {
|
||||||
|
__fzf_key_bindings_options="setopt"
|
||||||
|
'local' '__fzf_opt'
|
||||||
|
for __fzf_opt in "${(@)${(@f)$(set -o)}%% *}"; do
|
||||||
|
if [[ -o "$__fzf_opt" ]]; then
|
||||||
|
__fzf_key_bindings_options+=" -o $__fzf_opt"
|
||||||
|
else
|
||||||
|
__fzf_key_bindings_options+=" +o $__fzf_opt"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
'emulate' 'zsh' '-o' 'no_aliases'
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
[[ -o interactive ]] || return 0
|
||||||
|
|
||||||
|
# CTRL-T - Paste the selected file path(s) into the command line
|
||||||
|
__fsel() {
|
||||||
|
local cmd="${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
|
-o -type f -print \
|
||||||
|
-o -type d -print \
|
||||||
|
-o -type l -print 2> /dev/null | cut -b3-"}"
|
||||||
|
setopt localoptions pipefail no_aliases 2> /dev/null
|
||||||
|
local item
|
||||||
|
eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_CTRL_T_OPTS-}" $(__fzfcmd) -m "$@" | while read item; do
|
||||||
|
echo -n "${(q)item} "
|
||||||
|
done
|
||||||
|
local ret=$?
|
||||||
|
echo
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
|
__fzfcmd() {
|
||||||
|
[ -n "${TMUX_PANE-}" ] && { [ "${FZF_TMUX:-0}" != 0 ] || [ -n "${FZF_TMUX_OPTS-}" ]; } &&
|
||||||
|
echo "fzf-tmux ${FZF_TMUX_OPTS:--d${FZF_TMUX_HEIGHT:-40%}} -- " || echo "fzf"
|
||||||
|
}
|
||||||
|
|
||||||
|
fzf-file-widget() {
|
||||||
|
LBUFFER="${LBUFFER}$(__fsel)"
|
||||||
|
local ret=$?
|
||||||
|
zle reset-prompt
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
zle -N fzf-file-widget
|
||||||
|
bindkey -M emacs '^T' fzf-file-widget
|
||||||
|
bindkey -M vicmd '^T' fzf-file-widget
|
||||||
|
bindkey -M viins '^T' fzf-file-widget
|
||||||
|
|
||||||
|
# ALT-C - cd into the selected directory
|
||||||
|
fzf-cd-widget() {
|
||||||
|
local cmd="${FZF_ALT_C_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \
|
||||||
|
-o -type d -print 2> /dev/null | cut -b3-"}"
|
||||||
|
setopt localoptions pipefail no_aliases 2> /dev/null
|
||||||
|
local dir="$(eval "$cmd" | FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} --reverse --bind=ctrl-z:ignore ${FZF_DEFAULT_OPTS-} ${FZF_ALT_C_OPTS-}" $(__fzfcmd) +m)"
|
||||||
|
if [[ -z "$dir" ]]; then
|
||||||
|
zle redisplay
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
zle push-line # Clear buffer. Auto-restored on next prompt.
|
||||||
|
BUFFER="builtin cd -- ${(q)dir}"
|
||||||
|
zle accept-line
|
||||||
|
local ret=$?
|
||||||
|
unset dir # ensure this doesn't end up appearing in prompt expansion
|
||||||
|
zle reset-prompt
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
zle -N fzf-cd-widget
|
||||||
|
bindkey -M emacs '\ec' fzf-cd-widget
|
||||||
|
bindkey -M vicmd '\ec' fzf-cd-widget
|
||||||
|
bindkey -M viins '\ec' fzf-cd-widget
|
||||||
|
|
||||||
|
# CTRL-R - Paste the selected command from history into the command line
|
||||||
|
fzf-history-widget() {
|
||||||
|
local selected num
|
||||||
|
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null
|
||||||
|
selected=( $(fc -rl 1 | awk '{ cmd=$0; sub(/^[ \t]*[0-9]+\**[ \t]+/, "", cmd); if (!seen[cmd]++) print $0 }' |
|
||||||
|
FZF_DEFAULT_OPTS="--height ${FZF_TMUX_HEIGHT:-40%} ${FZF_DEFAULT_OPTS-} -n2..,.. --scheme=history --bind=ctrl-r:toggle-sort,ctrl-z:ignore ${FZF_CTRL_R_OPTS-} --query=${(qqq)LBUFFER} +m" $(__fzfcmd)) )
|
||||||
|
local ret=$?
|
||||||
|
if [ -n "$selected" ]; then
|
||||||
|
num=$selected[1]
|
||||||
|
if [ -n "$num" ]; then
|
||||||
|
zle vi-fetch-history -n $num
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
zle reset-prompt
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
zle -N fzf-history-widget
|
||||||
|
bindkey -M emacs '^R' fzf-history-widget
|
||||||
|
bindkey -M vicmd '^R' fzf-history-widget
|
||||||
|
bindkey -M viins '^R' fzf-history-widget
|
||||||
|
|
||||||
|
} always {
|
||||||
|
eval $__fzf_key_bindings_options
|
||||||
|
'unset' '__fzf_key_bindings_options'
|
||||||
|
}
|
||||||
@@ -18,6 +18,8 @@ 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
|
||||||
@@ -100,8 +102,6 @@ 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"
|
||||||
# Run arbitrary commands when files change
|
# Run arbitrary commands when files change
|
||||||
@@ -411,6 +411,7 @@ mas "Actions", id: 1586435171
|
|||||||
mas "Audiobook Builder", id: 1437681957
|
mas "Audiobook Builder", id: 1437681957
|
||||||
mas "Ivory", id: 6444602274
|
mas "Ivory", id: 6444602274
|
||||||
mas "Keynote", id: 409183694
|
mas "Keynote", id: 409183694
|
||||||
|
mas "LastPass", id: 926036361
|
||||||
mas "Numbers", id: 409203825
|
mas "Numbers", id: 409203825
|
||||||
mas "Pages", id: 409201541
|
mas "Pages", id: 409201541
|
||||||
mas "Tailscale", id: 1475387142
|
mas "Tailscale", id: 1475387142
|
||||||
|
|||||||
14
config/nvim/.gitignore
vendored
14
config/nvim/.gitignore
vendored
@@ -1,6 +1,8 @@
|
|||||||
tags
|
tt.*
|
||||||
test.sh
|
.tests
|
||||||
.luarc.json
|
doc/tags
|
||||||
nvim
|
debug
|
||||||
lazy-lock.json
|
.repro
|
||||||
session.vim
|
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,30 +1,2 @@
|
|||||||
local key = vim.api.nvim_set_keymap
|
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||||
local remap = { noremap = true, silent = true }
|
require("config.lazy")
|
||||||
|
|
||||||
-- 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
|
|
||||||
|
|||||||
66
config/nvim/lazy-lock.json
Normal file
66
config/nvim/lazy-lock.json
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" },
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "3657c3f3cb2214a681fc7e95b6ffb509d076ebfb" },
|
||||||
|
"SchemaStore.nvim": { "branch": "main", "commit": "2a6a5d3e2bc8a5727b6d083d2920d12a392ed05b" },
|
||||||
|
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
|
||||||
|
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
|
||||||
|
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "9961d87bb3ec008213c46ba14b3f384a5f520eb5" },
|
||||||
|
"catppuccin": { "branch": "main", "commit": "85e93601e0f0b48aa2c6bbfae4d0e9d7a1898280" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||||
|
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
|
||||||
|
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
|
||||||
|
"flash.nvim": { "branch": "main", "commit": "8a8e74922a383c253b7f92e042b749150140c8d1" },
|
||||||
|
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "bce4576a9047085a528c479a7fe1e2f6b787b6c1" },
|
||||||
|
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||||
|
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "f014db32437aa61c86fc0ef1067cd2bc6a37205c" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
|
||||||
|
"middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" },
|
||||||
|
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
|
||||||
|
"mini.animate": { "branch": "main", "commit": "230140aa0b06af87c9d345573aab1aaf50d8b539" },
|
||||||
|
"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": "2d89ca96e08eb6e9c8e50e1bb4738bc5125c9f12" },
|
||||||
|
"neoconf.nvim": { "branch": "main", "commit": "a4eb3675cb87be2e2dcb283dddc8c7aabd2c50ca" },
|
||||||
|
"neodev.nvim": { "branch": "main", "commit": "471324e6c746284dbbdc1d357799d1911bb7e120" },
|
||||||
|
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
|
||||||
|
"noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" },
|
||||||
|
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
|
||||||
|
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "cc388d3f6b9c7c943ae2b2dcd46ad470fd257f91" },
|
||||||
|
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
|
||||||
|
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
|
||||||
|
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
|
||||||
|
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "c0170e1e2c713341805ce13fe53fe4933e8471d8" },
|
||||||
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
|
||||||
|
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "973ab742f143a796a779af4d786ec409116a0d87" },
|
||||||
|
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
|
||||||
|
"stickybuf.nvim": { "branch": "master", "commit": "4c667bc837e5e3fec5a8857ee99f1a229fc76df9" },
|
||||||
|
"tabnine": { "branch": "master", "commit": "cceef1024aa1d8a17698a77c499a124fe85f1f79" },
|
||||||
|
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "b543aaa2c9cf8123ed2fe7dbb6c211a9cd415124" },
|
||||||
|
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
|
||||||
|
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
|
||||||
|
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
|
||||||
|
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },
|
||||||
|
"vim-illuminate": { "branch": "master", "commit": "8c910b2f84ae6acd9b4b17330bb94dd783c0c11a" },
|
||||||
|
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
|
||||||
|
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
|
||||||
|
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
|
||||||
|
"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
|
||||||
3
config/nvim/lua/config/keymaps.lua
Normal file
3
config/nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
-- 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
|
||||||
60
config/nvim/lua/config/lazy.lua
Normal file
60
config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
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.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", "tokyonight", "habamax" } },
|
||||||
|
checker = { enabled = true }, -- automatically check for plugin updates
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
-- disable some rtp plugins
|
||||||
|
disabled_plugins = {
|
||||||
|
"gzip",
|
||||||
|
-- "matchit",
|
||||||
|
-- "matchparen",
|
||||||
|
-- "netrwPlugin",
|
||||||
|
"tarPlugin",
|
||||||
|
"tohtml",
|
||||||
|
"tutor",
|
||||||
|
"zipPlugin",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
11
config/nvim/lua/config/options.lua
Normal file
11
config/nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
-- 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
|
||||||
|
|
||||||
|
-- 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,279 +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",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
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" },
|
|
||||||
},
|
|
||||||
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" },
|
|
||||||
},
|
|
||||||
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/Telescope",
|
|
||||||
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" },
|
|
||||||
},
|
|
||||||
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>" })
|
|
||||||
|
|
||||||
-- Go to the next block.
|
|
||||||
--key('n', '<C-Down>', 'g%', remap )
|
|
||||||
|
|
||||||
-- Loop through brackets blocks.
|
|
||||||
--key('n', '<C-Up>', 'z%', remap )
|
|
||||||
|
|
||||||
-- Do just End on CTRL + End.
|
|
||||||
key("i", "<C-End>", "<End>", remap)
|
|
||||||
key("n", "<C-End>", "<End>", remap)
|
|
||||||
|
|
||||||
-- Do just Home on CTRL + Home.
|
|
||||||
key("i", "<C-Home>", "<End>", 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)
|
|
||||||
|
|
||||||
-- Toggle the sidebar tree of the root folder.
|
|
||||||
key("n", "<leader>e", "", {
|
|
||||||
noremap = true,
|
|
||||||
silent = true,
|
|
||||||
desc = "Open NeoTree without warnings",
|
|
||||||
callback = function() vim.cmd("Neotree toggle source=filesystem position=left") end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- 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)
|
|
||||||
|
|
||||||
-- Set 'CTRL + s as save'
|
|
||||||
key("n", "<C-s>", "<cmd>w<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)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
-- Barbar keymappings
|
|
||||||
|
|
||||||
local map = vim.api.nvim_set_keymap
|
|
||||||
local opts = { noremap = true, silent = true }
|
|
||||||
|
|
||||||
-- Move to previous/next
|
|
||||||
map("n", "<C-,>", "<Cmd>BufferPrevious<CR>", opts)
|
|
||||||
map("n", "<C-.>", "<Cmd>BufferNext<CR>", opts)
|
|
||||||
-- Re-order to previous/next
|
|
||||||
map("n", "<C-<>", "<Cmd>BufferMovePrevious<CR>", opts)
|
|
||||||
map("n", "<C->>", "<Cmd>BufferMoveNext<CR>", opts)
|
|
||||||
-- Goto buffer in position...
|
|
||||||
map("n", "<C-1>", "<Cmd>BufferGoto 1<CR>", opts)
|
|
||||||
map("n", "<C-2>", "<Cmd>BufferGoto 2<CR>", opts)
|
|
||||||
map("n", "<C-3>", "<Cmd>BufferGoto 3<CR>", opts)
|
|
||||||
map("n", "<C-4>", "<Cmd>BufferGoto 4<CR>", opts)
|
|
||||||
map("n", "<C-5>", "<Cmd>BufferGoto 5<CR>", opts)
|
|
||||||
map("n", "<C-6>", "<Cmd>BufferGoto 6<CR>", opts)
|
|
||||||
map("n", "<C-7>", "<Cmd>BufferGoto 7<CR>", opts)
|
|
||||||
map("n", "<C-8>", "<Cmd>BufferGoto 8<CR>", opts)
|
|
||||||
map("n", "<C-9>", "<Cmd>BufferGoto 9<CR>", opts)
|
|
||||||
map("n", "<C-0>", "<Cmd>BufferLast<CR>", opts)
|
|
||||||
-- Pin/unpin buffer
|
|
||||||
map("n", "<C-p>", "<Cmd>BufferPin<CR>", opts)
|
|
||||||
|
|
||||||
-- Close buffer
|
|
||||||
-- map('n', '<C-c>', '<Cmd>BufferClose<CR>', opts)
|
|
||||||
|
|
||||||
-- Wipeout buffer
|
|
||||||
-- :BufferWipeout
|
|
||||||
-- Close commands
|
|
||||||
-- :BufferCloseAllButCurrent
|
|
||||||
-- :BufferCloseAllButPinned
|
|
||||||
-- :BufferCloseAllButCurrentOrPinned
|
|
||||||
-- :BufferCloseBuffersLeft
|
|
||||||
-- :BufferCloseBuffersRight
|
|
||||||
-- Magic buffer-picking mode
|
|
||||||
map("n", "<C-p>", "<Cmd>BufferPick<CR>", opts)
|
|
||||||
-- Sort automatically by...
|
|
||||||
map("n", "<Space>bb", "<Cmd>BufferOrderByBufferNumber<CR>", opts)
|
|
||||||
map("n", "<Space>bd", "<Cmd>BufferOrderByDirectory<CR>", opts)
|
|
||||||
map("n", "<Space>bl", "<Cmd>BufferOrderByLanguage<CR>", opts)
|
|
||||||
map("n", "<Space>bw", "<Cmd>BufferOrderByWindowNumber<CR>", opts)
|
|
||||||
|
|
||||||
-- Other:
|
|
||||||
-- :BarbarEnable - enables barbar (enabled by default)
|
|
||||||
-- :BarbarDisable - very bad command, should never be used
|
|
||||||
@@ -1,146 +0,0 @@
|
|||||||
-- Completion for snippets.
|
|
||||||
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,153 +0,0 @@
|
|||||||
local option = vim.api.nvim_set_option
|
|
||||||
local set = vim.api.nvim_set_var
|
|
||||||
|
|
||||||
-- 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 = 3
|
|
||||||
|
|
||||||
-- 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-----------------
|
|
||||||
|
|
||||||
set("one_allow_itali:set cursorlinec:set cursorlines", 1)
|
|
||||||
set("do_filetype_lua", 1)
|
|
||||||
set("MRU_File", "~/.cache/vim_mru_files")
|
|
||||||
|
|
||||||
--------------------API------------------------
|
|
||||||
|
|
||||||
-- Change title accordingly.
|
|
||||||
-- option('title', true)
|
|
||||||
|
|
||||||
-- Set clipboard to be global across the system
|
|
||||||
option("clipboard", "unnamedplus")
|
|
||||||
|
|
||||||
-- Basic fold column
|
|
||||||
option("foldcolumn", "1")
|
|
||||||
|
|
||||||
-- Set dictionary to language spell
|
|
||||||
option("dictionary", "/usr/share/dict/words")
|
|
||||||
|
|
||||||
-- Wildignore for when opening files :0
|
|
||||||
option("wildignore", "*/tmp*/,*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,~$,*/.log")
|
|
||||||
|
|
||||||
-- Folding
|
|
||||||
option("foldmethod", "syntax")
|
|
||||||
|
|
||||||
-- File format for neovim reading
|
|
||||||
option("fileformat", "unix")
|
|
||||||
@@ -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 = " ",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
return { "kazhala/close-buffers.nvim" }
|
|
||||||
90
config/nvim/lua/plugins/coding.lua
Normal file
90
config/nvim/lua/plugins/coding.lua
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
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",
|
||||||
|
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-CR>",
|
||||||
|
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 },
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
return {
|
|
||||||
"LudoPinelli/comment-box.nvim",
|
|
||||||
opts = {},
|
|
||||||
}
|
|
||||||
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,29 +0,0 @@
|
|||||||
return {
|
|
||||||
"anuvyklack/fold-preview.nvim",
|
|
||||||
dependencies = { "anuvyklack/keymap-amend.nvim", "ray-x/lsp_signature.nvim" },
|
|
||||||
config = function()
|
|
||||||
local fp = require("fold-preview")
|
|
||||||
local map = require("fold-preview").mapping
|
|
||||||
local keymap = vim.keymap
|
|
||||||
keymap.amend = require("keymap-amend")
|
|
||||||
|
|
||||||
fp.setup({
|
|
||||||
default_keybindings = false,
|
|
||||||
-- another settings
|
|
||||||
})
|
|
||||||
|
|
||||||
keymap.amend("n", "K", function(original)
|
|
||||||
if not fp.show_preview() then original() end
|
|
||||||
-- or
|
|
||||||
-- if not fp.toggle_preview() then original() end
|
|
||||||
-- to close preview on second press on K.
|
|
||||||
end)
|
|
||||||
keymap.amend("n", "h", map.close_preview_open_fold)
|
|
||||||
keymap.amend("n", "l", map.close_preview_open_fold)
|
|
||||||
keymap.amend("n", "zo", map.close_preview)
|
|
||||||
keymap.amend("n", "zO", map.close_preview)
|
|
||||||
keymap.amend("n", "zc", map.close_preview_without_defer)
|
|
||||||
keymap.amend("n", "zR", map.close_preview)
|
|
||||||
keymap.amend("n", "zM", map.close_preview_without_defer)
|
|
||||||
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>hs", gs.stage_hunk, { desc = "Stage Hunk" })
|
|
||||||
map("n", "<leader>hr", gs.reset_hunk, { desc = "Reset Hunk" })
|
|
||||||
map("v", "<leader>hs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
|
||||||
map("v", "<leader>hr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
|
||||||
map("n", "<leader>hS", gs.stage_buffer, { desc = "Stage Buffer" })
|
|
||||||
map("n", "<leader>hu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
|
|
||||||
map("n", "<leader>hR", gs.reset_buffer, { desc = "Reset Buffer" })
|
|
||||||
map("n", "<leader>hp", gs.preview_hunk, { desc = "Preview Hunk" })
|
|
||||||
map("n", "<leader>hb", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
|
|
||||||
map("n", "<leader>tb", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
|
|
||||||
map("n", "<leader>hd", gs.diffthis, { desc = "Diff This" })
|
|
||||||
map("n", "<leader>hD", function() gs.diffthis("~") end)
|
|
||||||
map("n", "<leader>td", 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,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
return { "ThePrimeagen/harpoon" }
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
-- Floating statuslines for Neovim
|
|
||||||
-- https://github.com/b0o/incline.nvim
|
|
||||||
--
|
|
||||||
-- Lightweight floating statuslines, best used with
|
|
||||||
-- Neovim's global statusline (set laststatus=3).
|
|
||||||
|
|
||||||
return {
|
|
||||||
"b0o/incline.nvim",
|
|
||||||
config = {
|
|
||||||
debounce_threshold = {
|
|
||||||
falling = 50,
|
|
||||||
rising = 0,
|
|
||||||
},
|
|
||||||
hide = {
|
|
||||||
cursorline = true,
|
|
||||||
focused_win = false,
|
|
||||||
only_win = true,
|
|
||||||
},
|
|
||||||
highlight = {
|
|
||||||
groups = {
|
|
||||||
InclineNormal = {
|
|
||||||
default = true,
|
|
||||||
group = "NormalFloat",
|
|
||||||
},
|
|
||||||
InclineNormalNC = {
|
|
||||||
default = true,
|
|
||||||
group = "NormalFloat",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
ignore = {
|
|
||||||
buftypes = "special",
|
|
||||||
filetypes = {},
|
|
||||||
floating_wins = true,
|
|
||||||
unlisted_buffers = true,
|
|
||||||
wintypes = "special",
|
|
||||||
},
|
|
||||||
render = "basic",
|
|
||||||
window = {
|
|
||||||
margin = {
|
|
||||||
horizontal = 1,
|
|
||||||
vertical = 1,
|
|
||||||
},
|
|
||||||
options = {
|
|
||||||
signcolumn = "no",
|
|
||||||
wrap = false,
|
|
||||||
},
|
|
||||||
padding = 1,
|
|
||||||
padding_char = " ",
|
|
||||||
placement = {
|
|
||||||
horizontal = "right",
|
|
||||||
vertical = "top",
|
|
||||||
},
|
|
||||||
width = "fit",
|
|
||||||
winhighlight = {
|
|
||||||
active = {
|
|
||||||
EndOfBuffer = "None",
|
|
||||||
Normal = "InclineNormal",
|
|
||||||
Search = "None",
|
|
||||||
},
|
|
||||||
inactive = {
|
|
||||||
EndOfBuffer = "None",
|
|
||||||
Normal = "InclineNormalNC",
|
|
||||||
Search = "None",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
zindex = 10,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
return {
|
|
||||||
--
|
|
||||||
-- Menu
|
|
||||||
--
|
|
||||||
-- Icons on menu
|
|
||||||
"onsails/lspkind-nvim",
|
|
||||||
|
|
||||||
-- Restore folds and cursor position
|
|
||||||
"senderle/restoreview",
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Appearance
|
|
||||||
--
|
|
||||||
|
|
||||||
-- 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 = {
|
|
||||||
dim_dirname = true, -- directory name is dimmed by default
|
|
||||||
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,
|
|
||||||
nvimtree = false,
|
|
||||||
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"
|
|
||||||
},
|
|
||||||
ts_rainbow = true,
|
|
||||||
treesitter = true,
|
|
||||||
lsp_trouble = true,
|
|
||||||
which_key = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
"rcarriga/nvim-notify",
|
|
||||||
|
|
||||||
-- Status information for LSP.
|
|
||||||
"j-hui/fidget.nvim",
|
|
||||||
|
|
||||||
-- Close buffer without messing up with the window.
|
|
||||||
"famiu/bufdelete.nvim",
|
|
||||||
|
|
||||||
"nyoom-engineering/oxocarbon.nvim",
|
|
||||||
|
|
||||||
-- JSONLS
|
|
||||||
"b0o/schemastore.nvim",
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
"mrjones2014/legendary.nvim",
|
|
||||||
-- since legendary.nvim handles all your keymaps/commands,
|
|
||||||
-- its recommended to load legendary.nvim before other plugins
|
|
||||||
priority = 10000,
|
|
||||||
lazy = false,
|
|
||||||
-- sqlite is only needed if you want to use frecency sorting
|
|
||||||
-- dependencies = { 'kkharji/sqlite.lua' }
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
-- Signs for built-in marks.
|
|
||||||
|
|
||||||
return {
|
|
||||||
"chentoast/marks.nvim",
|
|
||||||
config = {
|
|
||||||
-- whether to map keybinds or not. default true
|
|
||||||
default_mappings = true,
|
|
||||||
-- which builtin marks to show. default {}
|
|
||||||
builtin_marks = { ".", "<", ">", "^" },
|
|
||||||
-- whether movements cycle back to the beginning/end of buffer. default true
|
|
||||||
cyclic = true,
|
|
||||||
-- whether the shada file is updated after modifying uppercase marks. default false
|
|
||||||
force_write_shada = false,
|
|
||||||
-- how often (in ms) to redraw signs/recompute mark positions.
|
|
||||||
-- higher values will have better performance but may cause visual lag,
|
|
||||||
-- while lower values may cause performance penalties. default 150.
|
|
||||||
refresh_interval = 250,
|
|
||||||
-- sign priorities for each type of mark - builtin marks, uppercase marks, lowercase
|
|
||||||
-- marks, and bookmarks.
|
|
||||||
-- can be either a table with all/none of the keys, or a single number, in which case
|
|
||||||
-- the priority applies to all marks.
|
|
||||||
-- default 10.
|
|
||||||
sign_priority = { lower = 10, upper = 15, builtin = 8, bookmark = 20 },
|
|
||||||
-- disables mark tracking for specific filetypes. default {}
|
|
||||||
excluded_filetypes = {},
|
|
||||||
-- marks.nvim allows you to configure up to 10 bookmark groups, each with its own
|
|
||||||
-- sign/virttext. Bookmarks can be used to group together positions and quickly move
|
|
||||||
-- across multiple buffers. default sign is '!@#$%^&*()' (from 0 to 9), and
|
|
||||||
-- default virt_text is "".
|
|
||||||
bookmark_0 = {
|
|
||||||
sign = "⚑",
|
|
||||||
virt_text = "hello world",
|
|
||||||
},
|
|
||||||
mappings = {},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -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,415 +0,0 @@
|
|||||||
-- File-tree manager.
|
|
||||||
|
|
||||||
-- 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", -- not strictly required, but recommended
|
|
||||||
"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_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
|
|
||||||
popup_border_style = "rounded", -- "double", "none", "rounded", "shadow", "single" or "solid"
|
|
||||||
enable_git_status = true,
|
|
||||||
enable_diagnostics = true,
|
|
||||||
enable_normal_mode_for_inputs = false, -- Enable normal mode for input dialogs.
|
|
||||||
|
|
||||||
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
|
|
||||||
|
|
||||||
-- 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,
|
|
||||||
log_level = "info", -- "trace", "debug", "info", "warn", "error", "fatal"
|
|
||||||
log_to_file = false, -- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
|
|
||||||
open_files_in_last_window = true, -- false = open files in top left window
|
|
||||||
resize_timer_interval = 100, -- in ms, needed for containers to redraw right aligned and faded content
|
|
||||||
sort_case_insensitive = true, -- used when sorting files and directories in the tree
|
|
||||||
use_popups_for_input = false, -- If false, inputs will use vim.ui.input() instead of custom floats.
|
|
||||||
sort_function = nil, -- use a custom function for sorting files and directories in the tree
|
|
||||||
|
|
||||||
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,
|
|
||||||
padding = 1, -- extra padding on left hand side
|
|
||||||
-- indent guides
|
|
||||||
with_markers = true,
|
|
||||||
indent_marker = "│",
|
|
||||||
last_indent_marker = "└",
|
|
||||||
highlight = "NeoTreeIndentMarker",
|
|
||||||
-- expander config, needed for nesting files
|
|
||||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
|
||||||
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 = "˖", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
|
||||||
modified = "±", -- or "", but this is redundant info if you use git_status_colors on the name
|
|
||||||
deleted = "✕", -- this can only be used in the git_status source
|
|
||||||
renamed = "↪", -- this can only be used in the git_status source
|
|
||||||
-- 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.
|
|
||||||
position = "left", -- left, right, float, current
|
|
||||||
width = 40, -- applies to left and right positions
|
|
||||||
mapping_options = {
|
|
||||||
noremap = true,
|
|
||||||
nowait = true,
|
|
||||||
},
|
|
||||||
popup = { -- settings that apply to float position only
|
|
||||||
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",
|
|
||||||
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
|
|
||||||
},
|
|
||||||
["<2-LeftMouse>"] = "open",
|
|
||||||
["<cr>"] = "open",
|
|
||||||
["<esc>"] = "cancel", -- close preview or floating neo-tree window
|
|
||||||
["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",
|
|
||||||
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
|
|
||||||
["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 = {
|
|
||||||
show_path = "none", -- "none", "relative", "absolute"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
|
|
||||||
["d"] = "delete",
|
|
||||||
["r"] = "rename",
|
|
||||||
["y"] = "copy_to_clipboard",
|
|
||||||
["x"] = "cut_to_clipboard",
|
|
||||||
["p"] = "paste_from_clipboard",
|
|
||||||
["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add":
|
|
||||||
-- ["c"] = {
|
|
||||||
-- "copy",
|
|
||||||
-- config = {
|
|
||||||
-- show_path = "none" -- "none", "relative", "absolute"
|
|
||||||
-- }
|
|
||||||
--}
|
|
||||||
["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add".
|
|
||||||
["q"] = "close_window",
|
|
||||||
["R"] = "refresh",
|
|
||||||
["?"] = "show_help",
|
|
||||||
["<"] = "prev_source",
|
|
||||||
[">"] = "next_source",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
nesting_rules = {},
|
|
||||||
filesystem = {
|
|
||||||
commands = {}, -- Add a custom command or override a global one using the same function name
|
|
||||||
components = {
|
|
||||||
harpoon_index = function(config, node, state)
|
|
||||||
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 = {
|
|
||||||
visible = false, -- when true, they will just be displayed differently than normal items
|
|
||||||
hide_dotfiles = false,
|
|
||||||
hide_gitignored = false,
|
|
||||||
hide_hidden = true, -- only works on Windows for hidden files/directories
|
|
||||||
hide_by_name = {
|
|
||||||
".git",
|
|
||||||
".DS_Store",
|
|
||||||
"thumbs.db",
|
|
||||||
".idea",
|
|
||||||
".mypy_cache",
|
|
||||||
"node_modules",
|
|
||||||
},
|
|
||||||
hide_by_pattern = { -- uses glob style patterns
|
|
||||||
--"*.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,
|
|
||||||
group_empty_dirs = false, -- when true, empty folders will be grouped together
|
|
||||||
bind_to_cwd = false, -- true creates a 2-way binding between vim's cwd and neo-tree's root
|
|
||||||
search_limit = 50, -- max number of search results when using filters
|
|
||||||
follow_current_file = {
|
|
||||||
enabled = false, -- This will find and focus the file in the active buffer every time
|
|
||||||
-- -- the current file is changed while the tree is open.
|
|
||||||
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
|
||||||
},
|
|
||||||
hijack_netrw_behavior = "open_default", -- 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
|
|
||||||
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
|
|
||||||
-- instead of relying on nvim autocmd events.
|
|
||||||
window = {
|
|
||||||
mappings = {
|
|
||||||
["."] = "set_root",
|
|
||||||
["/"] = "fuzzy_finder",
|
|
||||||
["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm
|
|
||||||
["<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",
|
|
||||||
},
|
|
||||||
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
|
|
||||||
["<down>"] = "move_cursor_down",
|
|
||||||
["<C-n>"] = "move_cursor_down",
|
|
||||||
["<up>"] = "move_cursor_up",
|
|
||||||
["<C-p>"] = "move_cursor_up",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
buffers = {
|
|
||||||
follow_current_file = {
|
|
||||||
enabled = true, -- This will find and focus the file in the active buffer every time
|
|
||||||
-- -- the current file is changed while the tree is open.
|
|
||||||
leave_dirs_open = true, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
|
||||||
},
|
|
||||||
group_empty_dirs = true, -- when true, empty folders will be grouped together
|
|
||||||
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,20 +0,0 @@
|
|||||||
local prefix = "<leader>a"
|
|
||||||
return {
|
|
||||||
"danymat/neogen",
|
|
||||||
cmd = "Neogen",
|
|
||||||
opts = {
|
|
||||||
snippet_engine = "luasnip",
|
|
||||||
languages = {
|
|
||||||
lua = { template = { annotation_convention = "ldoc" } },
|
|
||||||
typescript = { template = { annotation_convention = "tsdoc" } },
|
|
||||||
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keys = {
|
|
||||||
{ prefix .. "<cr>", function() require("neogen").generate({ type = "current" }) end, desc = "Current" },
|
|
||||||
{ prefix .. "c", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
|
|
||||||
{ prefix .. "f", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
|
|
||||||
{ prefix .. "t", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
|
|
||||||
{ prefix .. "F", 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,257 +0,0 @@
|
|||||||
-- 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 = {
|
|
||||||
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,92 +0,0 @@
|
|||||||
--
|
|
||||||
-- Shows how to use the DAP plugin to debug your code.
|
|
||||||
--
|
|
||||||
-- Primarily focused on configuring the debugger for Go, but can
|
|
||||||
-- be extended to other languages as well. That's why it's called
|
|
||||||
-- kickstart.nvim and not kitchen-sink.nvim ;)
|
|
||||||
|
|
||||||
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",
|
|
||||||
"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,81 +1,17 @@
|
|||||||
return {
|
return {
|
||||||
-- LSP auto-complete.
|
|
||||||
"neovim/nvim-lspconfig",
|
"neovim/nvim-lspconfig",
|
||||||
dependencies = {
|
opts = {
|
||||||
-- Automatically install LSPs to stdpath for neovim
|
servers = { eslint = {} },
|
||||||
{ "williamboman/mason.nvim", config = true },
|
setup = {
|
||||||
"williamboman/mason-lspconfig.nvim",
|
eslint = function()
|
||||||
|
require("lazyvim.util").on_attach(function(client)
|
||||||
-- Useful status updates for LSP
|
if client.name == "eslint" then
|
||||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
client.server_capabilities.documentFormattingProvider = true
|
||||||
{ "j-hui/fidget.nvim", tag = "legacy", opts = {} },
|
elseif client.name == "tsserver" then
|
||||||
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
-- Additional lua configuration, makes nvim stuff amazing!
|
end
|
||||||
"folke/neodev.nvim",
|
end)
|
||||||
},
|
|
||||||
init = function()
|
|
||||||
-- 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,9 +0,0 @@
|
|||||||
return {
|
|
||||||
"chrisgrieser/nvim-origami",
|
|
||||||
event = "BufReadPost", -- later or on keypress would prevent saving folds
|
|
||||||
opts = {
|
|
||||||
keepFoldsAcrossSessions = true,
|
|
||||||
pauseFoldsOnSearch = true,
|
|
||||||
setupFoldKeymaps = true,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
return {
|
|
||||||
"bennypowers/nvim-regexplainer",
|
|
||||||
opts = {},
|
|
||||||
ft = { "html", "javascript", "javascriptreact", "typescript", "typescriptreact" },
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
--[[
|
|
||||||
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
|
|
||||||
]]
|
|
||||||
|
|
||||||
return {
|
|
||||||
"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,
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter-context",
|
|
||||||
lazy = false,
|
|
||||||
enabled = true,
|
|
||||||
opts = {
|
|
||||||
enable = true,
|
|
||||||
mode = "cursor", -- cursor, or topline
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
-- Treesitter (more highlight for syntax_on).
|
|
||||||
|
|
||||||
return {
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
build = ":TSUpdate",
|
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
-- 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",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Autoinstall languages that are not installed.
|
|
||||||
auto_install = true,
|
|
||||||
|
|
||||||
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,
|
|
||||||
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
|
||||||
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,
|
|
||||||
set_jumps = true, -- whether to set jumps in the jumplist
|
|
||||||
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,
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
-- Fold code.
|
|
||||||
|
|
||||||
return {
|
|
||||||
"anuvyklack/pretty-fold.nvim",
|
|
||||||
config = {
|
|
||||||
fill_char = "•",
|
|
||||||
sections = {
|
|
||||||
left = {
|
|
||||||
"content",
|
|
||||||
},
|
|
||||||
right = {
|
|
||||||
" ",
|
|
||||||
"number_of_folded_lines",
|
|
||||||
": ",
|
|
||||||
"percentage",
|
|
||||||
" ",
|
|
||||||
function(config) return config.fill_char:rep(3) end,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
remove_fold_markers = false,
|
|
||||||
|
|
||||||
-- Keep the indentation of the content of the fold string.
|
|
||||||
keep_indentation = true,
|
|
||||||
|
|
||||||
-- Possible values:
|
|
||||||
-- "delete" : Delete all comment signs from the fold string.
|
|
||||||
-- "spaces" : Replace all comment signs with equal number of spaces.
|
|
||||||
-- false : Do nothing with comment signs.
|
|
||||||
process_comment_signs = "spaces",
|
|
||||||
|
|
||||||
-- Comment signs additional to the value of `&commentstring` option.
|
|
||||||
comment_signs = {
|
|
||||||
{ "/**", "*/" }, -- multiline comment
|
|
||||||
{ "<!--", "-->" }, -- multiline comment
|
|
||||||
{ "%--[[", "--]]" }, -- multiline comment
|
|
||||||
},
|
|
||||||
|
|
||||||
-- List of patterns that will be removed from content foldtext section.
|
|
||||||
stop_words = {
|
|
||||||
"@brief%s*", -- (for C++) Remove '@brief' and all spaces after.
|
|
||||||
},
|
|
||||||
|
|
||||||
add_close_pattern = true,
|
|
||||||
matchup_patterns = {
|
|
||||||
{ "{", "}" },
|
|
||||||
{ "%(", ")" }, -- % to escape lua pattern char
|
|
||||||
{ "%[", "]" }, -- % to escape lua pattern char
|
|
||||||
{ "if%s", "end" },
|
|
||||||
{ "do%s", "end" },
|
|
||||||
{ "for%s", "end" },
|
|
||||||
{ "function%s*%(", "end" }, -- 'function(' or 'function ('
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"jay-babu/project.nvim",
|
|
||||||
name = "project_nvim",
|
|
||||||
event = "VeryLazy",
|
|
||||||
opts = { ignore_lsp = { "lua_ls" } },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
optional = true,
|
|
||||||
dependencies = { "project_nvim" },
|
|
||||||
opts = function() require("telescope").load_extension("projects") end,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,97 +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,7 +0,0 @@
|
|||||||
return {
|
|
||||||
"m4xshen/smartcolumn.nvim",
|
|
||||||
opts = {
|
|
||||||
colorcolumn = { "80", "100", "120" },
|
|
||||||
disabled_filetypes = { "help", "text", "markdown", "json", "lazy", "starter", "neo-tree" },
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
return { "stevearc/stickybuf.nvim", opts = {} }
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
return {
|
|
||||||
"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>" },
|
|
||||||
}
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
-- Telescope, a see-all-through file manager.
|
|
||||||
return {
|
|
||||||
"nvim-telescope/telescope.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/popup.nvim",
|
|
||||||
"nvim-lua/plenary.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,
|
|
||||||
},
|
|
||||||
|
|
||||||
extensions_list = { "themes", "terms" },
|
|
||||||
})
|
|
||||||
|
|
||||||
pcall(require("telescope").load_extension, "fzf")
|
|
||||||
pcall(require("telescope").load_extension, "file_browser")
|
|
||||||
|
|
||||||
-- See `:help telescope.builtin`
|
|
||||||
vim.keymap.set("n", "<leader>?", require("telescope.builtin").oldfiles, { desc = "[?] Find recently opened files" })
|
|
||||||
vim.keymap.set("n", "<leader><space>", require("telescope.builtin").buffers, { desc = "[ ] Find existing buffers" })
|
|
||||||
vim.keymap.set("n", "<leader>/", function()
|
|
||||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
|
||||||
require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
|
||||||
winblend = 10,
|
|
||||||
previewer = false,
|
|
||||||
}))
|
|
||||||
end, { desc = "[/] Fuzzily search in current buffer" })
|
|
||||||
|
|
||||||
vim.keymap.set(
|
|
||||||
"n",
|
|
||||||
"<leader>tg",
|
|
||||||
require("telescope.builtin").git_files,
|
|
||||||
{ desc = "[T]elescope: Search [G]it files" }
|
|
||||||
)
|
|
||||||
vim.keymap.set("n", "<leader>tf", require("telescope.builtin").find_files, { desc = "[T]elescope: Search [F]iles" })
|
|
||||||
vim.keymap.set("n", "<leader>th", require("telescope.builtin").help_tags, { desc = "[T]elescope: Search [H]elp" })
|
|
||||||
vim.keymap.set(
|
|
||||||
"n",
|
|
||||||
"<leader>tw",
|
|
||||||
require("telescope.builtin").grep_string,
|
|
||||||
{ desc = "[T]elescope: Search current [W]ord" }
|
|
||||||
)
|
|
||||||
vim.keymap.set(
|
|
||||||
"n",
|
|
||||||
"<leader>tr",
|
|
||||||
require("telescope.builtin").live_grep,
|
|
||||||
{ desc = "[T]elescope: Search by G[r]ep" }
|
|
||||||
)
|
|
||||||
vim.keymap.set(
|
|
||||||
"n",
|
|
||||||
"<leader>td",
|
|
||||||
require("telescope.builtin").diagnostics,
|
|
||||||
{ desc = "[T]elescope: Search [D]iagnostics" }
|
|
||||||
)
|
|
||||||
|
|
||||||
vim.keymap.set(
|
|
||||||
"n",
|
|
||||||
"<leader>tb",
|
|
||||||
":Telescope file_browser<CR>",
|
|
||||||
{ desc = "[T]elescope: File [B]rowser", noremap = true }
|
|
||||||
)
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
-- Trouble for diagnostics of plugins
|
|
||||||
return {
|
|
||||||
"folke/trouble.nvim",
|
|
||||||
dependencies = "kyazdani42/nvim-web-devicons",
|
|
||||||
config = {
|
|
||||||
-- your configuration comes here
|
|
||||||
-- or leave it empty to use the default settings
|
|
||||||
-- refer to the configuration section below
|
|
||||||
|
|
||||||
position = "bottom", -- position of the list can be: bottom, top, left, right
|
|
||||||
height = 10, -- height of the trouble list when position is top or bottom
|
|
||||||
width = 50, -- width of the list when position is left or right
|
|
||||||
icons = true, -- use devicons for filenames
|
|
||||||
mode = "workspace_diagnostics", -- "workspace_diagnostics", "document_diagnostics", "quickfix", "lsp_references", "loclist"
|
|
||||||
fold_open = "", -- icon used for open folds
|
|
||||||
fold_closed = "", -- icon used for closed folds
|
|
||||||
group = true, -- group results by file
|
|
||||||
padding = true, -- add an extra new line on top of the list
|
|
||||||
action_keys = { -- key mappings for actions in the trouble list
|
|
||||||
-- map to {} to remove a mapping, for example:
|
|
||||||
-- close = {},
|
|
||||||
close = "q", -- close the list
|
|
||||||
cancel = "<esc>", -- cancel the preview and get back to your last window / buffer / cursor
|
|
||||||
refresh = "r", -- manually refresh
|
|
||||||
jump = { "<cr>", "<tab>" }, -- jump to the diagnostic or open / close folds
|
|
||||||
open_split = { "<c-x>" }, -- open buffer in new split
|
|
||||||
open_vsplit = { "<c-v>" }, -- open buffer in new vsplit
|
|
||||||
open_tab = { "<c-t>" }, -- open buffer in new tab
|
|
||||||
jump_close = { "o" }, -- jump to the diagnostic and close the list
|
|
||||||
toggle_mode = "m", -- toggle between "workspace" and "document" diagnostics mode
|
|
||||||
toggle_preview = "P", -- toggle auto_preview
|
|
||||||
hover = "K", -- opens a small popup with the full multiline message
|
|
||||||
preview = "p", -- preview the diagnostic location
|
|
||||||
close_folds = { "zM", "zm" }, -- close all folds
|
|
||||||
open_folds = { "zR", "zr" }, -- open all folds
|
|
||||||
toggle_fold = { "zA", "za" }, -- toggle fold of current file
|
|
||||||
previous = "k", -- preview item
|
|
||||||
next = "j", -- next item
|
|
||||||
},
|
|
||||||
indent_lines = true, -- add an indent guide below the fold icons
|
|
||||||
auto_open = false, -- automatically open the list when you have diagnostics
|
|
||||||
auto_close = false, -- automatically close the list when you have no diagnostics
|
|
||||||
auto_preview = true, -- automatically preview the location of the diagnostic. <esc> to close preview and go back to last window
|
|
||||||
auto_fold = false, -- automatically fold a file trouble list at creation
|
|
||||||
auto_jump = { "lsp_definitions" }, -- for the given modes, automatically jump if there is only a single result
|
|
||||||
signs = {
|
|
||||||
-- icons / text used for a diagnostic
|
|
||||||
error = "",
|
|
||||||
warning = "",
|
|
||||||
hint = "",
|
|
||||||
information = "",
|
|
||||||
other = "",
|
|
||||||
},
|
|
||||||
use_diagnostic_signs = false, -- enabling this will use the signs defined in your lsp client
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
-- Dim
|
|
||||||
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
|
|
||||||
},
|
|
||||||
}
|
|
||||||
42
config/nvim/lua/plugins/ui.lua
Normal file
42
config/nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
-- 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",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- 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 = 10
|
||||||
|
vim.o.winminwidth = 10
|
||||||
|
vim.o.equalalways = false
|
||||||
|
require("windows").setup()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
-- Colorizer for strings.
|
|
||||||
|
|
||||||
-- Minimise code.
|
|
||||||
local set = vim.api.nvim_set_var
|
|
||||||
|
|
||||||
return {
|
|
||||||
"RRethy/vim-hexokinase",
|
|
||||||
build = "cd ~/.local/share/nvim/lazy/vim-hexokinase && make hexokinase",
|
|
||||||
init = function()
|
|
||||||
-- All possible highlighters
|
|
||||||
set("Hexokinase_highlighters", {
|
|
||||||
"virtual",
|
|
||||||
"sign_column",
|
|
||||||
"background",
|
|
||||||
"backgroundfull",
|
|
||||||
-- 'foreground',
|
|
||||||
-- 'foregroundfull'
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Patterns to match for all filetypes
|
|
||||||
-- Can be a comma separated string or a list of strings
|
|
||||||
|
|
||||||
-- All possible values
|
|
||||||
set("Hexokinase_optInPatterns", {
|
|
||||||
"full_hex",
|
|
||||||
"triple_hex",
|
|
||||||
"rgb",
|
|
||||||
"rgba",
|
|
||||||
"hsl",
|
|
||||||
"hsla",
|
|
||||||
"colour_names",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Filetype specific patterns to match
|
|
||||||
-- entry value must be comma seperated list
|
|
||||||
set("Hexokinase_ftOptInPatterns", {
|
|
||||||
css = "full_hex,rgb,rgba,hsl,hsla,colour_names",
|
|
||||||
html = "full_hex,rgb,rgba,hsl,hsla,colour_names",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Sample value, to keep default behaviour don't define this', variable
|
|
||||||
set("Hexokinase_ftEnabled", {
|
|
||||||
"css",
|
|
||||||
"html",
|
|
||||||
"javascript",
|
|
||||||
"scss",
|
|
||||||
"sass",
|
|
||||||
"lua",
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Turn the colors on.
|
|
||||||
--vim.cmd('au BufEnter * HexokinaseTurnOn')
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
-- Move faster between context.
|
|
||||||
|
|
||||||
return {
|
|
||||||
"andymass/vim-matchup",
|
|
||||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
|
||||||
config = {
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
disable = {},
|
|
||||||
},
|
|
||||||
indent = {
|
|
||||||
enable = false,
|
|
||||||
disable = {},
|
|
||||||
},
|
|
||||||
autotag = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
matchup = {
|
|
||||||
enable = true, -- mandatory, false will disable the whole extension
|
|
||||||
--disable = { "c", "ruby" }, -- optional, list of language that will be disabled
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
return { "tpope/vim-sleuth" }
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
return {
|
|
||||||
"wakatime/vim-wakatime",
|
|
||||||
lazy = false,
|
|
||||||
enabled = true,
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
local vim = vim
|
|
||||||
|
|
||||||
return {
|
|
||||||
"folke/which-key.nvim",
|
|
||||||
enabled = true,
|
|
||||||
lazy = false,
|
|
||||||
init = function()
|
|
||||||
vim.o.timeout = true
|
|
||||||
vim.o.timeoutlen = 300
|
|
||||||
end,
|
|
||||||
opts = {
|
|
||||||
-- your configuration comes here
|
|
||||||
-- or leave it empty to use the default settings
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -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
|
||||||
143
config/starship.toml
Normal file
143
config/starship.toml
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
# 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 = 1000
|
||||||
|
|
||||||
|
[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 = " "
|
||||||
|
|
||||||
|
[fill]
|
||||||
|
symbol = '·'
|
||||||
|
style = 'bold black'
|
||||||
|
|
||||||
|
[gcloud]
|
||||||
|
format = ' [($symbol)$account(@$domain)(\($region\))]($style) '
|
||||||
|
|
||||||
|
[git_branch]
|
||||||
|
symbol = " "
|
||||||
|
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 = " "
|
||||||
|
|
||||||
|
[hostname]
|
||||||
|
ssh_symbol = " "
|
||||||
|
|
||||||
|
[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) "
|
||||||
|
style = "bright-black"
|
||||||
|
|
||||||
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
Submodule config/tmux/plugins/vim-tmux-navigator deleted from 85b8e5f60c
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user