mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-27 23:41:05 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
840bd85232 | ||
| c81ee240bf | |||
| e215fe0a2f | |||
| 38e340ac8d | |||
| c9383f955c | |||
| 8eeaea802a | |||
| d626731736 | |||
| e459cd99e7 | |||
| 3e4391adda | |||
| a6400943d2 | |||
| 5ec8e89641 | |||
|
|
115dac4fb4 | ||
|
|
405e2d5c77 | ||
| 535925aeaf | |||
|
|
7fa29ae3d6 | ||
|
|
b1a01b6717 | ||
|
|
b9d2ee01ed | ||
| e81938a04d |
@@ -14,7 +14,7 @@ max_line_length = 100
|
||||
[*.lua]
|
||||
max_line_length = 120
|
||||
|
||||
[*.php]
|
||||
[*.{php,fish}]
|
||||
indent_size = 4
|
||||
|
||||
[.git{ignore,modules}]
|
||||
|
||||
4
.github/workflows/changelog.yml
vendored
4
.github/workflows/changelog.yml
vendored
@@ -18,11 +18,11 @@ jobs:
|
||||
permissions: write-all
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Create changelog text
|
||||
id: changelog
|
||||
uses: loopwerk/tag-changelog@941366edb8920e2071eae0449031830984b9f26e # v1
|
||||
uses: loopwerk/tag-changelog@941366edb8920e2071eae0449031830984b9f26e # v1.3.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config_file: .github/tag-changelog-config.js
|
||||
|
||||
8
.github/workflows/linters.yml
vendored
8
.github/workflows/linters.yml
vendored
@@ -20,10 +20,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: GitHub Actions
|
||||
uses: reviewdog/action-actionlint@db58217885f9a6570da9c71be4e40ec33fe44a1f # v1
|
||||
uses: reviewdog/action-actionlint@a5524e1c19e62881d79c1f1b9b6f09f16356e281 # v1.65.2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
reporter: github-pr-review
|
||||
@@ -35,13 +35,13 @@ jobs:
|
||||
reporter: github-pr-review
|
||||
|
||||
- name: markdownlint
|
||||
uses: reviewdog/action-markdownlint@f901468edf9a3634dd39b35ba26cad0aad1a0bfd # v0
|
||||
uses: reviewdog/action-markdownlint@3667398db9118d7e78f7a63d10e26ce454ba5f58 # v0.26.2
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
reporter: github-pr-review
|
||||
|
||||
- name: shfmt
|
||||
uses: reviewdog/action-shfmt@f59386f08bd9a24ac1a746e69f026ddc2ed06710 # v1
|
||||
uses: reviewdog/action-shfmt@d8f080930b9be5847b4f97e9f4122b81a82aaeac # v1.0.4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
shfmt_flags: |
|
||||
|
||||
8
.github/workflows/new-release.yml
vendored
8
.github/workflows/new-release.yml
vendored
@@ -24,23 +24,23 @@ jobs:
|
||||
version: ${{ steps.daily-version.outputs.version }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Create tag if necessary
|
||||
uses: fregante/daily-version-action@fb1a60b7c4daf1410cd755e360ebec3901e58588 # v2
|
||||
uses: fregante/daily-version-action@fb1a60b7c4daf1410cd755e360ebec3901e58588 # v2.1.3
|
||||
id: daily-version
|
||||
|
||||
- name: Create changelog text
|
||||
if: steps.daily-version.outputs.created
|
||||
id: changelog
|
||||
uses: loopwerk/tag-changelog@941366edb8920e2071eae0449031830984b9f26e # v1
|
||||
uses: loopwerk/tag-changelog@941366edb8920e2071eae0449031830984b9f26e # v1.3.0
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config_file: .github/tag-changelog-config.js
|
||||
|
||||
- name: Create release
|
||||
if: steps.daily-version.outputs.created
|
||||
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2
|
||||
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tag_name: ${{ steps.daily-version.outputs.version }}
|
||||
|
||||
6
.github/workflows/pre-commit-autoupdate.yml
vendored
6
.github/workflows/pre-commit-autoupdate.yml
vendored
@@ -23,13 +23,13 @@ jobs:
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
||||
- uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
|
||||
|
||||
- run: pip install pre-commit && pre-commit autoupdate
|
||||
|
||||
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7
|
||||
- uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
branch: update/pre-commit-hooks
|
||||
|
||||
2
.github/workflows/update-submodules.yml
vendored
2
.github/workflows/update-submodules.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
submodules: true
|
||||
fetch-depth: 2
|
||||
|
||||
@@ -29,7 +29,7 @@ repos:
|
||||
args: [-c, .markdownlint.json, --fix]
|
||||
|
||||
- repo: https://github.com/adrienverge/yamllint
|
||||
rev: v1.36.1
|
||||
rev: v1.37.0
|
||||
hooks:
|
||||
- id: yamllint
|
||||
|
||||
@@ -49,7 +49,7 @@ repos:
|
||||
- id: actionlint
|
||||
|
||||
- repo: https://github.com/renovatebot/pre-commit-hooks
|
||||
rev: 39.205.1
|
||||
rev: 39.212.0
|
||||
hooks:
|
||||
- id: renovate-config-validator
|
||||
|
||||
@@ -57,3 +57,9 @@ repos:
|
||||
rev: v2.0.2
|
||||
hooks:
|
||||
- id: stylua # or stylua-system / stylua-github
|
||||
|
||||
- repo: https://github.com/hugoh/pre-commit-fish.git
|
||||
rev: v1.2
|
||||
hooks:
|
||||
- id: fish_syntax
|
||||
- id: fish_indent
|
||||
|
||||
@@ -1 +1 @@
|
||||
lts/*
|
||||
v22.14.0
|
||||
|
||||
21
config/aqua/aqua.yaml
Normal file
21
config/aqua/aqua.yaml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/aquaproj/aqua/main/json-schema/aqua-yaml.json
|
||||
# aqua - Declarative CLI Version Manager
|
||||
# https://aquaproj.github.io/
|
||||
# checksum:
|
||||
# enabled: true
|
||||
# require_checksum: true
|
||||
# supported_envs:
|
||||
# - all
|
||||
registries:
|
||||
- type: standard
|
||||
ref: v4.331.0 # renovate: depName=aquaproj/aqua-registry
|
||||
packages:
|
||||
- name: cli/cli
|
||||
version: 'v2.69.0'
|
||||
- name: junegunn/fzf
|
||||
version: 'v0.60.3'
|
||||
- name: jqlang/jq
|
||||
version: 'jq-1.7.1'
|
||||
- name: 1password/cli
|
||||
version: '2.30.3'
|
||||
@@ -1,6 +1,8 @@
|
||||
// These are golang packages I use,
|
||||
// so they should be available with all versions
|
||||
|
||||
// Aqua is a package manager like asdf, or Brew
|
||||
github.com/aquaproj/aqua/v2/cmd/aqua@latest
|
||||
// Git Profile allows you to switch between user profiles in git repos
|
||||
github.com/dotzero/git-profile@v1.4.0
|
||||
// An extensible command line tool or library to format yaml files.
|
||||
|
||||
@@ -3,70 +3,106 @@
|
||||
alias vim='vim -u "$XDG_CONFIG_HOME/vim/vimrc"'
|
||||
|
||||
# eza aliases if eza is installed
|
||||
if type -q eza > /dev/null
|
||||
if type -q eza >/dev/null
|
||||
function eza_git -d "Use eza and its git options if in a git repo"
|
||||
if git rev-parse --is-inside-work-tree &>/dev/null
|
||||
eza --group-directories-first --icons=always --smart-group --git $argv
|
||||
else
|
||||
eza --group-directories-first --icons=always --smart-group $argv
|
||||
end
|
||||
end
|
||||
|
||||
function eza_git -d "Use eza and its git options if in a git repo"
|
||||
if git rev-parse --is-inside-work-tree &>/dev/null
|
||||
eza --group-directories-first --icons=always --smart-group --git $argv
|
||||
else
|
||||
eza --group-directories-first --icons=always --smart-group $argv
|
||||
end
|
||||
end
|
||||
function lsa --wraps='eza_git -al' --description 'eza -al'
|
||||
eza_git -al $argv
|
||||
end
|
||||
|
||||
function lsa --wraps='eza_git -al' --description 'eza -al'
|
||||
eza_git -al $argv
|
||||
end
|
||||
function ls --wraps='eza_git' --description eza
|
||||
eza_git $argv
|
||||
end
|
||||
|
||||
function ls --wraps='eza_git' --description 'eza'
|
||||
eza_git $argv
|
||||
end
|
||||
function ll --wraps='eza_git -l' --description 'eza -l'
|
||||
eza_git -l $argv
|
||||
end
|
||||
|
||||
function ll --wraps='eza_git -l' --description 'eza -l'
|
||||
eza_git -l $argv
|
||||
end
|
||||
|
||||
function l --wraps='eza_git' --description 'eza'
|
||||
eza_git $argv
|
||||
end
|
||||
function l --wraps='eza_git' --description eza
|
||||
eza_git $argv
|
||||
end
|
||||
end
|
||||
|
||||
# Edit fish alias file
|
||||
function .a --wraps='nvim ~/.dotfiles/config/fish/alias.fish' --description 'alias .a=nvim ~/.dotfiles/config/fish/alias.fish'
|
||||
nvim ~/.dotfiles/config/fish/alias.fish $argv
|
||||
|
||||
function .a --wraps='nvim ~/.dotfiles/config/fish/alias.fish' --description 'edit alias.fish'
|
||||
nvim ~/.dotfiles/config/fish/alias.fish $argv
|
||||
end
|
||||
|
||||
# Go to the directory where my projects are stored
|
||||
function .c --wraps='cd ~/Code' --description 'cd ~/Code'
|
||||
cd ~/Code $argv
|
||||
|
||||
cd ~/Code $argv
|
||||
end
|
||||
|
||||
# Go to the directory where the dotfiles are stored
|
||||
function .d --wraps='cd ~/.dotfiles' --description 'cd ~/.dotfiles'
|
||||
cd ~/.dotfiles $argv
|
||||
|
||||
cd ~/.dotfiles $argv
|
||||
end
|
||||
|
||||
# Go to the directory where my work codes are stored
|
||||
function .s --wraps='cd ~/Code/s' --description 'cd ~/Code/s'
|
||||
cd ~/Code/s $argv
|
||||
cd ~/Code/s $argv
|
||||
end
|
||||
|
||||
# Go to the directory where my personal codes are stored
|
||||
function .p --wraps='cd ~/Code/ivuorinen' --description 'cd ~/Code/ivuorinen'
|
||||
cd ~/Code/ivuorinen $argv
|
||||
end
|
||||
|
||||
# shortcut to commit with a message
|
||||
function commit --wraps='git commit -a -m "chore: automated commit"' --description 'commit shortcut'
|
||||
set -l commitMessage $argv
|
||||
git add .
|
||||
set -l commitMessage $argv
|
||||
git add .
|
||||
|
||||
if test -z "$commitMessage"
|
||||
if type -q aicommits
|
||||
aicommits --type conventional
|
||||
else
|
||||
git commit -a -m "chore: automated commit"
|
||||
if test -z "$commitMessage"
|
||||
if type -q aicommits
|
||||
aicommits --type conventional
|
||||
else
|
||||
git commit -a -m "chore: automated commit"
|
||||
end
|
||||
return
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
git commit -a -m "$commitMessage"
|
||||
end
|
||||
git commit -a -m "$commitMessage"
|
||||
end
|
||||
|
||||
function configure_tide --description 'Configure tide with the lean style and my preferences'
|
||||
tide configure \
|
||||
--auto \
|
||||
--style=Lean \
|
||||
--prompt_colors='True color' \
|
||||
--show_time=No \
|
||||
--lean_prompt_height='Two lines' \
|
||||
--prompt_connection=Disconnected \
|
||||
--prompt_spacing=Sparse \
|
||||
--icons='Many icons' \
|
||||
--transient=Yes
|
||||
end
|
||||
|
||||
# Abbreviations for git
|
||||
abbr --add gau git add -u
|
||||
abbr --add gaa git add -A
|
||||
abbr --add gcv git commit -v
|
||||
|
||||
# Abbreviations for composer
|
||||
abbr --add c composer
|
||||
abbr --add cu composer update
|
||||
abbr --add ci composer install
|
||||
|
||||
# Abbreviations for php artisan
|
||||
abbr --add .pa php artisan
|
||||
abbr --add .paf php artisan fresh
|
||||
abbr --add .pam php artisan migrate
|
||||
abbr --add .pams php artisan migrate --seed
|
||||
abbr --add .pat php artisan test
|
||||
|
||||
# Abbreviations for npm
|
||||
abbr --add .n npm
|
||||
abbr --add .nt npm test --if-present
|
||||
abbr --add .nb npm run build --if-present
|
||||
abbr --add .ns npm run start --if-present
|
||||
|
||||
125
config/fish/completions/aqua.fish
Normal file
125
config/fish/completions/aqua.fish
Normal file
@@ -0,0 +1,125 @@
|
||||
# aqua fish shell completion
|
||||
|
||||
function __fish_aqua_no_subcommand --description 'Test if there has been any subcommand yet'
|
||||
for i in (commandline -opc)
|
||||
if contains -- $i init install i generate g update-aqua upa update-checksum upc update up completion bash zsh fish help h help h which info remove rm vacuum cp policy allow deny init init-policy exec list generate-registry gr version root-dir help h
|
||||
return 1
|
||||
end
|
||||
end
|
||||
return 0
|
||||
end
|
||||
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l log-level -r -d 'log level'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l config -s c -r -d 'configuration file path'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l disable-cosign -d 'Disable Cosign verification'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l disable-slsa -d 'Disable SLSA verification'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l disable-github-artifact-attestation -d 'Disable GitHub Artifact Attestations verification'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l trace -r -d 'trace output file path'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l cpu-profile -r -d 'cpu profile output file path'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l help -s h -d 'show help'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l version -s v -d 'print the version'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l help -s h -d 'show help'
|
||||
complete -c aqua -n '__fish_aqua_no_subcommand' -f -l version -s v -d 'print the version'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'init' -d 'Create a configuration file if it doesn\'t exist'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l use-import-dir -s u -d 'Use import_dir'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l import-dir -s i -r -d 'import_dir'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l create-dir -s d -d 'Create a directory named aqua and create aqua.yaml in it'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'install i' -d 'Install tools'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l only-link -s l -d 'create links but skip downloading packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l test -d 'This flag was deprecated and had no meaning from aqua v2.0.0. This flag will be removed in aqua v3.0.0. https://github.com/aquaproj/aqua/issues/1691'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l all -s a -d 'install all aqua configuration packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l tags -s t -r -d 'filter installed packages with tags'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from install i' -f -l exclude-tags -r -d 'exclude installed packages with tags'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'generate g' -d 'Search packages in registries and output the configuration interactively'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l f -r -d 'the file path of packages list. When the value is "-", the list is passed from the standard input'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l i -d 'Insert packages to configuration file'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l pin -d 'Pin version'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l g -d 'Insert packages in a global configuration file'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l detail -s d -d 'Output additional fields such as description and link'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l o -r -d 'inserted file'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l select-version -s s -d 'Select the installed version interactively. Default to display 30 versions, use --limit/-l to change it.'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate g' -f -l limit -s l -r -d 'The maximum number of versions. Non-positive number refers to no limit.'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update-aqua upa' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'update-aqua upa' -d 'Update aqua'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'update-checksum upc' -d 'Create or Update aqua-checksums.json'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l all -s a -d 'Create or Update all aqua-checksums.json including global configuration'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l deep -d 'This flag was deprecated and had no meaning from aqua v2.0.0. This flag will be removed in aqua v3.0.0. https://github.com/aquaproj/aqua/issues/1769'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update-checksum upc' -f -l prune -d 'Remove unused checksums'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'update up' -d 'Update registries and packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l i -d 'Select packages with fuzzy finder'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l select-version -s s -d 'Select the version with fuzzy finder. Default to display 30 versions, use --limit/-l to change it.'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l only-registry -s r -d 'Update only registries'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l only-package -s p -d 'Update only packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l limit -s l -r -d 'The maximum number of versions. Non-positive number refers to no limit.'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l tags -s t -r -d 'filter installed packages with tags'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from update up' -f -l exclude-tags -r -d 'exclude installed packages with tags'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from completion' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'completion' -d 'Output shell completion script for bash, zsh, or fish'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from completion' -f -l help -s h -d 'show help'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from bash' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a 'bash' -d 'Output shell completion script for bash'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from zsh' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a 'zsh' -d 'Output shell completion script for zsh'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from fish' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a 'fish' -d 'Output shell completion script for fish'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from fish' -f -l help -s h -d 'show help'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from fish' -a 'help h' -d 'Shows a list of commands or help for one command'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from completion' -a 'help h' -d 'Shows a list of commands or help for one command'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from which' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'which' -d 'Output the absolute file path of the given command'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from which' -f -l version -s v -d 'Output the given package version'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from info' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'info' -d 'Show information'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'remove rm' -d 'Uninstall packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l all -s a -d 'uninstall all packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l mode -s m -r -d 'Removed target modes. l: link, p: package'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from remove rm' -f -l i -d 'Select packages with a Fuzzy Finder'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from vacuum' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'vacuum' -d 'Remove unused installed packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from vacuum' -f -l init -d 'Create timestamp files.'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from vacuum' -f -l days -s d -r -d 'Expiration days'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'cp' -d 'Copy executable files in a directory'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l o -r -d 'destination directory'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l all -s a -d 'install all aqua configuration packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l tags -s t -r -d 'filter installed packages with tags'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from cp' -f -l exclude-tags -r -d 'exclude installed packages with tags'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from policy' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'policy' -d 'Manage Policy'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from allow' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from policy' -a 'allow' -d 'Allow a policy file'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from deny' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from policy' -a 'deny' -d 'Deny a policy file'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from init' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_seen_subcommand_from policy' -a 'init' -d 'Create a policy file if it doesn\'t exist'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from init-policy' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'init-policy' -d '[Deprecated] Create a policy file if it doesn\'t exist'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from exec' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'exec' -d 'Execute tool'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from list' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'list' -d 'List packages in Registries'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from list' -f -l installed -s i -d 'List installed packages'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from list' -f -l all -s a -d 'List global configuration packages too'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'generate-registry gr' -d 'Generate a registry\'s package configuration'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l out-testdata -r -d 'A file path where the testdata is outputted'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l cmd -r -d 'A list of commands joined with commas \',\''
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l generate-config -s c -r -d 'A configuration file path'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l limit -s l -r -d 'the maximum number of versions'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l deep -d 'This flag was deprecated and had no meaning from aqua v2.15.0. This flag will be removed in aqua v3.0.0. https://github.com/aquaproj/aqua/issues/2351'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from generate-registry gr' -f -l init -d 'Generate a configuration file'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from version' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'version' -d 'Show version'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from root-dir' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'root-dir' -d 'Output the aqua root directory (AQUA_ROOT_DIR)'
|
||||
complete -c aqua -n '__fish_seen_subcommand_from help h' -f -l help -s h -d 'show help'
|
||||
complete -r -c aqua -n '__fish_aqua_no_subcommand' -a 'help h' -d 'Shows a list of commands or help for one command'
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
complete --command nvm --exclusive
|
||||
complete --command nvm --exclusive --long version --description "Print version"
|
||||
complete --command nvm --exclusive --long help --description "Print help"
|
||||
complete --command nvm --long silent --description "Suppress standard output"
|
||||
|
||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments install --description "Download and activate the specified Node version"
|
||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments use --description "Activate the specified Node version in the current shell"
|
||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list --description "List installed Node versions"
|
||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments list-remote --description "List available Node versions to install"
|
||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments current --description "Print the currently-active Node version"
|
||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from install" --arguments "(
|
||||
test -e $nvm_data && string split ' ' <$nvm_data/.index
|
||||
)"
|
||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use" --arguments "(_nvm_list | string split ' ')"
|
||||
complete --command nvm --exclusive --condition __fish_use_subcommand --arguments uninstall --description "Uninstall the specified Node version"
|
||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from uninstall" --arguments "(
|
||||
_nvm_list | string split ' ' | string replace system ''
|
||||
)"
|
||||
complete --command nvm --exclusive --condition "__fish_seen_subcommand_from use uninstall" --arguments "(
|
||||
set --query nvm_default_version && echo default
|
||||
)"
|
||||
@@ -1,28 +0,0 @@
|
||||
set --query XDG_DATA_HOME || set --local XDG_DATA_HOME ~/.local/share
|
||||
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||
set --query nvm_data || set --global nvm_data $XDG_DATA_HOME/nvm
|
||||
|
||||
function _nvm_install --on-event nvm_install
|
||||
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||
echo "Downloading the Node distribution index..." 2>/dev/null
|
||||
_nvm_index_update
|
||||
end
|
||||
|
||||
function _nvm_update --on-event nvm_update
|
||||
set --query --universal nvm_data && set --erase --universal nvm_data
|
||||
set --query --universal nvm_mirror && set --erase --universal nvm_mirror
|
||||
set --query nvm_mirror || set --global nvm_mirror https://nodejs.org/dist
|
||||
end
|
||||
|
||||
function _nvm_uninstall --on-event nvm_uninstall
|
||||
command rm -rf $nvm_data
|
||||
|
||||
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||
|
||||
set --names | string replace --filter --regex -- "^nvm" "set --erase nvm" | source
|
||||
functions --erase (functions --all | string match --entire --regex -- "^_nvm_")
|
||||
end
|
||||
|
||||
if status is-interactive && set --query nvm_default_version && ! set --query nvm_current_version
|
||||
nvm use --silent $nvm_default_version
|
||||
end
|
||||
@@ -3,10 +3,10 @@
|
||||
# ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
test -e "$HOME/.config/fish/alias.fish" &&
|
||||
source "$HOME/.config/fish/alias.fish"
|
||||
source "$HOME/.config/fish/alias.fish"
|
||||
|
||||
test -e "$HOME/.config/fish/exports.fish" &&
|
||||
source "$HOME/.config/fish/exports.fish"
|
||||
source "$HOME/.config/fish/exports.fish"
|
||||
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
@@ -17,3 +17,9 @@ end
|
||||
|
||||
# Added by LM Studio CLI (lms)
|
||||
set -gx PATH $PATH $HOME/.lmstudio/bin
|
||||
|
||||
type -q rbenv; and source (rbenv init -|psub)
|
||||
type -q pyenv; and source (pyenv init -|psub)
|
||||
type -q goenv; and source (goenv init -|psub)
|
||||
type -q fnm; and fnm env --use-on-cd --shell fish | source
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ set -q XDG_RUNTIME_DIR; or set -x XDG_RUNTIME_DIR "$HOME/.local/run"
|
||||
set -q DOTFILES; or set -x DOTFILES "$HOME/.dotfiles"
|
||||
|
||||
# Editor settings
|
||||
set -q EDITOR; or set -x EDITOR "nvim"
|
||||
set -q VISUAL; or set -x VISUAL "code"
|
||||
set -q EDITOR; or set -x EDITOR nvim
|
||||
set -q VISUAL; or set -x VISUAL code
|
||||
set -q HOSTNAME; or set -x HOSTNAME (hostname -s)
|
||||
|
||||
# Add local bin to path
|
||||
@@ -22,9 +22,15 @@ fish_add_path "$XDG_BIN_HOME"
|
||||
# Add cargo bin to path
|
||||
fish_add_path "$XDG_SHARE_HOME/cargo/bin"
|
||||
|
||||
# NPM configuration
|
||||
set -q NPM_CONFIG_PREFIX; or set -x NPM_CONFIG_PREFIX "$XDG_DATA_HOME/npm"
|
||||
fish_add_path "$NPM_CONFIG_PREFIX/bin"
|
||||
# Set Aqua configuration
|
||||
set -q AQUA_BIN; or set -gx AQUA_BIN "$XDG_DATA_HOME/aquaproj-aqua/bin"
|
||||
set -q AQUA_CONFIG; or set -gx AQUA_CONFIG "$XDG_CONFIG_HOME/aqua/aqua.yaml"
|
||||
set -gx PATH $AQUA_BIN $PATH
|
||||
|
||||
# NPM/NVM configuration
|
||||
set -q NVM_DIR; or set -x NVM_DIR "$XDG_DATA_HOME/nvm"
|
||||
fish_add_path "$NVM_DIR/bin"
|
||||
fish_add_path "$XDG_CONFIG_HOME/nvm"
|
||||
|
||||
# Yarn configuration
|
||||
set -q YARN_GLOBAL_FOLDER; or set -x YARN_GLOBAL_FOLDER "$XDG_DATA_HOME/yarn"
|
||||
@@ -56,19 +62,19 @@ set -q AWS_CONFIG_FILE; or set -x AWS_CONFIG_FILE "$XDG_STATE_HOME/aws/config"
|
||||
set -q AWS_SHARED_CREDENTIALS_FILE; or set -x AWS_SHARED_CREDENTIALS_FILE "$XDG_STATE_HOME/aws/credentials"
|
||||
set -q AWS_SESSION_TOKEN; or set -x AWS_SESSION_TOKEN "$XDG_STATE_HOME/aws/session_token"
|
||||
set -q AWS_DATA_PATH; or set -x AWS_DATA_PATH "$XDG_DATA_HOME/aws"
|
||||
set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT "table"
|
||||
set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS "true"
|
||||
set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION "true"
|
||||
set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION "7200"
|
||||
set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA "true"
|
||||
set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE "true"
|
||||
set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT "true"
|
||||
set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT "true"
|
||||
set -q AWS_DEFAULT_OUTPUT; or set -x AWS_DEFAULT_OUTPUT table
|
||||
set -q AWS_CONFIGURE_KEYS; or set -x AWS_CONFIGURE_KEYS true
|
||||
set -q AWS_CONFIGURE_SESSION; or set -x AWS_CONFIGURE_SESSION true
|
||||
set -q AWS_CONFIGURE_SESSION_DURATION; or set -x AWS_CONFIGURE_SESSION_DURATION 7200
|
||||
set -q AWS_CONFIGURE_SESSION_MFA; or set -x AWS_CONFIGURE_SESSION_MFA true
|
||||
set -q AWS_CONFIGURE_PROFILE; or set -x AWS_CONFIGURE_PROFILE true
|
||||
set -q AWS_CONFIGURE_PROMPT; or set -x AWS_CONFIGURE_PROMPT true
|
||||
set -q AWS_CONFIGURE_PROMPT_DEFAULT; or set -x AWS_CONFIGURE_PROMPT_DEFAULT true
|
||||
|
||||
# Brew configuration
|
||||
set -q HOMEBREW_NO_ANALYTICS; or set -x HOMEBREW_NO_ANALYTICS "true"
|
||||
set -q HOMEBREW_NO_ENV_HINTS; or set -x HOMEBREW_NO_ENV_HINTS "true"
|
||||
set -q HOMEBREW_BUNDLE_MAS_SKIP; or set -x HOMEBREW_BUNDLE_MAS_SKIP "true"
|
||||
set -q HOMEBREW_NO_ANALYTICS; or set -x HOMEBREW_NO_ANALYTICS true
|
||||
set -q HOMEBREW_NO_ENV_HINTS; or set -x HOMEBREW_NO_ENV_HINTS true
|
||||
set -q HOMEBREW_BUNDLE_MAS_SKIP; or set -x HOMEBREW_BUNDLE_MAS_SKIP true
|
||||
set -q HOMEBREW_BUNDLE_FILE; or set -x HOMEBREW_BUNDLE_FILE "$XDG_CONFIG_HOME/homebrew/Brewfile"
|
||||
|
||||
# Composer configuration
|
||||
@@ -82,8 +88,16 @@ set -q DIRENV_LOG_FORMAT; or set -x DIRENV_LOG_FORMAT ''
|
||||
# Docker configuration
|
||||
set -q DOCKER_CONFIG; or set -x DOCKER_CONFIG "$XDG_CONFIG_HOME/docker"
|
||||
x-dc "$DOCKER_CONFIG"
|
||||
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS "true"
|
||||
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST "false"
|
||||
set -q DOCKER_HIDE_LEGACY_COMMANDS; or set -x DOCKER_HIDE_LEGACY_COMMANDS true
|
||||
set -q DOCKER_SCAN_SUGGEST; or set -x DOCKER_SCAN_SUGGEST false
|
||||
|
||||
# FNM / Node.js configuration
|
||||
set -q FNM_DIR; or set -x FNM_DIR "$XDG_DATA_HOME/fnm"
|
||||
fish_add_path "$FNM_DIR"
|
||||
set -q FNM_VERSION_FILE_STRATEGY; or set -x FNM_VERSION_FILE_STRATEGY recursive
|
||||
set -q FNM_USE_ON_CD; or set -x FNM_USE_ON_CD true
|
||||
set -q FNM_COREPACK_ENABLED; or set -x FNM_COREPACK_ENABLED true
|
||||
set -q FNM_RESOLVE_ENGINES; or set -x FNM_RESOLVE_ENGINES true
|
||||
|
||||
# fzf configuration
|
||||
set -q FZF_BASE; or set -x FZF_BASE "$XDG_CONFIG_HOME/fzf"
|
||||
@@ -93,15 +107,12 @@ set -q FZF_DEFAULT_OPTS; or set -x FZF_DEFAULT_OPTS '--height 40% --tmux bottom,
|
||||
set -q GNUPGHOME; or set -x GNUPGHOME "$XDG_DATA_HOME/gnupg"
|
||||
|
||||
# Go configuration
|
||||
set -q GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go"
|
||||
# set -q GOPATH; or set -x GOPATH "$XDG_DATA_HOME/go"
|
||||
set -q GOBIN; or set -x GOBIN "$XDG_BIN_HOME"
|
||||
fish_add_path "$GOBIN"
|
||||
|
||||
# NPM: Add npm packages to path
|
||||
if x-have node;
|
||||
set -x NVM_NODE_BIN_DIR (dirname (which node))
|
||||
fish_add_path "$NVM_NODE_BIN_DIR"
|
||||
end
|
||||
set -q GOENV_ROOT; or set -x GOENV_ROOT "$XDG_DATA_HOME/goenv"
|
||||
set -q GOENV_RC_FILE; or set -x GOENV_RC_FILE "$XDG_CONFIG_HOME/goenv/goenvrc.fish"
|
||||
|
||||
# 1Password configuration
|
||||
set -q OP_CACHE; or set -x OP_CACHE "$XDG_STATE_HOME/1password"
|
||||
@@ -111,7 +122,7 @@ set -q WORKON_HOME; or set -x WORKON_HOME "$XDG_DATA_HOME/virtualenvs"
|
||||
set -q PYENV_ROOT; or set -x PYENV_ROOT "$XDG_DATA_HOME/pyenv"
|
||||
fish_add_path "$PYENV_ROOT/bin"
|
||||
if x-have pyenv; and not functions -q pyenv
|
||||
status --is-interactive; and source (pyenv init - | psub)
|
||||
status --is-interactive; and source (pyenv init - | psub)
|
||||
end
|
||||
|
||||
# Poetry configuration
|
||||
@@ -149,7 +160,7 @@ set -q TMUX_PLUGIN_MANAGER_PATH; or set -x TMUX_PLUGIN_MANAGER_PATH "$TMUX_PLUGI
|
||||
|
||||
# Source tmux theme activation script for Fish shell
|
||||
if test -f "$DOTFILES/config/tmux/theme-activate.fish"
|
||||
source "$DOTFILES/config/tmux/theme-activate.fish"
|
||||
source "$DOTFILES/config/tmux/theme-activate.fish"
|
||||
end
|
||||
|
||||
# tms configuration
|
||||
@@ -160,18 +171,27 @@ set -q WAKATIME_HOME; or set -x WAKATIME_HOME "$XDG_STATE_HOME/wakatime"
|
||||
x-dc "$WAKATIME_HOME"
|
||||
|
||||
# Miscellaneous configuration
|
||||
set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF "true"
|
||||
set -q CHEAT_USE_FZF; or set -x CHEAT_USE_FZF true
|
||||
set -q SQLITE_HISTORY; or set -x SQLITE_HISTORY "$XDG_CACHE_HOME/sqlite/sqlite_history"
|
||||
|
||||
# Source additional configuration files if they exist
|
||||
if test -f "$DOTFILES/config/fish/exports-secret.fish"
|
||||
source "$DOTFILES/config/fish/exports-secret.fish"
|
||||
source "$DOTFILES/config/fish/exports-secret.fish"
|
||||
end
|
||||
|
||||
if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
|
||||
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
|
||||
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports.fish"
|
||||
end
|
||||
|
||||
if test -f "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
|
||||
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
|
||||
source "$DOTFILES/hosts/$HOSTNAME/config/fish/exports-secret.fish"
|
||||
end
|
||||
|
||||
# Configure tide prompt
|
||||
set -gx tide_prompt_transient_enabled true
|
||||
set -gx tide_prompt_add_newline_before true
|
||||
set -gx tide_prompt_min_cols 34
|
||||
set -gx tide_prompt_pad_items false
|
||||
set -gx tide_left_prompt_items context pwd git node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig newline character
|
||||
set -gx tide_right_prompt_items status jobs direnv
|
||||
set -gx tide_context_hostname_parts 1
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
jorgebucaran/fisher
|
||||
jorgebucaran/nvm.fish
|
||||
ilancosman/tide@v6
|
||||
jethrokuan/z
|
||||
halostatue/fish-macos@v7
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
function _nvm_index_update
|
||||
test ! -d $nvm_data && command mkdir -p $nvm_data
|
||||
|
||||
set --local index $nvm_data/.index
|
||||
|
||||
if not command curl -q --location --silent $nvm_mirror/index.tab >$index.temp
|
||||
command rm -f $index.temp
|
||||
echo "nvm: Can't update index, host unavailable: \"$nvm_mirror\"" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
command awk -v OFS=\t '
|
||||
/v0.9.12/ { exit } # Unsupported
|
||||
NR > 1 {
|
||||
print $1 (NR == 2 ? " latest" : $10 != "-" ? " lts/" tolower($10) : "")
|
||||
}
|
||||
' $index.temp >$index
|
||||
|
||||
command rm -f $index.temp
|
||||
end
|
||||
@@ -1,14 +0,0 @@
|
||||
function _nvm_list
|
||||
set --local versions $nvm_data/*
|
||||
|
||||
set --query versions[1] &&
|
||||
string match --entire --regex -- (
|
||||
string replace --all -- $nvm_data/ "" $versions |
|
||||
string match --regex -- "v\d.+" |
|
||||
string escape --style=regex |
|
||||
string join "|"
|
||||
) <$nvm_data/.index
|
||||
|
||||
command --all node |
|
||||
string match --quiet --invert --regex -- "^$nvm_data" && echo system
|
||||
end
|
||||
@@ -1,4 +0,0 @@
|
||||
function _nvm_version_activate --argument-names ver
|
||||
set --global --export nvm_current_version $ver
|
||||
set --prepend PATH $nvm_data/$ver/bin
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
function _nvm_version_deactivate --argument-names ver
|
||||
test "$nvm_current_version" = "$ver" && set --erase nvm_current_version
|
||||
set --local index (contains --index -- $nvm_data/$ver/bin $PATH) &&
|
||||
set --erase PATH[$index]
|
||||
end
|
||||
@@ -1,235 +0,0 @@
|
||||
function nvm --description "Node version manager"
|
||||
for silent in --silent -s
|
||||
if set --local index (contains --index -- $silent $argv)
|
||||
set --erase argv[$index] && break
|
||||
end
|
||||
set --erase silent
|
||||
end
|
||||
|
||||
set --local cmd $argv[1]
|
||||
set --local ver $argv[2]
|
||||
|
||||
if set --query silent && ! set --query cmd[1]
|
||||
echo "nvm: Version number not specified (see nvm -h for usage)" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if ! set --query ver[1] && contains -- "$cmd" install use
|
||||
for file in .nvmrc .node-version
|
||||
set file (_nvm_find_up $PWD $file) && read ver <$file && break
|
||||
end
|
||||
|
||||
if ! set --query ver[1]
|
||||
echo "nvm: Invalid version or missing \".nvmrc\" file" >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
set --local their_version $ver
|
||||
|
||||
switch "$cmd"
|
||||
case -v --version
|
||||
echo "nvm, version 2.2.17"
|
||||
case "" -h --help
|
||||
echo "Usage: nvm install <version> Download and activate the specified Node version"
|
||||
echo " nvm install Install the version specified in the nearest .nvmrc file"
|
||||
echo " nvm use <version> Activate the specified Node version in the current shell"
|
||||
echo " nvm use Activate the version specified in the nearest .nvmrc file"
|
||||
echo " nvm list List installed Node versions"
|
||||
echo " nvm list-remote List available Node versions to install"
|
||||
echo " nvm list-remote <regex> List Node versions matching a given regex pattern"
|
||||
echo " nvm current Print the currently-active Node version"
|
||||
echo " nvm uninstall <version> Uninstall the specified Node version"
|
||||
echo "Options:"
|
||||
echo " -s, --silent Suppress standard output"
|
||||
echo " -v, --version Print the version of nvm"
|
||||
echo " -h, --help Print this help message"
|
||||
echo "Variables:"
|
||||
echo " nvm_arch Override architecture, e.g. x64-musl"
|
||||
echo " nvm_mirror Use a mirror for downloading Node binaries"
|
||||
echo " nvm_default_version Set the default version for new shells"
|
||||
echo " nvm_default_packages Install a list of packages every time a Node version is installed"
|
||||
echo " nvm_data Set a custom directory for storing nvm data"
|
||||
echo "Examples:"
|
||||
echo " nvm install latest Install the latest version of Node"
|
||||
echo " nvm use 14.15.1 Use Node version 14.15.1"
|
||||
echo " nvm use system Activate the system's Node version"
|
||||
|
||||
case install
|
||||
_nvm_index_update
|
||||
|
||||
string match --entire --regex -- (_nvm_version_match $ver) <$nvm_data/.index | read ver alias
|
||||
|
||||
if ! set --query ver[1]
|
||||
echo "nvm: Invalid version number or alias: \"$their_version\"" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if test ! -e $nvm_data/$ver
|
||||
set --local os (command uname -s | string lower)
|
||||
set --local ext tar.gz
|
||||
set --local arch (command uname -m)
|
||||
|
||||
switch $os
|
||||
case aix
|
||||
set arch ppc64
|
||||
case sunos
|
||||
case linux
|
||||
case darwin
|
||||
case {MSYS_NT,MINGW\*_NT}\*
|
||||
set os win
|
||||
set ext zip
|
||||
case \*
|
||||
echo "nvm: Unsupported operating system: \"$os\"" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
switch $arch
|
||||
case i\*86
|
||||
set arch x86
|
||||
case x86_64
|
||||
set arch x64
|
||||
case arm64
|
||||
string match --regex --quiet "v(?<major>\d+)" $ver
|
||||
if test "$os" = darwin -a $major -lt 16
|
||||
set arch x64
|
||||
end
|
||||
case armv6 armv6l
|
||||
set arch armv6l
|
||||
case armv7 armv7l
|
||||
set arch armv7l
|
||||
case armv8 armv8l aarch64
|
||||
set arch arm64
|
||||
end
|
||||
|
||||
set --query nvm_arch && set arch $nvm_arch
|
||||
|
||||
set --local dir "node-$ver-$os-$arch"
|
||||
set --local url $nvm_mirror/$ver/$dir.$ext
|
||||
|
||||
command mkdir -p $nvm_data/$ver
|
||||
|
||||
if ! set --query silent
|
||||
echo -e "Installing Node \x1b[1m$ver\x1b[22m $alias"
|
||||
echo -e "Fetching \x1b[4m$url\x1b[24m\x1b[7m"
|
||||
end
|
||||
|
||||
if ! command curl -q $silent --progress-bar --location $url |
|
||||
command tar --extract --gzip --directory $nvm_data/$ver 2>/dev/null
|
||||
command rm -rf $nvm_data/$ver
|
||||
echo -e "\033[F\33[2K\x1b[0mnvm: Invalid mirror or host unavailable: \"$url\"" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set --query silent || echo -en "\033[F\33[2K\x1b[0m"
|
||||
|
||||
if test "$os" = win
|
||||
command mv $nvm_data/$ver/$dir $nvm_data/$ver/bin
|
||||
else
|
||||
command mv $nvm_data/$ver/$dir/* $nvm_data/$ver
|
||||
command rm -rf $nvm_data/$ver/$dir
|
||||
end
|
||||
end
|
||||
|
||||
if test $ver != "$nvm_current_version"
|
||||
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||
_nvm_version_activate $ver
|
||||
|
||||
set --query nvm_default_packages[1] && npm install --global $silent $nvm_default_packages
|
||||
end
|
||||
|
||||
set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
||||
case use
|
||||
test $ver = default && set ver $nvm_default_version
|
||||
_nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
|
||||
|
||||
if ! set --query ver[1]
|
||||
echo "nvm: Can't use Node \"$their_version\", version must be installed first" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
if test $ver != "$nvm_current_version"
|
||||
set --query nvm_current_version && _nvm_version_deactivate $nvm_current_version
|
||||
test $ver != system && _nvm_version_activate $ver
|
||||
end
|
||||
|
||||
set --query silent || printf "Now using Node %s (npm %s) %s\n" (_nvm_node_info)
|
||||
case uninstall
|
||||
if test -z "$ver"
|
||||
echo "nvm: Not enough arguments for command: \"$cmd\"" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
test $ver = default && test ! -z "$nvm_default_version" && set ver $nvm_default_version
|
||||
|
||||
_nvm_list | string match --entire --regex -- (_nvm_version_match $ver) | read ver __
|
||||
|
||||
if ! set -q ver[1]
|
||||
echo "nvm: Node version not installed or invalid: \"$their_version\"" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
set --query silent || printf "Uninstalling Node %s %s\n" $ver (string replace ~ \~ "$nvm_data/$ver/bin/node")
|
||||
|
||||
_nvm_version_deactivate $ver
|
||||
|
||||
command rm -rf $nvm_data/$ver
|
||||
case current
|
||||
_nvm_current
|
||||
case ls list
|
||||
_nvm_list | _nvm_list_format (_nvm_current) $argv[2]
|
||||
case lsr {ls,list}-remote
|
||||
_nvm_index_update || return
|
||||
_nvm_list | command awk '
|
||||
FILENAME == "-" && (is_local[$1] = FNR == NR) { next } {
|
||||
print $0 (is_local[$1] ? " ✓" : "")
|
||||
}
|
||||
' - $nvm_data/.index | _nvm_list_format (_nvm_current) $argv[2]
|
||||
case \*
|
||||
echo "nvm: Unknown command or option: \"$cmd\" (see nvm -h for usage)" >&2
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
||||
function _nvm_find_up --argument-names path file
|
||||
test -e "$path/$file" && echo $path/$file || begin
|
||||
test ! -z "$path" || return
|
||||
_nvm_find_up (string replace --regex -- '/[^/]*$' "" $path) $file
|
||||
end
|
||||
end
|
||||
|
||||
function _nvm_version_match --argument-names ver
|
||||
string replace --regex -- '^v?(\d+|\d+\.\d+)$' 'v$1.' $ver |
|
||||
string replace --filter --regex -- '^v?(\d+)' 'v$1' |
|
||||
string escape --style=regex || string lower '\b'$ver'(?:/\w+)?$'
|
||||
end
|
||||
|
||||
function _nvm_list_format --argument-names current regex
|
||||
command awk -v current="$current" -v regex="$regex" '
|
||||
$0 ~ regex {
|
||||
aliases[versions[i++] = $1] = $2 " " $3
|
||||
pad = (n = length($1)) > pad ? n : pad
|
||||
}
|
||||
END {
|
||||
if (!i) exit 1
|
||||
while (i--)
|
||||
printf((current == versions[i] ? " ▶ " : " ") "%"pad"s %s\n",
|
||||
versions[i], aliases[versions[i]])
|
||||
}
|
||||
'
|
||||
end
|
||||
|
||||
function _nvm_current
|
||||
command --search --quiet node || return
|
||||
set --query nvm_current_version && echo $nvm_current_version || echo system
|
||||
end
|
||||
|
||||
function _nvm_node_info
|
||||
set --local npm_path (string replace bin/npm-cli.js "" (realpath (command --search npm)))
|
||||
test -f $npm_path/package.json || set --local npm_version_default (command npm --version)
|
||||
command node --eval "
|
||||
console.log(process.version)
|
||||
console.log('$npm_version_default' ? '$npm_version_default': require('$npm_path/package.json').version)
|
||||
console.log(process.execPath)
|
||||
" | string replace -- ~ \~
|
||||
end
|
||||
@@ -13,3 +13,52 @@
|
||||
|
||||
[advice]
|
||||
detachedHead = false
|
||||
[column]
|
||||
ui = auto
|
||||
[branch]
|
||||
sort = -committerdate
|
||||
[tag]
|
||||
sort = version:refname
|
||||
[init]
|
||||
defaultBranch = main
|
||||
[diff]
|
||||
algorithm = histogram
|
||||
colorMoved = plain
|
||||
mnemonicPrefix = true
|
||||
renames = true
|
||||
[push]
|
||||
default = simple
|
||||
autoSetupRemote = true
|
||||
followTags = true
|
||||
[fetch]
|
||||
prune = true
|
||||
pruneTags = true
|
||||
all = true
|
||||
[help]
|
||||
autocorrect = prompt
|
||||
[commit]
|
||||
verbose = true
|
||||
[rerere]
|
||||
enabled = true
|
||||
autoupdate = true
|
||||
[rebase]
|
||||
autoSquash = true
|
||||
autoStash = true
|
||||
updateRefs = true
|
||||
[merge]
|
||||
conflictstyle = zdiff3
|
||||
[pull]
|
||||
rebase = true
|
||||
[color "diff-highlight"]
|
||||
oldNormal = red bold
|
||||
oldHighlight = red bold 52
|
||||
newNormal = green bold
|
||||
newHighlight = green bold 22
|
||||
[color "diff"]
|
||||
meta = 11
|
||||
frag = magenta bold
|
||||
func = 146 bold
|
||||
commit = yellow bold
|
||||
old = red bold
|
||||
new = green bold
|
||||
whitespace = red reverse
|
||||
|
||||
6
config/goenv/goenvrc
Normal file
6
config/goenv/goenvrc
Normal file
@@ -0,0 +1,6 @@
|
||||
# Detect shell
|
||||
if [ -n "$BASH_VERSION" ] || [ -n "$ZSH_VERSION" ]; then
|
||||
export GOENV_PATH_ORDER=front
|
||||
export GOENV_PREPEND_GOPATH=true
|
||||
export GOENV_AUTO_INSTALL=true
|
||||
fi
|
||||
4
config/goenv/goenvrc.fish
Normal file
4
config/goenv/goenvrc.fish
Normal file
@@ -0,0 +1,4 @@
|
||||
set -gx GOENV_PATH_ORDER front
|
||||
set -gx GOENV_PREPEND_GOPATH true
|
||||
set -gx GOENV_AUTO_INSTALL true
|
||||
|
||||
@@ -6,12 +6,14 @@ tap "dm3ch/tap"
|
||||
tap "doron-cohen/tap"
|
||||
tap "gesquive/tap"
|
||||
tap "github/gh"
|
||||
tap "golangci/tap"
|
||||
tap "homebrew/autoupdate"
|
||||
tap "homebrew/bundle"
|
||||
tap "homebrew/services"
|
||||
tap "jesseduffield/lazygit"
|
||||
tap "k8sgpt-ai/k8sgpt"
|
||||
tap "keith/formulae"
|
||||
tap "koekeishiya/formulae"
|
||||
tap "mongodb/brew"
|
||||
tap "nikitabobko/tap"
|
||||
tap "pantheon-systems/external"
|
||||
@@ -95,6 +97,8 @@ brew "fontconfig"
|
||||
brew "gettext"
|
||||
# Core application library for C
|
||||
brew "glib"
|
||||
# Binary installation for rust projects
|
||||
brew "cargo-binstall"
|
||||
# Prevent cloud misconfigurations during build-time for IaC tools
|
||||
brew "checkov"
|
||||
# Human-friendly and fast alternative to cut and (sometimes) awk
|
||||
@@ -117,6 +121,8 @@ brew "figlet"
|
||||
brew "fish"
|
||||
# Lock file during command
|
||||
brew "flock"
|
||||
# Fast and simple Node.js version manager
|
||||
brew "fnm"
|
||||
# Libraries to talk to Microsoft SQL Server and Sybase databases
|
||||
brew "freetds"
|
||||
# Monitor a directory for changes and run a shell command
|
||||
@@ -153,6 +159,8 @@ brew "unbound"
|
||||
brew "gnutls"
|
||||
# GNU Pretty Good Privacy (PGP) package
|
||||
brew "gnupg"
|
||||
# Go version management
|
||||
brew "goenv"
|
||||
# Library access to GnuPG
|
||||
brew "gpgme"
|
||||
# Manage your GnuPG keys with ease!
|
||||
@@ -211,12 +219,22 @@ brew "ncdu"
|
||||
brew "nginx"
|
||||
# Port scanning utility for large networks
|
||||
brew "nmap"
|
||||
# Platform built on V8 to build network applications
|
||||
brew "node"
|
||||
# Libraries for security-enabled client and server applications
|
||||
brew "nss"
|
||||
# Command-line Git information tool
|
||||
brew "onefetch"
|
||||
# Open source suite of directory software
|
||||
brew "openldap"
|
||||
# ISO-C API and CLI for generating UUIDs
|
||||
brew "ossp-uuid"
|
||||
# General-purpose scripting language
|
||||
brew "php@8.2", link: true
|
||||
# General-purpose scripting language
|
||||
brew "php@8.3"
|
||||
# Pins GitHub Actions to full hashes and versions
|
||||
brew "pinact"
|
||||
# Execute binaries from Python packages in isolated environments
|
||||
brew "pipx"
|
||||
# Python version management
|
||||
@@ -269,6 +287,8 @@ brew "cormacrelf/tap/dark-notify"
|
||||
brew "doron-cohen/tap/antidot"
|
||||
# lets you quickly switch between multiple git user profiles
|
||||
brew "gesquive/tap/git-user"
|
||||
# Simple hotkey-daemon for macOS.
|
||||
brew "koekeishiya/formulae/skhd"
|
||||
# Automated code review tool integrated with any code analysis tools regardless of programming language.
|
||||
brew "reviewdog/tap/reviewdog"
|
||||
# Igbinary PHP extension
|
||||
@@ -290,8 +310,6 @@ brew "shivammathur/extensions/yaml@8.3"
|
||||
# General-purpose scripting language
|
||||
brew "shivammathur/php/php-debug"
|
||||
# General-purpose scripting language
|
||||
brew "shivammathur/php/php@8.2", link: true
|
||||
# General-purpose scripting language
|
||||
brew "shivammathur/php/php@8.2-debug"
|
||||
# Command-line interface for 1Password
|
||||
cask "1password-cli"
|
||||
|
||||
@@ -64,7 +64,7 @@ require('lazy').setup(
|
||||
}
|
||||
)
|
||||
|
||||
require('nvm-default').setup()
|
||||
-- require('nvm-default').setup()
|
||||
|
||||
require 'keymaps'
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ function M.setup(opts)
|
||||
local nvm_path = options.nvm_path
|
||||
local node_version = run_command(
|
||||
string.format('. %s/nvm.sh && nvm version default', nvm_path)
|
||||
) or run_command(string.format('. %s/nvm.sh && nvm version node', nvm_path))
|
||||
) or run_command(string.format('. %s/nvm.sh && nvm version node', nvm_path)) or nil
|
||||
|
||||
if node_version and node_version:match '^v' then
|
||||
-- Set vim.g.node_host_prog and vim.g.copilot_node_command
|
||||
|
||||
@@ -13,9 +13,9 @@ local a = vim.api -- A table to store API functions
|
||||
g.mapleader = ' ' -- Space as the leader key
|
||||
g.maplocalleader = ' ' -- Space as the local leader key
|
||||
|
||||
g.colors_theme = 'tokyonight' -- Set the colorscheme
|
||||
g.colors_variant_light = 'tokyonight-day' -- Set the light variant
|
||||
g.colors_variant_dark = 'tokyonight-storm' -- Set the dark variant
|
||||
g.colors_theme = 'pencil' -- Set the colorscheme
|
||||
-- g.colors_variant_light = 'tokyonight-day' -- Set the light variant
|
||||
-- g.colors_variant_dark = 'tokyonight-storm' -- Set the dark variant
|
||||
|
||||
g.editorconfig = true -- Make sure editorconfig support is enabled
|
||||
g.loaded_perl_provider = 0 -- Disable perl provider
|
||||
|
||||
@@ -335,6 +335,7 @@ return {
|
||||
sh = { 'shfmt' },
|
||||
bash = { 'shfmt' },
|
||||
php = { 'phpcbf' },
|
||||
python = { 'isort', 'black' },
|
||||
-- Conform can also run multiple formatters sequentially
|
||||
-- python = { "isort", "black" },
|
||||
--
|
||||
|
||||
@@ -54,7 +54,7 @@ return {
|
||||
event_handlers = {
|
||||
{
|
||||
event = 'file_opened',
|
||||
handler = function(file_path)
|
||||
handler = function(_)
|
||||
require('neo-tree.command').execute { action = 'close' }
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
return {
|
||||
-- Theme of choice, tokyonight
|
||||
-- https://github.com/folke/tokyonight.nvim
|
||||
-- https://github.com/preservim/vim-colors-pencil
|
||||
{
|
||||
'folke/tokyonight.nvim',
|
||||
'preservim/vim-colors-pencil',
|
||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||
init = function() vim.cmd.colorscheme(vim.g.colors_theme) end,
|
||||
opts = {
|
||||
transparent = true,
|
||||
},
|
||||
config = function()
|
||||
vim.cmd 'colorscheme pencil'
|
||||
vim.api.nvim_set_option_value('pencil_terminal_italics', 1, {})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Automatic dark mode
|
||||
@@ -18,11 +17,11 @@ return {
|
||||
update_interval = 1000,
|
||||
set_dark_mode = function()
|
||||
vim.api.nvim_set_option_value('background', 'dark', {})
|
||||
vim.cmd.colorscheme(vim.g.colors_variant_dark)
|
||||
-- vim.cmd.colorscheme(vim.g.colors_variant_dark)
|
||||
end,
|
||||
set_light_mode = function()
|
||||
vim.api.nvim_set_option_value('background', 'light', {})
|
||||
vim.cmd.colorscheme(vim.g.colors_variant_light)
|
||||
-- vim.cmd.colorscheme(vim.g.colors_variant_light)
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
2
config/vim/.gitignore
vendored
2
config/vim/.gitignore
vendored
@@ -1 +1,3 @@
|
||||
plugged
|
||||
extra/*
|
||||
!extra/.gitkeep
|
||||
|
||||
64
config/vim/after/autocmd.vim
Normal file
64
config/vim/after/autocmd.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
"" The PC is fast enough, do syntax highlight
|
||||
"" syncing from start 6nless 200 lines
|
||||
augroup vimrc-sync-fromstart
|
||||
autocmd!
|
||||
autocmd BufEnter * :syntax sync maxlines=600
|
||||
augroup END
|
||||
|
||||
"" txt
|
||||
augroup vimrc-wrapping
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.txt call s:setupWrapping()
|
||||
augroup END
|
||||
|
||||
"" make/cmake
|
||||
augroup vimrc-make-cmake
|
||||
autocmd!
|
||||
autocmd FileType make setlocal noexpandtab
|
||||
autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake
|
||||
augroup END
|
||||
|
||||
set autoread
|
||||
|
||||
""" Create/get autocommand group
|
||||
function! s:CreateAugroup(name) abort
|
||||
execute 'augroup' a:name
|
||||
autocmd!
|
||||
augroup END
|
||||
endfunction
|
||||
|
||||
" Highlight on yank
|
||||
" See `:help vim.highlight.on_yank()`
|
||||
call s:CreateAugroup('YankHighlight')
|
||||
autocmd YankHighlight TextYankPost * silent! lua vim.highlight.on_yank()
|
||||
|
||||
" Set the numberwidth to the maximum line number.
|
||||
" Fixes the issue where the line numbers jump
|
||||
" around when moving between lines with relative line numbers enabled.
|
||||
call s:CreateAugroup('AdjustNumberWidth')
|
||||
autocmd AdjustNumberWidth BufEnter,BufWinEnter,TabEnter *
|
||||
\ let max_line_count = line('$') |
|
||||
\ if max_line_count > 99 |
|
||||
\ let &numberwidth = strlen(string(max_line_count)) + 1
|
||||
\ endif
|
||||
|
||||
" Windows to close with "q"
|
||||
call s:CreateAugroup('close_with_q')
|
||||
autocmd close_with_q FileType checkhealth,dbout,gitsigns.blame,grug-far,help,
|
||||
\ lspinfo,man,neotest-output,neotest-output-panel,neotest-summary,notify,
|
||||
\ qf,spectre_panel,startuptime,tsplayground
|
||||
\ setlocal buflisted=false |
|
||||
\ nnoremap <silent> <buffer> q :close<CR>
|
||||
|
||||
" Make it easier to close man-files when opened inline
|
||||
call s:CreateAugroup('man_unlisted')
|
||||
autocmd man_unlisted FileType man setlocal buflisted=false
|
||||
|
||||
" Wrap and check for spell in text filetypes
|
||||
call s:CreateAugroup('wrap_spell')
|
||||
autocmd wrap_spell FileType text,plaintex,typst,gitcommit,markdown,asciidoc,rst,tex
|
||||
\ setlocal wrap spell
|
||||
|
||||
" Fix conceallevel for json files
|
||||
call s:CreateAugroup('json_conceal')
|
||||
autocmd json_conceal FileType json,jsonc,json5 setlocal conceallevel=0
|
||||
26
config/vim/after/colors.vim
Normal file
26
config/vim/after/colors.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
function! ChangeColorScheme(channel, msg)
|
||||
let time = trim(a:msg)
|
||||
if time ==# "Dark"
|
||||
set background="dark"
|
||||
else
|
||||
set background="light"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! CheckStatus(timer)
|
||||
if executable("defaults")
|
||||
let job = job_start(
|
||||
\ ["defaults", "read", "-g", "AppleInterfaceStyle"],
|
||||
\ {"out_cb": "ChangeColorScheme"}
|
||||
\ )
|
||||
else
|
||||
set background="dark"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! AutoDarkModeSetup()
|
||||
let timer = timer_start(3000, 'CheckStatus', {'repeat': -1})
|
||||
call CheckStatus(timer) " Initial call to setup the theme
|
||||
endfunction
|
||||
|
||||
call AutoDarkModeSetup()
|
||||
113
config/vim/after/mappings.vim
Normal file
113
config/vim/after/mappings.vim
Normal file
@@ -0,0 +1,113 @@
|
||||
"*****************************************************************************
|
||||
"" Abbreviations
|
||||
"*****************************************************************************
|
||||
"" no one is really happy until you have this shortcuts
|
||||
cnoreabbrev W! w! " force write
|
||||
cnoreabbrev Q! q! " force quit
|
||||
cnoreabbrev Qall! qall! " force quit all
|
||||
cnoreabbrev Wq wq " write and quit
|
||||
cnoreabbrev Wa wa " write all
|
||||
cnoreabbrev wQ wq " write and quit
|
||||
cnoreabbrev WQ wq " write and quit
|
||||
cnoreabbrev W w " write
|
||||
cnoreabbrev Q q " quit
|
||||
cnoreabbrev Qall qall " quit all
|
||||
|
||||
"*****************************************************************************
|
||||
"" Mappings
|
||||
"*****************************************************************************
|
||||
|
||||
noremap <C-S> :w<CR> " save buffer
|
||||
|
||||
" Split
|
||||
noremap <Leader>h :<C-u>split<CR> " horizontal split
|
||||
noremap <Leader>v :<C-u>vsplit<CR> " vertical split
|
||||
|
||||
" Git
|
||||
noremap <Leader>ga :Gwrite<CR>
|
||||
noremap <Leader>gc :Git commit --verbose<CR>
|
||||
noremap <Leader>gsh :Git push<CR>
|
||||
noremap <Leader>gll :Git pull<CR>
|
||||
noremap <Leader>gs :Git<CR>
|
||||
noremap <Leader>gb :Git blame<CR>
|
||||
noremap <Leader>gd :Gvdiffsplit<CR>
|
||||
noremap <Leader>gr :GRemove<CR>
|
||||
|
||||
" session management
|
||||
nnoremap <leader>so :OpenSession<Space>
|
||||
nnoremap <leader>ss :SaveSession<Space>
|
||||
nnoremap <leader>sd :DeleteSession<CR>
|
||||
nnoremap <leader>sc :CloseSession<CR>
|
||||
|
||||
" Tabs
|
||||
nnoremap <Tab> gt " next tab
|
||||
nnoremap <S-Tab> gT " previous tab
|
||||
nnoremap <silent> <S-t> :tabnew<CR> " new tab
|
||||
|
||||
nnoremap <leader>. :lcd %:p:h<CR> " set working directory to the current file
|
||||
|
||||
" Opens an edit command with the path of the currently
|
||||
" edited file filled in
|
||||
noremap <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
|
||||
|
||||
" Opens a tab edit command with the path of the currently
|
||||
" edited file filled
|
||||
noremap <Leader>r :tabe <C-R>=expand("%:p:h") . "/" <CR>
|
||||
|
||||
" fzf.vim
|
||||
let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'vendor/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null"
|
||||
|
||||
cnoremap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
|
||||
nnoremap <silent> <leader>b :Buffers<CR>
|
||||
nnoremap <silent> <leader>e :FZF -m<CR>
|
||||
" Recovery commands from history through FZF
|
||||
nmap <leader>y :History:<CR>
|
||||
|
||||
" Tagbar
|
||||
nmap <silent> <F4> :TagbarToggle<CR> " open tagbar
|
||||
let g:tagbar_autofocus = 1
|
||||
|
||||
" Disable visualbell
|
||||
set noerrorbells visualbell t_vb=
|
||||
if has('autocmd')
|
||||
autocmd GUIEnter * set visualbell t_vb=
|
||||
endif
|
||||
|
||||
"" Copy/Paste/Cut
|
||||
if has('unnamedplus')
|
||||
set clipboard=unnamed,unnamedplus
|
||||
endif
|
||||
|
||||
noremap YY "+y<CR> " copy line
|
||||
noremap <leader>p "+gP<CR> " paste
|
||||
noremap XX "+x<CR> " cut
|
||||
|
||||
if has('macunix')
|
||||
" pbcopy for OSX copy/paste
|
||||
vmap <C-x> :!pbcopy<CR> " copy
|
||||
vmap <C-c> :w !pbcopy<CR><CR> " cut
|
||||
vmap <C-v> :!pbpaste<CR> " paste
|
||||
endif
|
||||
|
||||
"" Buffer nav
|
||||
noremap <leader>z :bp<CR> " previous buffer
|
||||
noremap <leader>x :bn<CR> " next buffer
|
||||
noremap <leader>bq :bp<CR> " previous buffer
|
||||
noremap <leader>bw :bn<CR> " next buffer
|
||||
noremap <leader>bd :bd<CR> " close buffer
|
||||
|
||||
|
||||
"" Switching windows
|
||||
noremap <C-j> <C-w>j " move to window below
|
||||
noremap <C-k> <C-w>k " move to window above
|
||||
noremap <C-l> <C-w>l " move to window right
|
||||
noremap <C-h> <C-w>h " move to window left
|
||||
|
||||
vmap < <gv " move visual block left, keep selection
|
||||
vmap > >gv " move visual block right, keep selection
|
||||
vnoremap J :m '>+1<CR>gv=gv " move visual block down, keep selection
|
||||
vnoremap K :m '<-2<CR>gv=gv " move visual block up, keep selection
|
||||
|
||||
nnoremap <Leader>o :.GBrowse<CR> " open current line on GitHub
|
||||
nnoremap <silent> <leader>sh :terminal<CR> " open a new terminal
|
||||
nnoremap <silent> <esc><esc> :noh<cr> " clean search
|
||||
0
config/vim/after/settings.vim
Normal file
0
config/vim/after/settings.vim
Normal file
34
config/vim/after/ui.vim
Normal file
34
config/vim/after/ui.vim
Normal file
@@ -0,0 +1,34 @@
|
||||
" GUI settings
|
||||
if has("gui_running")
|
||||
if has("gui_mac") || has("gui_macvim")
|
||||
set macligatures
|
||||
set guifont=JetBrains\ Mono:h14
|
||||
set transparency=7
|
||||
endif
|
||||
else
|
||||
let g:CSApprox_loaded = 1
|
||||
|
||||
" IndentLine
|
||||
let g:indentLine_enabled = 1
|
||||
let g:indentLine_concealcursor = ''
|
||||
let g:indentLine_char = '┆'
|
||||
let g:indentLine_faster = 1
|
||||
|
||||
if $COLORTERM == 'gnome-terminal'
|
||||
set term=gnome-256color
|
||||
else
|
||||
if $TERM == 'xterm'
|
||||
set term=xterm-256color
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" if terminal supports 256 colors, disable t_ut
|
||||
if &term =~ '256color'
|
||||
set t_ut=
|
||||
endif
|
||||
|
||||
" set the title of the terminal to the file name
|
||||
set title
|
||||
set titleold="Terminal"
|
||||
set titlestring=%F
|
||||
175
config/vim/autoload/airline/themes/pencil.vim
Normal file
175
config/vim/autoload/airline/themes/pencil.vim
Normal file
@@ -0,0 +1,175 @@
|
||||
let g:airline#themes#pencil#palette = {}
|
||||
|
||||
function! airline#themes#pencil#refresh()
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Options
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:background = get(g:, 'airline_pencil_bg', &background)
|
||||
let s:ansi_colors = &t_Co < 16 ? 1 : 0
|
||||
let s:tty = &t_Co == 8
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colors
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Base colors
|
||||
let s:base03 = {'t': s:ansi_colors ? 8 : (s:tty ? '0' : 234), 'g': '#212121'}
|
||||
let s:base02 = {'t': s:ansi_colors ? '0' : (s:tty ? '0' : 235), 'g': '#424242'}
|
||||
let s:base01 = {'t': s:ansi_colors ? 10 : (s:tty ? '0' : 240), 'g': '#909090'}
|
||||
let s:base00 = {'t': s:ansi_colors ? 11 : (s:tty ? '7' : 241), 'g': '#545454'}
|
||||
let s:base0 = {'t': s:ansi_colors ? 12 : (s:tty ? '7' : 244), 'g': '#B2B2B2'}
|
||||
let s:base1 = {'t': s:ansi_colors ? 14 : (s:tty ? '7' : 245), 'g': '#636363'}
|
||||
let s:base2 = {'t': s:ansi_colors ? 7 : (s:tty ? '7' : 254), 'g': '#D9D9D9'}
|
||||
let s:base3 = {'t': s:ansi_colors ? 15 : (s:tty ? '7' : 7 ), 'g': '#C6C6C6'}
|
||||
let s:darkblue= {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 24 ), 'g': '#005F87'}
|
||||
let s:orange = {'t': s:ansi_colors ? 9 : (s:tty ? '1' : 166), 'g': '#D75F5F'}
|
||||
let s:red = {'t': s:ansi_colors ? 1 : (s:tty ? '1' : 160), 'g': '#C30771'}
|
||||
let s:magenta = {'t': s:ansi_colors ? 5 : (s:tty ? '5' : 125), 'g': '#E32791'}
|
||||
let s:violet = {'t': s:ansi_colors ? 13 : (s:tty ? '5' : 61 ), 'g': '#6855DE'}
|
||||
let s:blue = {'t': s:ansi_colors ? 4 : (s:tty ? '4' : 33 ), 'g': '#008EC4'}
|
||||
let s:cyan = {'t': s:ansi_colors ? 6 : (s:tty ? '6' : 37 ), 'g': '#20A5BA'}
|
||||
let s:green = {'t': s:ansi_colors ? 2 : (s:tty ? '2' : 64 ), 'g': '#10A778'}
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Simple mappings
|
||||
" NOTE: These are easily tweakable mappings. The actual mappings get
|
||||
" the specific gui and terminal colors from the base color dicts.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Normal mode
|
||||
if s:background == 'dark'
|
||||
let s:N1 = [s:base3, s:base1, 'bold']
|
||||
let s:N2 = [s:base2, (s:tty ? s:base01 : s:base00), '']
|
||||
let s:N3 = [s:base01, s:base02, '']
|
||||
else
|
||||
let s:N1 = [s:base2, s:base00, 'bold']
|
||||
let s:N2 = [(s:tty ? s:base01 : s:base2), s:base1, '']
|
||||
let s:N3 = [s:base1, s:base2, '']
|
||||
endif
|
||||
let s:NF = [s:orange, s:N3[1], '']
|
||||
let s:NW = [s:base3, s:orange, '']
|
||||
if s:background == 'dark'
|
||||
let s:NM = [s:base1, s:N3[1], '']
|
||||
let s:NMi = [s:base2, s:N3[1], '']
|
||||
else
|
||||
let s:NM = [s:base01, s:N3[1], '']
|
||||
let s:NMi = [s:base02, s:N3[1], '']
|
||||
endif
|
||||
|
||||
" Insert mode
|
||||
let s:I1 = [s:N1[0], s:darkblue, 'bold']
|
||||
let s:I2 = s:N2
|
||||
let s:I3 = s:N3
|
||||
let s:IF = s:NF
|
||||
let s:IM = s:NM
|
||||
|
||||
" Visual mode
|
||||
let s:V1 = [s:N1[0], s:magenta, 'bold']
|
||||
let s:V2 = s:N2
|
||||
let s:V3 = s:N3
|
||||
let s:VF = s:NF
|
||||
let s:VM = s:NM
|
||||
|
||||
" Replace mode
|
||||
let s:R1 = [s:N1[0], s:red, '']
|
||||
let s:R2 = s:N2
|
||||
let s:R3 = s:N3
|
||||
let s:RM = s:NM
|
||||
let s:RF = s:NF
|
||||
|
||||
" Inactive, according to VertSplit in pencil
|
||||
" (bg dark: base00; bg light: base0)
|
||||
if s:background == 'dark'
|
||||
let s:IA = [s:base01, s:base02, '']
|
||||
else
|
||||
let s:IA = [s:base1, s:base2, '']
|
||||
endif
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Actual mappings
|
||||
" WARNING: Don't modify this section unless necessary.
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
let s:NFa = [s:NF[0].g, s:NF[1].g, s:NF[0].t, s:NF[1].t, s:NF[2]]
|
||||
let s:IFa = [s:IF[0].g, s:IF[1].g, s:IF[0].t, s:IF[1].t, s:IF[2]]
|
||||
let s:VFa = [s:VF[0].g, s:VF[1].g, s:VF[0].t, s:VF[1].t, s:VF[2]]
|
||||
let s:RFa = [s:RF[0].g, s:RF[1].g, s:RF[0].t, s:RF[1].t, s:RF[2]]
|
||||
|
||||
let g:airline#themes#pencil#palette.accents = {
|
||||
\ 'red': s:NFa,
|
||||
\ }
|
||||
|
||||
let g:airline#themes#pencil#palette.inactive = airline#themes#generate_color_map(
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]],
|
||||
\ [s:IA[0].g, s:IA[1].g, s:IA[0].t, s:IA[1].t, s:IA[2]])
|
||||
let g:airline#themes#pencil#palette.inactive_modified = {
|
||||
\ 'airline_c': [s:NMi[0].g, '', s:NMi[0].t, '', s:NMi[2]]}
|
||||
|
||||
let g:airline#themes#pencil#palette.normal = airline#themes#generate_color_map(
|
||||
\ [s:N1[0].g, s:N1[1].g, s:N1[0].t, s:N1[1].t, s:N1[2]],
|
||||
\ [s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]],
|
||||
\ [s:N3[0].g, s:N3[1].g, s:N3[0].t, s:N3[1].t, s:N3[2]])
|
||||
|
||||
let g:airline#themes#pencil#palette.normal.airline_warning = [
|
||||
\ s:NW[0].g, s:NW[1].g, s:NW[0].t, s:NW[1].t, s:NW[2]]
|
||||
|
||||
let g:airline#themes#pencil#palette.normal_modified = {
|
||||
\ 'airline_c': [s:NM[0].g, s:NM[1].g,
|
||||
\ s:NM[0].t, s:NM[1].t, s:NM[2]]}
|
||||
|
||||
let g:airline#themes#pencil#palette.normal_modified.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.insert = airline#themes#generate_color_map(
|
||||
\ [s:I1[0].g, s:I1[1].g, s:I1[0].t, s:I1[1].t, s:I1[2]],
|
||||
\ [s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]],
|
||||
\ [s:I3[0].g, s:I3[1].g, s:I3[0].t, s:I3[1].t, s:I3[2]])
|
||||
|
||||
let g:airline#themes#pencil#palette.insert.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.insert_modified = {
|
||||
\ 'airline_c': [s:IM[0].g, s:IM[1].g,
|
||||
\ s:IM[0].t, s:IM[1].t, s:IM[2]]}
|
||||
|
||||
let g:airline#themes#pencil#palette.insert_modified.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.visual = airline#themes#generate_color_map(
|
||||
\ [s:V1[0].g, s:V1[1].g, s:V1[0].t, s:V1[1].t, s:V1[2]],
|
||||
\ [s:V2[0].g, s:V2[1].g, s:V2[0].t, s:V2[1].t, s:V2[2]],
|
||||
\ [s:V3[0].g, s:V3[1].g, s:V3[0].t, s:V3[1].t, s:V3[2]])
|
||||
|
||||
let g:airline#themes#pencil#palette.visual.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.visual_modified = {
|
||||
\ 'airline_c': [s:VM[0].g, s:VM[1].g,
|
||||
\ s:VM[0].t, s:VM[1].t, s:VM[2]]}
|
||||
|
||||
let g:airline#themes#pencil#palette.visual_modified.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.replace = airline#themes#generate_color_map(
|
||||
\ [s:R1[0].g, s:R1[1].g, s:R1[0].t, s:R1[1].t, s:R1[2]],
|
||||
\ [s:R2[0].g, s:R2[1].g, s:R2[0].t, s:R2[1].t, s:R2[2]],
|
||||
\ [s:R3[0].g, s:R3[1].g, s:R3[0].t, s:R3[1].t, s:R3[2]])
|
||||
|
||||
let g:airline#themes#pencil#palette.replace.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.replace_modified = {
|
||||
\ 'airline_c': [s:RM[0].g, s:RM[1].g,
|
||||
\ s:RM[0].t, s:RM[1].t, s:RM[2]]}
|
||||
|
||||
let g:airline#themes#pencil#palette.replace_modified.airline_warning =
|
||||
\ g:airline#themes#pencil#palette.normal.airline_warning
|
||||
|
||||
let g:airline#themes#pencil#palette.tabline = {}
|
||||
|
||||
let g:airline#themes#pencil#palette.tabline.airline_tab = [
|
||||
\ s:I2[0].g, s:I2[1].g, s:I2[0].t, s:I2[1].t, s:I2[2]]
|
||||
|
||||
let g:airline#themes#pencil#palette.tabline.airline_tabtype = [
|
||||
\ s:N2[0].g, s:N2[1].g, s:N2[0].t, s:N2[1].t, s:N2[2]]
|
||||
endfunction
|
||||
|
||||
call airline#themes#pencil#refresh()
|
||||
383
config/vim/colors/pencil.vim
Normal file
383
config/vim/colors/pencil.vim
Normal file
@@ -0,0 +1,383 @@
|
||||
" Vim Color File
|
||||
" Name: pencil.vim
|
||||
" Version: 0.6
|
||||
" Maintainer: github.com/preservim
|
||||
" License: The MIT License (MIT)
|
||||
|
||||
" Original iA Writer colors, to use as a guide
|
||||
" White #F1F1F1
|
||||
" OffWhiteIPad #F5F2EC
|
||||
" OffWhiteDemo #F9F8F4
|
||||
" Cursor #20BBFC
|
||||
" Selection #B6D6FD
|
||||
" SelectionNOS #D4D4D4
|
||||
" StatusBar #EDEDED
|
||||
" StatusBarBorder #D9D9D9 used for search too
|
||||
" Text #424242
|
||||
" Blue #B5D6FD
|
||||
" Green #30C798
|
||||
" Blue2 #1DAEE4
|
||||
" gray #999999
|
||||
" Red #E32791
|
||||
" UnfocusedText #B8B8B8
|
||||
" MenuSelected #2C81FB
|
||||
" MenuUnSelected #545454
|
||||
" MenuText #F1F1F1
|
||||
" LightKeyBg #4B4B4B
|
||||
" DarkKeyBg #262626
|
||||
" NearBlack #181818
|
||||
" SyntaxButton #363738
|
||||
" SearchHighlight #F3E430 yellow
|
||||
|
||||
hi clear
|
||||
|
||||
if exists('syntax on')
|
||||
syntax reset
|
||||
endif
|
||||
|
||||
let g:colors_name='pencil'
|
||||
|
||||
if ! exists("g:pencil_higher_contrast_ui")
|
||||
let g:pencil_higher_contrast_ui = 0
|
||||
endif
|
||||
|
||||
if ! exists("g:pencil_neutral_code_bg")
|
||||
let g:pencil_neutral_code_bg = 0
|
||||
endif
|
||||
|
||||
if ! exists("g:pencil_neutral_headings")
|
||||
let g:pencil_neutral_headings = 0
|
||||
endif
|
||||
|
||||
" not all terminals support italics properly. If yours does, opt-in.
|
||||
if ! exists("g:pencil_terminal_italics")
|
||||
let g:pencil_terminal_italics = 0
|
||||
endif
|
||||
|
||||
if ! exists("g:pencil_spell_undercurl")
|
||||
let g:pencil_spell_undercurl = 1
|
||||
endif
|
||||
|
||||
if ! exists("g:pencil_gutter_color")
|
||||
let g:pencil_gutter_color = 0
|
||||
endif
|
||||
|
||||
" Colors
|
||||
let s:black = { "gui": "#212121", "cterm": "0" }
|
||||
let s:medium_gray = { "gui": "#767676", "cterm": "243" }
|
||||
let s:white = { "gui": "#F1F1F1", "cterm": "15" }
|
||||
let s:actual_white = { "gui": "#FFFFFF", "cterm": "231" }
|
||||
let s:light_black = { "gui": "#424242", "cterm": "8" }
|
||||
let s:lighter_black = { "gui": "#545454", "cterm": "240" }
|
||||
|
||||
if g:pencil_higher_contrast_ui == 0
|
||||
" darker shadow and whiter grays
|
||||
let s:subtle_black = { "gui": "#262626", "cterm": "235" }
|
||||
let s:light_gray = { "gui": "#D9D9D9", "cterm": "253" }
|
||||
let s:lighter_gray = { "gui": "#E5E6E6", "cterm": "254" }
|
||||
else
|
||||
" lighter shadows and darker grays
|
||||
let s:subtle_black = { "gui": "#303030", "cterm": "236" }
|
||||
let s:light_gray = { "gui": "#B2B2B2", "cterm": "249" }
|
||||
let s:lighter_gray = { "gui": "#C6C6C6", "cterm": "251" }
|
||||
endif
|
||||
|
||||
let s:pink = { "gui": "#fb007a", "cterm": "9" }
|
||||
let s:dark_red = { "gui": "#C30771", "cterm": "1" }
|
||||
let s:light_red = { "gui": "#E32791", "cterm": "1" }
|
||||
let s:orange = { "gui": "#D75F5F", "cterm": "167" }
|
||||
|
||||
let s:darker_blue = { "gui": "#005F87", "cterm": "18" }
|
||||
let s:dark_blue = { "gui": "#008EC4", "cterm": "4" }
|
||||
let s:blue = { "gui": "#20BBFC", "cterm": "12" }
|
||||
let s:light_blue = { "gui": "#b6d6fd", "cterm": "153" }
|
||||
let s:dark_cyan = { "gui": "#20A5BA", "cterm": "6" }
|
||||
let s:light_cyan = { "gui": "#4FB8CC", "cterm": "14" }
|
||||
|
||||
let s:dark_green = { "gui": "#10A778", "cterm": "2" }
|
||||
let s:light_green = { "gui": "#5FD7A7", "cterm": "10" }
|
||||
|
||||
let s:dark_purple = { "gui": "#523C79", "cterm": "5" }
|
||||
let s:light_purple = { "gui": "#6855DE", "cterm": "13" }
|
||||
|
||||
let s:yellow = { "gui": "#F3E430", "cterm": "11" }
|
||||
let s:dark_yellow = { "gui": "#A89C14", "cterm": "3" }
|
||||
|
||||
if &background == "dark"
|
||||
let s:bg = s:black
|
||||
let s:bg_subtle = s:light_black
|
||||
let s:bg_very_subtle = s:subtle_black
|
||||
let s:norm = s:lighter_gray
|
||||
let s:norm_subtle = s:light_gray
|
||||
let s:purple = s:light_purple
|
||||
let s:cyan = s:light_cyan
|
||||
let s:green = s:light_green
|
||||
let s:red = s:light_red
|
||||
let s:visual = s:lighter_black
|
||||
else
|
||||
let s:bg = s:white
|
||||
let s:bg_subtle = s:light_gray
|
||||
let s:bg_very_subtle = s:lighter_gray
|
||||
let s:norm = s:light_black
|
||||
let s:norm_subtle = s:lighter_black
|
||||
let s:purple = s:dark_purple
|
||||
let s:cyan = s:dark_cyan
|
||||
let s:green = s:dark_green
|
||||
let s:red = s:dark_red
|
||||
let s:visual = s:light_blue
|
||||
endif
|
||||
|
||||
if g:pencil_neutral_headings == 1
|
||||
let s:head_a = s:norm
|
||||
let s:head_b = s:norm
|
||||
let s:head_c = s:norm
|
||||
else
|
||||
let s:head_a = s:dark_blue
|
||||
let s:head_b = s:blue
|
||||
let s:head_c = s:dark_cyan
|
||||
endif
|
||||
|
||||
if g:pencil_neutral_code_bg == 1
|
||||
let s:code_bg = s:bg
|
||||
else
|
||||
let s:code_bg = s:bg_very_subtle
|
||||
endif
|
||||
|
||||
if g:pencil_spell_undercurl == 1
|
||||
let s:sp_un = 'undercurl'
|
||||
else
|
||||
let s:sp_un = 'underline'
|
||||
endif
|
||||
|
||||
" shamelessly stolen from hemisu: https://github.com/noahfrederick/vim-hemisu/
|
||||
function! s:h(group, style)
|
||||
" Not all terminals support italics properly. If yours does, opt-in.
|
||||
if g:pencil_terminal_italics == 0 && has_key(a:style, "cterm") && a:style["cterm"] == "italic"
|
||||
unlet a:style.cterm
|
||||
endif
|
||||
execute "highlight" a:group
|
||||
\ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE")
|
||||
\ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE")
|
||||
\ "guisp=" (has_key(a:style, "sp") ? a:style.sp.gui : "NONE")
|
||||
\ "gui=" (has_key(a:style, "gui") ? a:style.gui : "NONE")
|
||||
\ "ctermfg=" (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE")
|
||||
\ "ctermbg=" (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE")
|
||||
\ "cterm=" (has_key(a:style, "cterm") ? a:style.cterm : "NONE")
|
||||
endfunction
|
||||
|
||||
" common groups ================================================================
|
||||
" (see `:h w18`)
|
||||
|
||||
call s:h("Normal", {"bg": s:bg, "fg": s:norm})
|
||||
call s:h("Cursor", {"bg": s:blue, "fg": s:norm })
|
||||
call s:h("Comment", {"fg": s:medium_gray, "gui": "italic", "cterm": "italic"})
|
||||
|
||||
call s:h("Constant", {"fg": s:cyan})
|
||||
hi! link String Constant
|
||||
hi! link Character Constant
|
||||
hi! link Number Constant
|
||||
hi! link Boolean Constant
|
||||
hi! link Float Constant
|
||||
|
||||
call s:h("Identifier", {"fg": s:dark_blue})
|
||||
hi! link Function Identifier
|
||||
|
||||
call s:h("Statement", {"fg": s:green})
|
||||
hi! link Conditonal Statement
|
||||
hi! link Repeat Statement
|
||||
hi! link Label Statement
|
||||
hi! link Operator Statement
|
||||
hi! link Keyword Statement
|
||||
hi! link Exception Statement
|
||||
|
||||
call s:h("PreProc", {"fg": s:red})
|
||||
hi! link Include PreProc
|
||||
hi! link Define PreProc
|
||||
hi! link Macro PreProc
|
||||
hi! link PreCondit PreProc
|
||||
|
||||
call s:h("Type", {"fg": s:purple})
|
||||
hi! link StorageClass Type
|
||||
hi! link Structure Type
|
||||
hi! link Typedef Type
|
||||
|
||||
call s:h("Special", {"fg": s:pink})
|
||||
hi! link SpecialChar Special
|
||||
hi! link Tag Special
|
||||
hi! link Delimiter Special
|
||||
hi! link SpecialComment Special
|
||||
hi! link Debug Special
|
||||
|
||||
call s:h("Underlined", {"fg": s:norm , "gui": "underline", "cterm": "underline"})
|
||||
call s:h("Ignore", {"fg": s:bg })
|
||||
call s:h("Error", {"fg": s:actual_white, "bg": s:red , "gui": "bold" , "cterm": "bold" })
|
||||
call s:h("Todo", {"fg": s:actual_white, "bg": s:pink, "gui": "bold" , "cterm": "bold" })
|
||||
|
||||
" ui chrome ====================================================================
|
||||
" ordered according to `:help hitest.vim`
|
||||
|
||||
call s:h("SpecialKey", {"fg": s:light_green})
|
||||
call s:h("NonText", {"fg": s:bg_subtle})
|
||||
call s:h("Directory", {"fg": s:dark_blue})
|
||||
call s:h("ErrorMsg", {"fg": s:pink})
|
||||
call s:h("IncSearch", {"bg": s:yellow, "fg": s:light_black})
|
||||
call s:h("Search", {"bg": s:bg_subtle})
|
||||
call s:h("MoreMsg", {"fg": s:medium_gray, "gui": "bold", "cterm": "bold"})
|
||||
hi! link ModeMsg MoreMsg
|
||||
call s:h("LineNr", {"fg": s:bg_subtle})
|
||||
call s:h("CursorLineNr", {"fg": s:blue, "bg": s:bg_very_subtle})
|
||||
call s:h("Question", {"fg": s:red})
|
||||
call s:h("StatusLine", {"bg": s:bg_very_subtle})
|
||||
call s:h("Conceal", {"fg": s:norm})
|
||||
call s:h("StatusLineNC", {"bg": s:bg_very_subtle, "fg": s:medium_gray})
|
||||
call s:h("VertSplit", {"bg": s:bg_very_subtle, "fg": s:bg_very_subtle})
|
||||
call s:h("Title", {"fg": s:dark_blue})
|
||||
call s:h("Visual", {"bg": s:visual})
|
||||
call s:h("VisualNOS", {"bg": s:bg_subtle})
|
||||
call s:h("WarningMsg", {"fg": s:red})
|
||||
call s:h("WildMenu", {"fg": s:bg, "bg": s:norm})
|
||||
call s:h("Folded", {"fg": s:medium_gray})
|
||||
call s:h("FoldColumn", {"fg": s:bg_subtle})
|
||||
call s:h("DiffAdd", {"bg": s:bg_subtle, "fg": s:green})
|
||||
call s:h("DiffAdded", {"bg": s:bg_subtle, "fg": s:green})
|
||||
call s:h("DiffDelete", {"bg": s:bg_subtle, "fg": s:red})
|
||||
call s:h("DiffRemoved", {"bg": s:bg_subtle, "fg": s:red})
|
||||
call s:h("DiffChange", {"bg": s:bg_subtle, "fg": s:dark_yellow})
|
||||
call s:h("DiffChanged", {"bg": s:bg_subtle, "fg": s:dark_yellow})
|
||||
call s:h("DiffText", {"bg": s:bg_subtle, "fg": s:dark_blue})
|
||||
call s:h("SignColumn", {"fg": s:light_green})
|
||||
|
||||
call s:h("SpellBad", {"gui": s:sp_un, "sp": s:red, "cterm": s:sp_un, "fg": s:red})
|
||||
call s:h("SpellCap", {"gui": s:sp_un, "sp": s:light_green, "cterm": s:sp_un, "fg": s:light_green})
|
||||
call s:h("SpellRare", {"gui": s:sp_un, "sp": s:pink, "cterm": s:sp_un, "fg": s:pink})
|
||||
call s:h("SpellLocal", {"gui": s:sp_un, "sp": s:dark_green, "cterm": s:sp_un, "fg": s:dark_green})
|
||||
|
||||
call s:h("Pmenu", {"fg": s:norm, "bg": s:bg_subtle})
|
||||
call s:h("PmenuSel", {"fg": s:norm, "bg": s:blue})
|
||||
call s:h("PmenuSbar", {"fg": s:norm, "bg": s:bg_subtle})
|
||||
call s:h("PmenuThumb", {"fg": s:norm, "bg": s:bg_subtle})
|
||||
call s:h("TabLine", {"fg": s:norm, "bg": s:bg_very_subtle})
|
||||
call s:h("TabLineSel", {"fg": s:blue, "bg": s:bg_subtle, "gui": "bold", "cterm": "bold"})
|
||||
call s:h("TabLineFill", {"fg": s:norm, "bg": s:bg_very_subtle})
|
||||
call s:h("CursorColumn", {"bg": s:bg_very_subtle})
|
||||
call s:h("CursorLine", {"bg": s:bg_very_subtle})
|
||||
call s:h("ColorColumn", {"bg": s:bg_subtle})
|
||||
|
||||
" remainder of syntax highlighting
|
||||
call s:h("MatchParen", {"bg": s:bg_subtle, "fg": s:norm})
|
||||
call s:h("qfLineNr", {"fg": s:medium_gray})
|
||||
|
||||
" hi helpHyperTextJump guifg=#5FAFD7 ctermfg=74
|
||||
|
||||
" HTML syntax
|
||||
hi! link htmlTag Special
|
||||
hi! link htmlEndTag htmlTag
|
||||
|
||||
hi! link htmlTagName KeyWord
|
||||
" html5 tags show up as htmlTagN
|
||||
hi! link htmlTagN Keyword
|
||||
|
||||
" HTML content
|
||||
call s:h("htmlH1", {"fg": s:head_a, "gui": "bold,italic", "cterm": "bold" })
|
||||
call s:h("htmlH2", {"fg": s:head_a, "gui": "bold" , "cterm": "bold" })
|
||||
call s:h("htmlH3", {"fg": s:head_b, "gui": "italic" , "cterm": "italic" })
|
||||
call s:h("htmlH4", {"fg": s:head_b, "gui": "italic" , "cterm": "italic" })
|
||||
call s:h("htmlH5", {"fg": s:head_c })
|
||||
call s:h("htmlH6", {"fg": s:head_c })
|
||||
call s:h("htmlLink", {"fg": s:blue , "gui": "underline" , "cterm": "underline"})
|
||||
call s:h("htmlItalic", { "gui": "italic" , "cterm": "italic" })
|
||||
call s:h("htmlBold", { "gui": "bold" , "cterm": "bold" })
|
||||
call s:h("htmlBoldItalic",{ "gui": "bold,italic", "cterm": "bold" })
|
||||
" hi htmlString guifg=#87875f guibg=NONE gui=NONE ctermfg=101 ctermbg=NONE cterm=NONE
|
||||
|
||||
" tpope/vim-markdown
|
||||
call s:h("markdownBlockquote", {"fg": s:norm})
|
||||
call s:h("markdownBold", {"fg": s:norm , "gui": "bold" , "cterm": "bold" })
|
||||
call s:h("markdownBoldItalic", {"fg": s:norm , "gui": "bold,italic", "cterm": "bold" })
|
||||
call s:h("markdownEscape", {"fg": s:norm})
|
||||
call s:h("markdownH1", {"fg": s:head_a, "gui": "bold,italic", "cterm": "bold" })
|
||||
call s:h("markdownH2", {"fg": s:head_a, "gui": "bold" , "cterm": "bold" })
|
||||
call s:h("markdownH3", {"fg": s:head_a, "gui": "italic" , "cterm": "italic"})
|
||||
call s:h("markdownH4", {"fg": s:head_a, "gui": "italic" , "cterm": "italic"})
|
||||
call s:h("markdownH5", {"fg": s:head_a})
|
||||
call s:h("markdownH6", {"fg": s:head_a})
|
||||
call s:h("markdownHeadingDelimiter", {"fg": s:norm})
|
||||
call s:h("markdownHeadingRule", {"fg": s:norm})
|
||||
call s:h("markdownId", {"fg": s:medium_gray})
|
||||
call s:h("markdownIdDeclaration", {"fg": s:norm_subtle})
|
||||
call s:h("markdownItalic", {"fg": s:norm , "gui": "italic" , "cterm": "italic"})
|
||||
call s:h("markdownLinkDelimiter", {"fg": s:medium_gray})
|
||||
call s:h("markdownLinkText", {"fg": s:norm})
|
||||
call s:h("markdownLinkTextDelimiter", {"fg": s:medium_gray})
|
||||
call s:h("markdownListMarker", {"fg": s:norm})
|
||||
call s:h("markdownOrderedListMarker", {"fg": s:norm})
|
||||
call s:h("markdownRule", {"fg": s:norm})
|
||||
call s:h("markdownUrl", {"fg": s:medium_gray, "gui": "underline", "cterm": "underline"})
|
||||
call s:h("markdownUrlDelimiter", {"fg": s:medium_gray})
|
||||
call s:h("markdownUrlTitle", {"fg": s:norm})
|
||||
call s:h("markdownUrlTitleDelimiter", {"fg": s:medium_gray})
|
||||
call s:h("markdownCode", {"fg": s:norm, "bg": s:code_bg})
|
||||
call s:h("markdownCodeDelimiter", {"fg": s:norm, "bg": s:code_bg})
|
||||
|
||||
" plasticboy/vim-markdown
|
||||
call s:h("mkdBlockquote", {"fg": s:norm})
|
||||
call s:h("mkdDelimiter", {"fg": s:medium_gray})
|
||||
call s:h("mkdID", {"fg": s:medium_gray})
|
||||
call s:h("mkdLink", {"fg": s:norm})
|
||||
call s:h("mkdLinkDef", {"fg": s:medium_gray})
|
||||
call s:h("mkdListItem", {"fg": s:norm})
|
||||
call s:h("mkdNonListItemBlock", {"fg": s:norm}) " bug in syntax?
|
||||
call s:h("mkdRule", {"fg": s:norm})
|
||||
call s:h("mkdURL", {"fg": s:medium_gray, "gui": "underline", "cterm": "underline"})
|
||||
call s:h("mkdCode", {"fg": s:norm, "bg": s:code_bg})
|
||||
|
||||
" gabrielelana/vim-markdown
|
||||
call s:h("markdownBlockquoteDelimiter", {"fg": s:norm})
|
||||
call s:h("markdownInlineDelimiter", {"fg": s:norm})
|
||||
call s:h("markdownItemDelimiter", {"fg": s:norm})
|
||||
call s:h("markdownLinkReference", {"fg": s:medium_gray})
|
||||
call s:h("markdownLinkText", {"fg": s:norm})
|
||||
call s:h("markdownLinkTextContainer", {"fg": s:medium_gray})
|
||||
call s:h("markdownLinkUrl", {"fg": s:medium_gray, "gui": "underline", "cterm": "underline"})
|
||||
call s:h("markdownLinkUrlContainer", {"fg": s:medium_gray})
|
||||
call s:h("markdownFencedCodeBlock", {"fg": s:norm, "bg": s:code_bg})
|
||||
call s:h("markdownInlineCode", {"fg": s:norm, "bg": s:code_bg})
|
||||
|
||||
" mattly/vim-markdown-enhancements
|
||||
call s:h("mmdFootnoteDelimiter", {"fg": s:medium_gray})
|
||||
call s:h("mmdFootnoteMarker", {"fg": s:norm})
|
||||
call s:h("mmdTableAlign", {"fg": s:norm})
|
||||
call s:h("mmdTableDelimiter", {"fg": s:norm})
|
||||
call s:h("mmdTableHeadDelimiter", {"fg": s:norm})
|
||||
call s:h("mmdTableHeader", {"fg": s:norm})
|
||||
call s:h("mmdTableCaptionDelimiter", {"fg": s:norm})
|
||||
call s:h("mmdTableCaption", {"fg": s:norm})
|
||||
|
||||
" Textile content
|
||||
" https://github.com/timcharper/textile.vim/blob/master/syntax/textile.vim
|
||||
"call s:h("txtBold", {"fg": s:norm , "gui": "bold" , "cterm": "bold" })
|
||||
"call s:h("txtEmphasis", {"fg": s:norm , "gui": "italic" , "cterm": "italic"})
|
||||
|
||||
" XML content
|
||||
hi! link xmlTag htmlTag
|
||||
hi! link xmlEndTag xmlTag
|
||||
hi! link xmlTagName htmlTagName
|
||||
|
||||
" Signify, git-gutter
|
||||
if g:pencil_gutter_color == 1
|
||||
hi link SignifySignAdd DiffAdd
|
||||
hi link SignifySignDelete DiffDelete
|
||||
hi link SignifySignChange DiffChange
|
||||
hi link GitGutterAdd DiffAdd
|
||||
hi link GitGutterDelete DiffDelete
|
||||
hi link GitGutterChange DiffChange
|
||||
hi link GitGutterChangeDelete DiffChange
|
||||
else
|
||||
hi link SignifySignAdd LineNr
|
||||
hi link SignifySignDelete LineNr
|
||||
hi link SignifySignChange LineNr
|
||||
hi link GitGutterAdd LineNr
|
||||
hi link GitGutterDelete LineNr
|
||||
hi link GitGutterChange LineNr
|
||||
hi link GitGutterChangeDelete LineNr
|
||||
endif
|
||||
0
config/vim/extra/.gitkeep
Normal file
0
config/vim/extra/.gitkeep
Normal file
64
config/vim/ftplugin/go.vim
Normal file
64
config/vim/ftplugin/go.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
" go
|
||||
" vim-go
|
||||
" run :GoBuild or :GoTestCompile based on the go file
|
||||
function! s:build_go_files()
|
||||
let l:file = expand('%')
|
||||
if l:file =~# '^\f\+_test\.go$'
|
||||
call go#test#Test(0, 1)
|
||||
elseif l:file =~# '^\f\+\.go$'
|
||||
call go#cmd#Build(0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:go_list_type = "quickfix"
|
||||
let g:go_fmt_command = "goimports"
|
||||
let g:go_fmt_fail_silently = 1
|
||||
|
||||
let g:go_highlight_types = 1
|
||||
let g:go_highlight_fields = 1
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_methods = 1
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_build_constraints = 1
|
||||
let g:go_highlight_structs = 1
|
||||
let g:go_highlight_generate_tags = 1
|
||||
let g:go_highlight_space_tab_error = 0
|
||||
let g:go_highlight_array_whitespace_error = 0
|
||||
let g:go_highlight_trailing_whitespace_error = 0
|
||||
let g:go_highlight_extra_types = 1
|
||||
|
||||
autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
augroup completion_preview_close
|
||||
autocmd!
|
||||
if v:version > 703 || v:version == 703 && has('patch598')
|
||||
autocmd CompleteDone * if !&previewwindow && &completeopt =~ 'preview' | silent! pclose | endif
|
||||
endif
|
||||
augroup END
|
||||
|
||||
" for go files
|
||||
augroup go
|
||||
au!
|
||||
au Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
|
||||
au Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
|
||||
au Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
|
||||
au Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
|
||||
|
||||
au FileType go nmap <Leader>dd <Plug>(go-def-vertical)
|
||||
au FileType go nmap <Leader>dv <Plug>(go-doc-vertical)
|
||||
au FileType go nmap <Leader>db <Plug>(go-doc-browser)
|
||||
|
||||
au FileType go nmap <leader>r <Plug>(go-run)
|
||||
au FileType go nmap <leader>t <Plug>(go-test)
|
||||
au FileType go nmap <Leader>gt <Plug>(go-coverage-toggle)
|
||||
au FileType go nmap <Leader>i <Plug>(go-info)
|
||||
au FileType go nmap <silent> <Leader>l <Plug>(go-metalinter)
|
||||
au FileType go nmap <C-g> :GoDecls<cr>
|
||||
au FileType go nmap <leader>dr :GoDeclsDir<cr>
|
||||
au FileType go imap <C-g> <esc>:<C-u>GoDecls<cr>
|
||||
au FileType go imap <leader>dr <esc>:<C-u>GoDeclsDir<cr>
|
||||
au FileType go nmap <leader>rb :<C-u>call <SID>build_go_files()<CR>
|
||||
augroup END
|
||||
|
||||
"" ale
|
||||
:call extend(g:ale_linters, {"go": [ 'golint', 'go vet' ]})
|
||||
3
config/vim/ftplugin/html.vim
Normal file
3
config/vim/ftplugin/html.vim
Normal file
@@ -0,0 +1,3 @@
|
||||
" html
|
||||
" for html files, 2 spaces
|
||||
autocmd Filetype html setlocal ts=2 sw=2 expandtab
|
||||
45
config/vim/ftplugin/php.vim
Normal file
45
config/vim/ftplugin/php.vim
Normal file
@@ -0,0 +1,45 @@
|
||||
" php
|
||||
" Phpactor plugin
|
||||
" Include use statement
|
||||
nmap <Leader>u :call phpactor#UseAdd()<CR>
|
||||
" Invoke the context menu
|
||||
nmap <Leader>mm :call phpactor#ContextMenu()<CR>
|
||||
" Invoke the navigation menu
|
||||
nmap <Leader>nn :call phpactor#Navigate()<CR>
|
||||
" Goto definition of class or class member under the cursor
|
||||
nmap <Leader>oo :call phpactor#GotoDefinition()<CR>
|
||||
nmap <Leader>oh :call phpactor#GotoDefinition('hsplit')<CR>
|
||||
nmap <Leader>ov :call phpactor#GotoDefinition('vsplit')<CR>
|
||||
nmap <Leader>ot :call phpactor#GotoDefinition('tabnew')<CR>
|
||||
" Show brief information about the symbol under the cursor
|
||||
nmap <Leader>K :call phpactor#Hover()<CR>
|
||||
" Transform the classes in the current file
|
||||
nmap <Leader>tt :call phpactor#Transform()<CR>
|
||||
" Generate a new class (replacing the current file)
|
||||
nmap <Leader>cc :call phpactor#ClassNew()<CR>
|
||||
" Extract expression (normal mode)
|
||||
nmap <silent><Leader>ee :call phpactor#ExtractExpression(v:false)<CR>
|
||||
" Extract expression from selection
|
||||
vmap <silent><Leader>ee :<C-U>call phpactor#ExtractExpression(v:true)<CR>
|
||||
" Extract method from selection
|
||||
vmap <silent><Leader>em :<C-U>call phpactor#ExtractMethod()<CR>
|
||||
|
||||
au FileType php,blade let b:coc_root_patterns = [
|
||||
\ '.git', '.env', 'composer.json', 'artisan'
|
||||
\]
|
||||
au FileType php,blade nmap <silent> ga <Plug>(coc-codeaction-line)
|
||||
au FileType php,blade nmap <silent> <leader>ac <Plug>(coc-codeaction-cursor)
|
||||
au FileType php,blade nmap <silent> gd <Plug>(coc-definition)
|
||||
au FileType php,blade nmap <silent> gy <Plug>(coc-type-definition)
|
||||
au FileType php,blade nmap <silent> gi <Plug>(coc-implementation)
|
||||
au FileType php,blade nmap <silent> gr <Plug>(coc-references)
|
||||
au FileType php,blade nmap <silent> K <Plug>(coc-hover)
|
||||
au FileType php,blade nmap <silent> <leader>rn <Plug>(coc-rename)
|
||||
au FileType php,blade nmap <silent> <leader>f <Plug>(coc-format)
|
||||
au FileType php,blade nmap <silent> <leader>qf <Plug>(coc-fix-current)
|
||||
au FileType php,blade nmap <silent> <leader>qo <Plug>(coc-fix-all)
|
||||
au FileType php,blade nmap <silent> <leader>do <Plug>(coc-diagnostic-prev)
|
||||
au FileType php,blade nmap <silent> <leader>dn <Plug>(coc-diagnostic-next)
|
||||
au FileType php,blade nmap <silent> <leader>ca <Plug>(coc-cursoraction)
|
||||
au FileType php,blade nmap <silent> <leader>so <Plug>(coc-symbols)
|
||||
au FileType php,blade nmap <silent> <leader>cs <Plug>(coc-list-symbols)
|
||||
350
config/vim/vimrc
350
config/vim/vimrc
@@ -15,9 +15,13 @@ endif
|
||||
|
||||
let g:vim_bootstrap_langs = "go,html,javascript,lua,php,python,typescript"
|
||||
let g:vim_bootstrap_editor = "vim" " nvim or vim
|
||||
let g:vim_bootstrap_theme = "iceberg"
|
||||
let g:vim_bootstrap_theme = "pencil"
|
||||
let g:vim_bootstrap_frams = "vuejs"
|
||||
|
||||
" ale
|
||||
let g:ale_fixers = {}
|
||||
let g:ale_linters = { "python": [ "flake8" ] }
|
||||
|
||||
if !filereadable(vimplug_exists)
|
||||
if !executable(curl_exists)
|
||||
echoerr "You have to install curl or first install vim-plug yourself!"
|
||||
@@ -33,7 +37,8 @@ endif
|
||||
|
||||
" {{{
|
||||
call plug#begin(expand('$HOME/.config/vim/plugged'))
|
||||
|
||||
" vim-sensible
|
||||
Plug 'tpope/vim-sensible'
|
||||
" coc.nvim - Intellisense engine
|
||||
Plug 'neoclide/coc.nvim', {'branch': 'release'}
|
||||
" editorconfig-vim - EditorConfig plugin
|
||||
@@ -67,9 +72,6 @@ call plug#begin(expand('$HOME/.config/vim/plugged'))
|
||||
" vim-airline
|
||||
Plug 'vim-airline/vim-airline'
|
||||
|
||||
" iceberg.vim - Iceberg color scheme
|
||||
Plug 'cocopon/iceberg.vim'
|
||||
|
||||
" fzf.vim - Fuzzy finder
|
||||
if isdirectory('~/.config/vim/extra/fzf')
|
||||
Plug '~/.config/vim/extra/fzf' | Plug 'junegunn/fzf.vim'
|
||||
@@ -206,7 +208,7 @@ set wrapscan " Searches wrap around the end of the file
|
||||
" Ignore these files in wildmenu
|
||||
set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__,vendor
|
||||
|
||||
colorscheme iceberg " Set the color scheme
|
||||
colorscheme pencil " Set the color scheme
|
||||
filetype plugin indent on " enable filetype detection, plugins and indenting
|
||||
|
||||
" Set the shell
|
||||
@@ -216,6 +218,7 @@ else
|
||||
set shell=/bin/sh
|
||||
endif
|
||||
|
||||
|
||||
" COC
|
||||
let g:coc_global_extensions = [
|
||||
\ '@yaegassy/coc-intelephense',
|
||||
@@ -242,46 +245,8 @@ let g:session_autoload = "yes"
|
||||
let g:session_autosave = "yes"
|
||||
let g:session_command_aliases = 1
|
||||
|
||||
" GUI settings
|
||||
if has("gui_running")
|
||||
if has("gui_mac") || has("gui_macvim")
|
||||
set macligatures
|
||||
set guifont=JetBrains\ Mono:h14
|
||||
set transparency=7
|
||||
endif
|
||||
else
|
||||
let g:CSApprox_loaded = 1
|
||||
|
||||
" IndentLine
|
||||
let g:indentLine_enabled = 1
|
||||
let g:indentLine_concealcursor = ''
|
||||
let g:indentLine_char = '┆'
|
||||
let g:indentLine_faster = 1
|
||||
|
||||
if $COLORTERM == 'gnome-terminal'
|
||||
set term=gnome-256color
|
||||
else
|
||||
if $TERM == 'xterm'
|
||||
set term=xterm-256color
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" if terminal supports 256 colors, disable t_ut
|
||||
if &term =~ '256color'
|
||||
set t_ut=
|
||||
endif
|
||||
|
||||
" set the title of the terminal to the file name
|
||||
set title
|
||||
set titleold="Terminal"
|
||||
set titlestring=%F
|
||||
|
||||
syntax on
|
||||
|
||||
" set statusline to show the file name
|
||||
" set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L)|
|
||||
|
||||
" Search mappings: These will make it so that going to the next one in a
|
||||
" search will center on the line it's found in.
|
||||
nnoremap n nzzzv
|
||||
@@ -299,29 +264,14 @@ let g:airline#extensions#tabline#enabled = 1
|
||||
let g:airline#extensions#tagbar#enabled = 1
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline_skip_empty_sections = 1
|
||||
let g:airline_theme = 'iceberg'
|
||||
|
||||
"*****************************************************************************
|
||||
"" Abbreviations
|
||||
"*****************************************************************************
|
||||
"" no one is really happy until you have this shortcuts
|
||||
cnoreabbrev W! w! " force write
|
||||
cnoreabbrev Q! q! " force quit
|
||||
cnoreabbrev Qall! qall! " force quit all
|
||||
cnoreabbrev Wq wq " write and quit
|
||||
cnoreabbrev Wa wa " write all
|
||||
cnoreabbrev wQ wq " write and quit
|
||||
cnoreabbrev WQ wq " write and quit
|
||||
cnoreabbrev W w " write
|
||||
cnoreabbrev Q q " quit
|
||||
cnoreabbrev Qall qall " quit all
|
||||
let g:airline_theme = 'pencil'
|
||||
|
||||
" NERDTree configuration
|
||||
let g:NERDTreeChDirMode=2
|
||||
let g:NERDTreeIgnore=['node_modules', 'vendor', '\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
|
||||
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
|
||||
let g:NERDTreeShowBookmarks=1
|
||||
let g:nerdtree_tabs_focus_on_files=1
|
||||
let g:NERDTreeIgnore = [ 'node_modules', 'vendor', '\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__' ]
|
||||
let g:NERDTreeSortOrder = [ '^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$' ]
|
||||
let g:NERDTreeShowBookmarks = 1
|
||||
let g:nerdtree_tabs_focus_on_files = 1
|
||||
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
|
||||
let g:NERDTreeWinSize = 50
|
||||
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite,*node_modules/,*vendor/
|
||||
@@ -334,8 +284,6 @@ let Grep_Default_Options = '-IR'
|
||||
let Grep_Skip_Files = '*.log *.db .DS_Store'
|
||||
let Grep_Skip_Dirs = '.git node_modules vendor plugged'
|
||||
|
||||
nnoremap <silent> <leader>sh :terminal<CR> " open a new terminal
|
||||
|
||||
" CoC (code suggestions, diagnostics and refactoring)
|
||||
" find or update definitions
|
||||
nmap <silent> gd <Plug>(coc-definition)
|
||||
@@ -403,14 +351,14 @@ xmap <leader>c <Plug>(coc-codeaction-selected)
|
||||
|
||||
let g:wordy#ring = [
|
||||
\ 'weak',
|
||||
\ ['being', 'passive-voice', ],
|
||||
\ [ 'being', 'passive-voice', ],
|
||||
\ 'business-jargon',
|
||||
\ 'weasel',
|
||||
\ 'puffery',
|
||||
\ ['problematic', 'redundant', ],
|
||||
\ ['colloquial', 'idiomatic', 'similies', ],
|
||||
\ [ 'problematic', 'redundant', ],
|
||||
\ [ 'colloquial', 'idiomatic', 'similies', ],
|
||||
\ 'art-jargon',
|
||||
\ ['contractions', 'opinion', 'vague-time', 'said-synonyms', ],
|
||||
\ [ 'contractions', 'opinion', 'vague-time', 'said-synonyms', ],
|
||||
\ 'adjectives',
|
||||
\ 'adverbs',
|
||||
\ ]
|
||||
@@ -435,235 +383,10 @@ if !exists('*s:setupWrapping')
|
||||
endfunction
|
||||
endif
|
||||
|
||||
function! ChangeColorScheme(channel, msg)
|
||||
let time = trim(a:msg)
|
||||
if time ==# "Dark"
|
||||
set background="dark"
|
||||
else
|
||||
set background="light"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! CheckStatus(timer)
|
||||
if executable("defaults")
|
||||
let job = job_start(
|
||||
\ ["defaults", "read", "-g", "AppleInterfaceStyle"],
|
||||
\ {"out_cb": "ChangeColorScheme"}
|
||||
\ )
|
||||
else
|
||||
set background="dark"
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! AutoDarkModeSetup()
|
||||
let timer = timer_start(3000, 'CheckStatus', {'repeat': -1})
|
||||
call CheckStatus(timer) " Initial call to setup the theme
|
||||
endfunction
|
||||
|
||||
call AutoDarkModeSetup()
|
||||
|
||||
"*****************************************************************************
|
||||
"" Autocmd Rules
|
||||
"*****************************************************************************
|
||||
|
||||
"" The PC is fast enough, do syntax highlight
|
||||
"" syncing from start 6nless 200 lines
|
||||
augroup vimrc-sync-fromstart
|
||||
autocmd!
|
||||
autocmd BufEnter * :syntax sync maxlines=600
|
||||
augroup END
|
||||
|
||||
"" txt
|
||||
augroup vimrc-wrapping
|
||||
autocmd!
|
||||
autocmd BufRead,BufNewFile *.txt call s:setupWrapping()
|
||||
augroup END
|
||||
|
||||
"" make/cmake
|
||||
augroup vimrc-make-cmake
|
||||
autocmd!
|
||||
autocmd FileType make setlocal noexpandtab
|
||||
autocmd BufNewFile,BufRead CMakeLists.txt setlocal filetype=cmake
|
||||
augroup END
|
||||
|
||||
set autoread
|
||||
|
||||
"*****************************************************************************
|
||||
"" Mappings
|
||||
"*****************************************************************************
|
||||
|
||||
noremap <C-s> :w<CR> " save buffer
|
||||
|
||||
"" Split
|
||||
noremap <Leader>h :<C-u>split<CR> " horizontal split
|
||||
noremap <Leader>v :<C-u>vsplit<CR> " vertical split
|
||||
|
||||
" Git
|
||||
noremap <Leader>ga :Gwrite<CR>
|
||||
noremap <Leader>gc :Git commit --verbose<CR>
|
||||
noremap <Leader>gsh :Git push<CR>
|
||||
noremap <Leader>gll :Git pull<CR>
|
||||
noremap <Leader>gs :Git<CR>
|
||||
noremap <Leader>gb :Git blame<CR>
|
||||
noremap <Leader>gd :Gvdiffsplit<CR>
|
||||
noremap <Leader>gr :GRemove<CR>
|
||||
|
||||
" session management
|
||||
nnoremap <leader>so :OpenSession<Space>
|
||||
nnoremap <leader>ss :SaveSession<Space>
|
||||
nnoremap <leader>sd :DeleteSession<CR>
|
||||
nnoremap <leader>sc :CloseSession<CR>
|
||||
|
||||
" Tabs
|
||||
nnoremap <Tab> gt " next tab
|
||||
nnoremap <S-Tab> gT " previous tab
|
||||
nnoremap <silent> <S-t> :tabnew<CR> " new tab
|
||||
|
||||
nnoremap <leader>. :lcd %:p:h<CR> " set working directory to the current file
|
||||
|
||||
"" Opens an edit command with the path of the currently edited file filled in
|
||||
noremap <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
|
||||
|
||||
"" Opens a tab edit command with the path of the currently edited file filled
|
||||
noremap <Leader>r :tabe <C-R>=expand("%:p:h") . "/" <CR>
|
||||
|
||||
"" fzf.vim
|
||||
let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'vendor/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null"
|
||||
|
||||
cnoremap <C-P> <C-R>=expand("%:p:h") . "/" <CR>
|
||||
nnoremap <silent> <leader>b :Buffers<CR>
|
||||
nnoremap <silent> <leader>e :FZF -m<CR>
|
||||
" Recovery commands from history through FZF
|
||||
nmap <leader>y :History:<CR>
|
||||
|
||||
" ale
|
||||
let g:ale_linters = {
|
||||
\ "vim": [ "vint" ]
|
||||
\}
|
||||
let g:ale_fixers = {
|
||||
\}
|
||||
|
||||
" Tagbar
|
||||
nmap <silent> <F4> :TagbarToggle<CR> " open tagbar
|
||||
let g:tagbar_autofocus = 1
|
||||
|
||||
" Disable visualbell
|
||||
set noerrorbells visualbell t_vb=
|
||||
if has('autocmd')
|
||||
autocmd GUIEnter * set visualbell t_vb=
|
||||
endif
|
||||
|
||||
"" Copy/Paste/Cut
|
||||
if has('unnamedplus')
|
||||
set clipboard=unnamed,unnamedplus
|
||||
endif
|
||||
|
||||
noremap YY "+y<CR> " copy line
|
||||
noremap <leader>p "+gP<CR> " paste
|
||||
noremap XX "+x<CR> " cut
|
||||
|
||||
if has('macunix')
|
||||
" pbcopy for OSX copy/paste
|
||||
vmap <C-x> :!pbcopy<CR> " copy
|
||||
vmap <C-c> :w !pbcopy<CR><CR> " cut
|
||||
vmap <C-v> :!pbpaste<CR> " paste
|
||||
endif
|
||||
|
||||
"" Buffer nav
|
||||
noremap <leader>z :bp<CR> " previous buffer
|
||||
noremap <leader>x :bn<CR> " next buffer
|
||||
noremap <leader>bq :bp<CR> " previous buffer
|
||||
noremap <leader>bw :bn<CR> " next buffer
|
||||
noremap <leader>bd :bd<CR> " close buffer
|
||||
|
||||
nnoremap <silent> <esc><esc> :noh<cr> " clean search
|
||||
|
||||
"" Switching windows
|
||||
noremap <C-j> <C-w>j " move to window below
|
||||
noremap <C-k> <C-w>k " move to window above
|
||||
noremap <C-l> <C-w>l " move to window right
|
||||
noremap <C-h> <C-w>h " move to window left
|
||||
|
||||
vmap < <gv " move visual block left, keep selection
|
||||
vmap > >gv " move visual block right, keep selection
|
||||
vnoremap J :m '>+1<CR>gv=gv " move visual block down, keep selection
|
||||
vnoremap K :m '<-2<CR>gv=gv " move visual block up, keep selection
|
||||
|
||||
nnoremap <Leader>o :.GBrowse<CR> " open current line on GitHub
|
||||
|
||||
"*****************************************************************************
|
||||
"" Custom configs
|
||||
"*****************************************************************************
|
||||
|
||||
" go
|
||||
" vim-go
|
||||
" run :GoBuild or :GoTestCompile based on the go file
|
||||
function! s:build_go_files()
|
||||
let l:file = expand('%')
|
||||
if l:file =~# '^\f\+_test\.go$'
|
||||
call go#test#Test(0, 1)
|
||||
elseif l:file =~# '^\f\+\.go$'
|
||||
call go#cmd#Build(0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let g:go_list_type = "quickfix"
|
||||
let g:go_fmt_command = "goimports"
|
||||
let g:go_fmt_fail_silently = 1
|
||||
|
||||
let g:go_highlight_types = 1
|
||||
let g:go_highlight_fields = 1
|
||||
let g:go_highlight_functions = 1
|
||||
let g:go_highlight_methods = 1
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_build_constraints = 1
|
||||
let g:go_highlight_structs = 1
|
||||
let g:go_highlight_generate_tags = 1
|
||||
let g:go_highlight_space_tab_error = 0
|
||||
let g:go_highlight_array_whitespace_error = 0
|
||||
let g:go_highlight_trailing_whitespace_error = 0
|
||||
let g:go_highlight_extra_types = 1
|
||||
|
||||
autocmd BufNewFile,BufRead *.go setlocal noexpandtab tabstop=4 shiftwidth=4 softtabstop=4
|
||||
|
||||
augroup completion_preview_close
|
||||
autocmd!
|
||||
if v:version > 703 || v:version == 703 && has('patch598')
|
||||
autocmd CompleteDone * if !&previewwindow && &completeopt =~ 'preview' | silent! pclose | endif
|
||||
endif
|
||||
augroup END
|
||||
|
||||
" for go files
|
||||
augroup go
|
||||
au!
|
||||
au Filetype go command! -bang A call go#alternate#Switch(<bang>0, 'edit')
|
||||
au Filetype go command! -bang AV call go#alternate#Switch(<bang>0, 'vsplit')
|
||||
au Filetype go command! -bang AS call go#alternate#Switch(<bang>0, 'split')
|
||||
au Filetype go command! -bang AT call go#alternate#Switch(<bang>0, 'tabe')
|
||||
|
||||
au FileType go nmap <Leader>dd <Plug>(go-def-vertical)
|
||||
au FileType go nmap <Leader>dv <Plug>(go-doc-vertical)
|
||||
au FileType go nmap <Leader>db <Plug>(go-doc-browser)
|
||||
|
||||
au FileType go nmap <leader>r <Plug>(go-run)
|
||||
au FileType go nmap <leader>t <Plug>(go-test)
|
||||
au FileType go nmap <Leader>gt <Plug>(go-coverage-toggle)
|
||||
au FileType go nmap <Leader>i <Plug>(go-info)
|
||||
au FileType go nmap <silent> <Leader>l <Plug>(go-metalinter)
|
||||
au FileType go nmap <C-g> :GoDecls<cr>
|
||||
au FileType go nmap <leader>dr :GoDeclsDir<cr>
|
||||
au FileType go imap <C-g> <esc>:<C-u>GoDecls<cr>
|
||||
au FileType go imap <leader>dr <esc>:<C-u>GoDeclsDir<cr>
|
||||
au FileType go nmap <leader>rb :<C-u>call <SID>build_go_files()<CR>
|
||||
augroup END
|
||||
|
||||
"" ale
|
||||
:call extend(g:ale_linters, {"go": [ 'golint', 'go vet' ]})
|
||||
|
||||
" html
|
||||
" for html files, 2 spaces
|
||||
autocmd Filetype html setlocal ts=2 sw=2 expandtab
|
||||
|
||||
" javascript
|
||||
let g:javascript_enable_domhtmlcss = 1
|
||||
|
||||
@@ -673,36 +396,6 @@ augroup vimrc-javascript
|
||||
autocmd FileType javascript setl tabstop=4|setl shiftwidth=4|setl expandtab softtabstop=4
|
||||
augroup END
|
||||
|
||||
" php
|
||||
" Phpactor plugin
|
||||
" Include use statement
|
||||
nmap <Leader>u :call phpactor#UseAdd()<CR>
|
||||
" Invoke the context menu
|
||||
nmap <Leader>mm :call phpactor#ContextMenu()<CR>
|
||||
" Invoke the navigation menu
|
||||
nmap <Leader>nn :call phpactor#Navigate()<CR>
|
||||
" Goto definition of class or class member under the cursor
|
||||
nmap <Leader>oo :call phpactor#GotoDefinition()<CR>
|
||||
nmap <Leader>oh :call phpactor#GotoDefinition('hsplit')<CR>
|
||||
nmap <Leader>ov :call phpactor#GotoDefinition('vsplit')<CR>
|
||||
nmap <Leader>ot :call phpactor#GotoDefinition('tabnew')<CR>
|
||||
" Show brief information about the symbol under the cursor
|
||||
nmap <Leader>K :call phpactor#Hover()<CR>
|
||||
" Transform the classes in the current file
|
||||
nmap <Leader>tt :call phpactor#Transform()<CR>
|
||||
" Generate a new class (replacing the current file)
|
||||
nmap <Leader>cc :call phpactor#ClassNew()<CR>
|
||||
" Extract expression (normal mode)
|
||||
nmap <silent><Leader>ee :call phpactor#ExtractExpression(v:false)<CR>
|
||||
" Extract expression from selection
|
||||
vmap <silent><Leader>ee :<C-U>call phpactor#ExtractExpression(v:true)<CR>
|
||||
" Extract method from selection
|
||||
vmap <silent><Leader>em :<C-U>call phpactor#ExtractMethod()<CR>
|
||||
|
||||
au FileType php,blade let b:coc_root_patterns = ['.git', '.env', 'composer.json', 'artisan']
|
||||
au FileType php,blade nmap <silent> ga <Plug>(coc-codeaction-line)
|
||||
au FileType php,blade nmap <silent> <leader>ac <Plug>(coc-codeaction-cursor)
|
||||
|
||||
" python
|
||||
" vim-python
|
||||
augroup vimrc-python
|
||||
@@ -723,11 +416,14 @@ let g:jedi#smart_auto_mappings = 0
|
||||
|
||||
" ale
|
||||
:call extend(g:ale_linters, {
|
||||
\ 'python': [ 'flake8' ],
|
||||
\ 'python': [ 'black' ],
|
||||
\ })
|
||||
|
||||
:call extend(g:ale_fixers, {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace']
|
||||
\ '*': [ 'remove_trailing_lines', 'trim_whitespace' ],
|
||||
\ 'python': [ 'autopep8', 'isort' ],
|
||||
\ })
|
||||
|
||||
let g:ale_sign_column_always = 1
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user