mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-27 20:45:31 +00:00
Compare commits
115 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| acbfd34e7d | |||
| bac03a0b7b | |||
| a96bf921a2 | |||
| b5df60851f | |||
| 2e682c58fa | |||
| cb28e274ca | |||
| 4572c42eea | |||
| cec1edb269 | |||
| bfe7e93b60 | |||
| 1b80c8b7ed | |||
| c7c3493259 | |||
| 0e797d36ae | |||
|
|
0beb386f4a | ||
|
|
cc0e668cd9 | ||
|
|
d6f7aecf6c | ||
|
|
5253b69e37 | ||
| 12080f59e1 | |||
| 614827a877 | |||
| 09343033ec | |||
| c24f51adb9 | |||
| 1a74cf78c1 | |||
| e31948dcc5 | |||
| 25acc678d8 | |||
| 8c3796b433 | |||
| 048c9ac64f | |||
| 4ef3369c0e | |||
| b9c343dc27 | |||
| cfb41b8a03 | |||
| e42edc2dcf | |||
| 5a95484c58 | |||
| 988cb9cd18 | |||
|
|
681396383a | ||
|
|
f1aaf65e93 | ||
| 83bdfbf6a2 | |||
| 08c2be6f97 | |||
|
|
acf0bbe659 | ||
| e4bae620fa | |||
| b81c8f05b5 | |||
| 56427a08a8 | |||
| f2e7864583 | |||
| 9f96d553f0 | |||
| 1dee09759a | |||
| e2f6db9208 | |||
| 14270093c2 | |||
| 5015a8cd5a | |||
| 266c18e195 | |||
| 9c432ed2a0 | |||
| e6f3aae287 | |||
| a73c54a5a6 | |||
| 39ecd0495c | |||
| 4b45c89a90 | |||
| dfb7a51786 | |||
| 56ae0e1e1c | |||
| 3d753fe08c | |||
| 540054d4bb | |||
| b1a7932b72 | |||
| ced09160ab | |||
| 594ee0d03c | |||
| 68ec53e29b | |||
| 0c8b075689 | |||
| 0242bbbd73 | |||
| 31423c30b9 | |||
| fbdd2c7448 | |||
| 0aff4784b1 | |||
| 10b18e8bcc | |||
| dc0a349139 | |||
| 3ac1fac444 | |||
| 5bf4ea462b | |||
| 1d056988f4 | |||
| 2415dff0e2 | |||
| d891d5a3c5 | |||
| f48813ff85 | |||
| a87b33b8c2 | |||
| 6f854ddbfd | |||
| 748e5bb561 | |||
| 67867b57cd | |||
| 91734ffa15 | |||
| 5364bef678 | |||
| 50b4f5c60f | |||
| 7cd508a727 | |||
| bf2c665433 | |||
| f5b1bf0915 | |||
| e0c6d7e4f4 | |||
| 1937e72f17 | |||
| 228ba78341 | |||
| c8c34dcc81 | |||
| 3d65fdee43 | |||
| 1897f49906 | |||
| d86785ad47 | |||
| 1c3c04a6f3 | |||
| debb79ee09 | |||
| c1dda8a230 | |||
| 5c74383dda | |||
| da1473547a | |||
| 43df368ec1 | |||
| 6f3f977100 | |||
| ab8e654c2a | |||
| 1a4113e3cd | |||
| b3445d7e7a | |||
| 50fc1ea279 | |||
| d61f53196d | |||
| 7769af68b5 | |||
| 05aa4ba092 | |||
| a26f160326 | |||
| 00de4a7b83 | |||
| 020012eb60 | |||
| cf92bc9a69 | |||
| 1c17ee28cb | |||
| 0919a9732e | |||
| 52a941f0fa | |||
| e661f6d942 | |||
| b5160bbbfa | |||
| 2df27d2a0e | |||
|
|
0c0f3823e4 | ||
|
|
5fb433f7ac |
1
.browserslistrc
Normal file
1
.browserslistrc
Normal file
@@ -0,0 +1 @@
|
||||
extends @ivuorinen/browserslist-config
|
||||
3
.commitlintrc.json
Normal file
3
.commitlintrc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["@ivuorinen/commitlint-config"]
|
||||
}
|
||||
@@ -19,11 +19,11 @@ indent_size = 1
|
||||
indent_size = 1
|
||||
indent_style = tab
|
||||
|
||||
[{local/bin/*,**/*.sh,**/zshrc}]
|
||||
[{local/bin/*,**/*.sh,**/zshrc,config/*}]
|
||||
shell_variant = bash # --language-variant
|
||||
binary_next_line = true
|
||||
switch_case_indent = true # --case-indent
|
||||
space_redirects = true
|
||||
keep_padding = true
|
||||
keep_padding = false
|
||||
function_next_line = true # --func-next-line
|
||||
|
||||
|
||||
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["@ivuorinen"]
|
||||
}
|
||||
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -13,7 +13,7 @@
|
||||
## Handle line endings automatically for files detected as
|
||||
## text and leave all files detected as binary untouched.
|
||||
## This will handle all files NOT defined below.
|
||||
* text=auto
|
||||
* text=auto oel=lf
|
||||
|
||||
# Source code
|
||||
*.bash text eol=lf
|
||||
|
||||
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
128
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
- Demonstrating empathy and kindness toward other people
|
||||
- Being respectful of differing opinions, viewpoints, and experiences
|
||||
- Giving and gracefully accepting constructive feedback
|
||||
- Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
- Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
Examples of unacceptable behavior include:
|
||||
|
||||
- The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
- Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
ismo@ivuorinen.net.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
24
.github/README.md
vendored
24
.github/README.md
vendored
@@ -23,20 +23,14 @@ fork or download the repo as a zip and go from there with your own configs.
|
||||
|
||||
## The looks
|
||||
|
||||
## tmux with powerlevel10k, the default view
|
||||
|
||||

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

|
||||

|
||||
|
||||
## Interesting files and locations
|
||||
|
||||
### Interesting folders
|
||||
|
||||
| Path | Description |
|
||||
|---------------------|----------------------------------------------|
|
||||
| ------------------- | -------------------------------------------- |
|
||||
| `.github` | GitHub Repository configuration files. |
|
||||
| `hosts/{hostname}/` | Configs that should apply to that host only. |
|
||||
| `local/bin` | Helper scripts that I've collected or wrote. |
|
||||
@@ -45,7 +39,7 @@ fork or download the repo as a zip and go from there with your own configs.
|
||||
### dotfile folders
|
||||
|
||||
| Repo | Destination | Description |
|
||||
|-----------|-------------|---------------------------------------------|
|
||||
| --------- | ----------- | ------------------------------------------- |
|
||||
| `base/` | `.*` | `$HOME` level files. |
|
||||
| `config/` | `.config/` | Configurations for applications. |
|
||||
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
||||
@@ -62,7 +56,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
||||
### XDG Variables
|
||||
|
||||
| Env | Default | Short description |
|
||||
|--------------------|----------------------|------------------------------------------------|
|
||||
| ------------------ | -------------------- | ---------------------------------------------- |
|
||||
| `$XDG_BIN_HOME` | `$HOME/.local/bin` | Local binaries |
|
||||
| `$XDG_CONFIG_HOME` | `$HOME/.config` | User-specific configs |
|
||||
| `$XDG_DATA_HOME` | `$HOME/.local/share` | User-specific data files |
|
||||
@@ -79,7 +73,7 @@ environment variable, at an appropriate place.
|
||||
#### XDG_DATA_HOME (`$HOME/.local/share`)
|
||||
|
||||
`$XDG_DATA_HOME` defines the base directory relative to which
|
||||
user-specific *data files* should be stored.
|
||||
user-specific _data files_ should be stored.
|
||||
|
||||
If `$XDG_DATA_HOME` is either not set or empty,
|
||||
a default equal to `$HOME/.local/share` should be used.
|
||||
@@ -87,7 +81,7 @@ a default equal to `$HOME/.local/share` should be used.
|
||||
#### XDG_CONFIG_HOME (`$HOME/.config`)
|
||||
|
||||
`$XDG_CONFIG_HOME` defines the base directory relative to which
|
||||
user-specific *configuration files* should be stored.
|
||||
user-specific _configuration files_ should be stored.
|
||||
|
||||
If `$XDG_CONFIG_HOME` is either not set or empty,
|
||||
a default equal to `$HOME/.config` should be used.
|
||||
@@ -95,13 +89,13 @@ a default equal to `$HOME/.config` should be used.
|
||||
#### XDG_STATE_HOME (`$HOME/.local/state`)
|
||||
|
||||
`$XDG_STATE_HOME` defines the base directory relative to which
|
||||
user-specific *state files* should be stored.
|
||||
user-specific _state files_ should be stored.
|
||||
|
||||
If `$XDG_STATE_HOME` is either not set or empty,
|
||||
a default equal to `$HOME/.local/state` should be used.
|
||||
|
||||
The `$XDG_STATE_HOME` contains *state data* that should
|
||||
*persist between (application) restarts*, but that is not important or
|
||||
The `$XDG_STATE_HOME` contains _state data_ that should
|
||||
_persist between (application) restarts_, but that is not important or
|
||||
portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
|
||||
|
||||
- It may contain:
|
||||
|
||||
12
.github/SECURITY.md
vendored
Normal file
12
.github/SECURITY.md
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
# Security Policy
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Usually only the latest daily tag is supported at all,
|
||||
because that's the current I'm using.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please send me email directly to the email in my profile.
|
||||
I'd appreciate link to the release the vulnerability was
|
||||
found in, and what is the vulnerable code/dependency.
|
||||
6
.github/dependabot.yml
vendored
6
.github/dependabot.yml
vendored
@@ -1,7 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
# Maintain dependencies for GitHub Actions
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
- package-ecosystem: 'github-actions'
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
interval: 'weekly'
|
||||
|
||||
4
.github/renovate.json
vendored
4
.github/renovate.json
vendored
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"local>ivuorinen/.github:renovate-config"
|
||||
]
|
||||
"extends": ["local>ivuorinen/.github:renovate-config"]
|
||||
}
|
||||
|
||||
BIN
.github/screenshots/tmux-nvim.png
vendored
Normal file
BIN
.github/screenshots/tmux-nvim.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
17
.github/tag-changelog-config.js
vendored
17
.github/tag-changelog-config.js
vendored
@@ -7,20 +7,21 @@ module.exports = {
|
||||
{ types: ['build', 'ci'], label: '🏗️ Build System' },
|
||||
{ types: ['refactor'], label: '🪚 Refactors' },
|
||||
{ types: ['doc', 'docs'], label: '📚 Documentation Changes' },
|
||||
{ types: ['config'], label: '🪛 Configuration Changes' },
|
||||
{ types: ['test', 'tests'], label: '🔍 Tests' },
|
||||
{ types: ['style', 'codestyle'], label: '💅 Code Style Changes' },
|
||||
{ types: ['chore', 'Chore'], label: '🧹 Chores' },
|
||||
{ types: ['style', 'codestyle', 'lint'], label: '💅 Code Style Changes' },
|
||||
{ types: ['chore', 'Chore', 'deps', 'Deps'], label: '🧹 Chores' },
|
||||
{ types: ['other', 'Other'], label: 'Other Changes' },
|
||||
],
|
||||
|
||||
excludeTypes: [],
|
||||
|
||||
renderTypeSection: function (label, commits) {
|
||||
let text = `\n## ${ label }\n\n`
|
||||
let text = `\n## ${label}\n\n`
|
||||
|
||||
commits.forEach((commit) => {
|
||||
const scope = commit.scope ? `**${ commit.scope }:** ` : ''
|
||||
text += `- ${ scope }${ commit.subject }\n`
|
||||
commits.forEach(commit => {
|
||||
const scope = commit.scope ? `**${commit.scope}:** ` : ''
|
||||
text += `- ${scope}${commit.subject}\n`
|
||||
})
|
||||
|
||||
return text
|
||||
@@ -28,8 +29,8 @@ module.exports = {
|
||||
|
||||
renderChangelog: function (release, changes) {
|
||||
const now = new Date()
|
||||
const d = now.toISOString().substring(0, 10);
|
||||
const header = `# ${ release } - ${ d }\n`;
|
||||
const d = now.toISOString().substring(0, 10)
|
||||
const header = `# ${release} - ${d}\n`
|
||||
return header + changes + '\n\n'
|
||||
},
|
||||
}
|
||||
|
||||
4
.github/workflows/changelog.yml
vendored
4
.github/workflows/changelog.yml
vendored
@@ -3,7 +3,7 @@ on:
|
||||
workflow_dispatch: # Trigger manually
|
||||
jobs:
|
||||
debug-changelog:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Create changelog text
|
||||
@@ -12,7 +12,7 @@ jobs:
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
config_file: .github/tag-changelog-config.js
|
||||
- name: "Echo results"
|
||||
- name: 'Echo results'
|
||||
id: output-changelog
|
||||
run: |
|
||||
echo "${{ steps.changelog.outputs.changes }}"
|
||||
|
||||
2
.github/workflows/linters.yml
vendored
2
.github/workflows/linters.yml
vendored
@@ -3,7 +3,7 @@ on: [push]
|
||||
jobs:
|
||||
linters:
|
||||
name: Linters
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: GitHub Actions
|
||||
|
||||
4
.github/workflows/new-release.yml
vendored
4
.github/workflows/new-release.yml
vendored
@@ -2,12 +2,12 @@ name: Release Daily State # Workflow name displayed on GitHub
|
||||
on:
|
||||
workflow_dispatch: # Trigger manually
|
||||
schedule:
|
||||
- cron: "30 20 * * *" # UTC is 2-3 hours behind Europe/Helsinki, my timezone
|
||||
- cron: '30 20 * * *' # UTC is 2-3 hours behind Europe/Helsinki, my timezone
|
||||
permissions:
|
||||
contents: write
|
||||
jobs:
|
||||
new-daily-release:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
outputs:
|
||||
created: ${{ steps.daily-version.outputs.created }}
|
||||
version: ${{ steps.daily-version.outputs.version }}
|
||||
|
||||
4
.github/workflows/update-submodules.yml
vendored
4
.github/workflows/update-submodules.yml
vendored
@@ -1,6 +1,6 @@
|
||||
name: Update submodules
|
||||
on:
|
||||
schedule: [{cron: 0 3 * * *}]
|
||||
schedule: [{ cron: 0 3 * * * }]
|
||||
workflow_dispatch:
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -8,7 +8,7 @@ permissions:
|
||||
pull-requests: write
|
||||
jobs:
|
||||
update-submodules:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,4 +1,5 @@
|
||||
Brewfile.lock.json
|
||||
config/nvim/lazy-lock.json
|
||||
*.log
|
||||
*-secret
|
||||
*cache
|
||||
@@ -13,4 +14,11 @@ ssh/local.d/*
|
||||
!ssh/local.d/.gitkeep
|
||||
!.gitkeep
|
||||
.env
|
||||
local/share/fonts/*
|
||||
node_modules
|
||||
.nfs*
|
||||
*.socket
|
||||
iTermServer-*
|
||||
lock
|
||||
config/iterm2/AppSupport
|
||||
|
||||
|
||||
28
.gitmodules
vendored
28
.gitmodules
vendored
@@ -19,28 +19,36 @@
|
||||
url = https://github.com/cheat/cheatsheets.git
|
||||
ignore = dirty
|
||||
|
||||
[submodule "tmux/tpm"]
|
||||
path = config/tmux/plugins/tpm
|
||||
url = https://github.com/tmux-plugins/tpm.git
|
||||
ignore = dirty
|
||||
[submodule "tmux/catppuccin"]
|
||||
path = config/tmux/plugins/tmux
|
||||
url = https://github.com/catppuccin/tmux.git
|
||||
[submodule "tmux/tmux-continuum"]
|
||||
path = config/tmux/plugins/tmux-continuum
|
||||
url = https://github.com/tmux-plugins/tmux-continuum
|
||||
[submodule "tmux/tmux-menus"]
|
||||
path = config/tmux/plugins/tmux-menus
|
||||
url = https://github.com/jaclu/tmux-menus.git
|
||||
ignore = dirty
|
||||
[submodule "tmux/tmux-resurrect"]
|
||||
path = config/tmux/plugins/tmux-resurrect
|
||||
url = https://github.com/tmux-plugins/tmux-resurrect
|
||||
ignore = dirty
|
||||
[submodule "tmux/tmux-sensible"]
|
||||
path = config/tmux/plugins/tmux-sensible
|
||||
url = https://github.com/tmux-plugins/tmux-sensible.git
|
||||
ignore = dirty
|
||||
[submodule "tmux/tmux-sessionist"]
|
||||
path = config/tmux/plugins/tmux-sessionist
|
||||
url = https://github.com/tmux-plugins/tmux-sessionist.git
|
||||
ignore = dirty
|
||||
[submodule "tmux/tmux-yank"]
|
||||
path = config/tmux/plugins/tmux-yank
|
||||
url = https://github.com/tmux-plugins/tmux-yank.git
|
||||
ignore = dirty
|
||||
[submodule "tmux/tmux-window-name"]
|
||||
path = config/tmux/plugins/tmux-window-name
|
||||
url = https://github.com/ofirgall/tmux-window-name.git
|
||||
ignore = dirty
|
||||
[submodule "dotbot-pip"]
|
||||
path = tools/dotbot-pip
|
||||
url = https://github.com/sobolevn/dotbot-pip.git
|
||||
[submodule "tmux/tmux-suspend"]
|
||||
path = config/tmux/plugins/tmux-suspend
|
||||
url = https://github.com/MunifTanjim/tmux-suspend.git
|
||||
[submodule "tmux/tmux-mode-indicator"]
|
||||
path = config/tmux/plugins/tmux-mode-indicator
|
||||
url = https://github.com/MunifTanjim/tmux-mode-indicator.git
|
||||
|
||||
2
.ignore
2
.ignore
@@ -3,4 +3,4 @@ config/cheat/cheatsheets/community/**
|
||||
tools/dotbot/**
|
||||
tools/dotbot-brew/**
|
||||
tools/dotbot-include/**
|
||||
|
||||
node_modules
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"extends": "markdownlint/style/prettier",
|
||||
"extends": "@ivuorinen/markdownlint-config",
|
||||
"code-block-style": {
|
||||
"style": "fenced"
|
||||
},
|
||||
|
||||
6
.markdownlintignore
Normal file
6
.markdownlintignore
Normal file
@@ -0,0 +1,6 @@
|
||||
# only care about files that are under our control
|
||||
config/cheat/cheatsheets/community/*
|
||||
config/tmux/plugins/*
|
||||
tools/*
|
||||
node_modules/*
|
||||
|
||||
8
.prettierignore
Normal file
8
.prettierignore
Normal file
@@ -0,0 +1,8 @@
|
||||
.mypy_cache/*
|
||||
tools/dotbot*
|
||||
local/bin/antigen.zsh
|
||||
config/cheat/cheatsheets/community
|
||||
config/tmux/plugins/*
|
||||
lazy-lock.json
|
||||
Brewfile.lock.json
|
||||
|
||||
14
.prettierrc.js
Normal file
14
.prettierrc.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = {
|
||||
...require('@ivuorinen/prettier-config'),
|
||||
trailingComma: 'all',
|
||||
// Add custom options below:
|
||||
overrides: [
|
||||
{
|
||||
files: '*.md',
|
||||
options: {
|
||||
printWidth: 120,
|
||||
proseWrap: 'preserve',
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -1 +1 @@
|
||||
3.11
|
||||
3.12
|
||||
|
||||
3
.releaserc.json
Normal file
3
.releaserc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": ["@ivuorinen/semantic-release-config"]
|
||||
}
|
||||
24
.yamlfmt
24
.yamlfmt
@@ -1,24 +0,0 @@
|
||||
formatter:
|
||||
type: basic
|
||||
indent: 2
|
||||
retain_line_breaks: false
|
||||
disallow_anchors: false
|
||||
max_line_length: 0
|
||||
scan_folded_as_literal: false
|
||||
indentless_arrays: false
|
||||
|
||||
doublestar: true
|
||||
|
||||
extensions:
|
||||
- yaml
|
||||
- yml
|
||||
|
||||
include:
|
||||
- ./*.{yml,yaml}
|
||||
- ./**/*.{yml,yaml}
|
||||
|
||||
exclude:
|
||||
- ./tools/dotbot/**
|
||||
- ./tools/dotbot-*/**
|
||||
- ./config/astronvim/**
|
||||
- ./config/nvim/**
|
||||
@@ -1,2 +0,0 @@
|
||||
# .yamlignore
|
||||
|
||||
@@ -1,24 +1,45 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
git submodule add --name dotbot -f https://github.com/anishathalye/dotbot.git tools/dotbot
|
||||
git submodule add --name dotbot-brew -f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
|
||||
git submodule add --name dotbot-include -f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
||||
git submodule add --name cheat-community -f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
|
||||
# dotbot and plugins
|
||||
git submodule add --name dotbot \
|
||||
-f https://github.com/anishathalye/dotbot.git tools/dotbot
|
||||
git submodule add --name dotbot-brew \
|
||||
-f https://github.com/wren/dotbot-brew.git tools/dotbot-brew
|
||||
git submodule add --name dotbot-include \
|
||||
-f https://gitlab.com/gnfzdz/dotbot-include.git tools/dotbot-include
|
||||
git submodule add --name dotbot-pip \
|
||||
-f https://github.com/sobolevn/dotbot-pip.git tools/dotbot-pip
|
||||
|
||||
# other repos
|
||||
git submodule add --name cheat-community \
|
||||
-f https://github.com/cheat/cheatsheets.git config/cheat/cheatsheets/community
|
||||
|
||||
# tmux plugin manager and plugins
|
||||
git submodule add --name tmux/tpm \
|
||||
-f https://github.com/tmux-plugins/tpm.git config/tmux/plugins/tpm
|
||||
git submodule add --name tmux/catppuccin \
|
||||
-f https://github.com/catppuccin/tmux.git config/tmux/plugins/tmux
|
||||
git submodule add --name tmux/tmux-continuum \
|
||||
-f https://github.com/tmux-plugins/tmux-continuum config/tmux/plugins/tmux-continuum
|
||||
git submodule add --name tmux/tmux-menus \
|
||||
-f https://github.com/jaclu/tmux-menus.git config/tmux/plugins/tmux-menus
|
||||
git submodule add --name tmux/tmux-mode-indicator \
|
||||
-f https://github.com/MunifTanjim/tmux-mode-indicator.git config/tmux/plugins/tmux-mode-indicator
|
||||
git submodule add --name tmux/tmux-resurrect \
|
||||
-f https://github.com/tmux-plugins/tmux-resurrect config/tmux/plugins/tmux-resurrect
|
||||
git submodule add --name tmux/tmux-sensible \
|
||||
-f https://github.com/tmux-plugins/tmux-sensible.git config/tmux/plugins/tmux-sensible
|
||||
git submodule add --name tmux/tmux-sessionist \
|
||||
-f https://github.com/tmux-plugins/tmux-sessionist.git config/tmux/plugins/tmux-sessionist
|
||||
git submodule add --name tmux/tmux-suspend \
|
||||
-f https://github.com/MunifTanjim/tmux-suspend.git config/tmux/plugins/tmux-suspend
|
||||
git submodule add --name tmux/tmux-window-name \
|
||||
-f https://github.com/ofirgall/tmux-window-name.git config/tmux/plugins/tmux-window-name
|
||||
git submodule add --name tmux/tmux-yank \
|
||||
-f https://github.com/tmux-plugins/tmux-yank.git config/tmux/plugins/tmux-yank
|
||||
|
||||
# Takes submodules and sets them to ignore all changes
|
||||
for MODULE in $(git config --file .gitmodules --get-regexp path | awk '{ print $2 }'); do
|
||||
git config "submodule.${MODULE}.ignore" all
|
||||
done
|
||||
|
||||
# remove old submodules
|
||||
[ -d "config/tmux/plugins/tpm" ] && rm -rf config/tmux/plugins/tpm
|
||||
[ -d "config/tmux/plugins/tmux" ] && rm -rf config/tmux/plugins/tmux
|
||||
[ -d "config/tmux/plugins/tmux-menus" ] && rm -rf config/tmux/plugins/tmux-menus
|
||||
[ -d "tools/dotbot-crontab" ] && rm -rf tools/dotbot-crontab
|
||||
[ -d "tools/dotbot-snap" ] && rm -rf tools/dotbot-snap
|
||||
|
||||
116
base/bashrc
116
base/bashrc
@@ -4,23 +4,105 @@
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
HOST="$(hostname -s)"
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
[ -r "$file" ] && source "$file"
|
||||
[ -r "$file-secret" ] && source "$file-secret"
|
||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||
done
|
||||
}
|
||||
x-load-configs
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# Import ssh keys in keychain
|
||||
ssh-add -A 2>/dev/null;
|
||||
# custom variables
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||
|
||||
# Paths
|
||||
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/cargo/bin:$PATH"
|
||||
|
||||
# shellcheck source=scripts/shared.sh
|
||||
# source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
source "$DOTFILES/config/exports"
|
||||
source "$DOTFILES/config/alias"
|
||||
|
||||
# shellcheck source=../config/fzf/fzf.bash
|
||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] \
|
||||
&& source "${DOTFILES}/config/fzf/fzf.bash"
|
||||
[ -f "${DOTFILES}/config/fzf/fzf.bash" ] &&
|
||||
source "${DOTFILES}/config/fzf/fzf.bash"
|
||||
|
||||
# Import ssh keys in keychain
|
||||
ssh-add -A 2>/dev/null
|
||||
|
||||
# Enable the subsequent settings only in interactive sessions
|
||||
case $- in
|
||||
*i*) ;;
|
||||
*) return ;;
|
||||
esac
|
||||
|
||||
# Path to your oh-my-bash installation.
|
||||
export OSH="$HOME/.local/share/oh-my-bash"
|
||||
|
||||
[ -d "$OSH" ] && {
|
||||
export OSH_THEME="powerline-multiline"
|
||||
|
||||
# PowerLine theme config
|
||||
export POWERLINE_LEFT_PROMPT="cwd scm"
|
||||
export POWERLINE_RIGHT_PROMPT="python_venv ruby in_vim battery user_info"
|
||||
|
||||
# Display red dots whilst waiting for completion.
|
||||
export COMPLETION_WAITING_DOTS="true"
|
||||
|
||||
# Uncomment the following line if you want to disable marking untracked files
|
||||
# under VCS as dirty. This makes repository status check for large repositories
|
||||
# much, much faster.
|
||||
export DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||
|
||||
# To disable the uses of "sudo" by oh-my-bash, please set "false" to
|
||||
# this variable. The default behavior for the empty value is "true".
|
||||
export OMB_USE_SUDO=true
|
||||
|
||||
# To enable/disable display of Python virtualenv and condaenv
|
||||
export OMB_PROMPT_SHOW_PYTHON_VENV=true # enable
|
||||
# OMB_PROMPT_SHOW_PYTHON_VENV=false # disable
|
||||
|
||||
# Which completions would you like to load? (completions can be found in ~/.oh-my-bash/completions/*)
|
||||
# Custom completions may be added to ~/.oh-my-bash/custom/completions/
|
||||
# Example format: completions=(ssh git bundler gem pip pip3)
|
||||
# Add wisely, as too many completions slow down shell startup.
|
||||
export completions=(
|
||||
git
|
||||
composer
|
||||
ssh
|
||||
)
|
||||
|
||||
# Which aliases would you like to load? (aliases can be found in ~/.oh-my-bash/aliases/*)
|
||||
# Custom aliases may be added to ~/.oh-my-bash/custom/aliases/
|
||||
# Example format: aliases=(vagrant composer git-avh)
|
||||
# Add wisely, as too many aliases slow down shell startup.
|
||||
export aliases=(
|
||||
general
|
||||
)
|
||||
|
||||
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-bash/plugins/*)
|
||||
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
|
||||
# Example format: plugins=(rails git textmate ruby lighthouse)
|
||||
# Add wisely, as too many plugins slow down shell startup.
|
||||
export plugins=(
|
||||
git
|
||||
bashmarks
|
||||
)
|
||||
|
||||
# Which plugins would you like to conditionally load? (plugins can be found in ~/.oh-my-bash/plugins/*)
|
||||
# Custom plugins may be added to ~/.oh-my-bash/custom/plugins/
|
||||
# Example format:
|
||||
# if [ "$DISPLAY" ] || [ "$SSH" ]; then
|
||||
# plugins+=(tmux-autoattach)
|
||||
# fi
|
||||
|
||||
source "$OSH/oh-my-bash.sh"
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
# if [[ -n $SSH_CONNECTION ]]; then
|
||||
# export EDITOR='vim'
|
||||
# else
|
||||
# export EDITOR='mvim'
|
||||
# fi
|
||||
}
|
||||
|
||||
19
base/zshenv
Normal file
19
base/zshenv
Normal file
@@ -0,0 +1,19 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: filetype=zsh
|
||||
|
||||
export PATH="$HOME/.local/bin:$HOME/.dotfiles/local/bin:$HOME/.local/go/bin:$PATH"
|
||||
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# custom variables
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||
|
||||
source "$DOTFILES/config/exports"
|
||||
107
base/zshrc
Normal file → Executable file
107
base/zshrc
Normal file → Executable file
@@ -1,53 +1,46 @@
|
||||
# this is my zsh config. there are many like it, but this one is mine.
|
||||
# shellcheck shell=bash
|
||||
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
# shellcheck source=scripts/shared.sh
|
||||
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# custom variables
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||
|
||||
export PATH="$XDG_BIN_HOME:$DOTFILES/local/bin:$HOME/.local/go/bin:$XDG_DATA_HOME/cargo/bin:$PATH"
|
||||
|
||||
source "$DOTFILES/config/exports"
|
||||
source "$DOTFILES/config/alias"
|
||||
source "$DOTFILES/config/functions"
|
||||
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
export COMPLETION_WAITING_DOTS=true
|
||||
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
HOST="$(hostname -s)"
|
||||
# global (exports|alias|functions) file for all hosts
|
||||
# shellcheck source=../config/exports
|
||||
[ -r "$file" ] && source "$file"
|
||||
# global secret file, git ignored
|
||||
# shellcheck source=../config/exports-secret
|
||||
[ -r "$file-secret" ] && source "$file-secret"
|
||||
# host specific (exports|alias|functions) file
|
||||
# shellcheck source=../config/exports
|
||||
[ -r "$file-$HOST" ] && source "$file-$HOST"
|
||||
# host specific (exports|alias|functions) file, git ignored
|
||||
# shellcheck source=../config/exports
|
||||
[ -r "$file-$HOST-secret" ] && source "$file-$HOST-secret"
|
||||
done
|
||||
}
|
||||
x-load-configs
|
||||
path_append "/opt/homebrew/bin"
|
||||
if type brew &> /dev/null; then
|
||||
eval "$(brew shellenv)"
|
||||
FPATH="$HOMEBREW_PREFIX/share/zsh/site-functions:${FPATH}"
|
||||
fi
|
||||
|
||||
export HISTFILE="$XDG_STATE_HOME"/zsh/history
|
||||
|
||||
autoload -U colors zsh/terminfo
|
||||
colors
|
||||
path_append "/usr/local/bin"
|
||||
path_prepend "$XDG_DATA_HOME/cargo/bin"
|
||||
path_prepend "$XDG_BIN_HOME"
|
||||
path_prepend "$HOME/.local/go/bin"
|
||||
path_prepend "$XDG_DATA_HOME/bob/nvim-bin"
|
||||
|
||||
export ZSH_CUSTOM_COMPLETION_PATH="$XDG_CONFIG_HOME/zsh/completion"
|
||||
x-dc "$ZSH_CUSTOM_COMPLETION_PATH"
|
||||
|
||||
# Add completion scripts to zsh path
|
||||
FPATH="$ZSH_CUSTOM_COMPLETION_PATH:$FPATH"
|
||||
autoload -Uz compinit
|
||||
|
||||
if type brew &>/dev/null
|
||||
then
|
||||
FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"
|
||||
fi
|
||||
|
||||
compinit -d "$XDG_CACHE_HOME"/zsh/zcompdump-"$ZSH_VERSION"
|
||||
|
||||
# Try to load antigen, if present
|
||||
ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||
@@ -55,14 +48,45 @@ ANTIGEN_ZSH_PATH="$XDG_BIN_HOME/antigen.zsh"
|
||||
[[ -f "$ANTIGEN_ZSH_PATH" ]] && source "$ANTIGEN_ZSH_PATH"
|
||||
|
||||
# antigen is present
|
||||
have antigen && {
|
||||
antigen use oh-my-zsh
|
||||
antigen use oh-my-zsh
|
||||
|
||||
# config/functions
|
||||
x-default-antigen-bundles
|
||||
export ZSH_TMUX_AUTOSTART=true
|
||||
export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
|
||||
export ZSH_TMUX_UNICODE=true
|
||||
export ZSH_TMUX_AUTOQUIT=false
|
||||
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
|
||||
|
||||
antigen apply
|
||||
}
|
||||
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
|
||||
|
||||
# z, the zsh version
|
||||
export ZSHZ_DATA="$XDG_STATE_HOME/z"
|
||||
antigen bundle z
|
||||
|
||||
# these should be always available
|
||||
antigen bundle tmux
|
||||
antigen bundle colored-man-pages
|
||||
antigen bundle command-not-found
|
||||
antigen bundle ssh-agent
|
||||
antigen bundle jreese/zsh-titles
|
||||
antigen bundle zsh-users/zsh-completions
|
||||
|
||||
# these should be available if there's need
|
||||
have brew && antigen bundle brew
|
||||
have php && antigen bundle php
|
||||
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||
|
||||
# nvm is a strange beast
|
||||
zstyle ':omz:plugins:nvm' autoload yes
|
||||
antigen bundle nvm
|
||||
# antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use"
|
||||
|
||||
# nice to have stuff
|
||||
antigen bundle gcloud
|
||||
|
||||
# this needs to be the last item
|
||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||
antigen apply
|
||||
|
||||
# shellcheck source=../config/fzf/fzf.zsh
|
||||
[ -f "${DOTFILES}/config/fzf/fzf.zsh" ] \
|
||||
@@ -70,4 +94,3 @@ have antigen && {
|
||||
|
||||
# Start starship
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
# Configuration for Alacritty, the GPU enhanced terminal emulator
|
||||
|
||||
# Any items in the `env` entry below will be added as
|
||||
@@ -16,6 +17,7 @@ env:
|
||||
# Window dimensions in character columns and lines
|
||||
# (changes require restart)
|
||||
window:
|
||||
dynamic_title: true
|
||||
dimensions:
|
||||
columns: 130
|
||||
lines: 40
|
||||
@@ -29,7 +31,7 @@ window:
|
||||
|
||||
decorations: buttonless
|
||||
|
||||
opacity: 0.85
|
||||
opacity: 0.97
|
||||
|
||||
# When true, bold text is drawn using the bright variant of colors.
|
||||
draw_bold_text_with_bright_colors: true
|
||||
@@ -38,19 +40,19 @@ draw_bold_text_with_bright_colors: true
|
||||
font:
|
||||
# The normal (roman) font face to use.
|
||||
normal:
|
||||
family: JetBrainsMono Nerd Font
|
||||
family: JetBrainsMonoNL Nerd Font Mono
|
||||
# Style can be specified to pick a specific face.
|
||||
# style: Regular
|
||||
style: ExtraLight
|
||||
|
||||
# The bold font face
|
||||
bold:
|
||||
family: JetBrainsMono Nerd Font
|
||||
family: JetBrainsMonoNL Nerd Font Mono
|
||||
# Style can be specified to pick a specific face.
|
||||
style: Bold
|
||||
|
||||
# The italic font face
|
||||
italic:
|
||||
family: JetBrainsMono Nerd Font
|
||||
family: JetBrainsMonoNL Nerd Font Mono
|
||||
# Style can be specified to pick a specific face.
|
||||
style: Italic
|
||||
|
||||
@@ -73,144 +75,39 @@ font:
|
||||
# Should display the render timer
|
||||
debug.render_timer: false
|
||||
|
||||
# https://github.com/catppuccin/alacritty
|
||||
# TokyoNight Alacritty Colors (storm)
|
||||
colors:
|
||||
# Default colors
|
||||
primary:
|
||||
background: "#1E1E2E" # base
|
||||
foreground: "#CDD6F4" # text
|
||||
# Bright and dim foreground colors
|
||||
dim_foreground: "#CDD6F4" # text
|
||||
bright_foreground: "#CDD6F4" # text
|
||||
|
||||
# Cursor colors
|
||||
cursor:
|
||||
text: "#1E1E2E" # base
|
||||
cursor: "#F5E0DC" # rosewater
|
||||
vi_mode_cursor:
|
||||
text: "#1E1E2E" # base
|
||||
cursor: "#B4BEFE" # lavender
|
||||
|
||||
# Search colors
|
||||
search:
|
||||
matches:
|
||||
foreground: "#1E1E2E" # base
|
||||
background: "#A6ADC8" # subtext0
|
||||
focused_match:
|
||||
foreground: "#1E1E2E" # base
|
||||
background: "#A6E3A1" # green
|
||||
footer_bar:
|
||||
foreground: "#1E1E2E" # base
|
||||
background: "#A6ADC8" # subtext0
|
||||
|
||||
# Keyboard regex hints
|
||||
hints:
|
||||
start:
|
||||
foreground: "#1E1E2E" # base
|
||||
background: "#F9E2AF" # yellow
|
||||
end:
|
||||
foreground: "#1E1E2E" # base
|
||||
background: "#A6ADC8" # subtext0
|
||||
|
||||
# Selection colors
|
||||
selection:
|
||||
text: "#1E1E2E" # base
|
||||
background: "#F5E0DC" # rosewater
|
||||
background: '0x24283b'
|
||||
foreground: '0xc0caf5'
|
||||
|
||||
# Normal colors
|
||||
normal:
|
||||
black: "#45475A" # surface1
|
||||
red: "#F38BA8" # red
|
||||
green: "#A6E3A1" # green
|
||||
yellow: "#F9E2AF" # yellow
|
||||
blue: "#89B4FA" # blue
|
||||
magenta: "#F5C2E7" # pink
|
||||
cyan: "#94E2D5" # teal
|
||||
white: "#BAC2DE" # subtext1
|
||||
black: '0x1d202f'
|
||||
red: '0xf7768e'
|
||||
green: '0x9ece6a'
|
||||
yellow: '0xe0af68'
|
||||
blue: '0x7aa2f7'
|
||||
magenta: '0xbb9af7'
|
||||
cyan: '0x7dcfff'
|
||||
white: '0xa9b1d6'
|
||||
|
||||
# Bright colors
|
||||
bright:
|
||||
black: "#585B70" # surface2
|
||||
red: "#F38BA8" # red
|
||||
green: "#A6E3A1" # green
|
||||
yellow: "#F9E2AF" # yellow
|
||||
blue: "#89B4FA" # blue
|
||||
magenta: "#F5C2E7" # pink
|
||||
cyan: "#94E2D5" # teal
|
||||
white: "#A6ADC8" # subtext0
|
||||
|
||||
# Dim colors
|
||||
dim:
|
||||
black: "#45475A" # surface1
|
||||
red: "#F38BA8" # red
|
||||
green: "#A6E3A1" # green
|
||||
yellow: "#F9E2AF" # yellow
|
||||
blue: "#89B4FA" # blue
|
||||
magenta: "#F5C2E7" # pink
|
||||
cyan: "#94E2D5" # teal
|
||||
white: "#BAC2DE" # subtext1
|
||||
black: '0x414868'
|
||||
red: '0xf7768e'
|
||||
green: '0x9ece6a'
|
||||
yellow: '0xe0af68'
|
||||
blue: '0x7aa2f7'
|
||||
magenta: '0xbb9af7'
|
||||
cyan: '0x7dcfff'
|
||||
white: '0xc0caf5'
|
||||
|
||||
indexed_colors:
|
||||
- { index: 16, color: "#FAB387" }
|
||||
- { index: 17, color: "#F5E0DC" }
|
||||
- { index: 16, color: '0xff9e64' }
|
||||
- { index: 17, color: '0xdb4b4b' }
|
||||
|
||||
# Visual Bell
|
||||
#
|
||||
# Any time the BEL code is received, Alacritty "rings" the visual bell. Once
|
||||
# rung, the terminal background will be set to white and transition back to the
|
||||
# default background color. You can control the rate of this transition by
|
||||
# setting the `duration` property (represented in milliseconds). You can also
|
||||
# configure the transition function by setting the `animation` property.
|
||||
#
|
||||
# Possible values for `animation`
|
||||
# `Ease`
|
||||
# `EaseOut`
|
||||
# `EaseOutSine`
|
||||
# `EaseOutQuad`
|
||||
# `EaseOutCubic`
|
||||
# `EaseOutQuart`
|
||||
# `EaseOutQuint`
|
||||
# `EaseOutExpo`
|
||||
# `EaseOutCirc`
|
||||
# `Linear`
|
||||
#
|
||||
# To completely disable the visual bell, set its duration to 0.
|
||||
#
|
||||
# visual_bell:
|
||||
# animation: EaseOutExpo
|
||||
# duration: 0
|
||||
|
||||
# Key bindings
|
||||
#
|
||||
# Each binding is defined as an object with some properties. Most of the
|
||||
# properties are optional. All of the alphabetical keys should have a letter for
|
||||
# the `key` value such as `V`. Function keys are probably what you would expect
|
||||
# as well (F1, F2, ..). The number keys above the main keyboard are encoded as
|
||||
# `Key1`, `Key2`, etc. Keys on the number pad are encoded `Number1`, `Number2`,
|
||||
# etc. These all match the glutin::VirtualKeyCode variants.
|
||||
#
|
||||
# Possible values for `mods`
|
||||
# `Command`, `Super` refer to the super/command/windows key
|
||||
# `Control` for the control key
|
||||
# `Shift` for the Shift key
|
||||
# `Alt` and `Option` refer to alt/option
|
||||
#
|
||||
# mods may be combined with a `|`. For example, requiring control and shift
|
||||
# looks like:
|
||||
#
|
||||
# mods: Control|Shift
|
||||
#
|
||||
# The parser is currently quite sensitive to whitespace and capitalization -
|
||||
# capitalization must match exactly, and piped items must not have whitespace
|
||||
# around them.
|
||||
#
|
||||
# Either an `action`, `chars`, or `command` field must be present.
|
||||
# `action` must be one of `Paste`, `PasteSelection`, `Copy`, or `Quit`.
|
||||
# `chars` writes the specified string every time that binding is activated.
|
||||
# These should generally be escape sequences, but they can be configured to
|
||||
# send arbitrary strings of bytes.
|
||||
# `command` must be a map containing a `program` string, and `args` array of
|
||||
# strings. For example:
|
||||
# - { ... , command: { program: "alacritty", args: ["-e", "vttest"] } }
|
||||
key_bindings:
|
||||
- { key: V, mods: Command, action: Paste }
|
||||
- { key: C, mods: Command, action: Copy }
|
||||
@@ -260,7 +157,7 @@ key_bindings:
|
||||
- { key: F10, chars: "\e[21~" }
|
||||
- { key: F11, chars: "\e[23~" }
|
||||
- { key: F12, chars: "\e[24~" }
|
||||
- { key: Back, chars: "" }
|
||||
- { key: Back, chars: '' }
|
||||
- { key: Back, mods: Alt, chars: "\e" }
|
||||
- { key: Insert, chars: "\e[2~" }
|
||||
- { key: Delete, chars: "\e[3~" }
|
||||
@@ -298,7 +195,6 @@ mouse:
|
||||
|
||||
selection:
|
||||
semantic_escape_chars: ',│`|:"'' ()[]{}<>'
|
||||
|
||||
# Shell
|
||||
#
|
||||
# You can set shell.program to the path of your favorite shell, e.g. /bin/fish.
|
||||
|
||||
130
config/alias
130
config/alias
@@ -1,14 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck source="../scripts/shared.sh"
|
||||
# shellcheck disable=1091,2139
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Get installed php versions from brew and setup aliases
|
||||
function x-set-php-aliases
|
||||
{
|
||||
have brew && {
|
||||
x-have brew && {
|
||||
local php_versions=()
|
||||
while IFS="" read -r line; do php_versions+=("$line"); done < <(brew list | grep '^php')
|
||||
while IFS="" read -r line; do php_versions+=("$line"); done < <(bkt -- brew list | grep '^php')
|
||||
|
||||
php_error_reporting='-d error_reporting=22527'
|
||||
|
||||
@@ -55,6 +55,57 @@ if [[ $(uname) == 'Darwin' ]]; then
|
||||
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
|
||||
fi
|
||||
|
||||
# Be nice
|
||||
alias please="sudo "
|
||||
|
||||
# Color the grep output
|
||||
alias grep='grep --color'
|
||||
|
||||
! x-have eza && alias ls='ls --color=auto'
|
||||
x-have eza && {
|
||||
alias ls='eza -h -s=type --git --icons --group-directories-first'
|
||||
}
|
||||
|
||||
# Easier navigation: .., ..., ....
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
|
||||
# cd to git root directory
|
||||
alias cdgr='cd "$(git root)"'
|
||||
|
||||
# Shortcuts for listing
|
||||
alias ll="ls -la"
|
||||
alias l="ls -a"
|
||||
|
||||
# Prevent common typos
|
||||
alias cd..="cd .."
|
||||
alias sl="ls"
|
||||
|
||||
# List only directories
|
||||
alias lsd="ls -lF | grep '^d'"
|
||||
|
||||
# IP addresses
|
||||
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
|
||||
alias localip="ipconfig getifaddr en1"
|
||||
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
|
||||
|
||||
# Show/hide hidden files in Finder
|
||||
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder"
|
||||
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false; killall Finder"
|
||||
|
||||
# Pipe public key to clipboard.
|
||||
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
|
||||
|
||||
# Flush Directory Service cache
|
||||
alias flush="dscacheutil -flushcache"
|
||||
|
||||
# Update locatedb
|
||||
alias updatedb="sudo /usr/libexec/locate.updatedb"
|
||||
|
||||
# Always return full history
|
||||
alias history="history 1"
|
||||
|
||||
# tmux: automatically attach or create session with name 'main'
|
||||
alias tmux='tmux new-session -A -s main'
|
||||
# tmux: attach or create new session
|
||||
@@ -64,6 +115,10 @@ alias ta='tmux attach || tmux'
|
||||
alias watchx='watch -dpbc'
|
||||
# delete .DS_Store files
|
||||
alias zapds='find . -name ".DS_Store" -print -delete'
|
||||
# Recursively delete `.pyc` files
|
||||
alias zappyc="find . -type f -name '*.pyc' -ls -delete"
|
||||
# Run all zaps
|
||||
alias zapall="zapds && zappyc"
|
||||
# tail with follow flag on
|
||||
alias t='tail -f'
|
||||
# directory usage, return only the total
|
||||
@@ -82,8 +137,7 @@ alias code_scanner='docker run
|
||||
|
||||
alias zedit='$EDITOR ~/.dotfiles'
|
||||
|
||||
have irssi \
|
||||
&& alias irssi="irssi --config='$IRSSI_CONFIG_FILE' --home='$IRSSI_CONFIG_HOME'"
|
||||
alias irssi="irssi --config=$XDG_CONFIG_HOME/irssi/config --home=$XDG_CONFIG_HOME/irssi"
|
||||
|
||||
if [[ -f "$HOME/.aliases.local" ]]; then
|
||||
# shellcheck disable=SC1091
|
||||
@@ -92,3 +146,69 @@ fi
|
||||
|
||||
alias wget=wget --hsts-file="$XDG_DATA_HOME/wget-hsts"
|
||||
alias svn="svn --config-dir $XDG_CONFIG_HOME/subversion"
|
||||
|
||||
# Alacritty preexec hook to update dynamic title
|
||||
preexec()
|
||||
{
|
||||
print -Pn "\e]0;$1%~\a"
|
||||
}
|
||||
|
||||
# Update dotfiles
|
||||
dfu()
|
||||
{
|
||||
(
|
||||
cd "$DOTFILES" && git pull --ff-only && ./install -q
|
||||
)
|
||||
}
|
||||
|
||||
# Weather in Tampere, or other city
|
||||
weather()
|
||||
{
|
||||
# https://github.com/chubin/wttr.in#usage
|
||||
local city="${1:-Tampere}"
|
||||
curl "http://wttr.in/${city// /+}?2nFQM&lang=fi"
|
||||
}
|
||||
|
||||
# Docker
|
||||
ssh-docker()
|
||||
{
|
||||
docker exec -it "$@" bash
|
||||
}
|
||||
|
||||
# All the dig info
|
||||
digga()
|
||||
{
|
||||
dig +nocmd "$1" any +multiline +noall +answer
|
||||
}
|
||||
|
||||
# Rector project to php version 8.2 by default.
|
||||
rector()
|
||||
{
|
||||
local php="${1:-82}"
|
||||
docker run -v "$(pwd)":/project rector/rector:latest process \
|
||||
"/project/$1" \
|
||||
--set "php${php}" \
|
||||
--autoload-file /project/vendor/autoload.php
|
||||
}
|
||||
|
||||
# Commit everything
|
||||
commit()
|
||||
{
|
||||
commitMessage="$*"
|
||||
|
||||
if [ "$commitMessage" = "" ]; then
|
||||
commitMessage="Automated commit"
|
||||
fi
|
||||
|
||||
git add .
|
||||
eval "git commit -a -m '${commitMessage}'"
|
||||
}
|
||||
|
||||
scheduler()
|
||||
{
|
||||
while :; do
|
||||
php artisan schedule:run
|
||||
echo "Sleeping 60 seconds..."
|
||||
sleep 60
|
||||
done
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# Setting aliases for tunkki
|
||||
|
||||
alias nvim="/snap/nvim/current/usr/bin/nvim"
|
||||
320
config/amethyst/amethyst.yml
Normal file
320
config/amethyst/amethyst.yml
Normal file
@@ -0,0 +1,320 @@
|
||||
# Default settings for amethyst
|
||||
# Repo: `https://github.com/ianyh/Amethyst`
|
||||
#
|
||||
# Note due to issue 1419 (https://github.com/ianyh/Amethyst/issues/1419) some
|
||||
# config values may conflict and not work if they are the same as the default
|
||||
# values for amathyst. You can see these values on github at
|
||||
# https://github.com/ianyh/Amethyst/blob/development/Amethyst/default.amethyst
|
||||
# If you're experiencing conflicts and the settings are the same as the default,
|
||||
# comment out the commands in this file.
|
||||
#
|
||||
# Move this file to: `~/.amethyst.yml`
|
||||
# In order to register changes restart Amethyst.
|
||||
# If you experience issues pulling in the changes you can also quit Amethyst and run: `defaults delete com.amethyst.Amethyst.plist`
|
||||
# This removes the current preferences and causes Amethyst to restart with default preferences and pull configs from this file.
|
||||
|
||||
# layouts - Ordered list of layouts to use by layout key (default tall, wide, fullscreen, and column).
|
||||
layouts:
|
||||
- bsp
|
||||
- tall
|
||||
# - fullscreen
|
||||
# - tall-right
|
||||
# - wide
|
||||
# - two-pane
|
||||
# - middle-wide
|
||||
- 3column-left
|
||||
# - 3column-middle
|
||||
# - 3column-right
|
||||
# - 4column-left
|
||||
# - 4column-right
|
||||
# - column
|
||||
# - row
|
||||
# - floating
|
||||
- widescreen-tall
|
||||
# - widescreen-tall-right
|
||||
# - bsp
|
||||
|
||||
# First mod (default option + shift).
|
||||
mod1:
|
||||
- option
|
||||
- shift
|
||||
# - control
|
||||
# - command
|
||||
|
||||
# Second mod (default option + shift + control).
|
||||
mod2:
|
||||
- option
|
||||
- shift
|
||||
- control
|
||||
# - command
|
||||
|
||||
# Commands:
|
||||
# special key values
|
||||
# space
|
||||
# enter
|
||||
# up
|
||||
# right
|
||||
# down
|
||||
# left
|
||||
|
||||
# special characters require quotes
|
||||
# '.'
|
||||
# ','
|
||||
|
||||
# Move to the next layout in the list.
|
||||
cycle-layout:
|
||||
mod: mod1
|
||||
key: space
|
||||
|
||||
# Move to the previous layout in the list.
|
||||
cycle-layout-backward:
|
||||
mod: mod2
|
||||
key: space
|
||||
|
||||
# Shrink the main pane by a percentage of the screen dimension as defined by window-resize-step. Note that not all layouts respond to this command.
|
||||
shrink-main:
|
||||
mod: mod1
|
||||
key: h
|
||||
|
||||
# Expand the main pane by a percentage of the screen dimension as defined by window-resize-step. Note that not all layouts respond to this command.
|
||||
expand-main:
|
||||
mod: mod1
|
||||
key: l
|
||||
|
||||
# Increase the number of windows in the main pane. Note that not all layouts respond to this command.
|
||||
increase-main:
|
||||
mod: mod1
|
||||
key: ','
|
||||
|
||||
# Decrease the number of windows in the main pane. Note that not all layouts respond to this command.
|
||||
decrease-main:
|
||||
mod: mod1
|
||||
key: '.'
|
||||
|
||||
# General purpose command for custom layouts. Functionality is layout-dependent.
|
||||
# command1:
|
||||
# mod: <NONE>
|
||||
# key: <NONE>
|
||||
# General purpose command for custom layouts. Functionality is layout-dependent.
|
||||
# command2:
|
||||
# mod: <NONE>
|
||||
# key: <NONE>
|
||||
# General purpose command for custom layouts. Functionality is layout-dependent.
|
||||
# command3:
|
||||
# mod: <NONE>
|
||||
# key: <NONE>
|
||||
# General purpose command for custom layouts. Functionality is layout-dependent.
|
||||
# command4:
|
||||
# mod: <NONE>
|
||||
# key: <NONE>
|
||||
|
||||
# Focus the next window in the list going counter-clockwise.
|
||||
focus-ccw:
|
||||
mod: mod1
|
||||
key: j
|
||||
|
||||
# Focus the next window in the list going clockwise.
|
||||
focus-cw:
|
||||
mod: mod1
|
||||
key: k
|
||||
|
||||
# Focus the main window in the list.
|
||||
focus-main:
|
||||
mod: mod1
|
||||
key: m
|
||||
|
||||
# Focus the next screen in the list going counter-clockwise.
|
||||
focus-screen-ccw:
|
||||
mod: mod1
|
||||
key: p
|
||||
|
||||
# Focus the next screen in the list going clockwise.
|
||||
focus-screen-cw:
|
||||
mod: mod1
|
||||
key: n
|
||||
|
||||
# Move the currently focused window onto the next screen in the list going counter-clockwise.
|
||||
swap-screen-ccw:
|
||||
mod: mod2
|
||||
key: h
|
||||
|
||||
# Move the currently focused window onto the next screen in the list going clockwise.
|
||||
swap-screen-cw:
|
||||
mod: mod2
|
||||
key: l
|
||||
|
||||
# Swap the position of the currently focused window with the next window in the list going counter-clockwise.
|
||||
swap-ccw:
|
||||
mod: mod2
|
||||
key: j
|
||||
|
||||
# Swap the position of the currently focused window with the next window in the list going clockwise.
|
||||
swap-cw:
|
||||
mod: mod2
|
||||
key: k
|
||||
|
||||
# Swap the position of the currently focused window with the main window in the list.
|
||||
swap-main:
|
||||
mod: mod1
|
||||
key: enter
|
||||
|
||||
# Move focus to the n-th screen in the list; e.g., focus-screen-3 will move mouse focus to the 3rd screen. Note that the main window in the given screen will be focused.
|
||||
#focus-screen-n:
|
||||
# focus-screen-<screen-number>:
|
||||
# mod: mod1
|
||||
# key: y
|
||||
# Move the currently focused window to the n-th screen; e.g., throw-screen-3 will move the window to the 3rd screen.
|
||||
# throw-screen-n:
|
||||
# throw-screen-<screen-number>:
|
||||
# mod: mod1
|
||||
# key: u
|
||||
# Move the currently focused window to the n-th space; e.g., throw-space-3 will move the window to the 3rd space.
|
||||
# throw-space-<screen-number>:
|
||||
# mod: mod1
|
||||
# key: i
|
||||
|
||||
# Select tall layout
|
||||
#select-tall-layout:
|
||||
# mod: mod1
|
||||
# key: a
|
||||
|
||||
# Select wide layout
|
||||
#select-wide-layout:
|
||||
# mod: mod1
|
||||
# key: s
|
||||
|
||||
# Select fullscreen layout
|
||||
select-fullscreen-layout:
|
||||
mod: mod1
|
||||
key: d
|
||||
|
||||
# Select column layout
|
||||
select-column-layout:
|
||||
mod: mod1
|
||||
key: f
|
||||
|
||||
# Move the currently focused window to the space to the left.
|
||||
throw-space-left:
|
||||
mod: mod2
|
||||
key: left
|
||||
|
||||
# Move currently the focused window to the space to the right.
|
||||
throw-space-right:
|
||||
mod: mod2
|
||||
key: right
|
||||
|
||||
# Toggle the floating state of the currently focused window; i.e., if it was floating make it tiled and if it was tiled make it floating.
|
||||
toggle-float:
|
||||
mod: mod1
|
||||
key: t
|
||||
|
||||
# Display the layout HUD with the current layout on each screen.
|
||||
display-current-layout:
|
||||
mod: mod1
|
||||
key: i
|
||||
|
||||
# Turn on or off tiling entirely.
|
||||
toggle-tiling:
|
||||
mod: mod1
|
||||
key: t
|
||||
|
||||
# Rerun the current layout's algorithm.
|
||||
reevaluate-windows:
|
||||
mod: mod1
|
||||
key: z
|
||||
|
||||
# Turn on or off focus-follows-mouse.
|
||||
toggle-focus-follows-mouse:
|
||||
mod: mod2
|
||||
key: x
|
||||
|
||||
# Automatically quit and reopen Amethyst.
|
||||
relaunch-amethyst:
|
||||
mod: mod2
|
||||
key: z
|
||||
|
||||
# disable screen padding on builtin display
|
||||
disable-padding-on-builtin-display: false
|
||||
|
||||
# Boolean flag for whether or not to add margins betwen windows (default false).
|
||||
window-margins: false
|
||||
|
||||
# Boolean flag for whether or not to set window margins if there is only one window on the screen, assuming window margins are enabled (default false).
|
||||
smart-window-margins: true
|
||||
|
||||
# # Add 10px margin between windows
|
||||
# window-margins: true
|
||||
# window-margin-size: 5
|
||||
# The size of the margins between windows (in px, default 0).
|
||||
window-margin-size: 0
|
||||
|
||||
# The max number of windows that may be visible on a screen at one time before
|
||||
# additional windows are minimized. A value of 0 disables the feature.
|
||||
window-max-count: 0
|
||||
|
||||
# The smallest height that a window can be sized to regardless of its layout frame (in px, default 0).
|
||||
window-minimum-height: 0
|
||||
|
||||
# The smallest width that a window can be sized to regardless of its layout frame (in px, default 0)
|
||||
window-minimum-width: 0
|
||||
|
||||
# List of bundle identifiers for applications to either be automatically floating or automatically tiled based on floating-is-blacklist (default []).
|
||||
floating: []
|
||||
|
||||
# Boolean flag determining behavior of the floating list.
|
||||
# true if the applications should be floating and all others tiled. false if the applications should be tiled and all others floating (default true).
|
||||
floating-is-blacklist: false
|
||||
|
||||
# true if screen frames should exclude the status bar. false if the screen frames should include the status bar (default false).
|
||||
ignore-menu-bar: false
|
||||
|
||||
# true if windows smaller than a 500px square should be floating by default (default true)
|
||||
float-small-windows: true
|
||||
|
||||
# true if the mouse should move position to the center of a window when it becomes focused (default false). Note that this is largely incompatible with focus-follows-mouse.
|
||||
mouse-follows-focus: false
|
||||
|
||||
# true if the windows underneath the mouse should become focused as the mouse moves (default false). Note that this is largely incompatible with mouse-follows-focus
|
||||
focus-follows-mouse: false
|
||||
|
||||
# true if dragging and dropping windows on to each other should swap their positions (default false).
|
||||
mouse-swaps-windows: true
|
||||
|
||||
# true if changing the frame of a window with the mouse should update the layout to accommodate the change (default false). Note that not all layouts will be able to respond to the change.
|
||||
mouse-resizes-windows: true
|
||||
|
||||
# true to display the name of the layout when a new layout is selected (default true).
|
||||
enables-layout-hud: true
|
||||
|
||||
# true to display the name of the layout when moving to a new space (default true).
|
||||
enables-layout-hud-on-space-change: true
|
||||
|
||||
# true to get updates to beta versions of the software (default false).
|
||||
use-canary-build: false
|
||||
|
||||
# true to insert new windows into the first position and false to insert new windows into the last position (default false).
|
||||
new-windows-to-main: false
|
||||
|
||||
# true to automatically move to a space when throwing a window to it (default true).
|
||||
follow-space-thrown-windows: true
|
||||
|
||||
# The integer percentage of the screen dimension to increment and decrement main pane ratios by (default 5).
|
||||
window-resize-step: 5
|
||||
|
||||
# Padding to apply between windows and the left edge of the screen (in px, default 0).
|
||||
screen-padding-left: 0
|
||||
|
||||
# Padding to apply between windows and the right edge of the screen (in px, default 0).
|
||||
screen-padding-right: 0
|
||||
|
||||
# Padding to apply between windows and the top edge of the screen (in px, default 0).
|
||||
screen-padding-top: 0
|
||||
|
||||
# Padding to apply between windows and the bottom edge of the screen (in px, default 0).
|
||||
screen-padding-bottom: 0
|
||||
|
||||
# true to maintain layout state across application executions (default true).
|
||||
restore-layouts-on-launch: true
|
||||
|
||||
# true to display some optional debug information in the layout HUD (default false).
|
||||
debug-layout-info: true
|
||||
35
config/amethyst/layouts/almost-maximize.js
Normal file
35
config/amethyst/layouts/almost-maximize.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Almost Maximize
|
||||
* Almost maximizes the window to the screen, leaving a small margin.
|
||||
*
|
||||
* @author Ville Viklund <https://github.com/ville6000>
|
||||
*
|
||||
* @param {Object} windows - All windows in the current space.
|
||||
* @param {Object} screenFrame - The frame of the current screen.
|
||||
* @param {Object} state - The state of the current space.
|
||||
* @param {Object} extendedFrames - The frames of the windows in the current space.
|
||||
* @return {Object} - The frames for the windows in the current space.
|
||||
*/
|
||||
function layout() {
|
||||
return {
|
||||
name: 'Almost Maximize',
|
||||
getFrameAssignments: (windows, screenFrame, state, extendedFrames) => {
|
||||
const width = screenFrame.width * 0.95
|
||||
const height = screenFrame.height * 0.95
|
||||
const x = (screenFrame.width - width) / 2
|
||||
const y = (screenFrame.height - height) / 2
|
||||
const windowFrames = {}
|
||||
|
||||
windows.forEach(window => {
|
||||
windowFrames[window.id] = {
|
||||
Y: screenFrame.y + y,
|
||||
x: screenFrame.x + x,
|
||||
width,
|
||||
height,
|
||||
}
|
||||
})
|
||||
|
||||
return windowFrames
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ colorize: true
|
||||
# Which 'chroma' colorscheme should be applied to the output?
|
||||
# Options are available here:
|
||||
# https://github.com/alecthomas/chroma/tree/master/styles
|
||||
style: "catppuccin"
|
||||
style: 'catppuccin'
|
||||
# Which 'chroma' "formatter" should be applied?
|
||||
# One of: "terminal", "terminal256", "terminal16m"
|
||||
formatter: terminal256
|
||||
@@ -74,7 +74,6 @@ cheatpaths:
|
||||
path: ~/.dotfiles/config/cheat/cheatsheets/tldr
|
||||
tags: [tldr]
|
||||
readonly: true
|
||||
|
||||
# While it requires no configuration here, it's also worth noting that
|
||||
# cheat will automatically append directories named '.cheat' within the
|
||||
# current working directory to the 'cheatpath'. This can be very useful if
|
||||
|
||||
@@ -2,33 +2,61 @@
|
||||
# shellcheck shell=bash
|
||||
# vim: filetype=zsh
|
||||
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
path_append "$DOTFILES/local/bin"
|
||||
# if cargo directory exists, add it to path
|
||||
if [[ -d "$HOME/.local/share/cargo/bin" ]]; then
|
||||
export PATH="$HOME/.local/share/cargo/bin:$PATH"
|
||||
fi
|
||||
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
# Cache commands using bkt if installed
|
||||
if command -v bkt >&/dev/null; then
|
||||
bkt()
|
||||
{
|
||||
command bkt --cache-dir="$XDG_CACHE_HOME/bkt" "$@"
|
||||
}
|
||||
else
|
||||
# If bkt isn't installed skip its arguments and just execute directly.
|
||||
# Optionally write a msg to stderr suggesting users install bkt.
|
||||
bkt()
|
||||
{
|
||||
while [[ "$1" == --* ]]; do shift; done
|
||||
"$@"
|
||||
}
|
||||
fi
|
||||
|
||||
# custom variables
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||
# shorthand for checking if the system has the bin in path,
|
||||
# this version does not use caching
|
||||
# usage: have_command php && php -v
|
||||
function have_command
|
||||
{
|
||||
command -v "$1" >&/dev/null
|
||||
}
|
||||
|
||||
path_append "/opt/homebrew/bin"
|
||||
have brew && eval "$(brew shellenv)"
|
||||
# shorthand for checking if the system has the bin in path,
|
||||
# this version uses caching
|
||||
# usage: have php && php -v
|
||||
function have
|
||||
{
|
||||
bkt -- which "$1" >&/dev/null
|
||||
}
|
||||
|
||||
path_append "/usr/local/bin"
|
||||
path_append "$XDG_BIN_HOME"
|
||||
function brew_installed
|
||||
{
|
||||
bkt -- brew list
|
||||
}
|
||||
|
||||
# brew, https://brew.sh
|
||||
have brew && {
|
||||
have_brew python && path_append "$(brew --prefix python)/bin"
|
||||
# shorthand for checking if brew package is installed
|
||||
# usage: have_brew php && php -v
|
||||
function have_brew
|
||||
{
|
||||
! have brew && return 125
|
||||
|
||||
if bkt -- brew list "$1" &> /dev/null; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
source "$DOTFILES/config/exports-shell"
|
||||
source "$DOTFILES/config/exports-apps"
|
||||
|
||||
have nvim && export EDITOR="nvim"
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
# shellcheck shell=bash
|
||||
# shellcheck enable=external-sources
|
||||
# shellcheck disable=1091,2139
|
||||
# vim: filetype=zsh
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
# vim: filetype=bash
|
||||
|
||||
# Antigen configuration
|
||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
||||
@@ -17,40 +15,31 @@ export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
||||
export ANSIBLE_HOME="$XDG_CONFIG_HOME/ansible"
|
||||
export ANSIBLE_CONFIG="$XDG_CONFIG_HOME/ansible.cfg"
|
||||
export ANSIBLE_GALAXY_CACHE_DIR="$XDG_CACHE_HOME/ansible/galaxy_cache"
|
||||
have ansible && {
|
||||
x-dc "$ANSIBLE_HOME"
|
||||
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
||||
}
|
||||
x-dc "$ANSIBLE_HOME"
|
||||
x-dc "$ANSIBLE_GALAXY_CACHE_DIR"
|
||||
|
||||
export ANDROID_HOME="$XDG_DATA_HOME/android"
|
||||
|
||||
# bob manages nvim versions
|
||||
x-path-prepend "$XDG_DATA_HOME/bob/nvim-bin"
|
||||
x-have nvim && export EDITOR="nvim"
|
||||
|
||||
export HOMEBREW_NO_ENV_HINTS=true
|
||||
|
||||
# composer, https://getcomposer.org/
|
||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||
have composer && {
|
||||
export PATH="$COMPOSER_BIN:$PATH"
|
||||
}
|
||||
x-path-append "$COMPOSER_BIN"
|
||||
|
||||
# docker, https://docs.docker.com/engine/reference/commandline/cli/
|
||||
export DOCKER_CONFIG="$XDG_CONFIG_HOME/docker"
|
||||
have docker && {
|
||||
x-dc "$DOCKER_CONFIG"
|
||||
# Docker: Disable snyk ad
|
||||
export DOCKER_SCAN_SUGGEST=false
|
||||
}
|
||||
x-dc "$DOCKER_CONFIG"
|
||||
# Docker: Disable snyk ad
|
||||
export DOCKER_SCAN_SUGGEST=false
|
||||
|
||||
# ffmpeg
|
||||
export FFMPEG_DATADIR="$XDG_CONFIG_HOME/ffmpeg"
|
||||
have ffmpeg && x-dc "$FFMPEG_DATADIR"
|
||||
|
||||
# gcloud
|
||||
have gcloud && {
|
||||
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
||||
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
||||
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
||||
}
|
||||
x-have ffmpeg && x-dc "$FFMPEG_DATADIR"
|
||||
|
||||
# GnuPG
|
||||
export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||
@@ -59,39 +48,23 @@ export GNUPGHOME="$XDG_DATA_HOME/gnupg"
|
||||
export GOPATH="$XDG_DATA_HOME/go"
|
||||
export GOBIN="$XDG_BIN_HOME"
|
||||
|
||||
# irssi
|
||||
have irssi && {
|
||||
# These variables are used in ./alias with --config and --home
|
||||
export IRSSI_CONFIG_HOME="$XDG_CONFIG_HOME/irssi"
|
||||
export IRSSI_CONFIG_FILE="$IRSSI_CONFIG_HOME/config"
|
||||
x-dc "$IRSSI_CONFIG_HOME"
|
||||
}
|
||||
|
||||
# nb, https://xwmx.github.io/nb/
|
||||
export NBRC_PATH="$XDG_CONFIG_HOME/nbrc"
|
||||
export NB_DIR="$XDG_STATE_HOME/nb"
|
||||
|
||||
# nvm, the node version manager
|
||||
export NVM_LAZY_LOAD=true
|
||||
export NVM_COMPLETION=true
|
||||
export NVM_AUTO_USE=true
|
||||
export NVM_DIR="$XDG_CONFIG_HOME/nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
export NPM_CONFIG_USERCONFIG="$XDG_CONFIG_HOME"/npm/npmrc
|
||||
|
||||
# Add npm packages to path
|
||||
have node && {
|
||||
# NPM: Add npm packages to path
|
||||
x-have node && {
|
||||
NVM_NODE_BIN_DIR="$(dirname "$(which node)")"
|
||||
path_append "$NVM_NODE_BIN_DIR"
|
||||
x-path-append "$NVM_NODE_BIN_DIR"
|
||||
}
|
||||
|
||||
# op (1Password cli) is present
|
||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||
have op && {
|
||||
eval "$(op completion zsh)"
|
||||
compdef _op op
|
||||
x-have op && {
|
||||
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && {
|
||||
eval "$(op completion zsh)"
|
||||
compdef _op op
|
||||
}
|
||||
}
|
||||
|
||||
# Python
|
||||
@@ -99,9 +72,8 @@ have op && {
|
||||
# pyenv, python environments
|
||||
export WORKON_HOME="$XDG_DATA_HOME/virtualenvs"
|
||||
export PYENV_ROOT="$XDG_STATE_HOME/pyenv"
|
||||
have pyenv && {
|
||||
path_append "$(pyenv root)/shims"
|
||||
path_append "$PYENV_ROOT/bin"
|
||||
x-have pyenv && {
|
||||
x-path-append "$PYENV_ROOT/shims"
|
||||
eval "$(pyenv init -)"
|
||||
}
|
||||
|
||||
@@ -115,12 +87,16 @@ export BUNDLE_USER_CACHE="$XDG_CACHE_HOME"/bundle
|
||||
export BUNDLE_USER_PLUGIN="$XDG_DATA_HOME"/bundle
|
||||
export RBENV_ROOT="$XDG_STATE_HOME/rbenv"
|
||||
x-dc "$RBENV_ROOT"
|
||||
have gem && path_append "$(gem environment gemdir)/bin"
|
||||
have rbenv && eval "$(rbenv init - zsh)"
|
||||
x-have gem && x-path-append "${GEM_HOME}/bin"
|
||||
x-have rbenv && {
|
||||
[ "$DOTFILES_CURRENT_SHELL" = "zsh" ] && eval "$(rbenv init - zsh)"
|
||||
[ "$DOTFILES_CURRENT_SHELL" = "bash" ] && eval "$(rbenv init - bash)"
|
||||
}
|
||||
|
||||
# Rust / cargo
|
||||
export RUSTUP_HOME="$XDG_DATA_HOME/rustup"
|
||||
export CARGO_HOME="$XDG_DATA_HOME/cargo"
|
||||
path_append "$CARGO_HOME/bin"
|
||||
x-path-append "$CARGO_HOME/bin"
|
||||
|
||||
# screen
|
||||
export SCREENRC="$XDG_CONFIG_HOME/misc/screenrc"
|
||||
@@ -138,10 +114,6 @@ export TMUX_CONF="$XDG_CONFIG_HOME/tmux/tmux.conf"
|
||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||
x-dc "$WAKATIME_HOME"
|
||||
|
||||
# z, https://github.com/rupa/z
|
||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
||||
[[ -f "$XDG_BIN_HOME/z/z.sh" ]] && source "$XDG_BIN_HOME/z/z.sh"
|
||||
|
||||
# Misc
|
||||
export BAT_THEME="ansi"
|
||||
export CHEAT_USE_FZF=true
|
||||
|
||||
20
config/exports-lakka
Normal file
20
config/exports-lakka
Normal file
@@ -0,0 +1,20 @@
|
||||
# lakka exports
|
||||
|
||||
## LUA
|
||||
have luarocks && $(luarocks path --bin)
|
||||
|
||||
path_prepend "$HOME/.local/go/bin"
|
||||
|
||||
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
||||
alias nano='nano -wS -$'
|
||||
alias gpg=gpg2
|
||||
|
||||
ACME_PATH="$HOME/.acme.sh"
|
||||
# shellcheck source=$HOME/.acme.sh/acme.sh.env
|
||||
[[ -s "$ACME_PATH/acme.sh.env" ]] && . "$ACME_PATH/acme.sh.env"
|
||||
|
||||
export RVM_PATH="$HOME/.rvm"
|
||||
export PATH="$RVM_PATH/bin:$PATH"
|
||||
# shellcheck source=$HOME/.rvm/scripts/rvm
|
||||
[[ -s "$RVM_PATH/scripts/rvm" ]] && source "$RVM_PATH/scripts/rvm" # Load RVM into a shell session *as a function*
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# shellcheck disable=1091,2046
|
||||
# vim: filetype=zsh
|
||||
# vim: filetype=bash
|
||||
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
|
||||
# custom variables
|
||||
export XDG_BIN_HOME="$HOME/.local/bin"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_RUNTIME_DIR="$HOME/.local/run"
|
||||
|
||||
export LC_ALL=fi_FI.UTF-8
|
||||
|
||||
@@ -23,9 +34,16 @@ export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
|
||||
# And include the parameter for ZSH
|
||||
export HISTORY_IGNORE="(ls|cd|cd -|pwd|exit|date|* --help)"
|
||||
|
||||
# Less history location
|
||||
export LESSHISTFILE="$XDG_STATE_HOME"/less/history
|
||||
|
||||
# Highlight section titles in manual pages
|
||||
export LESS_TERMCAP_md="$ORANGE"
|
||||
|
||||
# zsh autoloaded terminfo
|
||||
export TERMINFO="$XDG_DATA_HOME"/terminfo
|
||||
export TERMINFO_DIRS="$XDG_DATA_HOME"/terminfo:/usr/share/terminfo
|
||||
|
||||
# Don’t clear the screen after quitting a manual page
|
||||
export MANPAGER="less -X"
|
||||
|
||||
@@ -36,29 +54,3 @@ export GREP_OPTIONS="--color=auto"
|
||||
# update the values of LINES and COLUMNS.
|
||||
hash shopt 2> /dev/null && shopt -s checkwinsize
|
||||
|
||||
# Load iterm2 shell integration
|
||||
# https://iterm2.com/documentation-shell-integration.html
|
||||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] \
|
||||
&& source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
||||
|
||||
# Set dircolors based on the file, if it exists
|
||||
have dircolors && eval $(dircolors "$XDG_CONFIG_HOME/dircolors")
|
||||
|
||||
# If we are using zsh, color our dir lists and such
|
||||
if [ "$SHELL" = "$(which zsh)" ]; then
|
||||
x-dc "$XDG_CACHE_HOME/zsh"
|
||||
x-dc "$XDG_STATE_HOME/zsh"
|
||||
export HISTFILE="$XDG_STATE_HOME/zsh/history"
|
||||
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/zcompcache"
|
||||
zstyle ':completion:*' list-colors "$LS_COLORS"
|
||||
|
||||
# fzf
|
||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh ] \
|
||||
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.zsh
|
||||
fi
|
||||
|
||||
# If we are using bash
|
||||
if [ "$SHELL" = "$(which bash)" ]; then
|
||||
[ -f "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ] \
|
||||
&& source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
|
||||
fi
|
||||
|
||||
@@ -1,91 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# shell functions
|
||||
#
|
||||
# shellcheck source="../scripts/shared.sh"
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
# Weather in Tampere, or other city
|
||||
weather()
|
||||
{
|
||||
# https://github.com/chubin/wttr.in#usage
|
||||
local city="${1:-Tampere}"
|
||||
curl "http://wttr.in/${city// /+}?2nFQM&lang=fi"
|
||||
}
|
||||
|
||||
# Docker
|
||||
ssh-docker()
|
||||
{
|
||||
docker exec -it "$@" bash
|
||||
}
|
||||
|
||||
# All the dig info
|
||||
digga()
|
||||
{
|
||||
dig +nocmd "$1" any +multiline +noall +answer
|
||||
}
|
||||
|
||||
# Rector project to php version 8.2 by default.
|
||||
rector()
|
||||
{
|
||||
local php="${1:-82}"
|
||||
docker run -v "$(pwd)":/project rector/rector:latest process \
|
||||
"/project/$1" \
|
||||
--set "php${php}" \
|
||||
--autoload-file /project/vendor/autoload.php
|
||||
}
|
||||
|
||||
# Commit everything
|
||||
commit()
|
||||
{
|
||||
commitMessage="$*"
|
||||
|
||||
if [ "$commitMessage" = "" ]; then
|
||||
commitMessage="Automated commit"
|
||||
fi
|
||||
|
||||
git add .
|
||||
eval "git commit -a -m '${commitMessage}'"
|
||||
}
|
||||
|
||||
scheduler()
|
||||
{
|
||||
while :; do
|
||||
php artisan schedule:run
|
||||
echo "Sleeping 60 seconds..."
|
||||
sleep 60
|
||||
done
|
||||
}
|
||||
|
||||
# Defines default antigen bundles
|
||||
x-default-antigen-bundles()
|
||||
{
|
||||
export ZSH_TMUX_AUTOSTART=false
|
||||
export ZSH_TMUX_CONFIG="$DOTFILES/config/tmux/tmux.conf"
|
||||
export ZSH_TMUX_UNICODE=true
|
||||
export ZSH_TMUX_AUTOQUIT=false
|
||||
export ZSH_TMUX_DEFAULT_SESSION_NAME=main
|
||||
|
||||
# Add keychain to ssh-agent args when on macOS
|
||||
have brew && zstyle :omz:plugins:ssh-agent ssh-add-args --apple-load-keychain
|
||||
|
||||
# these should be always available
|
||||
antigen bundle tmux
|
||||
antigen bundle colored-man-pages
|
||||
antigen bundle command-not-found
|
||||
antigen bundle ssh-agent
|
||||
# antigen bundle MichaelAquilina/zsh-you-should-use
|
||||
antigen bundle jreese/zsh-titles
|
||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||
antigen bundle zsh-users/zsh-completions
|
||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||
|
||||
# these should be available if there's need
|
||||
have brew && antigen bundle brew
|
||||
# have nvm && antigen bundle nvm
|
||||
have nvm && antigen bundle "$DOTFILES/config/zsh/plugins/nvm-auto-use"
|
||||
have php && antigen bundle php
|
||||
have python && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||
have rvm && antigen bundle unixorn/rvm-plugin
|
||||
}
|
||||
|
||||
19
config/gh-changelog/config.yaml
Normal file
19
config/gh-changelog/config.yaml
Normal file
@@ -0,0 +1,19 @@
|
||||
check_for_updates: true
|
||||
excluded_labels:
|
||||
- maintenance
|
||||
- dependencies
|
||||
file_name: CHANGELOG.md
|
||||
logger: spinner
|
||||
no_color: false
|
||||
sections:
|
||||
added:
|
||||
- feature
|
||||
- enhancement
|
||||
changed:
|
||||
- backwards-incompatible
|
||||
fixed:
|
||||
- bug
|
||||
- bugfix
|
||||
- documentation
|
||||
show_unreleased: true
|
||||
skip_entries_without_label: false
|
||||
54
config/gh-dash/config.yml
Normal file
54
config/gh-dash/config.yml
Normal file
@@ -0,0 +1,54 @@
|
||||
prSections:
|
||||
- title: My Pull Requests
|
||||
filters: is:open author:@me
|
||||
- title: Needs My Review
|
||||
filters: is:open review-requested:@me
|
||||
- title: Involved
|
||||
filters: is:open involves:@me -author:@me
|
||||
issuesSections:
|
||||
- title: My Issues
|
||||
filters: is:open author:@me
|
||||
- title: Assigned
|
||||
filters: is:open assignee:@me
|
||||
- title: Involved
|
||||
filters: is:open involves:@me -author:@me
|
||||
defaults:
|
||||
preview:
|
||||
open: true
|
||||
width: 50
|
||||
prsLimit: 20
|
||||
issuesLimit: 20
|
||||
view: prs
|
||||
layout:
|
||||
prs:
|
||||
updatedAt:
|
||||
width: 7
|
||||
repo:
|
||||
width: 15
|
||||
author:
|
||||
width: 15
|
||||
assignees:
|
||||
width: 20
|
||||
hidden: true
|
||||
base:
|
||||
width: 15
|
||||
hidden: true
|
||||
lines:
|
||||
width: 16
|
||||
issues:
|
||||
updatedAt:
|
||||
width: 7
|
||||
repo:
|
||||
width: 15
|
||||
creator:
|
||||
width: 10
|
||||
assignees:
|
||||
width: 20
|
||||
hidden: true
|
||||
refetchIntervalMinutes: 30
|
||||
keybindings:
|
||||
issues: []
|
||||
prs: []
|
||||
repoPaths: {}
|
||||
pager:
|
||||
diff: ''
|
||||
3
config/gh/hosts.yml
Normal file
3
config/gh/hosts.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
github.com:
|
||||
user: ivuorinen
|
||||
git_protocol: https
|
||||
@@ -5,3 +5,9 @@
|
||||
name = Ismo Vuorinen
|
||||
email = ismo@ivuorinen.net
|
||||
|
||||
[github]
|
||||
user = ivuorinen
|
||||
|
||||
[include]
|
||||
path = ~/.config/git/overrides/config
|
||||
|
||||
|
||||
2
config/git/overrides/.gitignore
vendored
Normal file
2
config/git/overrides/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
!.gitkeep
|
||||
config
|
||||
@@ -18,12 +18,12 @@ tap "xwmx/taps"
|
||||
brew "act"
|
||||
# Mozilla CA certificate store
|
||||
brew "ca-certificates"
|
||||
# YAML Parser
|
||||
brew "libyaml"
|
||||
# Cryptography and SSL/TLS Toolkit
|
||||
brew "openssl@3"
|
||||
# Interpreted, interactive, object-oriented programming language
|
||||
brew "python@3.11"
|
||||
# YAML Parser
|
||||
brew "libyaml"
|
||||
# Automate deployment, configuration, and upgrading
|
||||
brew "ansible"
|
||||
# Checks ansible playbooks for practices and behaviour
|
||||
@@ -68,6 +68,8 @@ brew "awscli"
|
||||
brew "bash"
|
||||
# Clone of cat(1) with syntax highlighting and Git integration
|
||||
brew "bat"
|
||||
# C/C++ and Java libraries for Unicode and globalization
|
||||
brew "icu4c"
|
||||
# Yet another cross-platform graphical process/system monitor
|
||||
brew "bottom"
|
||||
# Switch Apache / Valet / CLI configs between PHP versions
|
||||
@@ -102,8 +104,12 @@ brew "dnsmasq"
|
||||
brew "dog"
|
||||
# Lightning-fast linter for .env files written in Rust
|
||||
brew "dotenv-linter"
|
||||
# Tool to verify that your files are in harmony with your .editorconfig
|
||||
brew "editorconfig-checker", link: false
|
||||
# Useful examples at the command-line
|
||||
brew "eg-examples"
|
||||
# Spellchecker wrapping library
|
||||
brew "enchant"
|
||||
# Run arbitrary commands when files change
|
||||
brew "entr"
|
||||
# Perl lib for reading and writing EXIF metadata
|
||||
@@ -152,8 +158,6 @@ brew "gpgme"
|
||||
brew "gpg-tui"
|
||||
# Image manipulation
|
||||
brew "netpbm"
|
||||
# C/C++ and Java libraries for Unicode and globalization
|
||||
brew "icu4c"
|
||||
# OpenType text shaping engine
|
||||
brew "harfbuzz"
|
||||
# Framework for layout and rendering of i18n text
|
||||
@@ -178,6 +182,8 @@ brew "hugo"
|
||||
brew "libheif"
|
||||
# Tools and libraries to manipulate images in many formats
|
||||
brew "imagemagick"
|
||||
# Modular IRC client
|
||||
brew "irssi"
|
||||
# Lightweight and flexible command-line JSON processor
|
||||
brew "jq"
|
||||
# Network authentication protocol
|
||||
@@ -192,10 +198,14 @@ brew "libvoikko"
|
||||
brew "lolcat"
|
||||
# Package manager for the Lua programming language
|
||||
brew "luarocks"
|
||||
# LZMA-based compression program similar to gzip or bzip2
|
||||
brew "lzip"
|
||||
# Swiss Army Knife for macOS
|
||||
brew "m-cli"
|
||||
# Mac App Store command-line interface
|
||||
brew "mas"
|
||||
# Mongrel of mail user agents (part elm, pine, mush, mh, etc.)
|
||||
brew "mutt"
|
||||
# NCurses Disk Usage
|
||||
brew "ncdu"
|
||||
# Ambitious Vim-fork focused on extensibility and agility
|
||||
@@ -278,6 +288,8 @@ brew "virtualenv"
|
||||
brew "wakatime-cli"
|
||||
# Executes a program periodically, showing output fullscreen
|
||||
brew "watch"
|
||||
# Watch files and take action when they change
|
||||
brew "watchman"
|
||||
# Internet file retriever
|
||||
brew "wget"
|
||||
# Personal information dashboard for your terminal
|
||||
@@ -314,8 +326,12 @@ brew "shivammathur/php/php@7.4"
|
||||
brew "shivammathur/php/php@8.0"
|
||||
# Ookla Speedtest
|
||||
brew "teamookla/speedtest/speedtest"
|
||||
# Command-line helper for the 1Password password manager
|
||||
# Command-line interface for 1Password
|
||||
cask "1password-cli"
|
||||
# GPU-accelerated terminal emulator
|
||||
cask "alacritty"
|
||||
# Automatic tiling window manager similar to xmonad
|
||||
cask "amethyst"
|
||||
# Turn audio CDs and files into audiobooks
|
||||
cask "audiobook-builder"
|
||||
# Text editor
|
||||
@@ -388,6 +404,8 @@ cask "rsyncosx"
|
||||
cask "rsyncui"
|
||||
# MySQL/MariaDB database management
|
||||
cask "sequel-ace"
|
||||
# Plugin for AWS CLI to start and end sessions that connect to managed instances
|
||||
cask "session-manager-plugin"
|
||||
# Collection of apps available by subscription
|
||||
cask "setapp"
|
||||
# Team communication and collaboration software
|
||||
@@ -414,8 +432,11 @@ mas "Keynote", id: 409183694
|
||||
mas "LastPass", id: 926036361
|
||||
mas "Numbers", id: 409203825
|
||||
mas "Pages", id: 409201541
|
||||
mas "Pixelmator Pro", id: 1289583905
|
||||
mas "Tailscale", id: 1475387142
|
||||
mas "Xcode", id: 497799835
|
||||
vscode "4ops.terraform"
|
||||
vscode "adamiBs.terraform-live-graph"
|
||||
vscode "akamud.vscode-theme-onelight"
|
||||
vscode "amiralizadeh9480.laravel-extra-intellisense"
|
||||
vscode "andrewleedham.vscode-css-modules"
|
||||
@@ -435,12 +456,16 @@ vscode "esbenp.prettier-vscode"
|
||||
vscode "formulahendry.auto-close-tag"
|
||||
vscode "formulahendry.auto-rename-tag"
|
||||
vscode "formulahendry.code-runner"
|
||||
vscode "foxundermoon.shell-format"
|
||||
vscode "gencer.html-slim-scss-css-class-completion"
|
||||
vscode "GitHub.copilot"
|
||||
vscode "GitHub.copilot-chat"
|
||||
vscode "github.vscode-github-actions"
|
||||
vscode "GitHub.vscode-pull-request-github"
|
||||
vscode "GraphQL.vscode-graphql"
|
||||
vscode "GraphQL.vscode-graphql-execution"
|
||||
vscode "GraphQL.vscode-graphql-syntax"
|
||||
vscode "hashicorp.terraform"
|
||||
vscode "heybourn.headwind"
|
||||
vscode "JohnnyMorganz.stylua"
|
||||
vscode "jumpinjackie.vscode-map-preview"
|
||||
@@ -452,6 +477,7 @@ vscode "mikestead.dotenv"
|
||||
vscode "MisterJ.vue-volar-extention-pack"
|
||||
vscode "MrChetan.phpstorm-parameter-hints-in-vscode"
|
||||
vscode "mrorz.language-gettext"
|
||||
vscode "ms-azuretools.vscode-azureterraform"
|
||||
vscode "ms-azuretools.vscode-docker"
|
||||
vscode "ms-python.python"
|
||||
vscode "ms-python.vscode-pylance"
|
||||
@@ -461,6 +487,7 @@ vscode "ms-toolsai.vscode-jupyter-cell-tags"
|
||||
vscode "ms-toolsai.vscode-jupyter-slideshow"
|
||||
vscode "ms-vscode-remote.remote-containers"
|
||||
vscode "ms-vscode-remote.remote-wsl"
|
||||
vscode "ms-vscode.azure-account"
|
||||
vscode "ms-vscode.cpptools"
|
||||
vscode "msjsdiag.vscode-react-native"
|
||||
vscode "mtxr.sqltools"
|
||||
@@ -473,6 +500,7 @@ vscode "phiter.phpstorm-snippets"
|
||||
vscode "sibiraj-s.vscode-scss-formatter"
|
||||
vscode "SonarSource.sonarlint-vscode"
|
||||
vscode "stylelint.vscode-stylelint"
|
||||
vscode "sumneko.lua"
|
||||
vscode "syler.sass-indented"
|
||||
vscode "timonwong.shellcheck"
|
||||
vscode "tootone.org-mode"
|
||||
@@ -481,6 +509,7 @@ vscode "Vue.volar"
|
||||
vscode "Vue.vscode-typescript-vue-plugin"
|
||||
vscode "WakaTime.vscode-wakatime"
|
||||
vscode "wix.vscode-import-cost"
|
||||
vscode "XadillaX.viml"
|
||||
vscode "xdebug.php-debug"
|
||||
vscode "xdebug.php-pack"
|
||||
vscode "yinfei.luahelper"
|
||||
|
||||
328
config/irssi/config
Normal file
328
config/irssi/config
Normal file
@@ -0,0 +1,328 @@
|
||||
# vim:noext ft=conf;
|
||||
servers = (
|
||||
{
|
||||
address = "irc.cc.tut.fi";
|
||||
chatnet = "IRCNet";
|
||||
port = "6667";
|
||||
own_host = "kapsi.fi";
|
||||
family = "inet";
|
||||
autoconnect = "no";
|
||||
},
|
||||
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
|
||||
{
|
||||
address = "ssl.efnet.org";
|
||||
chatnet = "EFNet";
|
||||
port = "9999";
|
||||
use_tls = "yes";
|
||||
tls_verify = "no";
|
||||
},
|
||||
{
|
||||
address = "irc.esper.net";
|
||||
chatnet = "EsperNet";
|
||||
port = "6697";
|
||||
use_tls = "yes";
|
||||
tls_verify = "yes";
|
||||
},
|
||||
{
|
||||
address = "irc.libera.chat";
|
||||
chatnet = "liberachat";
|
||||
port = "6697";
|
||||
use_tls = "yes";
|
||||
tls_verify = "yes";
|
||||
},
|
||||
{
|
||||
address = "irc.gamesurge.net";
|
||||
chatnet = "GameSurge";
|
||||
port = "6667";
|
||||
},
|
||||
{
|
||||
address = "ssl.ircnet.ovh";
|
||||
chatnet = "IRCnet";
|
||||
port = "6697";
|
||||
use_tls = "yes";
|
||||
tls_verify = "yes";
|
||||
},
|
||||
{ address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; },
|
||||
{
|
||||
address = "irc.ircsource.net";
|
||||
chatnet = "IRCSource";
|
||||
port = "6667";
|
||||
},
|
||||
{ address = "irc.netfuze.net"; chatnet = "NetFuze"; port = "6667"; },
|
||||
{
|
||||
address = "irc.oftc.net";
|
||||
chatnet = "OFTC";
|
||||
port = "6697";
|
||||
use_tls = "yes";
|
||||
tls_verify = "yes";
|
||||
},
|
||||
{
|
||||
address = "irc.quakenet.org";
|
||||
chatnet = "QuakeNet";
|
||||
port = "6667";
|
||||
},
|
||||
{
|
||||
address = "irc.rizon.net";
|
||||
chatnet = "Rizon";
|
||||
port = "6697";
|
||||
use_tls = "yes";
|
||||
tls_verify = "yes";
|
||||
},
|
||||
{ address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; },
|
||||
{
|
||||
address = "irc.undernet.org";
|
||||
chatnet = "Undernet";
|
||||
port = "6667";
|
||||
}
|
||||
);
|
||||
|
||||
chatnets = {
|
||||
DALnet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "20";
|
||||
max_whois = "30";
|
||||
};
|
||||
EFNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "4";
|
||||
max_whois = "1";
|
||||
};
|
||||
EsperNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "4";
|
||||
max_whois = "1";
|
||||
};
|
||||
liberachat = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "4";
|
||||
max_whois = "1";
|
||||
};
|
||||
GameSurge = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "1";
|
||||
max_whois = "1";
|
||||
};
|
||||
IRCnet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "1";
|
||||
max_whois = "1";
|
||||
};
|
||||
IRCSource = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "4";
|
||||
max_whois = "1";
|
||||
};
|
||||
NetFuze = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "1";
|
||||
max_whois = "1";
|
||||
};
|
||||
OFTC = { type = "IRC"; max_kicks = "1"; max_msgs = "1"; max_whois = "1"; };
|
||||
QuakeNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "1";
|
||||
max_whois = "1";
|
||||
};
|
||||
Rizon = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "1";
|
||||
max_whois = "1";
|
||||
};
|
||||
SILC = { type = "SILC"; };
|
||||
Undernet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "1";
|
||||
max_whois = "1";
|
||||
};
|
||||
};
|
||||
|
||||
channels = (
|
||||
{ name = "#lobby"; chatnet = "EsperNet"; autojoin = "No"; },
|
||||
{ name = "#libera"; chatnet = "liberachat"; autojoin = "No"; },
|
||||
{ name = "#irssi"; chatnet = "liberachat"; autojoin = "No"; },
|
||||
{ name = "#gamesurge"; chatnet = "GameSurge"; autojoin = "No"; },
|
||||
{ name = "#irssi"; chatnet = "IRCNet"; autojoin = "No"; },
|
||||
{ name = "#ircsource"; chatnet = "IRCSource"; autojoin = "No"; },
|
||||
{ name = "#netfuze"; chatnet = "NetFuze"; autojoin = "No"; },
|
||||
{ name = "#oftc"; chatnet = "OFTC"; autojoin = "No"; },
|
||||
{ name = "silc"; chatnet = "SILC"; autojoin = "No"; }
|
||||
);
|
||||
|
||||
aliases = {
|
||||
ATAG = "WINDOW SERVER";
|
||||
ADDALLCHANS = "SCRIPT EXEC foreach my \\$channel (Irssi::channels()) { Irssi::command(\"CHANNEL ADD -auto \\$channel->{visible_name} \\$channel->{server}->{tag} \\$channel->{key}\")\\;}";
|
||||
B = "BAN";
|
||||
BACK = "AWAY";
|
||||
BANS = "BAN";
|
||||
BYE = "QUIT";
|
||||
C = "CLEAR";
|
||||
CALC = "EXEC - if command -v bc >/dev/null 2>&1\\; then printf '%s=' '$*'\\; echo '$*' | bc -l\\; else echo bc was not found\\; fi";
|
||||
CHAT = "DCC CHAT";
|
||||
CS = "QUOTE CS";
|
||||
DATE = "TIME";
|
||||
DEHIGHLIGHT = "DEHILIGHT";
|
||||
DESCRIBE = "ACTION";
|
||||
DHL = "DEHILIGHT";
|
||||
EXEMPTLIST = "MODE $C +e";
|
||||
EXIT = "QUIT";
|
||||
GOTO = "SCROLLBACK GOTO";
|
||||
HIGHLIGHT = "HILIGHT";
|
||||
HL = "HILIGHT";
|
||||
HOST = "USERHOST";
|
||||
INVITELIST = "MODE $C +I";
|
||||
J = "JOIN";
|
||||
K = "KICK";
|
||||
KB = "KICKBAN";
|
||||
KN = "KNOCKOUT";
|
||||
LAST = "LASTLOG";
|
||||
LEAVE = "PART";
|
||||
M = "MSG";
|
||||
MS = "QUOTE MS";
|
||||
MUB = "UNBAN *";
|
||||
N = "NAMES";
|
||||
NMSG = "^MSG";
|
||||
NS = "QUOTE NS";
|
||||
OS = "QUOTE OS";
|
||||
P = "PART";
|
||||
Q = "QUERY";
|
||||
RESET = "SET -default";
|
||||
RUN = "SCRIPT LOAD";
|
||||
SAY = "MSG *";
|
||||
SB = "SCROLLBACK";
|
||||
SBAR = "STATUSBAR";
|
||||
SHELP = "QUOTE HELP";
|
||||
SIGNOFF = "QUIT";
|
||||
SV = "MSG * Irssi $J ($V) - https://irssi.org";
|
||||
T = "TOPIC";
|
||||
UB = "UNBAN";
|
||||
UMODE = "MODE $N";
|
||||
UNSET = "SET -clear";
|
||||
W = "WHO";
|
||||
WC = "WINDOW CLOSE";
|
||||
WG = "WINDOW GOTO";
|
||||
WJOIN = "JOIN -window";
|
||||
WI = "WHOIS";
|
||||
WII = "WHOIS $0 $0";
|
||||
WL = "WINDOW LIST";
|
||||
WN = "WINDOW NEW HIDDEN";
|
||||
WQUERY = "QUERY -window";
|
||||
WW = "WHOWAS";
|
||||
};
|
||||
|
||||
statusbar = {
|
||||
|
||||
items = {
|
||||
|
||||
barstart = "{sbstart}";
|
||||
barend = "{sbend}";
|
||||
|
||||
topicbarstart = "{topicsbstart}";
|
||||
topicbarend = "{topicsbend}";
|
||||
|
||||
time = "{sb $Z}";
|
||||
user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
|
||||
|
||||
window = "{sb $winref:$tag/$itemname{sbmode $M}}";
|
||||
window_empty = "{sb $winref{sbservertag $tag}}";
|
||||
|
||||
prompt = "{prompt $[.15]itemname}";
|
||||
prompt_empty = "{prompt $winname}";
|
||||
|
||||
topic = " $topic";
|
||||
topic_empty = " Irssi v$J - https://irssi.org";
|
||||
|
||||
lag = "{sb Lag: $0-}";
|
||||
act = "{sb Act: $0-}";
|
||||
more = "-- more --";
|
||||
};
|
||||
|
||||
default = {
|
||||
|
||||
window = {
|
||||
|
||||
disabled = "no";
|
||||
type = "window";
|
||||
placement = "bottom";
|
||||
position = "1";
|
||||
visible = "active";
|
||||
|
||||
items = {
|
||||
barstart = { priority = "100"; };
|
||||
time = { };
|
||||
user = { };
|
||||
window = { };
|
||||
window_empty = { };
|
||||
lag = { priority = "-1"; };
|
||||
act = { priority = "10"; };
|
||||
more = { priority = "-1"; alignment = "right"; };
|
||||
barend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
|
||||
window_inact = {
|
||||
|
||||
type = "window";
|
||||
placement = "bottom";
|
||||
position = "1";
|
||||
visible = "inactive";
|
||||
|
||||
items = {
|
||||
barstart = { priority = "100"; };
|
||||
window = { };
|
||||
window_empty = { };
|
||||
more = { priority = "-1"; alignment = "right"; };
|
||||
barend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
|
||||
prompt = {
|
||||
|
||||
type = "root";
|
||||
placement = "bottom";
|
||||
position = "100";
|
||||
visible = "always";
|
||||
|
||||
items = {
|
||||
prompt = { priority = "-1"; };
|
||||
prompt_empty = { priority = "-1"; };
|
||||
input = { priority = "10"; };
|
||||
};
|
||||
};
|
||||
|
||||
topic = {
|
||||
|
||||
type = "root";
|
||||
placement = "top";
|
||||
position = "1";
|
||||
visible = "always";
|
||||
|
||||
items = {
|
||||
topicbarstart = { priority = "100"; };
|
||||
topic = { };
|
||||
topic_empty = { };
|
||||
topicbarend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
settings = {
|
||||
core = {
|
||||
real_name = "Ismo Vuorinen";
|
||||
user_name = "ivuorinen";
|
||||
nick = "ivuorinen";
|
||||
};
|
||||
"fe-common/core" = { theme = "lyynx"; };
|
||||
"fe-text" = { actlist_sort = "refnum"; };
|
||||
};
|
||||
@@ -120,7 +120,7 @@ abstracts = {
|
||||
# the basic styling of how to print message, $0 = nick mode, $1 = nick
|
||||
msgnick = "%K<%n$0$1-%K>%n %|";
|
||||
|
||||
# message from you is printed. "msgownnick" specifies the styling of the
|
||||
# message from you is printed. "ownnick" specifies the styling of the
|
||||
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
|
||||
# whole line.
|
||||
|
||||
@@ -251,6 +251,7 @@ abstracts = {
|
||||
# default background for all statusbars. You can also give
|
||||
# the default foreground color for statusbar items.
|
||||
sb_background = "%4%w";
|
||||
window_border = "%4%w";
|
||||
|
||||
# default backround for "default" statusbar group
|
||||
#sb_default_bg = "%4";
|
||||
@@ -261,8 +262,8 @@ abstracts = {
|
||||
# background for topicbar (same default)
|
||||
#sb_topic_bg = "%4";
|
||||
|
||||
# text at the beginning of statusbars. sb-item already puts
|
||||
# space there,so we don't use anything by default.
|
||||
# text at the beginning of statusbars. "sb" already puts a space there,
|
||||
# so we don't use anything by default.
|
||||
sbstart = "";
|
||||
# text at the end of statusbars. Use space so that it's never
|
||||
# used for anything.
|
||||
258
config/irssi/lyynx.theme
Normal file
258
config/irssi/lyynx.theme
Normal file
@@ -0,0 +1,258 @@
|
||||
# LyyNx.theme
|
||||
# started this by editing agon.theme, but later i noticed that there
|
||||
# was nothing left from agon :)
|
||||
# so here it is. i use it with transparent aterm, tint - lightblue,
|
||||
# shading - 99, foreground - lightyellow
|
||||
|
||||
default_color = "-1";
|
||||
info_eol = "false";
|
||||
replaces = { "[]=" = "%K$*%n"; };
|
||||
|
||||
abstracts = {
|
||||
##
|
||||
## generic
|
||||
##
|
||||
|
||||
# text to insert at the beginning of each non-message line
|
||||
line_start = ". ";
|
||||
|
||||
# timestamp styling, nothing by default
|
||||
timestamp = "%w$*%n";
|
||||
|
||||
# any kind of text that needs hilighting, default is to bold
|
||||
hilight = "%_$*%_";
|
||||
|
||||
# any kind of error message, default is bright red
|
||||
error = "%r$*%n";
|
||||
|
||||
# channel name is printed
|
||||
channel = "%w$0-%n";
|
||||
|
||||
# nick is printed
|
||||
nick = "%_%n$*%_";
|
||||
|
||||
# nick host is printed
|
||||
nickhost = "$*";
|
||||
|
||||
# server name is printed
|
||||
server = "%_$*%_";
|
||||
|
||||
# some kind of comment is printed
|
||||
comment = "$*";
|
||||
|
||||
# reason for something is printed (part, quit, kick, ..)
|
||||
reason = "{comment}";
|
||||
|
||||
# mode change is printed ([+o nick])
|
||||
mode = "{comment $*}";
|
||||
|
||||
##
|
||||
## channel specific messages
|
||||
##
|
||||
|
||||
# highlighted nick/host is printed (joins)
|
||||
channick_hilight = "%c$0-%n";
|
||||
chanhost_hilight = "{nickhost %w$0-%n}";
|
||||
|
||||
# nick/host is printed (parts, quits, etc.)
|
||||
channick = "%c$*";
|
||||
chanhost = "%w{nickhost $*}";
|
||||
|
||||
# highlighted channel name is printed
|
||||
channelhilight = "%n$*%n";
|
||||
|
||||
# ban/ban exception/invite list mask is printed
|
||||
ban = "%n$*%n";
|
||||
|
||||
##
|
||||
## messages
|
||||
##
|
||||
|
||||
# the basic styling of how to print message, $0 = nick mode, $1 = nick
|
||||
msgnick = "%_%n$0%n$1-%w:%n ";
|
||||
|
||||
# message from you is printed. "msgownnick" specifies the styling of the
|
||||
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
|
||||
# whole line.
|
||||
|
||||
# Example1: You want the message text to be green:
|
||||
# ownmsgnick = "{msgnick $0 $1-}%g";
|
||||
# Example2.1: You want < and> chars to be yellow:
|
||||
# ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
|
||||
# (you'll also have to remove <> from replaces list above)
|
||||
# Example2.2: But you still want to keep <> grey for other messages:
|
||||
# pubmsgnick = "%K{msgnick $0 $1-%K}%n";
|
||||
# pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
|
||||
# pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
|
||||
# ownprivmsgnick = "%K{msgnick $*%K}%n";
|
||||
# privmsgnick = "%K{msgnick %R$*%K}%n";
|
||||
|
||||
# $0 = nick mod, $1 = nick
|
||||
ownmsgnick = "%n{msgnick %n$0$1-%n}%w";
|
||||
ownnick = "%w$*%n";
|
||||
|
||||
# public message in channel, $0 = nick mode, $1 = nick
|
||||
pubmsgnick = "{msgnick %n$0 %b$1-}";
|
||||
pubnick = "%w$*%n";
|
||||
|
||||
# public message in channel meant for me, $0 = nick mode, $1 = nick
|
||||
pubmsgmenick = "{msgnick $0 $1-}";
|
||||
menick = "%w$*";
|
||||
|
||||
# public highlighted message in channel
|
||||
# $0 = highlight color, $1 = nick mode, $2 = nick
|
||||
pubmsghinick = "{msgnick $1 $0$2-%n}";
|
||||
|
||||
# channel name is printed with message
|
||||
msgchannel = "%K:%c$*%n";
|
||||
|
||||
# private message, $0 = nick, $1 = host
|
||||
privmsg = "[%n$0%K(%W$1-%K)%n] ";
|
||||
|
||||
# private message from you, $0 = "msg", $1 = target nick
|
||||
ownprivmsg = "[%n$0%K(%n$1-%K)%n] ";
|
||||
|
||||
# own private message in query
|
||||
ownprivmsgnick = "{msgnick $*}%W";
|
||||
ownprivnick = "%n$*%W";
|
||||
|
||||
# private message in query
|
||||
privmsgnick = "{msgnick $*}";
|
||||
|
||||
##
|
||||
## Actions (/ME stuff)
|
||||
##
|
||||
|
||||
# used internally by this theme
|
||||
action_core = "%c * $*";
|
||||
|
||||
# generic one that's used by most actions
|
||||
action = "{action_core $*} ";
|
||||
|
||||
# own action, both private/public
|
||||
ownaction = "{action $*}";
|
||||
|
||||
# own action with target, both private/public
|
||||
ownaction_target = "{action_core $0}%K:%c$1%n ";
|
||||
|
||||
# private action sent by others
|
||||
pvtaction = "%W (*) $*%n ";
|
||||
pvtaction_query = "{action $*}";
|
||||
|
||||
# public action sent by others
|
||||
pubaction = "{action $*}";
|
||||
|
||||
|
||||
##
|
||||
## other IRC events
|
||||
##
|
||||
|
||||
# whois
|
||||
whois = "$[8]0: $1-";
|
||||
|
||||
# notices
|
||||
ownnotice = "[%n$0%K(%R$1-%K)]%n ";
|
||||
notice = "%K-%C$*%K-%n ";
|
||||
pubnotice_channel = "%K:%m$*";
|
||||
pvtnotice_host = "%K(%m$*%K)";
|
||||
servernotice = "%g!$*%n ";
|
||||
|
||||
# CTCPs
|
||||
ownctcp = "[%y$0%K(%n$1-%K)] ";
|
||||
ctcp = "%Y$*%n";
|
||||
|
||||
# wallops
|
||||
wallop = "%W$*%n: ";
|
||||
wallop_nick = "%n$*";
|
||||
wallop_action = "%W * $*%n ";
|
||||
|
||||
# netsplits
|
||||
netsplit = "%n$*%n";
|
||||
netjoin = "%C$*%n";
|
||||
|
||||
# /names list
|
||||
names_prefix = "";
|
||||
names_nick = "%_$0%_$1- ";
|
||||
names_nick_op = "{names_nick $*}";
|
||||
names_nick_halfop = "{names_nick $*}";
|
||||
names_nick_voice = "{names_nick $*}";
|
||||
names_users = "%c$*%n";
|
||||
names_channel = "%C$*%n";
|
||||
|
||||
# DCC
|
||||
dcc = "%g$*%n";
|
||||
dccfile = "%_$*%_";
|
||||
|
||||
# DCC chat, own msg/action
|
||||
dccownmsg = "[%n$0%K($1-%K)%n] ";
|
||||
dccownnick = "%n$*%n";
|
||||
dccownquerynick = "%W$*%n";
|
||||
dccownaction = "{action $*}";
|
||||
dccownaction_target = "{action_core $0}%K:%c$1%n ";
|
||||
|
||||
# DCC chat, others
|
||||
dccmsg = "[%G$1-%K(%g$0%K)%n] ";
|
||||
dccquerynick = "%G$*%n";
|
||||
dccaction = "%W (*dcc*) $*%n %|";
|
||||
|
||||
##
|
||||
## statusbar
|
||||
##
|
||||
|
||||
# default background for all statusbars. You can also give
|
||||
# the default foreground color for statusbar items.
|
||||
sb_background = "%N%w";
|
||||
|
||||
# default backround for "default" statusbar group
|
||||
#sb_default_bg = "%4";
|
||||
# background for prompt / input line
|
||||
sb_prompt_bg = "%n";
|
||||
# background for info statusbar
|
||||
sb_info_bg = "%8";
|
||||
# background for topicbar (same default)
|
||||
#sb_topic_bg = "%4";
|
||||
|
||||
# text at the beginning of statusbars. sb-item already puts
|
||||
# space there,so we don't use anything by default.
|
||||
sbstart = "";
|
||||
# text at the end of statusbars. Use space so that it's never
|
||||
# used for anything.
|
||||
sbend = " ";
|
||||
|
||||
topicsbstart = "{sbstart $*}";
|
||||
topicsbend = "{sbend $*}";
|
||||
|
||||
prompt = "$* ";
|
||||
|
||||
sb = " %n$*%n";
|
||||
sbmode = "";
|
||||
#sbaway = " (%g[away]%n)";
|
||||
sbservertag = " $0";
|
||||
sbnickmode = "$0";
|
||||
|
||||
# activity in statusbar
|
||||
|
||||
# ',' separator
|
||||
sb_act_sep = "%K$*";
|
||||
# normal text
|
||||
sb_act_text = "%w$*";
|
||||
# public message
|
||||
sb_act_msg = "%c$*";
|
||||
# hilight
|
||||
sb_act_hilight = "%C$*";
|
||||
# hilight with specified color, $0 = color, $1 = text
|
||||
sb_act_hilight_color = "$0$1-%n";
|
||||
};
|
||||
formats = {
|
||||
"fe-common/core" = {
|
||||
join = "%g{channick $0} {chanhost $1} %cgot in {channel $2}";
|
||||
part = "%g{channick $0} {chanhost $1} %cgot out of%n $2";
|
||||
kick = "%g{channick $2} kicked %g{channick $0} ($3)";
|
||||
quit = "%g{channick $0} {chanhost $1} %cleft irc%n ($2)";
|
||||
line_start_irssi = "{line_start}";
|
||||
nick_changed = "%g{channick $0} --> {channick $1}";
|
||||
new_topic = "%g{nick $0} topic change -> {channel $1} to: $2";
|
||||
endofnames = "$1 nicks totaly - $2 ops, $3 voices and $4 normal";
|
||||
timestamp = "{timestamp %%H:%%M:%%S} ";
|
||||
};
|
||||
};
|
||||
129
config/irssi/scripts/autorun/autoaway.pl
Normal file
129
config/irssi/scripts/autorun/autoaway.pl
Normal file
@@ -0,0 +1,129 @@
|
||||
# /AUTOAWAY <n> - Mark user away after <n> seconds of inactivity
|
||||
# /AWAY - play nice with autoaway
|
||||
# New, brighter, whiter version of my autoaway script. Actually works :)
|
||||
# (c) 2000 Larry Daffner (vizzie@airmail.net)
|
||||
# You may freely use, modify and distribute this script, as long as
|
||||
# 1) you leave this notice intact
|
||||
# 2) you don't pretend my code is yours
|
||||
# 3) you don't pretend your code is mine
|
||||
#
|
||||
# share and enjoy!
|
||||
|
||||
# A simple script. /autoaway <n> will mark you as away automatically if
|
||||
# you have not typed any commands in <n> seconds. (<n>=0 disables the feature)
|
||||
# It will also automatically unmark you away the next time you type a command.
|
||||
# Note that using the /away command will disable the autoaway mechanism, as
|
||||
# well as the autoreturn. (when you unmark yourself, the autoaway wil
|
||||
# restart again)
|
||||
|
||||
# Thanks to Adam Monsen for multiserver and config file fix
|
||||
|
||||
use strict;
|
||||
use Irssi;
|
||||
use Irssi::Irc;
|
||||
|
||||
use vars qw($VERSION %IRSSI);
|
||||
$VERSION = "0.5";
|
||||
%IRSSI = (
|
||||
authors => 'Larry "Vizzie" Daffner',
|
||||
contact => 'vizzie@airmail.net',
|
||||
name => 'Automagic away setting',
|
||||
description => 'Automatically goes away after defined inactivity',
|
||||
license => 'BSD',
|
||||
url => 'http://www.flamingpackets.net/~vizzie/irssi/',
|
||||
changed => '2018-12-02',
|
||||
);
|
||||
|
||||
my ($autoaway_sec, $autoaway_to_tag, $autoaway_state);
|
||||
$autoaway_state = 0;
|
||||
|
||||
#
|
||||
# /AUTOAWAY - set the autoaway timeout
|
||||
#
|
||||
sub cmd_autoaway {
|
||||
my ($data, $server, $channel) = @_;
|
||||
|
||||
if (!($data =~ /^[0-9]+$/)) {
|
||||
Irssi::print("autoaway: usage: /autoaway <seconds>");
|
||||
return 1;
|
||||
}
|
||||
|
||||
$autoaway_sec = $data;
|
||||
|
||||
if ($autoaway_sec) {
|
||||
Irssi::settings_set_int("autoaway_timeout", $autoaway_sec);
|
||||
Irssi::print("autoaway timeout set to $autoaway_sec seconds");
|
||||
} else {
|
||||
Irssi::print("autoway disabled");
|
||||
}
|
||||
|
||||
if (defined($autoaway_to_tag)) {
|
||||
Irssi::timeout_remove($autoaway_to_tag);
|
||||
$autoaway_to_tag = undef;
|
||||
}
|
||||
|
||||
if ($autoaway_sec) {
|
||||
$autoaway_to_tag =
|
||||
Irssi::timeout_add($autoaway_sec*1000, "auto_timeout", "");
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# away = Set us away or back, within the autoaway system
|
||||
sub cmd_away {
|
||||
my ($data, $server, $channel) = @_;
|
||||
|
||||
if ($data eq "") {
|
||||
$autoaway_state = 0;
|
||||
} else {
|
||||
if ($autoaway_state eq 0) {
|
||||
Irssi::timeout_remove($autoaway_to_tag);
|
||||
$autoaway_to_tag = undef;
|
||||
$autoaway_state = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub auto_timeout {
|
||||
my ($data, $server) = @_;
|
||||
|
||||
# we're in the process.. don't touch anything.
|
||||
$autoaway_state = 3;
|
||||
foreach my $server (Irssi::servers()) {
|
||||
$server->command("/AWAY autoaway after $autoaway_sec seconds");
|
||||
}
|
||||
|
||||
Irssi::timeout_remove($autoaway_to_tag);
|
||||
$autoaway_state = 1;
|
||||
}
|
||||
|
||||
sub reset_timer {
|
||||
if ($autoaway_state eq 1) {
|
||||
$autoaway_state = 3;
|
||||
foreach my $server (Irssi::servers()) {
|
||||
$server->command("/AWAY");
|
||||
}
|
||||
|
||||
$autoaway_state = 0;
|
||||
}
|
||||
if ($autoaway_state eq 0) {
|
||||
if (defined($autoaway_to_tag)) {
|
||||
Irssi::timeout_remove($autoaway_to_tag);
|
||||
$autoaway_to_tag = undef();
|
||||
}
|
||||
if ($autoaway_sec) {
|
||||
$autoaway_to_tag = Irssi::timeout_add($autoaway_sec*1000, "auto_timeout", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Irssi::settings_add_int("misc", "autoaway_timeout", 0);
|
||||
|
||||
$autoaway_sec = Irssi::settings_get_int("autoaway_timeout");
|
||||
reset_timer();
|
||||
|
||||
Irssi::command_bind('autoaway', 'cmd_autoaway');
|
||||
Irssi::command_bind('away', 'cmd_away');
|
||||
Irssi::signal_add('send command', 'reset_timer');
|
||||
|
||||
# vim:set expandtab ts=2 sw=2:
|
||||
39
config/irssi/scripts/autorun/autowhois.pl
Normal file
39
config/irssi/scripts/autorun/autowhois.pl
Normal file
@@ -0,0 +1,39 @@
|
||||
# /WHOIS all the users who send you a private message.
|
||||
# v1.1 for irssi 0.7.98 by Timo Sirainen
|
||||
use strict;
|
||||
use Irssi;
|
||||
use vars qw($VERSION %IRSSI);
|
||||
$VERSION = "1.1";
|
||||
%IRSSI = (
|
||||
authors => "Timo \'cras\' Sirainen",
|
||||
contact => "tss\@iki.fi",
|
||||
name => "autowhois",
|
||||
description => "/WHOIS all the users who send you a private message.",
|
||||
license => "Public Domain",
|
||||
url => "http://irssi.org/",
|
||||
changed => "2002-03-04T22:47+0100",
|
||||
changes => "v1.1: don't /WHOIS if query exists for the nick already"
|
||||
);
|
||||
|
||||
# History:
|
||||
# v1.1: don't /WHOIS if query exists for the nick already
|
||||
|
||||
my ($lastfrom, $lastquery);
|
||||
|
||||
sub msg_private_first {
|
||||
my ($server, $msg, $nick, $address) = @_;
|
||||
|
||||
$lastquery = $server->query_find($nick);
|
||||
}
|
||||
|
||||
sub msg_private {
|
||||
my ($server, $msg, $nick, $address) = @_;
|
||||
|
||||
return if $lastquery || $lastfrom eq $nick;
|
||||
|
||||
$lastfrom = $nick;
|
||||
$server->command("whois $nick");
|
||||
}
|
||||
|
||||
Irssi::signal_add_first('message private', 'msg_private_first');
|
||||
Irssi::signal_add('message private', 'msg_private');
|
||||
115
config/irssi/scripts/autorun/go.pl
Normal file
115
config/irssi/scripts/autorun/go.pl
Normal file
@@ -0,0 +1,115 @@
|
||||
use strict;
|
||||
use vars qw($VERSION %IRSSI);
|
||||
use Irssi;
|
||||
use Irssi::Irc;
|
||||
|
||||
# Usage:
|
||||
# /script load go.pl
|
||||
# If you are in #irssi you can type /go #irssi or /go irssi or even /go ir ...
|
||||
# also try /go ir<tab> and /go <tab> (that's two spaces)
|
||||
#
|
||||
# The following settings exist:
|
||||
#
|
||||
# /SET go_match_case_sensitive [ON|OFF]
|
||||
# Match window/item names sensitively (the default). Turning this off
|
||||
# means e.g. "/go foo" would jump to a window named "Foobar", too.
|
||||
#
|
||||
# /SET go_match_anchored [ON|OFF]
|
||||
# Match window/names only at the start of the word (the default). Turning
|
||||
# this off will mean that strings can match anywhere in the window/names.
|
||||
# The leading '#' of channel names is optional either way.
|
||||
#
|
||||
# /SET go_complete_case_sensitive [ON|OFF]
|
||||
# When using tab-completion, match case-insensitively (the default).
|
||||
# Turning this on means that "/go foo<tab>" will *not* suggest "Foobar".
|
||||
#
|
||||
# /SET go_complete_anchored [ON|OFF]
|
||||
# Match window/names only at the start of the word. The default is 'off',
|
||||
# which causes completion to match anywhere in the window/names during
|
||||
# completion. The leading '#' of channel names is optional either way.
|
||||
#
|
||||
|
||||
$VERSION = '1.1.1';
|
||||
|
||||
%IRSSI = (
|
||||
authors => 'nohar',
|
||||
contact => 'nohar@freenode',
|
||||
name => 'go to window',
|
||||
description => 'Implements /go command that activates a window given a name/partial name. It features a nice completion.',
|
||||
license => 'GPLv2 or later',
|
||||
changed => '2019-02-25'
|
||||
);
|
||||
|
||||
sub _make_regexp {
|
||||
my ($name, $ci, $aw) = @_;
|
||||
my $re = "\Q${name}\E";
|
||||
$re = "(?i:$re)" unless $ci;
|
||||
$re = "^#?$re" if $aw;
|
||||
return $re;
|
||||
}
|
||||
|
||||
sub signal_complete_go {
|
||||
my ($complist, $window, $word, $linestart, $want_space) = @_;
|
||||
my $channel = $window->get_active_name();
|
||||
my $k = Irssi::parse_special('$k');
|
||||
|
||||
return unless ($linestart =~ /^\Q${k}\Ego\b/i);
|
||||
|
||||
my $re = _make_regexp($word,
|
||||
Irssi::settings_get_bool('go_complete_case_sensitive'),
|
||||
Irssi::settings_get_bool('go_complete_anchored'));
|
||||
@$complist = ();
|
||||
foreach my $w (Irssi::windows) {
|
||||
my $name = $w->get_active_name();
|
||||
if ($word ne "") {
|
||||
if ($name =~ $re) {
|
||||
push(@$complist, $name)
|
||||
}
|
||||
} else {
|
||||
push(@$complist, $name);
|
||||
}
|
||||
}
|
||||
Irssi::signal_stop();
|
||||
};
|
||||
|
||||
sub cmd_go
|
||||
{
|
||||
my($chan,$server,$witem) = @_;
|
||||
|
||||
my $case_sensitive = Irssi::settings_get_bool('go_match_case_sensitive');
|
||||
my $match_anchored = Irssi::settings_get_bool('go_match_anchored');
|
||||
|
||||
$chan =~ s/ *//g;
|
||||
my $re = _make_regexp($chan, $case_sensitive, $match_anchored);
|
||||
|
||||
my @matches;
|
||||
foreach my $w (Irssi::windows) {
|
||||
my $name = $w->get_active_name();
|
||||
if (($case_sensitive && $name eq $chan) ||
|
||||
(!$case_sensitive && CORE::fc $name eq CORE::fc $chan)) {
|
||||
$w->set_active();
|
||||
return;
|
||||
} elsif ($name =~ /$re/) {
|
||||
push(@matches, $w);
|
||||
}
|
||||
}
|
||||
if (@matches) {
|
||||
$matches[0]->set_active();
|
||||
}
|
||||
}
|
||||
|
||||
Irssi::command_bind("go", "cmd_go");
|
||||
Irssi::signal_add_first('complete word', 'signal_complete_go');
|
||||
Irssi::settings_add_bool('go', 'go_match_case_sensitive', 1);
|
||||
Irssi::settings_add_bool('go', 'go_complete_case_sensitive', 0);
|
||||
Irssi::settings_add_bool('go', 'go_match_anchored', 1);
|
||||
Irssi::settings_add_bool('go', 'go_complete_anchored', 0);
|
||||
|
||||
# Changelog
|
||||
#
|
||||
# 2017-02-02 1.1 martin f. krafft <madduck@madduck.net>
|
||||
# - made case-sensitivity of match configurable
|
||||
# - made anchoring of search strings configurable
|
||||
#
|
||||
# 2019-02-025 1.1.1 dylan lloyd <dylan@disinclined.org>
|
||||
# - prefer exact channel matches
|
||||
113
config/irssi/scripts/autorun/highlite.pl
Normal file
113
config/irssi/scripts/autorun/highlite.pl
Normal file
@@ -0,0 +1,113 @@
|
||||
use strict;
|
||||
use Irssi;
|
||||
use Irssi::Irc;
|
||||
|
||||
use vars qw($VERSION %IRSSI);
|
||||
|
||||
$VERSION = "1.0";
|
||||
%IRSSI = (
|
||||
"authors" => "Mantis",
|
||||
"contact" => "mantis\@inta-link.com",
|
||||
"name" => "highlite",
|
||||
"description" => "shows events happening in all channels you are in that may concern you",
|
||||
"url" => "http://www.inta-link.com/",
|
||||
"license" => "GNU GPL v2",
|
||||
"changed" => "2003-01-03"
|
||||
);
|
||||
|
||||
sub msg_join
|
||||
{
|
||||
my ($server, $channame, $nick, $host) = @_;
|
||||
$channame =~ s/^://;
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
$windowname->print("%B%0JOIN : " . $nick . " : " . $channame . " : " . $host, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
}
|
||||
|
||||
sub msg_part
|
||||
{
|
||||
my ($server, $channame, $nick, $host) = @_;
|
||||
$channame =~ s/^://;
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
$windowname->print("%b%0PART : " . $nick . " : " . $channame . " : " . $host, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
}
|
||||
|
||||
sub msg_quit
|
||||
{
|
||||
my ($server, $nick, $host, $quitmsg) = @_;
|
||||
|
||||
if (substr($quitmsg, 0, 14) eq "Read error to ")
|
||||
{
|
||||
$quitmsg = "[ General Read Error ]";
|
||||
}
|
||||
if (substr($quitmsg, 0, 17) eq "Ping timeout for ")
|
||||
{
|
||||
$quitmsg = "[ General Ping Timeout Error ]";
|
||||
}
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
$windowname->print("%R%0QUIT : " . $nick . " : " . $host . " : " . $quitmsg, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
|
||||
$quitmsg = "";
|
||||
}
|
||||
|
||||
sub msg_topic
|
||||
{
|
||||
my ($server, $channame, $topicmsg, $nick, $host) = @_;
|
||||
$channame =~ s/^://;
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
$windowname->print("%G%0TOPIC : " . $nick . " : " . $channame . " : " . $topicmsg, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
}
|
||||
|
||||
sub msg_nick
|
||||
{
|
||||
my ($server, $nick, $old_nick, $host) = @_;
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
$windowname->print("%m%0NICK : " . $old_nick . " : " . $nick . " : " . $host, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
}
|
||||
|
||||
sub msg_kick
|
||||
{
|
||||
my ($server, $channame, $kicked, $nick, $host, $reason) = @_;
|
||||
$channame =~ s/^://;
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
$windowname->print("%Y%0KICK : " . $kicked . " : " . $channame . " : " . $nick . " : " . $reason, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
}
|
||||
|
||||
sub sig_printtext {
|
||||
my ($dest, $text, $stripped) = @_;
|
||||
|
||||
if (($dest->{level} & (MSGLEVEL_HILIGHT|MSGLEVEL_MSGS)) && ($dest->{level} & MSGLEVEL_NOHILIGHT) == 0)
|
||||
{
|
||||
if ($dest->{level} & MSGLEVEL_PUBLIC)
|
||||
{
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
|
||||
$windowname->print("%W%0HIGHLITE : " . $dest->{target} . " : " . $text, MSGLEVEL_CLIENTCRAP) if ($windowname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $windowname = Irssi::window_find_name('highlite');
|
||||
if (!$windowname)
|
||||
{
|
||||
Irssi::command("window new hidden");
|
||||
Irssi::command("window name highlite");
|
||||
}
|
||||
|
||||
Irssi::signal_add(
|
||||
{
|
||||
'message join' => \&msg_join,
|
||||
'message part' => \&msg_part,
|
||||
'message quit' => \&msg_quit,
|
||||
'message topic' => \&msg_topic,
|
||||
'print text', 'sig_printtext',
|
||||
'message nick' => \&msg_nick,
|
||||
'message kick' => \&msg_kick
|
||||
}
|
||||
);
|
||||
|
||||
257
config/irssi/scripts/autorun/nickcolor.pl
Normal file
257
config/irssi/scripts/autorun/nickcolor.pl
Normal file
@@ -0,0 +1,257 @@
|
||||
use strict;
|
||||
use Irssi 20020101.0250 ();
|
||||
use vars qw($VERSION %IRSSI);
|
||||
$VERSION = "2.1";
|
||||
%IRSSI = (
|
||||
authors => "Timo Sirainen, Ian Peters, David Leadbeater, Bruno Cattáneo",
|
||||
contact => "tss\@iki.fi",
|
||||
name => "Nick Color",
|
||||
description => "assign a different color for each nick",
|
||||
license => "Public Domain",
|
||||
url => "http://irssi.org/",
|
||||
changed => "Mon 08 Jan 21:28:53 BST 2018",
|
||||
);
|
||||
|
||||
# Tweaks to this plugin are:
|
||||
# - Moved irssi folder under $XDG_CONFIG_HOME/irssi/
|
||||
# - changed TABs to spaces
|
||||
|
||||
# Settings:
|
||||
# nickcolor_colors: List of color codes to use.
|
||||
# e.g. /set nickcolor_colors 2 3 4 5 6 7 9 10 11 12 13
|
||||
# (avoid 8, as used for hilights in the default theme).
|
||||
#
|
||||
# nickcolor_enable_prefix: Enables prefix for same nick.
|
||||
#
|
||||
# nickcolor_enable_truncate: Enables nick truncation.
|
||||
#
|
||||
# nickcolor_prefix_text: Prefix text for succesive messages.
|
||||
# e.g. /set nickcolor_prefix_text -
|
||||
#
|
||||
# nickcolor_truncate_value: Truncate nick value.
|
||||
# e.g. /set nickcolor_truncate_value -7
|
||||
# This will truncate nicknames at 7 characters and make them right aligned
|
||||
|
||||
my %saved_colors;
|
||||
my %session_colors = {};
|
||||
my %saved_nicks; # To store each channel's last nickname
|
||||
|
||||
sub load_colors {
|
||||
open my $color_fh, "<", "$ENV{XDG_CONFIG_HOME}/irssi/saved_colors";
|
||||
while (<$color_fh>) {
|
||||
chomp;
|
||||
my($nick, $color) = split ":";
|
||||
$saved_colors{$nick} = $color;
|
||||
}
|
||||
}
|
||||
|
||||
sub save_colors {
|
||||
open COLORS, ">", "$ENV{XDG_CONFIG_HOME}/irssi/saved_colors";
|
||||
|
||||
foreach my $nick (keys %saved_colors) {
|
||||
print COLORS "$nick:$saved_colors{$nick}\n";
|
||||
}
|
||||
|
||||
close COLORS;
|
||||
}
|
||||
|
||||
# If someone we've colored (either through the saved colors, or the hash
|
||||
# function) changes their nick, we'd like to keep the same color associated
|
||||
# with them (but only in the session_colors, ie a temporary mapping).
|
||||
|
||||
sub sig_nick {
|
||||
my ($server, $newnick, $nick, $address) = @_;
|
||||
my $color;
|
||||
|
||||
$newnick = substr ($newnick, 1) if ($newnick =~ /^:/);
|
||||
|
||||
if ($color = $saved_colors{$nick}) {
|
||||
$session_colors{$newnick} = $color;
|
||||
} elsif ($color = $session_colors{$nick}) {
|
||||
$session_colors{$newnick} = $color;
|
||||
}
|
||||
}
|
||||
|
||||
# This gave reasonable distribution values when run across
|
||||
# /usr/share/dict/words
|
||||
|
||||
sub simple_hash {
|
||||
my ($string) = @_;
|
||||
chomp $string;
|
||||
my @chars = split //, $string;
|
||||
my $counter;
|
||||
|
||||
foreach my $char (@chars) {
|
||||
$counter += ord $char;
|
||||
}
|
||||
|
||||
my @colors = split / /, Irssi::settings_get_str('nickcolor_colors');
|
||||
$counter = $colors[$counter % @colors];
|
||||
|
||||
return $counter;
|
||||
}
|
||||
|
||||
# process public (others) messages
|
||||
sub sig_public {
|
||||
my ($server, $msg, $nick, $address, $target) = @_;
|
||||
|
||||
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
|
||||
my $enable_truncate = Irssi::settings_get_bool('nickcolor_enable_truncate');
|
||||
my $prefix_text = Irssi::settings_get_str('nickcolor_prefix_text');
|
||||
my $truncate_value = Irssi::settings_get_int('nickcolor_truncate_value');
|
||||
|
||||
# Reference for server/channel
|
||||
my $tagtarget = "$server->{tag}/$target";
|
||||
|
||||
# Set default nick truncate value to 0 if option is disabled
|
||||
$truncate_value = 0 if (!$enable_truncate);
|
||||
|
||||
# Has the user assigned this nick a color?
|
||||
my $color = $saved_colors{$nick};
|
||||
|
||||
# Have -we- already assigned this nick a color?
|
||||
if (!$color) {
|
||||
$color = $session_colors{$nick};
|
||||
}
|
||||
|
||||
# Let's assign this nick a color
|
||||
if (!$color) {
|
||||
$color = simple_hash $nick;
|
||||
$session_colors{$nick} = $color;
|
||||
}
|
||||
|
||||
$color = sprintf "\003%02d", $color;
|
||||
|
||||
# Optional: We check if it's the same nickname for current target
|
||||
if ($saved_nicks{$tagtarget} eq $nick && $enable_prefix)
|
||||
{
|
||||
# Grouped message
|
||||
Irssi::command('/^format pubmsg ' . $prefix_text . '$1');
|
||||
}
|
||||
else
|
||||
{
|
||||
# Normal message
|
||||
Irssi::command('/^format pubmsg {pubmsgnick $2 {pubnick ' . $color . '$[' . $truncate_value . ']0}}$1');
|
||||
|
||||
# Save nickname for next message
|
||||
$saved_nicks{$tagtarget} = $nick;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# process public (me) messages
|
||||
sub sig_me {
|
||||
my ($server, $msg, $target) = @_;
|
||||
my $nick = $server->{nick};
|
||||
|
||||
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
|
||||
my $enable_truncate = Irssi::settings_get_bool('nickcolor_enable_truncate');
|
||||
my $prefix_text = Irssi::settings_get_str('nickcolor_prefix_text');
|
||||
my $truncate_value = Irssi::settings_get_int('nickcolor_truncate_value');
|
||||
|
||||
# Reference for server/channel
|
||||
my $tagtarget = "$server->{tag}/$target";
|
||||
|
||||
# Set default nick truncate value to 0 if option is disabled
|
||||
$truncate_value = 0 if (!$enable_truncate);
|
||||
|
||||
# Optional: We check if it's the same nickname for current target
|
||||
if ($saved_nicks{$tagtarget} eq $nick && $enable_prefix)
|
||||
{
|
||||
# Grouped message
|
||||
Irssi::command('/^format own_msg ' . $prefix_text . '$1');
|
||||
}
|
||||
else
|
||||
{
|
||||
# Normal message
|
||||
Irssi::command('/^format own_msg {ownmsgnick $2 {ownnick $[' . $truncate_value . ']0}}$1');
|
||||
|
||||
# Save nickname for next message
|
||||
$saved_nicks{$tagtarget} = $nick;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
# process public (others) actions
|
||||
sub sig_action_public {
|
||||
my ($server, $msg, $nick, $address, $target) = @_;
|
||||
|
||||
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
|
||||
|
||||
# Reference for server/channel
|
||||
my $tagtarget = "$server->{tag}/$target";
|
||||
|
||||
# Empty current target nick if prefix option is enabled
|
||||
$saved_nicks{$tagtarget} = '' if ($enable_prefix);
|
||||
|
||||
}
|
||||
|
||||
# process public (me) actions
|
||||
sub sig_action_me {
|
||||
my ($server, $msg, $target) = @_;
|
||||
my $nick = $server->{nick};
|
||||
|
||||
my $enable_prefix = Irssi::settings_get_bool('nickcolor_enable_prefix');
|
||||
|
||||
# Reference for server/channel
|
||||
my $tagtarget = "$server->{tag}/$target";
|
||||
|
||||
# Empty current target nick if prefix option is enabled
|
||||
$saved_nicks{$tagtarget} = '' if ($enable_prefix);
|
||||
|
||||
}
|
||||
|
||||
sub cmd_color {
|
||||
my ($data, $server, $witem) = @_;
|
||||
my ($op, $nick, $color) = split " ", $data;
|
||||
|
||||
$op = lc $op;
|
||||
|
||||
if (!$op) {
|
||||
Irssi::print ("No operation given (save/set/clear/list/preview)");
|
||||
} elsif ($op eq "save") {
|
||||
save_colors;
|
||||
} elsif ($op eq "set") {
|
||||
if (!$nick) {
|
||||
Irssi::print ("Nick not given");
|
||||
} elsif (!$color) {
|
||||
Irssi::print ("Color not given");
|
||||
} elsif ($color < 2 || $color > 14) {
|
||||
Irssi::print ("Color must be between 2 and 14 inclusive");
|
||||
} else {
|
||||
$saved_colors{$nick} = $color;
|
||||
}
|
||||
} elsif ($op eq "clear") {
|
||||
if (!$nick) {
|
||||
Irssi::print ("Nick not given");
|
||||
} else {
|
||||
delete ($saved_colors{$nick});
|
||||
}
|
||||
} elsif ($op eq "list") {
|
||||
Irssi::print ("\nSaved Colors:");
|
||||
foreach my $nick (keys %saved_colors) {
|
||||
Irssi::print (chr (3) . sprintf("%02d", $saved_colors{$nick}) . "$nick" .
|
||||
chr (3) . "1 ($saved_colors{$nick})");
|
||||
}
|
||||
} elsif ($op eq "preview") {
|
||||
Irssi::print ("\nAvailable colors:");
|
||||
foreach my $i (2..14) {
|
||||
Irssi::print (chr (3) . "$i" . "Color #$i");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
load_colors;
|
||||
|
||||
Irssi::settings_add_str('misc', 'nickcolor_colors', '2 3 4 5 6 7 9 10 11 12 13');
|
||||
Irssi::settings_add_bool('misc', 'nickcolor_enable_prefix', 0);
|
||||
Irssi::settings_add_bool('misc', 'nickcolor_enable_truncate', 0);
|
||||
Irssi::settings_add_str('misc', 'nickcolor_prefix_text' => '- ');
|
||||
Irssi::settings_add_int('misc', 'nickcolor_truncate_value' => 0);
|
||||
Irssi::command_bind('color', 'cmd_color');
|
||||
|
||||
Irssi::signal_add('message public', 'sig_public');
|
||||
Irssi::signal_add('message own_public', 'sig_me');
|
||||
Irssi::signal_add('message irc action', 'sig_action_public');
|
||||
Irssi::signal_add('message irc own_action', 'sig_action_me');
|
||||
Irssi::signal_add('event nick', 'sig_nick');
|
||||
606
config/irssi/scripts/autorun/trackbar.pl
Normal file
606
config/irssi/scripts/autorun/trackbar.pl
Normal file
@@ -0,0 +1,606 @@
|
||||
## trackbar.pl
|
||||
#
|
||||
# This little script will do just one thing: it will draw a line each time you
|
||||
# switch away from a window. This way, you always know just upto where you've
|
||||
# been reading that window :) It also removes the previous drawn line, so you
|
||||
# don't see double lines.
|
||||
#
|
||||
# redraw trackbar only works on irssi 0.8.17 or higher.
|
||||
#
|
||||
##
|
||||
|
||||
## Usage:
|
||||
#
|
||||
# The script works right out of the box, but if you want you can change
|
||||
# the working by /set'ing the following variables:
|
||||
#
|
||||
# Setting: trackbar_style
|
||||
# Description: This setting will be the color of your trackbar line.
|
||||
# By default the value will be '%K', only Irssi color
|
||||
# formats are allowed. If you don't know the color formats
|
||||
# by heart, you can take a look at the formats documentation.
|
||||
# You will find the proper docs on http://www.irssi.org/docs.
|
||||
#
|
||||
# Setting: trackbar_string
|
||||
# Description: This is the string that your line will display. This can
|
||||
# be multiple characters or just one. For example: '~-~-'
|
||||
# The default setting is '-'.
|
||||
# Here are some unicode characters you can try:
|
||||
# "───" => U+2500 => a line
|
||||
# "═══" => U+2550 => a double line
|
||||
# "━━━" => U+2501 => a wide line
|
||||
# "▭ " => U+25ad => a white rectangle
|
||||
#
|
||||
# Setting: trackbar_use_status_window
|
||||
# Description: If this setting is set to OFF, Irssi won't print a trackbar
|
||||
# in the statuswindow
|
||||
#
|
||||
# Setting: trackbar_ignore_windows
|
||||
# Description: A list of windows where no trackbar should be printed
|
||||
#
|
||||
# Setting: trackbar_print_timestamp
|
||||
# Description: If this setting is set to ON, Irssi will print the formatted
|
||||
# timestamp in front of the trackbar.
|
||||
#
|
||||
# Setting: trackbar_require_seen
|
||||
# Description: Only clear the trackbar if it has been scrolled to.
|
||||
#
|
||||
# Setting: trackbar_all_manual
|
||||
# Description: Never clear the trackbar until you do /mark.
|
||||
#
|
||||
# /mark is a command that will redraw the line at the bottom.
|
||||
#
|
||||
# Command: /trackbar, /trackbar goto
|
||||
# Description: Jump to where the trackbar is, to pick up reading
|
||||
#
|
||||
# Command: /trackbar keep
|
||||
# Description: Keep this window's trackbar where it is the next time
|
||||
# you switch windows (then this flag is cleared again)
|
||||
#
|
||||
# Command: /mark, /trackbar mark
|
||||
# Description: Remove the old trackbar and mark the bottom of this
|
||||
# window with a new trackbar
|
||||
#
|
||||
# Command: /trackbar markvisible
|
||||
# Description: Like mark for all visible windows
|
||||
#
|
||||
# Command: /trackbar markall
|
||||
# Description: Like mark for all windows
|
||||
#
|
||||
# Command: /trackbar remove
|
||||
# Description: Remove this window's trackbar
|
||||
#
|
||||
# Command: /trackbar removeall
|
||||
# Description: Remove all windows' trackbars
|
||||
#
|
||||
# Command: /trackbar redraw
|
||||
# Description: Force redraw of trackbars
|
||||
#
|
||||
##
|
||||
|
||||
##
|
||||
#
|
||||
# For bugreports and other improvements contact one of the authors.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this script; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
##
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use vars qw($VERSION %IRSSI);
|
||||
|
||||
$VERSION = "2.9"; # a4c78e85092a271
|
||||
|
||||
%IRSSI = (
|
||||
authors => "Peter 'kinlo' Leurs, Uwe Dudenhoeffer, " .
|
||||
"Michiel Holtkamp, Nico R. Wohlgemuth, " .
|
||||
"Geert Hauwaerts",
|
||||
contact => 'peter@pfoe.be',
|
||||
patchers => 'Johan Kiviniemi (UTF-8), Uwe Dudenhoeffer (on-upgrade-remove-line)',
|
||||
name => 'trackbar',
|
||||
description => 'Shows a bar where you have last read a window.',
|
||||
license => 'GNU General Public License',
|
||||
url => 'http://www.pfoe.be/~peter/trackbar/',
|
||||
commands => 'trackbar',
|
||||
);
|
||||
|
||||
## Comments and remarks.
|
||||
#
|
||||
# This script uses settings.
|
||||
# Use /SET to change the value or /TOGGLE to switch it on or off.
|
||||
#
|
||||
#
|
||||
# Tip: The command 'trackbar' is very useful if you bind that to a key,
|
||||
# so you can easily jump to the trackbar. Please see 'help bind' for
|
||||
# more information about keybindings in Irssi.
|
||||
#
|
||||
# Command: /BIND meta2-P key F1
|
||||
# /BIND F1 command trackbar
|
||||
#
|
||||
##
|
||||
|
||||
## Bugfixes and new items in this rewrite.
|
||||
#
|
||||
# * Remove all the trackbars before upgrading.
|
||||
# * New setting trackbar_use_status_window to control the statuswindow trackbar.
|
||||
# * New setting trackbar_print_timestamp to print a timestamp or not.
|
||||
# * New command 'trackbar' to scroll up to the trackbar.
|
||||
# * When resizing your terminal, Irssi will update all the trackbars to the new size.
|
||||
# * When changing trackbar settings, change all the trackbars to the new settings.
|
||||
# * New command 'trackbar mark' to draw a new trackbar (The old '/mark').
|
||||
# * New command 'trackbar markall' to draw a new trackbar in each window.
|
||||
# * New command 'trackbar remove' to remove the trackbar from the current window.
|
||||
# * New command 'trackbar removeall' to remove all the trackbars.
|
||||
# * Don't draw a trackbar in empty windows.
|
||||
# * Added a version check to prevent Irssi redraw errors.
|
||||
# * Fixed a bookmark NULL versus 0 bug.
|
||||
# * Fixed a remove-line bug in Uwe Dudenhoeffer his patch.
|
||||
# * New command 'help trackbar' to display the trackbar commands.
|
||||
# * Fixed an Irssi startup bug, now processing each auto-created window.
|
||||
#
|
||||
##
|
||||
|
||||
## Known bugs and the todolist.
|
||||
#
|
||||
# Todo: * Instead of drawing a line, invert the line.
|
||||
#
|
||||
##
|
||||
|
||||
## Authors:
|
||||
#
|
||||
# - Main maintainer & author: Peter 'kinlo' Leurs
|
||||
# - Many thanks to Timo 'cras' Sirainen for placing me on my way
|
||||
# - on-upgrade-remove-line patch by Uwe Dudenhoeffer
|
||||
# - trackbar resizing by Michiel Holtkamp (02 Jul 2012)
|
||||
# - scroll to trackbar, window excludes, and timestamp options by Nico R.
|
||||
# Wohlgemuth (22 Sep 2012)
|
||||
#
|
||||
##
|
||||
|
||||
## Version history:
|
||||
#
|
||||
# 2.9: - fix crash on /mark in empty window
|
||||
# 2.8: - fix /^join bug
|
||||
# 2.7: - add /set trackbar_all_manual option
|
||||
# 2.5: - merge back on scripts.irssi.org
|
||||
# - fix /trackbar redraw broken in 2.4
|
||||
# - fix legacy encodings
|
||||
# - add workaround for irssi issue #271
|
||||
# 2.4: - add support for horizontal splits
|
||||
# 2.3: - add some features for seen tracking using other scripts
|
||||
# 2.0: - big rewrite based on 1.4
|
||||
# * removed /tb, you can have it with /alias tb trackbar if you want
|
||||
# * subcommand and settings changes:
|
||||
# /trackbar vmark => /trackbar markvisible
|
||||
# /trackbar scroll => /trackbar goto (or just /trackbar)
|
||||
# /trackbar help => /help trackbar
|
||||
# /set trackbar_hide_windows => /set trackbar_ignore_windows
|
||||
# /set trackbar_timestamp => /set trackbar_print_timestamp
|
||||
# * magic line strings were removed, just paste the unicode you want!
|
||||
# * trackbar_timestamp_styled is not currently supported
|
||||
# 1.9: - add version guard
|
||||
# 1.8: - sub draw_bar
|
||||
# 1.7: - Added /tb scroll, trackbar_hide_windows, trackbar_timestamp_timestamp
|
||||
# and trackbar_timestamp_styled
|
||||
# 1.6: - Work around Irssi resize bug, please do /upgrade! (see below)
|
||||
# 1.5: - Resize trackbars in all windows when terminal is resized
|
||||
# 1.4: - Changed our's by my's so the irssi script header is valid
|
||||
# - Removed utf-8 support. In theory, the script should work w/o any
|
||||
# problems for utf-8, just set trackbar_string to a valid utf-8 character
|
||||
# and everything *should* work. However, this script is being plagued by
|
||||
# irssi internal bugs. The function Irssi::settings_get_str does NOT handle
|
||||
# unicode strings properly, hence you will notice problems when setting the bar
|
||||
# to a unicode char. For changing your bar to utf-8 symbols, read the line sub.
|
||||
# 1.3: - Upgrade now removes the trackbars.
|
||||
# - Some code cleanups, other defaults
|
||||
# - /mark sets the line to the bottom
|
||||
# 1.2: - Support for utf-8
|
||||
# - How the bar looks can now be configured with trackbar_string
|
||||
# and trackbar_style
|
||||
# 1.1: - Fixed bug when closing window
|
||||
# 1.0: - Initial release
|
||||
#
|
||||
##
|
||||
|
||||
use Irssi;
|
||||
use Irssi::TextUI;
|
||||
use Encode;
|
||||
|
||||
use POSIX qw(strftime);
|
||||
|
||||
sub cmd_help {
|
||||
my ($args) = @_;
|
||||
if ($args =~ /^trackbar *$/i) {
|
||||
print CLIENTCRAP <<HELP
|
||||
%9Syntax:%9
|
||||
|
||||
TRACKBAR
|
||||
TRACKBAR GOTO
|
||||
TRACKBAR KEEP
|
||||
TRACKBAR MARK
|
||||
TRACKBAR MARKVISIBLE
|
||||
TRACKBAR MARKALL
|
||||
TRACKBAR REMOVE
|
||||
TRACKBAR REMOVEALL
|
||||
TRACKBAR REDRAW
|
||||
|
||||
%9Parameters:%9
|
||||
|
||||
GOTO: Jump to where the trackbar is, to pick up reading
|
||||
KEEP: Keep this window's trackbar where it is the next time
|
||||
you switch windows (then this flag is cleared again)
|
||||
MARK: Remove the old trackbar and mark the bottom of this
|
||||
window with a new trackbar
|
||||
MARKVISIBLE: Like mark for all visible windows
|
||||
MARKALL: Like mark for all windows
|
||||
REMOVE: Remove this window's trackbar
|
||||
REMOVEALL: Remove all windows' trackbars
|
||||
REDRAW: Force redraw of trackbars
|
||||
|
||||
%9Description:%9
|
||||
|
||||
Manage a trackbar. Without arguments, it will scroll up to the trackbar.
|
||||
|
||||
%9Examples:%9
|
||||
|
||||
/TRACKBAR MARK
|
||||
/TRACKBAR REMOVE
|
||||
HELP
|
||||
}
|
||||
}
|
||||
|
||||
Irssi::theme_register([
|
||||
'trackbar_loaded', '%R>>%n %_Scriptinfo:%_ Loaded $0 version $1 by $2.',
|
||||
'trackbar_wrong_version', '%R>>%n %_Trackbar:%_ Please upgrade your client to 0.8.17 or above if you would like to use this feature of trackbar.',
|
||||
'trackbar_all_removed', '%R>>%n %_Trackbar:%_ All the trackbars have been removed.',
|
||||
'trackbar_not_found', '%R>>%n %_Trackbar:%_ No trackbar found in this window.',
|
||||
]);
|
||||
|
||||
my $old_irssi = Irssi::version < 20140701;
|
||||
sub check_version {
|
||||
if ($old_irssi) {
|
||||
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_wrong_version');
|
||||
return;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
sub is_utf8 {
|
||||
lc Irssi::settings_get_str('term_charset') eq 'utf-8'
|
||||
}
|
||||
|
||||
my (%config, %keep_trackbar, %unseen_trackbar);
|
||||
|
||||
sub remove_one_trackbar {
|
||||
my $win = shift;
|
||||
my $view = shift || $win->view;
|
||||
my $line = $view->get_bookmark('trackbar');
|
||||
if (defined $line) {
|
||||
my $bottom = $view->{bottom};
|
||||
$view->remove_line($line);
|
||||
$win->command('^scrollback end') if $bottom && !$win->view->{bottom};
|
||||
$view->redraw;
|
||||
}
|
||||
}
|
||||
|
||||
sub add_one_trackbar_pt1 {
|
||||
my $win = shift;
|
||||
my $view = shift || $win->view;
|
||||
|
||||
my $last_cur_line = ($view->{buffer}{cur_line}||+{})->{_irssi};
|
||||
$win->print(line($win->{width}), MSGLEVEL_NEVER);
|
||||
|
||||
my $cur_line = ($win->view->{buffer}{cur_line}||+{})->{_irssi}; # get a fresh buffer
|
||||
|
||||
($last_cur_line//'') ne ($cur_line//'') # printing was successful
|
||||
}
|
||||
|
||||
sub add_one_trackbar_pt2 {
|
||||
my $win = shift;
|
||||
my $view = $win->view;
|
||||
|
||||
$view->set_bookmark_bottom('trackbar');
|
||||
$unseen_trackbar{ $win->{_irssi} } = 1;
|
||||
Irssi::signal_emit("window trackbar added", $win);
|
||||
$view->redraw;
|
||||
}
|
||||
|
||||
sub update_one_trackbar {
|
||||
my $win = shift;
|
||||
my $view = shift || $win->view;
|
||||
my $force = shift;
|
||||
my $ignored = win_ignored($win, $view);
|
||||
my $success;
|
||||
|
||||
$success = add_one_trackbar_pt1($win, $view) ? 1 : 0
|
||||
if $force || !$ignored;
|
||||
|
||||
remove_one_trackbar($win, $view)
|
||||
if ( $success || !defined $success ) && ( $force || !defined $force || !$ignored );
|
||||
|
||||
add_one_trackbar_pt2($win)
|
||||
if $success;
|
||||
}
|
||||
|
||||
sub win_ignored {
|
||||
my $win = shift;
|
||||
my $view = shift || $win->view;
|
||||
return 1 unless $view->{buffer}{lines_count};
|
||||
return 1 if $win->{name} eq '(status)' && !$config{use_status_window};
|
||||
no warnings 'uninitialized';
|
||||
return 1 if grep { $win->{name} eq $_ || $win->{refnum} eq $_
|
||||
|| $win->get_active_name eq $_ } @{ $config{ignore_windows} };
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub sig_window_changed {
|
||||
my ($newwindow, $oldwindow) = @_;
|
||||
return unless $oldwindow;
|
||||
redraw_one_trackbar($newwindow) unless $old_irssi;
|
||||
trackbar_update_seen($newwindow);
|
||||
return if delete $keep_trackbar{ $oldwindow->{_irssi} };
|
||||
trackbar_update_seen($oldwindow);
|
||||
return if $config{require_seen} && $unseen_trackbar{ $oldwindow->{_irssi } };
|
||||
return if $config{all_manual};
|
||||
update_one_trackbar($oldwindow, undef, 0);
|
||||
}
|
||||
|
||||
sub trackbar_update_seen {
|
||||
my $win = shift;
|
||||
return unless $win;
|
||||
return unless $unseen_trackbar{ $win->{_irssi} };
|
||||
|
||||
my $view = $win->view;
|
||||
my $line = $view->get_bookmark('trackbar');
|
||||
unless ($line) {
|
||||
delete $unseen_trackbar{ $win->{_irssi} };
|
||||
Irssi::signal_emit("window trackbar seen", $win);
|
||||
return;
|
||||
}
|
||||
my $startline = $view->{startline};
|
||||
return unless $startline;
|
||||
|
||||
if ($startline->{info}{time} < $line->{info}{time}
|
||||
|| $startline->{_irssi} == $line->{_irssi}) {
|
||||
delete $unseen_trackbar{ $win->{_irssi} };
|
||||
Irssi::signal_emit("window trackbar seen", $win);
|
||||
}
|
||||
}
|
||||
|
||||
sub screen_length;
|
||||
{ local $@;
|
||||
eval { require Text::CharWidth; };
|
||||
unless ($@) {
|
||||
*screen_length = sub { Text::CharWidth::mbswidth($_[0]) };
|
||||
}
|
||||
else {
|
||||
*screen_length = sub {
|
||||
my $temp = shift;
|
||||
Encode::_utf8_on($temp) if is_utf8();
|
||||
length($temp)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
{ my %strip_table = (
|
||||
(map { $_ => '' } (split //, '04261537' . 'kbgcrmyw' . 'KBGCRMYW' . 'U9_8I:|FnN>#[' . 'pP')),
|
||||
(map { $_ => $_ } (split //, '{}%')),
|
||||
);
|
||||
sub c_length {
|
||||
my $o = Irssi::strip_codes($_[0]);
|
||||
$o =~ s/(%(%|Z.{6}|z.{6}|X..|x..|.))/exists $strip_table{$2} ? $strip_table{$2} :
|
||||
$2 =~ m{x(?:0[a-f]|[1-6][0-9a-z]|7[a-x])|z[0-9a-f]{6}}i ? '' : $1/gex;
|
||||
screen_length($o)
|
||||
}
|
||||
}
|
||||
|
||||
sub line {
|
||||
my ($width, $time) = @_;
|
||||
my $string = $config{string};
|
||||
$string = ' ' unless length $string;
|
||||
$time ||= time;
|
||||
|
||||
Encode::_utf8_on($string) if is_utf8();
|
||||
my $length = c_length($string);
|
||||
|
||||
my $format = '';
|
||||
if ($config{print_timestamp}) {
|
||||
$format = $config{timestamp_str};
|
||||
$format =~ y/%/\01/;
|
||||
$format =~ s/\01\01/%/g;
|
||||
$format = strftime($format, localtime $time);
|
||||
$format =~ y/\01/%/;
|
||||
}
|
||||
|
||||
my $times = $width / $length;
|
||||
$times += 1 if $times != int $times;
|
||||
my $style = "$config{style}";
|
||||
Encode::_utf8_on($style) if is_utf8();
|
||||
$format .= $style;
|
||||
$width -= c_length($format);
|
||||
$string x= $times;
|
||||
chop $string while length $string && c_length($string) > $width;
|
||||
return $format . $string;
|
||||
}
|
||||
|
||||
sub remove_all_trackbars {
|
||||
for my $window (Irssi::windows) {
|
||||
next unless ref $window;
|
||||
remove_one_trackbar($window);
|
||||
}
|
||||
}
|
||||
|
||||
sub UNLOAD {
|
||||
remove_all_trackbars();
|
||||
}
|
||||
|
||||
sub redraw_one_trackbar {
|
||||
my $win = shift;
|
||||
my $view = $win->view;
|
||||
my $line = $view->get_bookmark('trackbar');
|
||||
return unless $line;
|
||||
my $bottom = $view->{bottom};
|
||||
$win->print_after($line, MSGLEVEL_NEVER, line($win->{width}, $line->{info}{time}),
|
||||
$line->{info}{time});
|
||||
$view->set_bookmark('trackbar', $win->last_line_insert);
|
||||
$view->remove_line($line);
|
||||
$win->command('^scrollback end') if $bottom && !$win->view->{bottom};
|
||||
$view->redraw;
|
||||
}
|
||||
|
||||
sub redraw_trackbars {
|
||||
return unless check_version();
|
||||
for my $win (Irssi::windows) {
|
||||
next unless ref $win;
|
||||
redraw_one_trackbar($win);
|
||||
}
|
||||
}
|
||||
|
||||
sub goto_trackbar {
|
||||
my $win = Irssi::active_win;
|
||||
my $line = $win->view->get_bookmark('trackbar');
|
||||
|
||||
if ($line) {
|
||||
$win->command("scrollback goto ". strftime("%d %H:%M:%S", localtime($line->{info}{time})));
|
||||
} else {
|
||||
$win->printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_not_found');
|
||||
}
|
||||
}
|
||||
|
||||
sub cmd_mark {
|
||||
update_one_trackbar(Irssi::active_win, undef, 1);
|
||||
}
|
||||
|
||||
sub cmd_markall {
|
||||
for my $window (Irssi::windows) {
|
||||
next unless ref $window;
|
||||
update_one_trackbar($window);
|
||||
}
|
||||
}
|
||||
|
||||
sub signal_stop {
|
||||
Irssi::signal_stop;
|
||||
}
|
||||
|
||||
sub cmd_markvisible {
|
||||
my @wins = Irssi::windows;
|
||||
my $awin =
|
||||
my $bwin = Irssi::active_win;
|
||||
my $awin_counter = 0;
|
||||
Irssi::signal_add_priority('window changed' => 'signal_stop', -99);
|
||||
do {
|
||||
Irssi::active_win->command('window up');
|
||||
$awin = Irssi::active_win;
|
||||
update_one_trackbar($awin);
|
||||
++$awin_counter;
|
||||
} until ($awin->{refnum} == $bwin->{refnum} || $awin_counter >= @wins);
|
||||
Irssi::signal_remove('window changed' => 'signal_stop');
|
||||
}
|
||||
|
||||
sub cmd_trackbar_remove_one {
|
||||
remove_one_trackbar(Irssi::active_win);
|
||||
}
|
||||
|
||||
sub cmd_remove_all_trackbars {
|
||||
remove_all_trackbars();
|
||||
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_all_removed');
|
||||
}
|
||||
|
||||
sub cmd_keep_once {
|
||||
$keep_trackbar{ Irssi::active_win->{_irssi} } = 1;
|
||||
}
|
||||
|
||||
sub trackbar_runsub {
|
||||
my ($data, $server, $item) = @_;
|
||||
$data =~ s/\s+$//g;
|
||||
|
||||
if ($data) {
|
||||
Irssi::command_runsub('trackbar', $data, $server, $item);
|
||||
} else {
|
||||
goto_trackbar();
|
||||
}
|
||||
}
|
||||
|
||||
sub update_config {
|
||||
my $was_status_window = $config{use_status_window};
|
||||
$config{style} = Irssi::settings_get_str('trackbar_style');
|
||||
$config{string} = Irssi::settings_get_str('trackbar_string');
|
||||
$config{require_seen} = Irssi::settings_get_bool('trackbar_require_seen');
|
||||
$config{all_manual} = Irssi::settings_get_bool('trackbar_all_manual');
|
||||
$config{ignore_windows} = [ split /[,\s]+/, Irssi::settings_get_str('trackbar_ignore_windows') ];
|
||||
$config{use_status_window} = Irssi::settings_get_bool('trackbar_use_status_window');
|
||||
$config{print_timestamp} = Irssi::settings_get_bool('trackbar_print_timestamp');
|
||||
if (defined $was_status_window && $was_status_window != $config{use_status_window}) {
|
||||
if (my $swin = Irssi::window_find_name('(status)')) {
|
||||
if ($config{use_status_window}) {
|
||||
update_one_trackbar($swin);
|
||||
}
|
||||
else {
|
||||
remove_one_trackbar($swin);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($config{print_timestamp}) {
|
||||
my $ts_format = Irssi::settings_get_str('timestamp_format');
|
||||
my $ts_theme = Irssi::current_theme->get_format('fe-common/core', 'timestamp');
|
||||
my $render_str = Irssi::current_theme->format_expand($ts_theme);
|
||||
(my $ts_escaped = $ts_format) =~ s/([%\$])/$1$1/g;
|
||||
$render_str =~ s/(?|\$(.)(?!\w)|\$\{(\w+)\})/$1 eq 'Z' ? $ts_escaped : $1/ge;
|
||||
$config{timestamp_str} = $render_str;
|
||||
}
|
||||
redraw_trackbars() unless $old_irssi;
|
||||
}
|
||||
|
||||
Irssi::settings_add_str('trackbar', 'trackbar_string', is_utf8() ? "\x{2500}" : '-');
|
||||
Irssi::settings_add_str('trackbar', 'trackbar_style', '%K');
|
||||
Irssi::settings_add_str('trackbar', 'trackbar_ignore_windows', '');
|
||||
Irssi::settings_add_bool('trackbar', 'trackbar_use_status_window', 1);
|
||||
Irssi::settings_add_bool('trackbar', 'trackbar_print_timestamp', 0);
|
||||
Irssi::settings_add_bool('trackbar', 'trackbar_require_seen', 0);
|
||||
Irssi::settings_add_bool('trackbar', 'trackbar_all_manual', 0);
|
||||
|
||||
update_config();
|
||||
|
||||
Irssi::signal_add_last( 'mainwindow resized' => 'redraw_trackbars')
|
||||
unless $old_irssi;
|
||||
|
||||
Irssi::signal_register({'window trackbar added' => [qw/Irssi::UI::Window/]});
|
||||
Irssi::signal_register({'window trackbar seen' => [qw/Irssi::UI::Window/]});
|
||||
Irssi::signal_register({'gui page scrolled' => [qw/Irssi::UI::Window/]});
|
||||
Irssi::signal_add_last('gui page scrolled' => 'trackbar_update_seen');
|
||||
|
||||
Irssi::signal_add('setup changed' => 'update_config');
|
||||
Irssi::signal_add_priority('session save' => 'remove_all_trackbars', Irssi::SIGNAL_PRIORITY_HIGH-1);
|
||||
|
||||
Irssi::signal_add('window changed' => 'sig_window_changed');
|
||||
|
||||
Irssi::command_bind('trackbar goto' => 'goto_trackbar');
|
||||
Irssi::command_bind('trackbar keep' => 'cmd_keep_once');
|
||||
Irssi::command_bind('trackbar mark' => 'cmd_mark');
|
||||
Irssi::command_bind('trackbar markvisible' => 'cmd_markvisible');
|
||||
Irssi::command_bind('trackbar markall' => 'cmd_markall');
|
||||
Irssi::command_bind('trackbar remove' => 'cmd_trackbar_remove_one');
|
||||
Irssi::command_bind('trackbar removeall' => 'cmd_remove_all_trackbars');
|
||||
Irssi::command_bind('trackbar redraw' => 'redraw_trackbars');
|
||||
Irssi::command_bind('trackbar' => 'trackbar_runsub');
|
||||
Irssi::command_bind('mark' => 'cmd_mark');
|
||||
Irssi::command_bind_last('help' => 'cmd_help');
|
||||
|
||||
Irssi::printformat(MSGLEVEL_CLIENTCRAP, 'trackbar_loaded', $IRSSI{name}, $VERSION, $IRSSI{authors});
|
||||
|
||||
# workaround for issue #271
|
||||
{ package Irssi::Nick }
|
||||
171
config/irssi/scripts/autorun/usercount.pl
Normal file
171
config/irssi/scripts/autorun/usercount.pl
Normal file
@@ -0,0 +1,171 @@
|
||||
use Irssi 20020101.0250 ();
|
||||
$VERSION = "1.16";
|
||||
%IRSSI = (
|
||||
authors => 'David Leadbeater, Timo Sirainen, Georg Lukas',
|
||||
contact => 'dgl@dgl.cx, tss@iki.fi, georg@boerde.de',
|
||||
name => 'usercount',
|
||||
description => 'Adds a usercount for a channel as a statusbar item',
|
||||
license => 'GNU GPLv2 or later',
|
||||
url => 'http://irssi.dgl.yi.org/',
|
||||
);
|
||||
|
||||
# Once you have loaded this script run the following command:
|
||||
# /statusbar window add usercount
|
||||
# You can also add -alignment left|right option
|
||||
|
||||
# /set usercount_show_zero on or off to show users when 0 users of that type
|
||||
# /set usercount_show_ircops (default off)
|
||||
# /set usercount_show_halfops (default on)
|
||||
|
||||
# you can customize the look of this item from theme file:
|
||||
# sb_usercount = "{sb %_$0%_ nicks ($1-)}";
|
||||
# sb_uc_ircops = "%_*%_$*";
|
||||
# sb_uc_ops = "%_@%_$*";
|
||||
# sb_uc_halfops = "%_%%%_$*";
|
||||
# sb_uc_voices = "%_+%_$*";
|
||||
# sb_uc_normal = "$*";
|
||||
# sb_uc_space = " ";
|
||||
|
||||
|
||||
use strict;
|
||||
use Irssi::TextUI;
|
||||
|
||||
my ($ircops, $ops, $halfops, $voices, $normal, $total);
|
||||
my ($timeout_tag, $recalc);
|
||||
|
||||
# Called to make the status bar item
|
||||
sub usercount {
|
||||
my ($item, $get_size_only) = @_;
|
||||
my $wi = !Irssi::active_win() ? undef : Irssi::active_win()->{active};
|
||||
|
||||
if(!ref $wi || $wi->{type} ne "CHANNEL") { # only works on channels
|
||||
return unless ref $item;
|
||||
$item->{min_size} = $item->{max_size} = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if ($recalc) {
|
||||
$recalc = 0;
|
||||
calc_users($wi);
|
||||
}
|
||||
|
||||
my $theme = Irssi::current_theme();
|
||||
my $format = $theme->format_expand("{sb_usercount}");
|
||||
if ($format) {
|
||||
# use theme-specific look
|
||||
my $ircopstr = $theme->format_expand("{sb_uc_ircops $ircops}",
|
||||
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
|
||||
my $opstr = $theme->format_expand("{sb_uc_ops $ops}",
|
||||
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
|
||||
my $halfopstr = $theme->format_expand("{sb_uc_halfops $halfops}",
|
||||
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
|
||||
my $voicestr = $theme->format_expand("{sb_uc_voices $voices}",
|
||||
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
|
||||
my $normalstr = $theme->format_expand("{sb_uc_normal $normal}",
|
||||
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
|
||||
my $space = $theme->format_expand('{sb_uc_space}',
|
||||
Irssi::EXPAND_FLAG_IGNORE_EMPTY);
|
||||
$space = " " unless $space;
|
||||
|
||||
my $str = "";
|
||||
$str .= $ircopstr.$space if defined $ircops;
|
||||
$str .= $opstr.$space if defined $ops;
|
||||
$str .= $halfopstr.$space if defined $halfops;
|
||||
$str .= $voicestr.$space if defined $voices;
|
||||
$str .= $normalstr.$space if defined $normal;
|
||||
$str =~ s/\Q$space\E$//;
|
||||
|
||||
$format = $theme->format_expand("{sb_usercount $total $str}",
|
||||
Irssi::EXPAND_FLAG_IGNORE_REPLACES);
|
||||
} else {
|
||||
# use the default look
|
||||
$format = "{sb \%_$total\%_ nicks \%c(\%n";
|
||||
$format .= '*'.$ircops.' ' if (defined $ircops);
|
||||
$format .= '@'.$ops.' ' if (defined $ops);
|
||||
$format .= '%%'.$halfops.' ' if (defined $halfops);
|
||||
$format .= "+$voices " if (defined $voices);
|
||||
$format .= "$normal " if (defined $normal);
|
||||
$format =~ s/ $//;
|
||||
$format .= "\%c)}";
|
||||
}
|
||||
|
||||
$item->default_handler($get_size_only, $format, undef, 1);
|
||||
}
|
||||
|
||||
sub calc_users() {
|
||||
my $channel = shift;
|
||||
my $server = $channel->{server};
|
||||
|
||||
$ircops = $ops = $halfops = $voices = $normal = 0;
|
||||
for ($channel->nicks()) {
|
||||
if ($_->{serverop}) {
|
||||
$ircops++;
|
||||
}
|
||||
|
||||
if ($_->{op}) {
|
||||
$ops++;
|
||||
} elsif ($_->{halfop}) {
|
||||
$halfops++;
|
||||
} elsif ($_->{voice}) {
|
||||
$voices++;
|
||||
} else {
|
||||
$normal++;
|
||||
}
|
||||
}
|
||||
|
||||
$total = $ops+$halfops+$voices+$normal;
|
||||
if (!Irssi::settings_get_bool('usercount_show_zero')) {
|
||||
$ircops = undef if ($ircops == 0);
|
||||
$ops = undef if ($ops == 0);
|
||||
$halfops = undef if ($halfops == 0);
|
||||
$voices = undef if ($voices == 0);
|
||||
$normal = undef if ($normal == 0);
|
||||
}
|
||||
$halfops = undef unless Irssi::settings_get_bool('usercount_show_halfops');
|
||||
$ircops = undef unless Irssi::settings_get_bool('usercount_show_ircops');
|
||||
}
|
||||
|
||||
sub refresh {
|
||||
if ($timeout_tag > 0) {
|
||||
Irssi::timeout_remove($timeout_tag);
|
||||
$timeout_tag = 0;
|
||||
}
|
||||
Irssi::statusbar_items_redraw('usercount');
|
||||
}
|
||||
|
||||
sub refresh_check {
|
||||
my $channel = shift;
|
||||
my $wi = ref Irssi::active_win() ? Irssi::active_win()->{active} : 0;
|
||||
|
||||
return unless ref $wi && ref $channel;
|
||||
return if $wi->{name} ne $channel->{name};
|
||||
return if $wi->{server}->{tag} ne $channel->{server}->{tag};
|
||||
|
||||
# don't refresh immediately, or we'll end up refreshing
|
||||
# a lot around netsplits
|
||||
$recalc = 1;
|
||||
Irssi::timeout_remove($timeout_tag) if ($timeout_tag > 0);
|
||||
$timeout_tag = Irssi::timeout_add(500, 'refresh', undef);
|
||||
}
|
||||
|
||||
sub refresh_recalc {
|
||||
$recalc = 1;
|
||||
refresh();
|
||||
}
|
||||
|
||||
$recalc = 1;
|
||||
$timeout_tag = 0;
|
||||
|
||||
Irssi::settings_add_bool('usercount', 'usercount_show_zero', 1);
|
||||
Irssi::settings_add_bool('usercount', 'usercount_show_ircops', 0);
|
||||
Irssi::settings_add_bool('usercount', 'usercount_show_halfops', 1);
|
||||
|
||||
Irssi::statusbar_item_register('usercount', undef, 'usercount');
|
||||
Irssi::statusbars_recreate_items();
|
||||
|
||||
Irssi::signal_add_last('nicklist new', 'refresh_check');
|
||||
Irssi::signal_add_last('nicklist remove', 'refresh_check');
|
||||
Irssi::signal_add_last('nick mode changed', 'refresh_check');
|
||||
Irssi::signal_add_last('setup changed', 'refresh_recalc');
|
||||
Irssi::signal_add_last('window changed', 'refresh_recalc');
|
||||
Irssi::signal_add_last('window item changed', 'refresh_recalc');
|
||||
@@ -1,417 +1,410 @@
|
||||
{
|
||||
"Badge Text" : "",
|
||||
"Working Directory" : "\/Users\/ivuorinen\/Code",
|
||||
"Prompt Before Closing 2" : false,
|
||||
"Selected Text Color" : {
|
||||
"Red Component" : 0.80392156862745101,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.95686274509803926,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.83921568627450982
|
||||
"Badge Text": "",
|
||||
"Working Directory": "/Users/ivuorinen/Code",
|
||||
"Prompt Before Closing 2": false,
|
||||
"Selected Text Color": {
|
||||
"Red Component": 0.80392156862745101,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.95686274509803926,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.83921568627450982
|
||||
},
|
||||
"Rows" : 25,
|
||||
"Ansi 11 Color" : {
|
||||
"Red Component" : 0.97647058823529409,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.68627450980392157,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.88627450980392153
|
||||
"Rows": 25,
|
||||
"Ansi 11 Color": {
|
||||
"Red Component": 0.97647058823529409,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.68627450980392157,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.88627450980392153
|
||||
},
|
||||
"Use Italic Font" : true,
|
||||
"Foreground Color" : {
|
||||
"Red Component" : 0.80392156862745101,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.95686274509803926,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.83921568627450982
|
||||
"Use Italic Font": true,
|
||||
"Foreground Color": {
|
||||
"Red Component": 0.80392156862745101,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.95686274509803926,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.83921568627450982
|
||||
},
|
||||
"Right Option Key Sends" : 0,
|
||||
"Character Encoding" : 4,
|
||||
"Selection Color" : {
|
||||
"Red Component" : 0.34509803921568627,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.4392156862745098,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.35686274509803922
|
||||
"Right Option Key Sends": 0,
|
||||
"Character Encoding": 4,
|
||||
"Selection Color": {
|
||||
"Red Component": 0.34509803921568627,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.4392156862745098,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.35686274509803922
|
||||
},
|
||||
"Blend" : 0.24709154211956524,
|
||||
"Mouse Reporting" : true,
|
||||
"Cursor Boost" : 0,
|
||||
"Ansi 4 Color" : {
|
||||
"Red Component" : 0.53725490196078429,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.98039215686274506,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.70588235294117652
|
||||
"Blend": 0.24709154211956524,
|
||||
"Mouse Reporting": true,
|
||||
"Cursor Boost": 0,
|
||||
"Ansi 4 Color": {
|
||||
"Red Component": 0.53725490196078429,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.98039215686274506,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.70588235294117652
|
||||
},
|
||||
"Non-ASCII Anti Aliased" : true,
|
||||
"Sync Title" : false,
|
||||
"Badge Font" : "JetBrainsMonoNerdFontCompleteM-Bold",
|
||||
"Disable Window Resizing" : true,
|
||||
"Description" : "Default",
|
||||
"Close Sessions On End" : true,
|
||||
"Jobs to Ignore" : [
|
||||
"rlogin",
|
||||
"ssh",
|
||||
"slogin",
|
||||
"telnet"
|
||||
],
|
||||
"Scrollback Lines" : 0,
|
||||
"Draw Powerline Glyphs" : true,
|
||||
"Flashing Bell" : true,
|
||||
"Cursor Guide Color" : {
|
||||
"Red Component" : 0.80392156862745101,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.95686274509803926,
|
||||
"Alpha Component" : 0.070000000000000007,
|
||||
"Green Component" : 0.83921568627450982
|
||||
"Non-ASCII Anti Aliased": true,
|
||||
"Sync Title": false,
|
||||
"Badge Font": "JetBrainsMonoNerdFontCompleteM-Bold",
|
||||
"Disable Window Resizing": true,
|
||||
"Description": "Default",
|
||||
"Close Sessions On End": true,
|
||||
"Jobs to Ignore": ["rlogin", "ssh", "slogin", "telnet"],
|
||||
"Scrollback Lines": 0,
|
||||
"Draw Powerline Glyphs": true,
|
||||
"Flashing Bell": true,
|
||||
"Cursor Guide Color": {
|
||||
"Red Component": 0.80392156862745101,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.95686274509803926,
|
||||
"Alpha Component": 0.070000000000000007,
|
||||
"Green Component": 0.83921568627450982
|
||||
},
|
||||
"BM Growl" : true,
|
||||
"Ansi 3 Color" : {
|
||||
"Red Component" : 0.97647058823529409,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.68627450980392157,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.88627450980392153
|
||||
"BM Growl": true,
|
||||
"Ansi 3 Color": {
|
||||
"Red Component": 0.97647058823529409,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.68627450980392157,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.88627450980392153
|
||||
},
|
||||
"Icon" : 1,
|
||||
"Use Non-ASCII Font" : false,
|
||||
"Link Color" : {
|
||||
"Red Component" : 0.53725490196078429,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.92156862745098034,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.86274509803921573
|
||||
"Icon": 1,
|
||||
"Use Non-ASCII Font": false,
|
||||
"Link Color": {
|
||||
"Red Component": 0.53725490196078429,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.92156862745098034,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.86274509803921573
|
||||
},
|
||||
"Shortcut" : "",
|
||||
"Background Image Location" : "",
|
||||
"Bold Color" : {
|
||||
"Red Component" : 0.80392156862745101,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.95686274509803926,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.83921568627450982
|
||||
"Shortcut": "",
|
||||
"Background Image Location": "",
|
||||
"Bold Color": {
|
||||
"Red Component": 0.80392156862745101,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.95686274509803926,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.83921568627450982
|
||||
},
|
||||
"Use Cursor Guide" : false,
|
||||
"Unlimited Scrollback" : true,
|
||||
"Custom Command" : "No",
|
||||
"Title Components" : 512,
|
||||
"Keyboard Map" : {
|
||||
"0xf700-0x260000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;6A"
|
||||
"Use Cursor Guide": false,
|
||||
"Unlimited Scrollback": true,
|
||||
"Custom Command": "No",
|
||||
"Title Components": 512,
|
||||
"Keyboard Map": {
|
||||
"0xf700-0x260000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;6A"
|
||||
},
|
||||
"0x37-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1f"
|
||||
"0x37-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1f"
|
||||
},
|
||||
"0x32-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x00"
|
||||
"0x32-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x00"
|
||||
},
|
||||
"0xf709-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[17;2~"
|
||||
"0xf709-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[17;2~"
|
||||
},
|
||||
"0xf70c-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[20;2~"
|
||||
"0xf70c-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[20;2~"
|
||||
},
|
||||
"0xf729-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2H"
|
||||
"0xf729-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2H"
|
||||
},
|
||||
"0xf72b-0x40000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;5F"
|
||||
"0xf72b-0x40000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;5F"
|
||||
},
|
||||
"0xf705-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2Q"
|
||||
"0xf705-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2Q"
|
||||
},
|
||||
"0xf703-0x260000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;6C"
|
||||
"0xf703-0x260000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;6C"
|
||||
},
|
||||
"0xf700-0x220000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2A"
|
||||
"0xf700-0x220000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2A"
|
||||
},
|
||||
"0xf701-0x280000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1b 0x1b 0x5b 0x42"
|
||||
"0xf701-0x280000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1b 0x1b 0x5b 0x42"
|
||||
},
|
||||
"0x38-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x7f"
|
||||
"0x38-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x7f"
|
||||
},
|
||||
"0x33-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1b"
|
||||
"0x33-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1b"
|
||||
},
|
||||
"0xf703-0x220000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2C"
|
||||
"0xf703-0x220000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2C"
|
||||
},
|
||||
"0xf701-0x240000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;5B"
|
||||
"0xf701-0x240000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;5B"
|
||||
},
|
||||
"0xf70d-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[21;2~"
|
||||
"0xf70d-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[21;2~"
|
||||
},
|
||||
"0xf702-0x260000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;6D"
|
||||
"0xf702-0x260000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;6D"
|
||||
},
|
||||
"0xf729-0x40000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;5H"
|
||||
"0xf729-0x40000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;5H"
|
||||
},
|
||||
"0xf706-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2R"
|
||||
"0xf706-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2R"
|
||||
},
|
||||
"0x34-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1c"
|
||||
"0x34-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1c"
|
||||
},
|
||||
"0xf700-0x280000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1b 0x1b 0x5b 0x41"
|
||||
"0xf700-0x280000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1b 0x1b 0x5b 0x41"
|
||||
},
|
||||
"0x2d-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1f"
|
||||
"0x2d-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1f"
|
||||
},
|
||||
"0xf70e-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[23;2~"
|
||||
"0xf70e-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[23;2~"
|
||||
},
|
||||
"0xf702-0x220000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2D"
|
||||
"0xf702-0x220000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2D"
|
||||
},
|
||||
"0xf703-0x280000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1b 0x1b 0x5b 0x43"
|
||||
"0xf703-0x280000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1b 0x1b 0x5b 0x43"
|
||||
},
|
||||
"0xf700-0x240000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;5A"
|
||||
"0xf700-0x240000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;5A"
|
||||
},
|
||||
"0xf707-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2S"
|
||||
"0xf707-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2S"
|
||||
},
|
||||
"0xf70a-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[18;2~"
|
||||
"0xf70a-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[18;2~"
|
||||
},
|
||||
"0x35-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1d"
|
||||
"0x35-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1d"
|
||||
},
|
||||
"0xf70f-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[24;2~"
|
||||
"0xf70f-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[24;2~"
|
||||
},
|
||||
"0xf703-0x240000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;5C"
|
||||
"0xf703-0x240000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;5C"
|
||||
},
|
||||
"0xf701-0x260000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;6B"
|
||||
"0xf701-0x260000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;6B"
|
||||
},
|
||||
"0xf702-0x280000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1b 0x1b 0x5b 0x44"
|
||||
"0xf702-0x280000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1b 0x1b 0x5b 0x44"
|
||||
},
|
||||
"0xf72b-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2F"
|
||||
"0xf72b-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2F"
|
||||
},
|
||||
"0x36-0x40000" : {
|
||||
"Action" : 11,
|
||||
"Text" : "0x1e"
|
||||
"0x36-0x40000": {
|
||||
"Action": 11,
|
||||
"Text": "0x1e"
|
||||
},
|
||||
"0xf708-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[15;2~"
|
||||
"0xf708-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[15;2~"
|
||||
},
|
||||
"0xf701-0x220000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2B"
|
||||
"0xf701-0x220000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2B"
|
||||
},
|
||||
"0xf70b-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[19;2~"
|
||||
"0xf70b-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[19;2~"
|
||||
},
|
||||
"0xf702-0x240000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;5D"
|
||||
"0xf702-0x240000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;5D"
|
||||
},
|
||||
"0xf704-0x20000" : {
|
||||
"Action" : 10,
|
||||
"Text" : "[1;2P"
|
||||
"0xf704-0x20000": {
|
||||
"Action": 10,
|
||||
"Text": "[1;2P"
|
||||
}
|
||||
},
|
||||
"Ansi 14 Color" : {
|
||||
"Red Component" : 0.58039215686274515,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.83529411764705885,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.88627450980392153
|
||||
"Ansi 14 Color": {
|
||||
"Red Component": 0.58039215686274515,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.83529411764705885,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.88627450980392153
|
||||
},
|
||||
"Ansi 2 Color" : {
|
||||
"Red Component" : 0.65098039215686276,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.63137254901960782,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.8901960784313725
|
||||
"Ansi 2 Color": {
|
||||
"Red Component": 0.65098039215686276,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.63137254901960782,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.8901960784313725
|
||||
},
|
||||
"Send Code When Idle" : false,
|
||||
"ASCII Anti Aliased" : true,
|
||||
"Tags" : [
|
||||
|
||||
],
|
||||
"Ansi 9 Color" : {
|
||||
"Red Component" : 0.95294117647058818,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.6588235294117647,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.54509803921568623
|
||||
"Send Code When Idle": false,
|
||||
"ASCII Anti Aliased": true,
|
||||
"Tags": [],
|
||||
"Ansi 9 Color": {
|
||||
"Red Component": 0.95294117647058818,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.6588235294117647,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.54509803921568623
|
||||
},
|
||||
"Badge Right Margin" : 10,
|
||||
"Use Bold Font" : true,
|
||||
"Silence Bell" : false,
|
||||
"Ansi 12 Color" : {
|
||||
"Red Component" : 0.53725490196078429,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.98039215686274506,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.70588235294117652
|
||||
"Badge Right Margin": 10,
|
||||
"Use Bold Font": true,
|
||||
"Silence Bell": false,
|
||||
"Ansi 12 Color": {
|
||||
"Red Component": 0.53725490196078429,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.98039215686274506,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.70588235294117652
|
||||
},
|
||||
"Window Type" : 0,
|
||||
"Use Bright Bold" : true,
|
||||
"Cursor Text Color" : {
|
||||
"Red Component" : 0.80392156862745101,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.95686274509803926,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.83921568627450982
|
||||
"Window Type": 0,
|
||||
"Use Bright Bold": true,
|
||||
"Cursor Text Color": {
|
||||
"Red Component": 0.80392156862745101,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.95686274509803926,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.83921568627450982
|
||||
},
|
||||
"Default Bookmark" : "No",
|
||||
"Cursor Color" : {
|
||||
"Red Component" : 0.96078431372549022,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.86274509803921573,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.8784313725490196
|
||||
"Default Bookmark": "No",
|
||||
"Cursor Color": {
|
||||
"Red Component": 0.96078431372549022,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.86274509803921573,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.8784313725490196
|
||||
},
|
||||
"Ansi 1 Color" : {
|
||||
"Red Component" : 0.95294117647058818,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.6588235294117647,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.54509803921568623
|
||||
"Ansi 1 Color": {
|
||||
"Red Component": 0.95294117647058818,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.6588235294117647,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.54509803921568623
|
||||
},
|
||||
"Name" : "Default",
|
||||
"Blinking Cursor" : false,
|
||||
"Guid" : "82636119-EA17-4A26-9AA7-408172F4A9C8",
|
||||
"Badge Max Width" : 0.45000000000000001,
|
||||
"Idle Code" : 0,
|
||||
"Ansi 10 Color" : {
|
||||
"Red Component" : 0.65098039215686276,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.63137254901960782,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.8901960784313725
|
||||
"Name": "Default",
|
||||
"Blinking Cursor": false,
|
||||
"Guid": "82636119-EA17-4A26-9AA7-408172F4A9C8",
|
||||
"Badge Max Width": 0.45000000000000001,
|
||||
"Idle Code": 0,
|
||||
"Ansi 10 Color": {
|
||||
"Red Component": 0.65098039215686276,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.63137254901960782,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.8901960784313725
|
||||
},
|
||||
"Ansi 8 Color" : {
|
||||
"Red Component" : 0.34509803921568627,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.4392156862745098,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.35686274509803922
|
||||
"Ansi 8 Color": {
|
||||
"Red Component": 0.34509803921568627,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.4392156862745098,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.35686274509803922
|
||||
},
|
||||
"Badge Color" : {
|
||||
"Red Component" : 1,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0,
|
||||
"Alpha Component" : 0.5,
|
||||
"Green Component" : 0.14910030364990234
|
||||
"Badge Color": {
|
||||
"Red Component": 1,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0,
|
||||
"Alpha Component": 0.5,
|
||||
"Green Component": 0.14910030364990234
|
||||
},
|
||||
"Smart Cursor Color" : true,
|
||||
"Ambiguous Double Width" : false,
|
||||
"Blur Radius" : 9.5927277260638313,
|
||||
"Badge Max Height" : 0.10000000000000001,
|
||||
"Ansi 0 Color" : {
|
||||
"Red Component" : 0.27058823529411763,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.35294117647058826,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.27843137254901962
|
||||
"Smart Cursor Color": true,
|
||||
"Ambiguous Double Width": false,
|
||||
"Blur Radius": 9.5927277260638313,
|
||||
"Badge Max Height": 0.10000000000000001,
|
||||
"Ansi 0 Color": {
|
||||
"Red Component": 0.27058823529411763,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.35294117647058826,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.27843137254901962
|
||||
},
|
||||
"Blur" : true,
|
||||
"Normal Font" : "JetBrainsMonoNerdFontCompleteM-Light 15",
|
||||
"Vertical Spacing" : 1,
|
||||
"Ansi 7 Color" : {
|
||||
"Red Component" : 0.72941176470588232,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.87058823529411766,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.76078431372549016
|
||||
"Blur": true,
|
||||
"Normal Font": "JetBrainsMonoNerdFontCompleteM-Light 15",
|
||||
"Vertical Spacing": 1,
|
||||
"Ansi 7 Color": {
|
||||
"Red Component": 0.72941176470588232,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.87058823529411766,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.76078431372549016
|
||||
},
|
||||
"Command" : "",
|
||||
"Terminal Type" : "xterm-256color",
|
||||
"Horizontal Spacing" : 1,
|
||||
"Option Key Sends" : 0,
|
||||
"Only The Default BG Color Uses Transparency" : true,
|
||||
"Minimum Contrast" : 0.14973958333333334,
|
||||
"Ansi 15 Color" : {
|
||||
"Red Component" : 0.65098039215686276,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.78431372549019607,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.67843137254901964
|
||||
"Command": "",
|
||||
"Terminal Type": "xterm-256color",
|
||||
"Horizontal Spacing": 1,
|
||||
"Option Key Sends": 0,
|
||||
"Only The Default BG Color Uses Transparency": true,
|
||||
"Minimum Contrast": 0.14973958333333334,
|
||||
"Ansi 15 Color": {
|
||||
"Red Component": 0.65098039215686276,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.78431372549019607,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.67843137254901964
|
||||
},
|
||||
"Ansi 6 Color" : {
|
||||
"Red Component" : 0.58039215686274515,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.83529411764705885,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.88627450980392153
|
||||
"Ansi 6 Color": {
|
||||
"Red Component": 0.58039215686274515,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.83529411764705885,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.88627450980392153
|
||||
},
|
||||
"Badge Top Margin" : 10,
|
||||
"Transparency" : 0.10293218085106381,
|
||||
"Background Color" : {
|
||||
"Red Component" : 0.11764705882352941,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.1803921568627451,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.11764705882352941
|
||||
"Badge Top Margin": 10,
|
||||
"Transparency": 0.10293218085106381,
|
||||
"Background Color": {
|
||||
"Red Component": 0.11764705882352941,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.1803921568627451,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.11764705882352941
|
||||
},
|
||||
"Screen" : -2,
|
||||
"Non Ascii Font" : "Monaco 12",
|
||||
"Ansi 13 Color" : {
|
||||
"Red Component" : 0.96078431372549022,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.90588235294117647,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.76078431372549016
|
||||
"Screen": -2,
|
||||
"Non Ascii Font": "Monaco 12",
|
||||
"Ansi 13 Color": {
|
||||
"Red Component": 0.96078431372549022,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.90588235294117647,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.76078431372549016
|
||||
},
|
||||
"Columns" : 120,
|
||||
"Visual Bell" : true,
|
||||
"ASCII Ligatures" : false,
|
||||
"Ansi 5 Color" : {
|
||||
"Red Component" : 0.96078431372549022,
|
||||
"Color Space" : "sRGB",
|
||||
"Blue Component" : 0.90588235294117647,
|
||||
"Alpha Component" : 1,
|
||||
"Green Component" : 0.76078431372549016
|
||||
"Columns": 120,
|
||||
"Visual Bell": true,
|
||||
"ASCII Ligatures": false,
|
||||
"Ansi 5 Color": {
|
||||
"Red Component": 0.96078431372549022,
|
||||
"Color Space": "sRGB",
|
||||
"Blue Component": 0.90588235294117647,
|
||||
"Alpha Component": 1,
|
||||
"Green Component": 0.76078431372549016
|
||||
},
|
||||
"Custom Directory" : "Yes"
|
||||
}
|
||||
"Custom Directory": "Yes"
|
||||
}
|
||||
|
||||
9
config/nvim/.gitignore
vendored
9
config/nvim/.gitignore
vendored
@@ -1 +1,8 @@
|
||||
session.vim
|
||||
tt.*
|
||||
.tests
|
||||
doc/tags
|
||||
debug
|
||||
.repro
|
||||
foo.*
|
||||
*.log
|
||||
data
|
||||
|
||||
3
config/nvim/.luarc.json
Normal file
3
config/nvim/.luarc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"diagnostics.globals": ["vim"]
|
||||
}
|
||||
15
config/nvim/.neoconf.json
Normal file
15
config/nvim/.neoconf.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"neodev": {
|
||||
"library": {
|
||||
"enabled": true,
|
||||
"plugins": true
|
||||
}
|
||||
},
|
||||
"neoconf": {
|
||||
"plugins": {
|
||||
"lua_ls": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
column_width = 160
|
||||
line_endings = "Unix"
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
quote_style = "AutoPreferDouble"
|
||||
call_parentheses = "Always"
|
||||
collapse_simple_statement = "Always"
|
||||
|
||||
[sort_requires]
|
||||
enabled = true
|
||||
4
config/nvim/README.md
Normal file
4
config/nvim/README.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# 💤 LazyVim
|
||||
|
||||
A starter template for [LazyVim](https://github.com/LazyVim/LazyVim).
|
||||
Refer to the [documentation](https://lazyvim.github.io/installation) to get started.
|
||||
@@ -1 +0,0 @@
|
||||
vim.api.nvim_command("set formatoptions-=cro")
|
||||
@@ -1,31 +1,2 @@
|
||||
-- luacheck: globals vim
|
||||
local key = vim.api.nvim_set_keymap
|
||||
local remap = { noremap = true, silent = true }
|
||||
|
||||
-- Set with normal Vim opts, 'Space' as mapleader
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
-- Set 'Space' as <NOP> key to leadermap key
|
||||
key("n", "<Space>", "<NOP>", remap)
|
||||
|
||||
-- Global, windows options of neovim:
|
||||
require("options")
|
||||
|
||||
-- Filetype specialties.
|
||||
require("filetype")
|
||||
|
||||
-- To adminstrate packages:
|
||||
require("plugin-manager")
|
||||
|
||||
-- LSP for editing.
|
||||
require("lsp")
|
||||
|
||||
-- Autocmd commands from Vimscript
|
||||
require("autocmd")
|
||||
|
||||
-- Personal Keymaps of neovim:
|
||||
require("keymappings")
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
-- bootstrap lazy.nvim, LazyVim and your plugins
|
||||
require("config.lazy")
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
{
|
||||
"barbecue.nvim": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
|
||||
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
|
||||
"catppuccin": { "branch": "main", "commit": "a937d546f4783a1ff67f84043d2d7871ad4ecd83" },
|
||||
"close-buffers.nvim": { "branch": "master", "commit": "3acbcad1211572342632a6c0151f839e7dead27f" },
|
||||
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
|
||||
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "983f1a216cca1a079399ba050bc4b9ce130de83a" },
|
||||
"harpoon": { "branch": "master", "commit": "21f4c47c6803d64ddb934a5b314dcb1b8e7365dc" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "2a9354c7d2368d78cbd5575a51a2af5bd8a6ad01" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "dfdd771b792fbb4bad8e057d72558255695aa1a7" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "6148b51db945b55b3b725da39eaea6441e59dff8" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ee6a7f179ebf8aa9da9d53b1cf1b57d292ea0182" },
|
||||
"mini.nvim": { "branch": "main", "commit": "707dca4f4152c2d9c9b4c5e02635f78dfd33db50" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "dcd34653b0f1d3e7ea9aeb3e37dc7c8da445c4fe" },
|
||||
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
|
||||
"nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" },
|
||||
"nvim-dap": { "branch": "master", "commit": "0e6b7c47dd70e80793ed39271b2aa712d9366dbc" },
|
||||
"nvim-dap-go": { "branch": "main", "commit": "1b508e9db330108d3b5d62a6d9cc01fe6bbdd4e0" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "0517d8522dcec286b1dba47aa3ee1ed8f523aed6" },
|
||||
"nvim-navic": { "branch": "master", "commit": "9c89730da6a05acfeb6a197e212dfadf5aa60ca0" },
|
||||
"nvim-notify": { "branch": "master", "commit": "ea9c8ce7a37f2238f934e087c255758659948e0f" },
|
||||
"nvim-regexplainer": { "branch": "main", "commit": "4250c8f3c1307876384e70eeedde5149249e154f" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "dfcfdb0e7bcb362c4de1ed7d0015c21957c91ba7" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "b6c763db8cc486215ba96e0a67418848a710ab25" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "bc11ee2498de2310de5776477dd9dce65d03b464" },
|
||||
"nvim-window-picker": { "branch": "main", "commit": "1b1bb834b0acb9eebb11a61664efc665757f1ba2" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "a56bf0071bf63d35274fdc4738bb1e8821cfd2ea" },
|
||||
"popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" },
|
||||
"refactoring.nvim": { "branch": "master", "commit": "2ec9bc0fb5f3c8c6a0f776f0159dd2a3b1663554" },
|
||||
"restoreview": { "branch": "main", "commit": "03d00d59a9ba640db6b44192ed0fcc9d7261dcd2" },
|
||||
"schemastore.nvim": { "branch": "main", "commit": "b6e498b2e34af832311472a07d4d5e349e2e7c62" },
|
||||
"smartcolumn.nvim": { "branch": "main", "commit": "d01b99355c7fab13233f48d0f28dc097e68a03f7" },
|
||||
"stickybuf.nvim": { "branch": "master", "commit": "4c667bc837e5e3fec5a8857ee99f1a229fc76df9" },
|
||||
"symbols-outline.nvim": { "branch": "master", "commit": "512791925d57a61c545bc303356e8a8f7869763c" },
|
||||
"tabnine": { "branch": "master", "commit": "dcca6d2f9e8bbcde36aab87b9b87890810e4056d" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "ad7b637c72549713b9aaed7c4f9c79c62bcbdff0" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "18f10f28007cb8b4d50324217349c3f568684be2" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "b90a1381e9b5b8596f49070ee86c71db267ac868" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
|
||||
"twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" },
|
||||
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
|
||||
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
|
||||
}
|
||||
28
config/nvim/lazyvim.json
Normal file
28
config/nvim/lazyvim.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"extras": [
|
||||
"lazyvim.plugins.extras.coding.copilot",
|
||||
"lazyvim.plugins.extras.editor.aerial",
|
||||
"lazyvim.plugins.extras.editor.leap",
|
||||
"lazyvim.plugins.extras.editor.symbols-outline",
|
||||
"lazyvim.plugins.extras.formatting.black",
|
||||
"lazyvim.plugins.extras.formatting.prettier",
|
||||
"lazyvim.plugins.extras.lang.docker",
|
||||
"lazyvim.plugins.extras.lang.go",
|
||||
"lazyvim.plugins.extras.lang.json",
|
||||
"lazyvim.plugins.extras.lang.markdown",
|
||||
"lazyvim.plugins.extras.lang.python",
|
||||
"lazyvim.plugins.extras.lang.tailwind",
|
||||
"lazyvim.plugins.extras.lang.terraform",
|
||||
"lazyvim.plugins.extras.lang.typescript",
|
||||
"lazyvim.plugins.extras.lang.yaml",
|
||||
"lazyvim.plugins.extras.linting.eslint",
|
||||
"lazyvim.plugins.extras.ui.edgy",
|
||||
"lazyvim.plugins.extras.ui.mini-animate",
|
||||
"lazyvim.plugins.extras.util.dot",
|
||||
"lazyvim.plugins.extras.vscode"
|
||||
],
|
||||
"news": {
|
||||
"NEWS.md": "2123"
|
||||
},
|
||||
"version": 2
|
||||
}
|
||||
@@ -1,146 +0,0 @@
|
||||
local vim = vim
|
||||
local api = vim.api
|
||||
local M = {}
|
||||
|
||||
--- function to create a list of commands and convert them to autocommands
|
||||
--- This function is taken from https://github.com/norcalli/nvim_utils
|
||||
function M.nvim_create_augroups(definitions)
|
||||
for group_name, definition in pairs(definitions) do
|
||||
api.nvim_command("augroup " .. group_name)
|
||||
api.nvim_command("autocmd!")
|
||||
for _, def in ipairs(definition) do
|
||||
local command = table.concat(vim.tbl_flatten({ "autocmd", def }), " ")
|
||||
api.nvim_command(command)
|
||||
end
|
||||
api.nvim_command("augroup END")
|
||||
end
|
||||
end
|
||||
|
||||
local autoCommands = {
|
||||
-- To save the current session (may be restored later).
|
||||
-- autocmd! VimLeavePre * :mks! ~/.config/nvim/session.vim
|
||||
save_session = {
|
||||
{ "VimLeavePre", "*", ":mks! ~/.local/state/nvim/session.vim" },
|
||||
},
|
||||
-- other autocommands
|
||||
open_folds = {
|
||||
{ "BufReadPost,FileReadPost", "*", "normal zR<cr>" },
|
||||
},
|
||||
}
|
||||
|
||||
M.nvim_create_augroups(autoCommands)
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"help",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"neo-tree",
|
||||
"Trouble",
|
||||
"lazy",
|
||||
"mason",
|
||||
"notify",
|
||||
"toggleterm",
|
||||
"lazyterm",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.b[event.buf].miniindentscope_disable = true
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ taken from LazyVim repository │
|
||||
-- ╭─────────────────────────────────────────────────────────────────────────────╮
|
||||
-- │ https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua│
|
||||
-- ╰─────────────────────────────────────────────────────────────────────────────╯
|
||||
|
||||
local function augroup(name)
|
||||
return vim.api.nvim_create_augroup("ivuorinen_" .. name, { clear = true })
|
||||
end
|
||||
-- Check if we need to reload the file when it changed
|
||||
vim.api.nvim_create_autocmd({ "FocusGained", "TermClose", "TermLeave" }, {
|
||||
group = augroup("checktime"),
|
||||
command = "checktime",
|
||||
})
|
||||
|
||||
-- Highlight on yank
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
group = augroup("highlight_yank"),
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
})
|
||||
|
||||
-- resize splits if window got resized
|
||||
vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||
group = augroup("resize_splits"),
|
||||
callback = function()
|
||||
local current_tab = vim.fn.tabpagenr()
|
||||
vim.cmd("tabdo wincmd =")
|
||||
vim.cmd("tabnext " .. current_tab)
|
||||
end,
|
||||
})
|
||||
|
||||
-- go to last loc when opening a buffer
|
||||
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||
group = augroup("last_loc"),
|
||||
callback = function()
|
||||
local exclude = { "gitcommit" }
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
if vim.tbl_contains(exclude, vim.bo[buf].filetype) then
|
||||
return
|
||||
end
|
||||
local mark = vim.api.nvim_buf_get_mark(buf, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(buf)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- close some filetypes with <q>
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("close_with_q"),
|
||||
pattern = {
|
||||
"PlenaryTestPopup",
|
||||
"help",
|
||||
"lspinfo",
|
||||
"man",
|
||||
"notify",
|
||||
"qf",
|
||||
"spectre_panel",
|
||||
"startuptime",
|
||||
"tsplayground",
|
||||
"neotest-output",
|
||||
"checkhealth",
|
||||
"neotest-summary",
|
||||
"neotest-output-panel",
|
||||
},
|
||||
callback = function(event)
|
||||
vim.bo[event.buf].buflisted = false
|
||||
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
|
||||
end,
|
||||
})
|
||||
|
||||
-- wrap and check for spell in text filetypes
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = augroup("wrap_spell"),
|
||||
pattern = { "gitcommit", "markdown" },
|
||||
callback = function()
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.spell = true
|
||||
end,
|
||||
})
|
||||
|
||||
-- Auto create dir when saving a file, in case some intermediate directory does not exist
|
||||
vim.api.nvim_create_autocmd({ "BufWritePre" }, {
|
||||
group = augroup("auto_create_dir"),
|
||||
callback = function(event)
|
||||
if event.match:match("^%w%w+://") then
|
||||
return
|
||||
end
|
||||
local file = vim.loop.fs_realpath(event.match) or event.match
|
||||
vim.fn.mkdir(vim.fn.fnamemodify(file, ":p:h"), "p")
|
||||
end,
|
||||
})
|
||||
3
config/nvim/lua/config/autocmds.lua
Normal file
3
config/nvim/lua/config/autocmds.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
-- Autocmds are automatically loaded on the VeryLazy event
|
||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||
-- Add any additional autocmds here
|
||||
19
config/nvim/lua/config/keymaps.lua
Normal file
19
config/nvim/lua/config/keymaps.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Keymaps are automatically loaded on the VeryLazy event
|
||||
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
|
||||
-- Add any additional keymaps here
|
||||
|
||||
local keymap = vim.keymap.set
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Comment box │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
local cb = require("comment-box")
|
||||
|
||||
-- left aligned fixed size box with left aligned text
|
||||
keymap({ "n", "v" }, "<Leader>bcb", cb.lbox, { desc = "Comment: Left aligned" })
|
||||
-- centered adapted box with centered text
|
||||
keymap({ "n", "v" }, "<Leader>bcc", cb.ccbox, { desc = "Comment: Centered" })
|
||||
|
||||
-- centered line
|
||||
keymap("n", "<Leader>bcl", cb.cline, { desc = "Comment: Centered line" })
|
||||
keymap("i", "<M-l>", cb.cline, { desc = "Comment: Centered line" })
|
||||
56
config/nvim/lua/config/lazy.lua
Normal file
56
config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,56 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
-- bootstrap lazy.nvim
|
||||
-- stylua: ignore
|
||||
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
|
||||
end
|
||||
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- add LazyVim and import its plugins
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
import = "lazyvim.plugins",
|
||||
},
|
||||
{
|
||||
"folke/tokyonight.nvim",
|
||||
opts = {
|
||||
style = "night",
|
||||
transparent = true,
|
||||
sidebars = { "qf", "vista_kind", "terminal", "packer" },
|
||||
styles = {
|
||||
sidebars = "transparent",
|
||||
floats = "transparent",
|
||||
},
|
||||
},
|
||||
},
|
||||
{ import = "plugins" },
|
||||
},
|
||||
defaults = {
|
||||
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
|
||||
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
|
||||
lazy = false,
|
||||
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
|
||||
-- have outdated releases, which may break your Neovim install.
|
||||
version = false, -- always use the latest git commit
|
||||
-- version = "*", -- try installing the latest stable version for plugins that support semver
|
||||
},
|
||||
install = { colorscheme = { "tokyonight" } },
|
||||
checker = { enabled = true }, -- automatically check for plugin updates
|
||||
performance = {
|
||||
rtp = {
|
||||
-- disable some rtp plugins
|
||||
disabled_plugins = {
|
||||
"gzip",
|
||||
-- "matchit",
|
||||
-- "matchparen",
|
||||
-- "netrwPlugin",
|
||||
"tarPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
"zipPlugin",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
13
config/nvim/lua/config/options.lua
Normal file
13
config/nvim/lua/config/options.lua
Normal file
@@ -0,0 +1,13 @@
|
||||
-- Options are automatically loaded before lazy.nvim startup
|
||||
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
|
||||
-- Add any additional options here
|
||||
|
||||
local opt = vim.opt
|
||||
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.modeline = true
|
||||
vim.g.root_spec = { "lsp", { ".git", "lua" }, "cwd" }
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
@@ -1,77 +0,0 @@
|
||||
-- To be used anywhere.
|
||||
local function job(command) vim.api.nvim_command("call jobstart('" .. command .. "')") end
|
||||
|
||||
local function format()
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
pattern = "<buffer>",
|
||||
callback = function() vim.lsp.buf.format() end,
|
||||
})
|
||||
end
|
||||
|
||||
local function yaml_ft(path, bufnr)
|
||||
-- get content of buffer as string
|
||||
local content = vim.filetype.getlines(bufnr)
|
||||
if type(content) == "table" then content = table.concat(content, "\n") end
|
||||
|
||||
-- check if file is in roles, tasks, or handlers folder
|
||||
local path_regex = vim.regex("(tasks\\|roles\\|handlers)/")
|
||||
if path_regex and path_regex:match_str(path) then return "yaml.ansible" end
|
||||
-- check for known ansible playbook text and if found, return yaml.ansible
|
||||
local regex = vim.regex("hosts:\\|tasks:")
|
||||
if regex and regex:match_str(content) then return "yaml.ansible" end
|
||||
|
||||
-- return yaml if nothing else
|
||||
return "yaml"
|
||||
end
|
||||
|
||||
-- In init.lua or filetype.nvim's config file
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
|
||||
h = function()
|
||||
-- Use a lazy heuristic that #including a C++ header means it's a
|
||||
-- C++ header
|
||||
if vim.fn.search("\\C^#include <[^>.]\\+>$", "nw") == 1 then return "cpp" end
|
||||
return "c"
|
||||
end,
|
||||
|
||||
-- Spelling fix.
|
||||
md = function() vim.api.nvim_command("setlocal spell!") end,
|
||||
|
||||
yml = yaml_ft,
|
||||
yaml = yaml_ft,
|
||||
|
||||
--
|
||||
csv = "csv",
|
||||
cl = "opencl",
|
||||
env = "env",
|
||||
sh = "zsh",
|
||||
--
|
||||
},
|
||||
pattern = {
|
||||
|
||||
-- Go to root configuration of some projects.
|
||||
-- [".*config/nvim/.*"] = function() vim.api.nvim_command "cd ~/.config/nvim/" end,
|
||||
|
||||
---- Typescript Projects
|
||||
[".*/src/.*ts"] = function() format() end,
|
||||
[".*/src/.*json"] = function() format() end,
|
||||
[".*/src/.*scss"] = function() format() end,
|
||||
[".*/src/.*html"] = function() format() end,
|
||||
|
||||
--[".*Code/ivuorinen/[project]/src/.*ts"] = function()
|
||||
-- vim.api.nvim_command('cd ~/Code/ivuorinen/[project]/')
|
||||
-- build('ts index')
|
||||
--end,
|
||||
},
|
||||
|
||||
filename = {
|
||||
-- For eslint_d configuration file.
|
||||
[".eslintrc"] = "jsonc",
|
||||
|
||||
-- For Typescript projects.
|
||||
["tsconfig.json"] = "json5",
|
||||
|
||||
[".ignore"] = "gitignore",
|
||||
},
|
||||
})
|
||||
@@ -1,222 +0,0 @@
|
||||
--[[
|
||||
Keymappings for nvim experience.
|
||||
|
||||
I use combination of both nvim default vim.api.nvim_set_keymap
|
||||
and WhichKey register. Slowly migrating to the WhichKey system,
|
||||
and tweaking the groupings as I go.
|
||||
--]]
|
||||
-- luacheck: globals vim CAPABILITIES
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Register keybindings │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Register in all modes, prefix <leader> │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
b = {
|
||||
name = "+buffer",
|
||||
n = { "<cmd>tabnew<cr>", "[n]ew tab" },
|
||||
a = {
|
||||
name = "+annotate"
|
||||
-- defined in plugins/neogen.lua
|
||||
},
|
||||
c = {
|
||||
name = "+comments",
|
||||
b = {
|
||||
"<cmd>lua require('comment-box').lbox()<cr>",
|
||||
"Left aligned fixed size box with left aligned text",
|
||||
},
|
||||
c = {
|
||||
"<cmd>lua require('comment-box').ccbox()<cr>",
|
||||
desc = "Centered adapted box with centered text",
|
||||
},
|
||||
l = {
|
||||
"<cmd>lua require('comment-box').cline()<cr>",
|
||||
desc = "Centered line",
|
||||
},
|
||||
},
|
||||
d = {
|
||||
name = "+delete buffers",
|
||||
h = {
|
||||
"<CMD>lua require('close_buffers').delete({type = 'hidden'})<CR>",
|
||||
"Delete hidden buffers",
|
||||
},
|
||||
},
|
||||
t = { ":TabnineToggle<cr>", "Toggle TabNine" },
|
||||
},
|
||||
D = {
|
||||
name = "+Diagnostics (Trouble)",
|
||||
t = { ":TroubleToggle<CR>", "[D]iagnostics [t]oggle" },
|
||||
-- Quick navigation between diagonostics.
|
||||
f = { ":lua vim.diagnostic.open_float()<CR>", "[D]iagnostics: Open [f]loat" },
|
||||
n = { ":lua vim.diagnostic.goto_next()<CR>", "[D]iagnostics: [n]ext" },
|
||||
p = { ":lua vim.diagnostic.goto_prev()<CR>", "[D]iagnostics: [p]rev" },
|
||||
---
|
||||
x = { function() require("trouble").open() end, "Open Trouble" },
|
||||
w = { function() require("trouble").open("workspace_diagnostics") end, "Workspace diagnostics" },
|
||||
d = { function() require("trouble").open("document_diagnostics") end, "Document diagnostics" },
|
||||
q = { function() require("trouble").open("quickfix") end, "Quickfix" },
|
||||
l = { function() require("trouble").open("loclist") end, "Loclist" },
|
||||
r = { function() require("trouble").open("lsp_references") end, "LSP References" },
|
||||
},
|
||||
e = {
|
||||
function() vim.cmd("Neotree focus source=filesystem position=left") end,
|
||||
"Toggle the sidebar tree",
|
||||
},
|
||||
f = {
|
||||
name = "+find",
|
||||
-- Find recursively files across the root folder subfiles.
|
||||
f = { ':lua require("telescope.builtin").find_files()<cr>', "[f]ind [f]iles" },
|
||||
-- Find recursively a text across the root folder subfiles.
|
||||
g = { ':lua require("telescope.builtin").live_grep()<cr>', "[f]ind text with [g]rep" },
|
||||
},
|
||||
h = {
|
||||
name = "+harpoon",
|
||||
a = { "<cmd>lua require('harpoon.mark').add_file()<cr>", "[h]arpoon: [A]dd file" },
|
||||
r = { "<cmd>lua require('harpoon.mark').rm_file()<cr>", "[h]arpoon: [r]emove file" },
|
||||
m = { "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>", "[h]arpoon: harpoon [m]enu" },
|
||||
n = { "<cmd>lua require('harpoon.ui').nav_next()<cr>", "[h]arpoon: [n]ext file" },
|
||||
p = { "<cmd>lua require('harpoon.ui').nav_prev()<cr>", "[h]arpoon: [p]revious file" },
|
||||
["1"] = { "<cmd> lua require('harpoon.ui').nav_file(1)<cr>", "[h]arpoon: file 1" },
|
||||
["2"] = { "<cmd> lua require('harpoon.ui').nav_file(2)<cr>", "[h]arpoon: file 2" },
|
||||
["3"] = { "<cmd> lua require('harpoon.ui').nav_file(3)<cr>", "[h]arpoon: file 3" },
|
||||
},
|
||||
--- Remap debugging to "H" from LV default of "h"
|
||||
H = {
|
||||
name = "+help/Conceal/Treesitter",
|
||||
c = {
|
||||
name = "+conceal",
|
||||
h = { ":set conceallevel=1<cr>", "hide/conceal" },
|
||||
s = { ":set conceallevel=0<cr>", "show/unconceal" },
|
||||
},
|
||||
t = {
|
||||
name = "+treesitter",
|
||||
t = { vim.treesitter.inspect_tree, "show tree" },
|
||||
c = { ":=vim.treesitter.get_captures_at_cursor()<cr>", "show capture" },
|
||||
n = { ":=vim.treesitter.get_node():type()<cr>", "show node" },
|
||||
},
|
||||
},
|
||||
o = {
|
||||
g = {
|
||||
-- defined in plugins/gitsigns.lua
|
||||
name = "+git",
|
||||
b = {
|
||||
name = "+blame",
|
||||
},
|
||||
},
|
||||
},
|
||||
p = {
|
||||
name = "+plugins",
|
||||
i = { function() require("lazy").install() end, "plugins [i]nstall" },
|
||||
s = { function() require("lazy").home() end, "plugins [s]tatus" },
|
||||
S = { function() require("lazy").sync() end, "plugins [S]ync" },
|
||||
u = { function() require("lazy").check() end, "plugins Check [u]pdates" },
|
||||
U = { function() require("lazy").update() end, "plugins [U]pdate" },
|
||||
},
|
||||
q = {
|
||||
name = "+quit",
|
||||
q = { ":qa<cr>", "quit: [q]uit all" },
|
||||
f = { ":qa!<cr>", "quit: all with [f]orce" },
|
||||
},
|
||||
r = {
|
||||
-- defined in plugins/refactoring-nvim.lua
|
||||
name = "+refactor",
|
||||
},
|
||||
t = {
|
||||
name = "+telescope",
|
||||
-- Find recursively TODOs, NOTEs, FIXITs, ... across the root folder subfiles.
|
||||
t = { ":TodoTelescope<cr>", "[t]elescope: [t]odo" },
|
||||
},
|
||||
x = { ":Bdelete<CR>", "Close current buffer" },
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Normal mode, prefix <leader> │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
b = { name = "Buffer" },
|
||||
}, { mode = "n", prefix = "<leader>" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Insert mode, prefix <leader> │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
b = { name = "Buffer" },
|
||||
}, { mode = "i", prefix = "<leader>" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Insert mode, no prefix │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
["<C-s>"] = { "<cmd>w<cr>", "Save file" },
|
||||
["<C-Home>"] = { "<Home>", "Do just Home on CTRL + Home" },
|
||||
}, { mode = "i", prefix = "" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ All modes, no prefix │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
wk.register({
|
||||
["<C-s>"] = { "<cmd>w<cr>", "Save file" },
|
||||
["<C-End>"] = { "<End>", "Do just End on CTRL + End" },
|
||||
}, { prefix = "" })
|
||||
|
||||
--
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Other keymappings, still to move │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
local key = vim.api.nvim_set_keymap
|
||||
local remap = { noremap = true, silent = true }
|
||||
|
||||
-- Go to the next block.
|
||||
--key('n', '<C-Down>', 'g%', remap )
|
||||
|
||||
-- Loop through brackets blocks.
|
||||
--key('n', '<C-Up>', 'z%', remap )
|
||||
|
||||
-- Move lines normally like an IDE when line wraps
|
||||
key("i", "<Down>", [[v:count ? 'j' : '<c-o>gj']], { expr = true, noremap = true, silent = true })
|
||||
key("i", "<Up>", [[v:count ? 'k' : '<c-o>gk']], { expr = true, noremap = true, silent = true })
|
||||
key("n", "<Down>", [[v:count ? 'j' : 'gj']], { expr = true, noremap = true, silent = true })
|
||||
key("n", "<Up>", [[v:count ? 'k' : 'gk']], { expr = true, noremap = true, silent = true })
|
||||
|
||||
-- Move normaly bottom and up with C+Up and C+Down.
|
||||
key("i", "<C-Up>", "<C-o>gk", remap)
|
||||
key("i", "<C-Down>", "<C-o>gj", remap)
|
||||
key("n", "<C-Up>", "gk", remap)
|
||||
key("n", "<C-Down>", "gj", remap)
|
||||
|
||||
-- Set 'CTRL + z' as 'undo'
|
||||
key("i", "<C-z>", "<Esc>ui", remap)
|
||||
|
||||
-- Set 'CTRL + y' as 'redo'
|
||||
key("i", "<C-y>", "<Esc><C-r>", remap)
|
||||
|
||||
-- Set 'SHIFT + arrows' as 'select' like modern text-editor.
|
||||
key("n", "<S-Up>", "v<Up>", remap)
|
||||
key("n", "<S-Down>", "v<Down>", remap)
|
||||
key("n", "<S-Left>", "v<Left>", remap)
|
||||
key("n", "<S-Right>", "v<Right>", remap)
|
||||
key("v", "<S-Up>", "<Up>", remap)
|
||||
key("v", "<S-Down>", "<Down>", remap)
|
||||
key("v", "<S-Left>", "<Left>", remap)
|
||||
key("v", "<S-Right>", "<Right>", remap)
|
||||
key("i", "<S-Up>", "<Esc>v<Up>", remap)
|
||||
key("i", "<S-Down>", "<C-o>v<Down>", remap)
|
||||
key("i", "<S-Left>", "<Esc>v<Left>", remap)
|
||||
key("i", "<S-Right>", "<C-o>v<Right>", remap)
|
||||
|
||||
-- Indent the current visual selection.
|
||||
key("v", "<", "<gv", remap)
|
||||
key("v", ">", ">gv", remap)
|
||||
|
||||
-- Set 'Backspace' as 'delete selection' for the visual selection.
|
||||
key("v", "<BS>", '"_di', remap)
|
||||
@@ -1,199 +0,0 @@
|
||||
-- Completion for snippets.
|
||||
-- luacheck: globals vim CAPABILITIES
|
||||
local vim = vim
|
||||
CAPABILITIES = vim.lsp.protocol.make_client_capabilities()
|
||||
CAPABILITIES.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- [[ Configure LSP ]]
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(_, bufnr)
|
||||
local nmap = function(keys, func, desc)
|
||||
if desc then desc = "LSP: " .. desc end
|
||||
|
||||
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.register({
|
||||
l = {
|
||||
name = "LSP",
|
||||
n = { vim.lsp.buf.rename, "Rename" },
|
||||
c = { vim.lsp.buf.code_action, "Code Action" },
|
||||
f = { "<cmd>Format", "Format current buffer with LSP" },
|
||||
D = { vim.lsp.buf.declaration, "[G]oto [D]eclaration" },
|
||||
w = {
|
||||
name = "[w]orkspace",
|
||||
a = { vim.lsp.buf.add_workspace_folder, "[w]orkspace: [a]dd folder" },
|
||||
r = { vim.lsp.buf.remove_workspace_folder, "[w]orkspace: [r]emove folder" },
|
||||
l = {
|
||||
function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,
|
||||
"[w]orkspace [l]ist folders",
|
||||
},
|
||||
},
|
||||
},
|
||||
g = {
|
||||
name = "Goto",
|
||||
d = { vim.lsp.buf.definition, "[G]oto [D]efinition" },
|
||||
r = { require("telescope.builtin").lsp_references, "[G]oto [R]eferences" },
|
||||
I = { vim.lsp.buf.implementation, "[G]oto [I]mplementation" },
|
||||
D = { vim.lsp.buf.type_definition, "Type [D]efinition" },
|
||||
s = { require("telescope.builtin").lsp_document_symbols, "[D]ocument [S]ymbols" },
|
||||
w = { require("telescope.builtin").lsp_dynamic_workspace_symbols, "[W]orkspace [S]ymbols" },
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
|
||||
nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(
|
||||
bufnr,
|
||||
"Format",
|
||||
function(_) vim.lsp.buf.format() end,
|
||||
{ desc = "Format current buffer with LSP" }
|
||||
)
|
||||
end
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here.
|
||||
-- They will automatically be installed.
|
||||
--
|
||||
-- Add any additional override configuration in the following
|
||||
-- tables. They will be passed to the `settings` field of the
|
||||
-- server config. You must look up that documentation yourself.
|
||||
--
|
||||
-- If you want to override the default filetypes that your
|
||||
-- language server will attach to you can define the property
|
||||
-- 'filetypes' to the map in question.
|
||||
local servers = {
|
||||
ansiblels = {},
|
||||
bashls = {},
|
||||
clangd = {},
|
||||
docker_compose_language_service = {},
|
||||
dockerls = {},
|
||||
eslint = {},
|
||||
gopls = {},
|
||||
html = { filetypes = { "html", "twig", "hbs" } },
|
||||
intelephense = {},
|
||||
jsonls = {},
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
diagnostics = { globals = { "vim" } },
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
marksman = {},
|
||||
pyright = {},
|
||||
rust_analyzer = {},
|
||||
terraformls = {},
|
||||
tsserver = {},
|
||||
vuels = {},
|
||||
yamlls = {},
|
||||
}
|
||||
|
||||
-- Setup neovim lua configuration
|
||||
require("neodev").setup()
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities,
|
||||
-- so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
mason_lspconfig.setup_handlers({
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
filetypes = (servers[server_name] or {}).filetypes,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- Configure language servers for specific languages
|
||||
local lspconfig = require("lspconfig")
|
||||
|
||||
-- Bash Language Server
|
||||
lspconfig.bashls.setup({
|
||||
cmd = {
|
||||
"bash-language-server",
|
||||
"start",
|
||||
},
|
||||
filetypes = { "sh", "zsh" },
|
||||
capabilities = CAPABILITIES,
|
||||
})
|
||||
|
||||
-- HTML
|
||||
lspconfig.html.setup({ capabilities = CAPABILITIES })
|
||||
|
||||
-- JSON
|
||||
lspconfig.jsonls.setup({
|
||||
settings = {
|
||||
json = {
|
||||
schemas = require("schemastore").json.schemas(),
|
||||
validate = { enable = true },
|
||||
},
|
||||
},
|
||||
capabilities = CAPABILITIES,
|
||||
})
|
||||
|
||||
-- Python
|
||||
lspconfig.pylsp.setup({})
|
||||
|
||||
-- CSS + Less + SCSS
|
||||
lspconfig.cssls.setup({
|
||||
cmd = { "vscode-css-language-server", "--stdio" },
|
||||
filetypes = { "css", "scss", "less" },
|
||||
-- root_dir = root_pattern("package.json", ".git") or bufdir,
|
||||
settings = {
|
||||
css = {
|
||||
validate = true,
|
||||
},
|
||||
less = {
|
||||
validate = true,
|
||||
},
|
||||
scss = {
|
||||
validate = true,
|
||||
},
|
||||
},
|
||||
single_file_support = true,
|
||||
capabilities = CAPABILITIES,
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- rome
|
||||
local util = require("lspconfig.util")
|
||||
lspconfig.rome.setup({
|
||||
root_dir = util.root_pattern("rome.json"),
|
||||
single_file_support = true,
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
||||
end,
|
||||
capabilities = CAPABILITIES,
|
||||
})
|
||||
|
||||
|
||||
-- Typescript + Javascript
|
||||
lspconfig.tsserver.setup({
|
||||
capabilities = CAPABILITIES,
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then require("nvim-navic").attach(client, bufnr) end
|
||||
end,
|
||||
})
|
||||
|
||||
lspconfig.lua_ls.setup({})
|
||||
lspconfig.yamlls.setup({})
|
||||
@@ -1,59 +0,0 @@
|
||||
-- Signature for LSP
|
||||
|
||||
return {
|
||||
"ray-x/lsp_signature.nvim",
|
||||
config = {
|
||||
debug = false, -- set to true to enable debug logging
|
||||
verbose = false, -- show debug line number
|
||||
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
-- If you want to hook lspsaga or other signature handler, pls set to false
|
||||
doc_lines = 10, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
|
||||
-- set to 0 if you DO NOT want any API comments be shown
|
||||
-- This setting only take effect in insert mode, it does not affect signature help in normal
|
||||
-- mode, 10 by default
|
||||
|
||||
floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
|
||||
|
||||
floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
|
||||
-- will set to true when fully tested, set to false will use whichever side has more space
|
||||
-- this setting will be helpful if you do not want the PUM and floating win overlap
|
||||
close_timeout = 4000, -- close floating window after ms when laster parameter is entered
|
||||
hint_enable = true, -- virtual hint enable
|
||||
hint_prefix = "🐼", -- Panda for parameter
|
||||
hint_scheme = "String",
|
||||
use_lspsaga = false, -- set to true if you want to use lspsaga popup
|
||||
|
||||
hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
|
||||
|
||||
max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down
|
||||
-- to view the hiding contents
|
||||
max_width = 90, -- max_width of signature floating_window, line will be wrapped if exceed max_width
|
||||
wrap = true,
|
||||
handler_opts = {
|
||||
border = "shadow", -- double, rounded, single, shadow, none
|
||||
},
|
||||
|
||||
always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
|
||||
|
||||
floating_window_off_x = 0, -- adjust float windows x position.
|
||||
-- can be either a number or function
|
||||
floating_window_off_y = 2, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
|
||||
-- can be either number or function, see examples
|
||||
|
||||
auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
|
||||
extra_trigger_chars = { "(", ",", ";", ")", "{", "}" }, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
|
||||
zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
|
||||
|
||||
padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
|
||||
|
||||
transparency = 20, -- disabled by default, allow floating win transparent value 1~100
|
||||
shadow_blend = 36, -- if you using shadow as border use this set the opacity
|
||||
shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
|
||||
timer_interval = 50, -- default timer check interval set to lower value if you want to reduce latency
|
||||
toggle_key = "<C-n>", -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
|
||||
|
||||
select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
|
||||
move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating
|
||||
},
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
-- luacheck: globals vim
|
||||
|
||||
-- Use the new FileType system of Neovim.
|
||||
-- let g:do_filetype_lua = 1
|
||||
|
||||
vim.wo.linebreak = true -- Fix moving through lines 'gk' and 'gj'
|
||||
vim.o.breakindent = true -- Enable break indent
|
||||
vim.o.undofile = true -- Save undo history
|
||||
vim.wo.number = true -- Show lines number (hybrid)
|
||||
vim.wo.relativenumber = true -- Show lines number (hybrid)
|
||||
vim.wo.signcolumn = "yes" -- Keep signcolumn on by default
|
||||
|
||||
-- Case-insensitive searching UNLESS \C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
vim.o.cmdheight = 0 -- To have a extra line :)
|
||||
vim.wo.wrap = true -- Set wrap for words
|
||||
vim.o.showtabline = 2 -- Always show tabs
|
||||
vim.opt.list = true -- Show xtra spaces
|
||||
vim.o.wildmenu = true -- Set wildmenu for later use
|
||||
vim.o.hlsearch = true -- Highlighting search
|
||||
vim.o.ruler = true -- Set ruler for better look
|
||||
vim.o.hidden = true -- No nice message
|
||||
vim.o.showcmd = true -- Partial commands only in the screen
|
||||
vim.o.showmatch = true -- Match braces when inserting new ones
|
||||
|
||||
-- Cursor line
|
||||
---- Cursor column
|
||||
vim.o.cursorline = true
|
||||
vim.wo.cursorline = true
|
||||
vim.o.cursorcolumn = true
|
||||
vim.wo.cursorcolumn = true
|
||||
|
||||
vim.o.scrolloff = 40 -- Off scroll when moving through the buffer
|
||||
vim.go.termguicolors = true -- For terminal RGB colours
|
||||
vim.go.t_Co = "256" -- Colours, I believe
|
||||
vim.go.t_ut = "" -- Colours, I believe
|
||||
vim.o.laststatus = 3 -- Space for tabs
|
||||
vim.o.softtabstop = 2 -- Space for tabs
|
||||
vim.o.expandtab = true -- Expand tab to use spaces instead
|
||||
vim.o.tabstop = 2 -- Space for tabs
|
||||
vim.bo.shiftwidth = 2 -- Space for tabs
|
||||
vim.o.shiftwidth = 2 -- Space for tabs
|
||||
|
||||
vim.o.formatoptions = "tqj" -- Format options to not create new lines with comments
|
||||
vim.o.mouse = "a" -- Mouse working with neovim
|
||||
|
||||
-- viminfo file
|
||||
-- vim.o.viminfo = vim.o.viminfo .. '~/.config/nvim/viminfo'
|
||||
|
||||
-- Spell language to English (UK)
|
||||
vim.o.spelllang = "en_gb"
|
||||
vim.bo.spelllang = "en_gb"
|
||||
|
||||
vim.opt.laststatus = 2 -- Global statusline.
|
||||
|
||||
-- When "on" the commands listed below move the cursor to the first non-blank
|
||||
-- of the line. When off the cursor is kept in the same column (if possible).
|
||||
-- https://neovim.io/doc/user/options.html#'startofline'
|
||||
vim.opt.startofline = true
|
||||
|
||||
-- Set path for better searching across the system
|
||||
-- vim.o.path = vim.o.path .. '**'
|
||||
|
||||
-- Complete options
|
||||
vim.o.completeopt = "menuone,longest,noselect"
|
||||
vim.o.shortmess = vim.o.shortmess .. "c"
|
||||
|
||||
vim.go.pumblend = 10 -- Menu Transparency.
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ Variables │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
vim.api.nvim_set_var("one_allow_itali:set cursorlinec:set cursorlines", 1)
|
||||
vim.api.nvim_set_var("do_filetype_lua", 1)
|
||||
vim.api.nvim_set_var("MRU_File", "~/.cache/vim_mru_files")
|
||||
|
||||
-- ╭──────────────────────────────────────────────────────────╮
|
||||
-- │ API │
|
||||
-- ╰──────────────────────────────────────────────────────────╯
|
||||
|
||||
-- Change title accordingly.
|
||||
vim.api.nvim_set_option("title", true)
|
||||
|
||||
-- Set clipboard to be global across the system
|
||||
vim.api.nvim_set_option("clipboard", "unnamedplus")
|
||||
|
||||
-- Basic fold column
|
||||
vim.api.nvim_set_option("foldcolumn", "1")
|
||||
|
||||
-- Set dictionary to language spell
|
||||
vim.api.nvim_set_option("dictionary", "/usr/share/dict/words")
|
||||
|
||||
-- Wildignore for when opening files :0
|
||||
vim.api.nvim_set_option(
|
||||
"wildignore",
|
||||
"*/tmp*/,*/node_modules/*,_site,*/__pycache__/,*/venv/*,*/target/*,*/.vim$,~$,*/.log"
|
||||
)
|
||||
|
||||
-- Folding
|
||||
vim.api.nvim_set_option("foldmethod", "syntax")
|
||||
vim.api.nvim_set_option('foldenable', false)
|
||||
vim.api.nvim_set_option('foldminlines', 5)
|
||||
@@ -1,40 +0,0 @@
|
||||
-- Package manager https://github.com/folke/lazy.nvim
|
||||
-- :help lazy.nvim.txt
|
||||
-- luacheck: globals vim
|
||||
|
||||
-- To install lazy.nvim automatically.
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local options = {
|
||||
defaults = { lazy = false },
|
||||
install = { colorscheme = { "catppuccin" } },
|
||||
performance = {
|
||||
cache = {
|
||||
enabled = true,
|
||||
},
|
||||
rtp = {
|
||||
disabled_plugins = {
|
||||
"matchit",
|
||||
"matchparen",
|
||||
"netrwPlugin",
|
||||
"tohtml",
|
||||
"tutor",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
require("lazy").setup("plugins", options)
|
||||
@@ -1,92 +0,0 @@
|
||||
-- A VS Code like winbar for Neovim
|
||||
-- https://github.com/utilyre/barbecue.nvim
|
||||
return {
|
||||
"utilyre/barbecue.nvim",
|
||||
dependencies = {
|
||||
"neovim/nvim-lspconfig",
|
||||
"SmiteshP/nvim-navic",
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
},
|
||||
version = "*",
|
||||
config = {
|
||||
theme = "catppuccin",
|
||||
|
||||
-- If you set this to false, floating windows will look weird
|
||||
exclude_float = true,
|
||||
|
||||
-- Instead of excluding countless number of filetypes, barbecue tries to only show on some buftypes
|
||||
-- "": file buffer
|
||||
-- "nofile": e.g. nvim-tree and nvim-dap-ui
|
||||
-- "prompt": e.g. telescope.nvim and nvim-fzf
|
||||
-- "terminal": e.g. fterm.nvim and toggleterm.nvim
|
||||
-- ...
|
||||
include_buftypes = { "" },
|
||||
|
||||
---Filetypes not to enable winbar in.
|
||||
---
|
||||
---@type string[]
|
||||
exclude_filetypes = {
|
||||
"",
|
||||
"txt",
|
||||
"markdown",
|
||||
},
|
||||
|
||||
-- :help events
|
||||
-- :help [event] (like :help BufWinEnter)
|
||||
update_events = {
|
||||
"BufWinEnter",
|
||||
"BufWritePost",
|
||||
"CursorMoved",
|
||||
"CursorMovedI",
|
||||
"TextChanged",
|
||||
"TextChangedI",
|
||||
},
|
||||
|
||||
-- Show `~ ...` instead of `/ home user ...`
|
||||
tilde_home = true,
|
||||
|
||||
-- Your winbar will have a little padding from the edge
|
||||
prefix = " ",
|
||||
|
||||
-- The sign between each entry
|
||||
separator = " ",
|
||||
|
||||
-- Show if lsp context is available but there is nothing to show
|
||||
no_info_indicator = "…",
|
||||
|
||||
-- Symbol to show if file has been modified (not saved). It's usually `[+]` in vim
|
||||
-- `nil` to disable
|
||||
modified_indicator = nil,
|
||||
|
||||
-- Icons passed to nvim-navic
|
||||
icons = {
|
||||
File = " ",
|
||||
Module = " ",
|
||||
Namespace = " ",
|
||||
Package = " ",
|
||||
Class = " ",
|
||||
Method = " ",
|
||||
Property = " ",
|
||||
Field = " ",
|
||||
Constructor = " ",
|
||||
Enum = "練",
|
||||
Interface = "練",
|
||||
Function = " ",
|
||||
Variable = " ",
|
||||
Constant = " ",
|
||||
String = " ",
|
||||
Number = " ",
|
||||
Boolean = "◩ ",
|
||||
Array = " ",
|
||||
Object = " ",
|
||||
Key = " ",
|
||||
Null = "ﳠ ",
|
||||
EnumMember = " ",
|
||||
Struct = " ",
|
||||
Event = " ",
|
||||
Operator = " ",
|
||||
TypeParameter = " ",
|
||||
Define = " ",
|
||||
},
|
||||
},
|
||||
}
|
||||
105
config/nvim/lua/plugins/coding.lua
Normal file
105
config/nvim/lua/plugins/coding.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
return {
|
||||
-- A better annotation generator. Supports multiple languages and annotation conventions.
|
||||
-- https://github.com/danymat/neogen
|
||||
{
|
||||
"danymat/neogen",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
version = "*",
|
||||
cmd = "Neogen",
|
||||
opts = {
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
lua = { template = { annotation_convention = "ldoc" } },
|
||||
typescript = { template = { annotation_convention = "tsdoc" } },
|
||||
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
"<leader>baa",
|
||||
function()
|
||||
require("neogen").generate({ type = "current" })
|
||||
end,
|
||||
desc = "Current",
|
||||
},
|
||||
{
|
||||
"<leader>bac",
|
||||
function()
|
||||
require("neogen").generate({ type = "class" })
|
||||
end,
|
||||
desc = "Class",
|
||||
},
|
||||
{
|
||||
"<leader>baf",
|
||||
function()
|
||||
require("neogen").generate({ type = "func" })
|
||||
end,
|
||||
desc = "Function",
|
||||
},
|
||||
{
|
||||
"<leader>bat",
|
||||
function()
|
||||
require("neogen").generate({ type = "type" })
|
||||
end,
|
||||
desc = "Type",
|
||||
},
|
||||
{
|
||||
"<leader>baF",
|
||||
function()
|
||||
require("neogen").generate({ type = "file" })
|
||||
end,
|
||||
desc = "File",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Describe the regexp under the cursor
|
||||
-- https://github.com/bennypowers/nvim-regexplainer
|
||||
{
|
||||
"bennypowers/nvim-regexplainer",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
-- automatically show the explainer when the cursor enters a regexp
|
||||
auto = true,
|
||||
},
|
||||
},
|
||||
-- Clarify and beautify your comments using boxes and lines.
|
||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"actionlint",
|
||||
"ansible-language-server",
|
||||
"ansible-lint",
|
||||
"bash-language-server",
|
||||
"blade-formatter",
|
||||
"cfn-lint",
|
||||
"codeql",
|
||||
"codespell",
|
||||
"commitlint",
|
||||
"diagnostic-languageserver",
|
||||
"docker-compose-language-service",
|
||||
"dockerfile-language-server",
|
||||
"editorconfig-checker",
|
||||
"fixjson",
|
||||
"html-lsp",
|
||||
"jq",
|
||||
"nginx-language-server",
|
||||
"php-cs-fixer",
|
||||
"semgrep",
|
||||
"sonarlint-language-server",
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
||||
-- https://github.com/wakatime/vim-wakatime
|
||||
{ "wakatime/vim-wakatime", lazy = false, enabled = true },
|
||||
}
|
||||
266
config/nvim/lua/plugins/example.lua
Normal file
266
config/nvim/lua/plugins/example.lua
Normal file
@@ -0,0 +1,266 @@
|
||||
-- since this is just an example spec, don't actually load anything here and return an empty spec
|
||||
-- stylua: ignore
|
||||
if true then return {} end
|
||||
|
||||
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
|
||||
--
|
||||
-- In your plugin files, you can:
|
||||
-- * add extra plugins
|
||||
-- * disable/enabled LazyVim plugins
|
||||
-- * override the configuration of LazyVim plugins
|
||||
return {
|
||||
-- add gruvbox
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
-- Configure LazyVim to load gruvbox
|
||||
{
|
||||
"LazyVim/LazyVim",
|
||||
opts = {
|
||||
colorscheme = "gruvbox",
|
||||
},
|
||||
},
|
||||
|
||||
-- change trouble config
|
||||
{
|
||||
"folke/trouble.nvim",
|
||||
-- opts will be merged with the parent spec
|
||||
opts = { use_diagnostic_signs = true },
|
||||
},
|
||||
|
||||
-- disable trouble
|
||||
{ "folke/trouble.nvim", enabled = false },
|
||||
|
||||
-- add symbols-outline
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- override nvim-cmp and add cmp-emoji
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = { "hrsh7th/cmp-emoji" },
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local cmp = require("cmp")
|
||||
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
|
||||
end,
|
||||
},
|
||||
|
||||
-- change some telescope options and a keymap to browse plugin files
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
keys = {
|
||||
-- add a keymap to browse plugin files
|
||||
-- stylua: ignore
|
||||
{
|
||||
"<leader>fp",
|
||||
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
|
||||
desc = "Find Plugin File",
|
||||
},
|
||||
},
|
||||
-- change some options
|
||||
opts = {
|
||||
defaults = {
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = { prompt_position = "top" },
|
||||
sorting_strategy = "ascending",
|
||||
winblend = 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add telescope-fzf-native
|
||||
{
|
||||
"telescope.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
build = "make",
|
||||
config = function()
|
||||
require("telescope").load_extension("fzf")
|
||||
end,
|
||||
},
|
||||
},
|
||||
|
||||
-- add pyright to lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- pyright will be automatically installed with mason and loaded with lspconfig
|
||||
pyright = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- add tsserver and setup with typescript.nvim instead of lspconfig
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"jose-elias-alvarez/typescript.nvim",
|
||||
init = function()
|
||||
require("lazyvim.util.lsp").on_attach(function(_, buffer)
|
||||
-- stylua: ignore
|
||||
vim.keymap.set("n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
|
||||
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
|
||||
end)
|
||||
end,
|
||||
},
|
||||
---@class PluginLspOpts
|
||||
opts = {
|
||||
---@type lspconfig.options
|
||||
servers = {
|
||||
-- tsserver will be automatically installed with mason and loaded with lspconfig
|
||||
tsserver = {},
|
||||
},
|
||||
-- you can do any additional lsp server setup here
|
||||
-- return true if you don't want this server to be setup with lspconfig
|
||||
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
|
||||
setup = {
|
||||
-- example to setup with typescript.nvim
|
||||
tsserver = function(_, opts)
|
||||
require("typescript").setup({ server = opts })
|
||||
return true
|
||||
end,
|
||||
-- Specify * to use this function as a fallback for any server
|
||||
-- ["*"] = function(server, opts) end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
|
||||
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
|
||||
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
||||
|
||||
-- add more treesitter parsers
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
|
||||
-- would overwrite `ensure_installed` with the new value.
|
||||
-- If you'd rather extend the default config, use the code below instead:
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
-- add tsx and treesitter
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"tsx",
|
||||
"typescript",
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- the opts function can also be used to change the default opts:
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function(_, opts)
|
||||
table.insert(opts.sections.lualine_x, "😄")
|
||||
end,
|
||||
},
|
||||
|
||||
-- or you can return new options to override all the defaults
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = function()
|
||||
return {
|
||||
--[[add your custom lualine config here]]
|
||||
}
|
||||
end,
|
||||
},
|
||||
|
||||
-- use mini.starter instead of alpha
|
||||
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
|
||||
|
||||
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
|
||||
{ import = "lazyvim.plugins.extras.lang.json" },
|
||||
|
||||
-- add any tools you want to have installed below
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"stylua",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"flake8",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Use <tab> for completion and snippets (supertab)
|
||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
keys = function()
|
||||
return {}
|
||||
end,
|
||||
},
|
||||
-- then: setup supertab in cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
local cmp = require("cmp")
|
||||
|
||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- this way you will only jump inside the snippet region
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
-- Git integration for buffers
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
"lewis6991/gitsigns.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
config = {
|
||||
signs = {
|
||||
add = { hl = "GitSignsAdd", text = "┃", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
|
||||
change = { hl = "GitSignsChange", text = "┃", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
delete = { hl = "GitSignsDelete", text = "_", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
topdelete = { hl = "GitSignsDelete", text = "‾", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
|
||||
changedelete = { hl = "GitSignsChange", text = "~", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
on_attach = function(bufnr)
|
||||
local gs = package.loaded.gitsigns
|
||||
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
opts.buffer = bufnr
|
||||
vim.keymap.set(mode, l, r, opts)
|
||||
end
|
||||
|
||||
-- Navigation
|
||||
map("n", "]c", function()
|
||||
if vim.wo.diff then return "]c" end
|
||||
vim.schedule(function() gs.next_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true })
|
||||
|
||||
map("n", "[c", function()
|
||||
if vim.wo.diff then return "[c" end
|
||||
vim.schedule(function() gs.prev_hunk() end)
|
||||
return "<Ignore>"
|
||||
end, { expr = true })
|
||||
|
||||
-- Actions
|
||||
map("n", "<leader>oghs", gs.stage_hunk, { desc = "Stage Hunk" })
|
||||
map("n", "<leader>oghr", gs.reset_hunk, { desc = "Reset Hunk" })
|
||||
map("v", "<leader>oghs", function() gs.stage_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
||||
map("v", "<leader>oghr", function() gs.reset_hunk({ vim.fn.line("."), vim.fn.line("v") }) end)
|
||||
map("n", "<leader>oghS", gs.stage_buffer, { desc = "Stage Buffer" })
|
||||
map("n", "<leader>oghu", gs.undo_stage_hunk, { desc = "Undo Stage Hunk" })
|
||||
map("n", "<leader>oghR", gs.reset_buffer, { desc = "Reset Buffer" })
|
||||
map("n", "<leader>oghp", gs.preview_hunk, { desc = "Preview Hunk" })
|
||||
map("n", "<leader>ogbl", function() gs.blame_line({ full = true }) end, { desc = "Blame Line" })
|
||||
map("n", "<leader>ogbt", gs.toggle_current_line_blame, { desc = "Toggle Current Line Blame" })
|
||||
map("n", "<leader>oghd", gs.diffthis, { desc = "Diff This" })
|
||||
map("n", "<leader>oghD", function() gs.diffthis("~") end)
|
||||
map("n", "<leader>ogtd", gs.toggle_deleted, { desc = "Toggle Deleted" })
|
||||
|
||||
-- Text object
|
||||
map({ "o", "x" }, "ih", ":<C-U>Gitsigns select_hunk<CR>")
|
||||
end,
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true,
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false,
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = "single",
|
||||
style = "minimal",
|
||||
relative = "cursor",
|
||||
row = 0,
|
||||
col = 1,
|
||||
},
|
||||
yadm = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
47
config/nvim/lua/plugins/lang-php.lua
Normal file
47
config/nvim/lua/plugins/lang-php.lua
Normal file
@@ -0,0 +1,47 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"php",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"phpactor",
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
phpactor = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-dap",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
table.insert(opts.ensure_installed, "php-debug-adapter")
|
||||
end
|
||||
end,
|
||||
},
|
||||
opts = function()
|
||||
local dap = require("dap")
|
||||
local path = require("mason-registry").get_package("php-debug-adapter"):get_install_path()
|
||||
dap.adapters.php = {
|
||||
type = "executable",
|
||||
command = "node",
|
||||
args = { path .. "/extension/out/phpDebug.js" },
|
||||
}
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,264 +0,0 @@
|
||||
-- luacheck: globals vim
|
||||
|
||||
return {
|
||||
-- plenary: full; complete; entire; absolute; unqualified.
|
||||
-- All the lua functions I don't want to write twice.
|
||||
-- https://github.com/nvim-lua/plenary.nvim
|
||||
{ "nvim-lua/plenary.nvim", lazy = true },
|
||||
|
||||
-- lua `fork` of vim-web-devicons for neovim
|
||||
-- https://github.com/nvim-tree/nvim-web-devicons
|
||||
{ "kyazdani42/nvim-web-devicons" },
|
||||
|
||||
-- The theme of choise, catppuccin
|
||||
-- https://github.com/catppuccin/nvim
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
priority = 10000,
|
||||
enabled = true,
|
||||
lazy = false,
|
||||
config = function() vim.cmd.colorscheme("catppuccin") end,
|
||||
opts = {
|
||||
flavour = "mocha",
|
||||
transparent_background = true,
|
||||
dim_inactive = {
|
||||
enabled = true,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
integrations = {
|
||||
aerial = true,
|
||||
barbecue = {
|
||||
-- directory name is dimmed by default
|
||||
dim_dirname = true,
|
||||
bold_basename = true,
|
||||
dim_context = false,
|
||||
alt_background = false,
|
||||
},
|
||||
cmp = true,
|
||||
dap = { enabled = true, enable_ui = true },
|
||||
gitsigns = true,
|
||||
harpoon = true,
|
||||
indent_blankline = {
|
||||
enabled = true,
|
||||
colored_indent_levels = false,
|
||||
},
|
||||
mason = true,
|
||||
neotree = true,
|
||||
notify = true,
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
inlay_hints = {
|
||||
background = true,
|
||||
},
|
||||
},
|
||||
semantic_tokens = true,
|
||||
symbols_outline = true,
|
||||
telescope = {
|
||||
enabled = true,
|
||||
style = "catppuccin",
|
||||
},
|
||||
treesitter = true,
|
||||
lsp_trouble = true,
|
||||
which_key = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Notifications as a popup
|
||||
-- https://github.com/rcarriga/nvim-notify
|
||||
{
|
||||
"rcarriga/nvim-notify",
|
||||
keys = {
|
||||
{
|
||||
"<leader>un",
|
||||
function() require("notify").dismiss({ silent = true, pending = true }) end,
|
||||
desc = "Dismiss all Notifications",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
timeout = 3000,
|
||||
max_height = function() return math.floor(vim.o.lines * 0.75) end,
|
||||
max_width = function() return math.floor(vim.o.columns * 0.75) end,
|
||||
},
|
||||
init = function() vim.notify = require("notify") end,
|
||||
},
|
||||
|
||||
-- vscode-like pictograms for neovim lsp completion items
|
||||
-- https://github.com/onsails/lspkind.nvim
|
||||
{ "onsails/lspkind-nvim" },
|
||||
|
||||
-- Save and restore Vim views automatically
|
||||
-- https://github.com/senderle/restoreview
|
||||
{ "senderle/restoreview" },
|
||||
|
||||
-- Create key bindings that stick. WhichKey is a lua plugin for Neovim that
|
||||
-- displays a popup with possible keybindings of the command you started typing.
|
||||
-- https://github.com/folke/which-key.nvim
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
enabled = true,
|
||||
lazy = false,
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
opts = {
|
||||
plugins = { spelling = true, marks = true, registers = true },
|
||||
},
|
||||
},
|
||||
|
||||
-- Neovim plugin to improve the default vim.ui interfaces
|
||||
-- https://github.com/stevearc/dressing.nvim
|
||||
{
|
||||
"stevearc/dressing.nvim",
|
||||
lazy = true,
|
||||
init = function()
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.select = function(...)
|
||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||
return vim.ui.select(...)
|
||||
end
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
vim.ui.input = function(...)
|
||||
require("lazy").load({ plugins = { "dressing.nvim" } })
|
||||
return vim.ui.input(...)
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- A tree like view for symbols in Neovim using the LSP.
|
||||
-- https://github.com/simrat39/symbols-outline.nvim
|
||||
{
|
||||
"simrat39/symbols-outline.nvim",
|
||||
cmd = "SymbolsOutline",
|
||||
keys = { { "<leader>bs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
|
||||
opts = {
|
||||
-- add your options that should be passed to the setup() function here
|
||||
position = "right",
|
||||
},
|
||||
},
|
||||
|
||||
-- Getting you where you want with the fewest keystrokes.
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
{ "ThePrimeagen/harpoon" },
|
||||
|
||||
-- A Neovim plugin hiding your colorcolumn when unneeded.
|
||||
-- https://github.com/m4xshen/smartcolumn.nvim
|
||||
{
|
||||
"m4xshen/smartcolumn.nvim",
|
||||
opts = {
|
||||
colorcolumn = { "80", "100", "120" },
|
||||
disabled_filetypes = {
|
||||
"dashboard",
|
||||
"help",
|
||||
"json",
|
||||
"lazy",
|
||||
"lazyterm",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"notify",
|
||||
"starter",
|
||||
"toggleterm",
|
||||
"Trouble",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Status information for LSP.
|
||||
-- https://github.com/j-hui/fidget.nvim
|
||||
{ "j-hui/fidget.nvim" },
|
||||
|
||||
-- A neovim lua plugin to help easily manage multiple terminal windows
|
||||
-- https://github.com/akinsho/toggleterm.nvim
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = "*",
|
||||
opts = {
|
||||
open_mapping = [[<c-t>]],
|
||||
insert_mappings = true,
|
||||
-- direction = "float",
|
||||
float_opts = {
|
||||
width = function()
|
||||
return math.floor(vim.o.columns * 0.9)
|
||||
end,
|
||||
height = function()
|
||||
return math.floor(vim.o.lines * 0.9)
|
||||
end,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
-- Close buffer without messing up with the window.
|
||||
-- https://github.com/famiu/bufdelete.nvim
|
||||
{ "famiu/bufdelete.nvim" },
|
||||
|
||||
-- Delete multiple vim buffers based on different conditions
|
||||
-- https://github.com/kazhala/close-buffers.nvim
|
||||
{ "kazhala/close-buffers.nvim" },
|
||||
|
||||
-- JSONLS
|
||||
-- https://github.com/b0o/schemastore.nvim
|
||||
{ "b0o/schemastore.nvim" },
|
||||
|
||||
-- sleuth.vim: Heuristically set buffer options
|
||||
-- https://github.com/tpope/vim-sleuth
|
||||
{ "tpope/vim-sleuth" },
|
||||
|
||||
-- Neovim plugin for locking a buffer to a window
|
||||
-- https://github.com/stevearc/stickybuf.nvim
|
||||
{ "stevearc/stickybuf.nvim", opts = {} },
|
||||
|
||||
-- Describe the regexp under the cursor
|
||||
-- https://github.com/bennypowers/nvim-regexplainer
|
||||
{
|
||||
"bennypowers/nvim-regexplainer",
|
||||
requires = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"MunifTanjim/nui.nvim",
|
||||
},
|
||||
opts = {
|
||||
-- automatically show the explainer when the cursor enters a regexp
|
||||
auto = true,
|
||||
},
|
||||
},
|
||||
|
||||
-- Clarify and beautify your comments using boxes and lines.
|
||||
-- https://github.com/LudoPinelli/comment-box.nvim
|
||||
{ "LudoPinelli/comment-box.nvim", opts = {} },
|
||||
|
||||
-- Tabnine Client for Neovim
|
||||
-- https://github.com/codota/tabnine-nvim
|
||||
{
|
||||
"codota/tabnine-nvim",
|
||||
name = "tabnine",
|
||||
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
|
||||
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
|
||||
event = "User",
|
||||
opts = {
|
||||
accept_keymap = "<C-CR>",
|
||||
dismiss_keymap = "<C-Esc>",
|
||||
},
|
||||
},
|
||||
|
||||
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
|
||||
-- https://github.com/wakatime/vim-wakatime
|
||||
{
|
||||
"wakatime/vim-wakatime",
|
||||
lazy = false,
|
||||
enabled = true,
|
||||
},
|
||||
}
|
||||
@@ -1,140 +0,0 @@
|
||||
return {
|
||||
"echasnovski/mini.nvim",
|
||||
version = "*",
|
||||
config = function()
|
||||
-- Common configuration presets
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-basics.md
|
||||
require("mini.basics").setup()
|
||||
|
||||
-- Fast and flexible start screen
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-starter.md
|
||||
local starter = require("mini.starter")
|
||||
starter.setup({
|
||||
header = table.concat({
|
||||
" ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ",
|
||||
" ▄▀░░░░░░░░░░░░▄░░░░░░░▀▄ ",
|
||||
" █░░▄░░░░▄░░░░░░░░░░░░░░█ ",
|
||||
" █░░░░░░░░░░░░▄█▄▄░░▄░░░█ ▄▄▄ ",
|
||||
"▄▄▄▄▄ █░░░░░░▀░░░░▀█░░▀▄░░░░░█▀▀░██ ",
|
||||
"██▄▀██▄█░░░▄░░░░░░░██░░░░▀▀▀▀▀░░░░██ ",
|
||||
" ▀██▄▀██░░░░░░░░▀░██▀░░░░░░░░░░░░░▀██",
|
||||
" ▀████░▀░░░░▄░░░██░░░▄█░░░░▄░▄█░░██",
|
||||
" ▀█░░░░▄░░░░░██░░░░▄░░░▄░░▄░░░██",
|
||||
" ▄█▄░░░░░░░░░░░▀▄░░▀▀▀▀▀▀▀▀░░▄▀ ",
|
||||
" █▀▀█████████▀▀▀▀████████████▀ ",
|
||||
" ████▀ ███▀ ▀███ ▀██▀ ",
|
||||
}, "\n"),
|
||||
evaluate_single = true,
|
||||
items = {
|
||||
starter.sections.telescope(),
|
||||
starter.sections.builtin_actions(),
|
||||
starter.sections.recent_files(5, true, true),
|
||||
},
|
||||
content_hooks = {
|
||||
starter.gen_hook.adding_bullet(),
|
||||
starter.gen_hook.aligning("center", "center"),
|
||||
},
|
||||
})
|
||||
|
||||
-- Miscellaneous useful functions
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-misc.md
|
||||
require("mini.misc").setup()
|
||||
|
||||
-- Extend and create a/i textobjects
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-ai.md
|
||||
require("mini.ai").setup()
|
||||
|
||||
-- Align text interactively
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-align.md
|
||||
require("mini.align").setup()
|
||||
|
||||
-- Animate common Neovim actions
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-animate.md
|
||||
-- require("mini.animate").setup()
|
||||
|
||||
-- Go forward/backward with square brackets
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-bracketed.md
|
||||
require("mini.bracketed").setup()
|
||||
|
||||
-- Comment lines
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-comment.md
|
||||
require("mini.comment").setup()
|
||||
|
||||
-- Autocompletion and signature help plugin
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-completion.md
|
||||
-- require("mini.completion").setup()
|
||||
|
||||
-- Automatic highlighting of word under cursor
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-cursorword.md
|
||||
-- require("mini.cursorword").setup()
|
||||
|
||||
-- Highlight patterns in text
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-hipatterns.md
|
||||
local hipatterns = require("mini.hipatterns")
|
||||
hipatterns.setup({
|
||||
highlighters = {
|
||||
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
|
||||
fixme = { pattern = "%f[%w]()FIXME()%f[%W]", group = "MiniHipatternsFixme" },
|
||||
hack = { pattern = "%f[%w]()HACK()%f[%W]", group = "MiniHipatternsHack" },
|
||||
todo = { pattern = "%f[%w]()TODO()%f[%W]", group = "MiniHipatternsTodo" },
|
||||
note = { pattern = "%f[%w]()NOTE()%f[%W]", group = "MiniHipatternsNote" },
|
||||
|
||||
-- Highlight hex color strings (`#rrggbb`) using that color
|
||||
hex_color = hipatterns.gen_highlighter.hex_color(),
|
||||
},
|
||||
})
|
||||
|
||||
-- Visualize and work with indent scope
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-indentscope.md
|
||||
require("mini.indentscope").setup({
|
||||
draw = {
|
||||
delay = 0,
|
||||
-- animation = require("mini.indentscope").gen_animation("none"),
|
||||
},
|
||||
})
|
||||
|
||||
-- Jump to next/previous single character
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump.md
|
||||
require("mini.jump").setup()
|
||||
|
||||
-- Jump within visible lines via iterative label filtering
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-jump2d.md
|
||||
require("mini.jump2d").setup()
|
||||
|
||||
-- Window with buffer text overview, scrollbar, and highlights
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-map.md
|
||||
require("mini.map").setup()
|
||||
|
||||
-- Move any selection in any direction
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-move.md
|
||||
require("mini.move").setup()
|
||||
|
||||
-- Text edit operators
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-operators.md
|
||||
-- require("mini.operators").setup()
|
||||
|
||||
-- Minimal and fast autopairs
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-pairs.md
|
||||
require("mini.pairs").setup()
|
||||
|
||||
-- Split and join arguments
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-splitjoin.md
|
||||
require("mini.splitjoin").setup()
|
||||
|
||||
-- Minimal and fast statusline module with opinionated default look
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-statusline.md
|
||||
require("mini.statusline").setup()
|
||||
|
||||
-- Fast and feature-rich surround actions
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-surround.md
|
||||
require("mini.surround").setup()
|
||||
|
||||
-- Minimal and fast tabline showing listed buffers
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-tabline.md
|
||||
require("mini.tabline").setup()
|
||||
|
||||
-- Work with trailing whitespace
|
||||
-- https://github.com/echasnovski/mini.nvim/blob/main/readmes/mini-trailspace.md
|
||||
require("mini.trailspace").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,456 +0,0 @@
|
||||
-- File-tree manager.
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
-- luacheck: globals vim
|
||||
|
||||
-- Unless you are still migrating, remove the deprecated commands from v1.x
|
||||
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
|
||||
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"kyazdani42/nvim-web-devicons",
|
||||
"MunifTanjim/nui.nvim",
|
||||
{
|
||||
-- only needed if you want to use the commands with "_with_window_picker" suffix
|
||||
"s1n7ax/nvim-window-picker",
|
||||
config = function()
|
||||
require("window-picker").setup({
|
||||
autoselect_one = true,
|
||||
include_current = false,
|
||||
filter_rules = {
|
||||
-- filter using buffer options
|
||||
bo = {
|
||||
-- if the file type is one of following, the window will be ignored
|
||||
filetype = { "neo-tree", "neo-tree-popup", "notify" },
|
||||
|
||||
-- if the buffer type is one of following, the window will be ignored
|
||||
buftype = { "terminal", "quickfix" },
|
||||
},
|
||||
},
|
||||
other_win_hl_color = "#e35e4f",
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
|
||||
vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticSignError" })
|
||||
vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticSignWarn" })
|
||||
vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticSignInfo" })
|
||||
vim.fn.sign_define("DiagnosticSignHint", { text = "", texthl = "DiagnosticSignHint" })
|
||||
|
||||
require("neo-tree").setup({
|
||||
-- Close Neo-tree if it is the last window left in the tab
|
||||
close_if_last_window = true,
|
||||
-- "double", "none", "rounded", "shadow", "single" or "solid"
|
||||
popup_border_style = "rounded",
|
||||
enable_git_status = true,
|
||||
enable_diagnostics = true,
|
||||
-- Enable normal mode for input dialogs.
|
||||
enable_normal_mode_for_inputs = false,
|
||||
|
||||
-- when opening files, do not use windows containing these filetypes or buftypes
|
||||
open_files_do_not_replace_types = { "terminal", "trouble", "qf" },
|
||||
|
||||
-- popup_border_style is for input and confirmation dialogs.
|
||||
-- Configurtaion of floating window is done in the individual source sections.
|
||||
-- "NC" is a special style that works well with NormalNC set
|
||||
close_floats_on_escape_key = true,
|
||||
default_source = "filesystem",
|
||||
git_status_async = true,
|
||||
-- "trace", "debug", "info", "warn", "error", "fatal"
|
||||
log_level = "info",
|
||||
-- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
|
||||
log_to_file = false,
|
||||
-- false = open files in top left window
|
||||
open_files_in_last_window = true,
|
||||
-- in ms, needed for containers to redraw right aligned and faded content
|
||||
resize_timer_interval = 100,
|
||||
-- used when sorting files and directories in the tree
|
||||
sort_case_insensitive = true,
|
||||
-- If false, inputs will use vim.ui.input() instead of custom floats.
|
||||
use_popups_for_input = false,
|
||||
-- use a custom function for sorting files and directories in the tree
|
||||
sort_function = nil,
|
||||
event_handlers = {
|
||||
-- {
|
||||
-- event = "before_render",
|
||||
-- handler = function (state)
|
||||
-- -- add something to the state that can be used by custom components
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_opened",
|
||||
-- handler = function(file_path)
|
||||
-- --auto close
|
||||
-- require("neo-tree").close_all()
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_opened",
|
||||
-- handler = function(file_path)
|
||||
-- --clear search after opening a file
|
||||
-- require("neo-tree.sources.filesystem").reset_search()
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_renamed",
|
||||
-- handler = function(args)
|
||||
-- -- fix references to file
|
||||
-- print(args.source, " renamed to ", args.destination)
|
||||
-- end
|
||||
-- },
|
||||
-- {
|
||||
-- event = "file_moved",
|
||||
-- handler = function(args)
|
||||
-- -- fix references to file
|
||||
-- print(args.source, " moved to ", args.destination)
|
||||
-- end
|
||||
-- },
|
||||
{
|
||||
event = "neo_tree_buffer_enter",
|
||||
handler = function()
|
||||
vim.cmd("set winbar=")
|
||||
vim.cmd("highlight CursorLine gui='bold'")
|
||||
vim.cmd("highlight CursorColumn guibg=NONE")
|
||||
--vim.cmd("set guicursor+=a:InvisibleCursor")
|
||||
--vim.cmd("highlight InvisibleCursor gui=reverse blend=100")
|
||||
end,
|
||||
},
|
||||
{
|
||||
event = "neo_tree_buffer_leave",
|
||||
handler = function()
|
||||
--vim.cmd("set guicursor-=a:InvisibleCursor")
|
||||
vim.cmd("highlight CursorLine gui=NONE")
|
||||
end,
|
||||
},
|
||||
},
|
||||
default_component_configs = {
|
||||
container = {
|
||||
enable_character_fade = true,
|
||||
},
|
||||
indent = {
|
||||
indent_size = 2,
|
||||
-- extra padding on left hand side
|
||||
padding = 1,
|
||||
-- indent guides
|
||||
with_markers = true,
|
||||
indent_marker = "│",
|
||||
last_indent_marker = "└",
|
||||
highlight = "NeoTreeIndentMarker",
|
||||
-- expander config, needed for nesting files
|
||||
-- if nil and file nesting is enabled, will enable expanders
|
||||
with_expanders = true,
|
||||
expander_collapsed = "",
|
||||
expander_expanded = "",
|
||||
expander_highlight = "NeoTreeExpander",
|
||||
},
|
||||
icon = {
|
||||
folder_closed = "",
|
||||
folder_open = "",
|
||||
folder_empty = "-",
|
||||
-- The next two settings are only a fallback,
|
||||
-- if you use nvim-web-devicons and configure default icons there
|
||||
-- then these will never be used.
|
||||
default = "*",
|
||||
highlight = "NeoTreeFileIcon",
|
||||
},
|
||||
modified = {
|
||||
symbol = "[+]",
|
||||
highlight = "NeoTreeModified",
|
||||
},
|
||||
name = {
|
||||
trailing_slash = true,
|
||||
use_git_status_colors = false,
|
||||
highlight = "NeoTreeFileName",
|
||||
},
|
||||
git_status = {
|
||||
symbols = {
|
||||
-- Change type
|
||||
added = "˖",
|
||||
modified = "±",
|
||||
deleted = "✕",
|
||||
renamed = "↪",
|
||||
-- Status type
|
||||
untracked = "?",
|
||||
ignored = "⍨",
|
||||
unstaged = "·",
|
||||
staged = "✓",
|
||||
conflict = "",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- A list of functions, each representing a global custom command
|
||||
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
|
||||
-- see `:h neo-tree-custom-commands-global`
|
||||
commands = {},
|
||||
window = {
|
||||
-- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
|
||||
-- possible options. These can also be functions that return these options.
|
||||
|
||||
-- left, right, float, current
|
||||
position = "left",
|
||||
-- applies to left and right positions
|
||||
width = 40,
|
||||
mapping_options = {
|
||||
noremap = true,
|
||||
nowait = true,
|
||||
},
|
||||
-- settings that apply to float position only
|
||||
popup = {
|
||||
size = {
|
||||
height = "80%",
|
||||
width = "50%",
|
||||
},
|
||||
position = "50%", -- 50% means center it
|
||||
-- you can also specify border here, if you want a different setting from
|
||||
-- the global popup_border_style.
|
||||
},
|
||||
-- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands.
|
||||
-- You can also create your own commands by providing a function instead of a string.
|
||||
mappings = {
|
||||
["<space>"] = {
|
||||
"toggle_node",
|
||||
-- disable `nowait` if you have existing combos
|
||||
-- starting with this char that you want to use
|
||||
nowait = false,
|
||||
},
|
||||
["<2-LeftMouse>"] = "open",
|
||||
["<cr>"] = "open",
|
||||
-- close preview or floating neo-tree window
|
||||
["<esc>"] = "cancel",
|
||||
["P"] = { "toggle_preview", config = { use_float = true } },
|
||||
["l"] = "focus_preview",
|
||||
-- ["S"] = "open_split",
|
||||
-- ["s"] = "open_vsplit",
|
||||
["S"] = "split_with_window_picker",
|
||||
["s"] = "vsplit_with_window_picker",
|
||||
["t"] = "open_tabnew",
|
||||
-- ["<cr>"] = "open_drop",
|
||||
-- ["t"] = "open_tab_drop",
|
||||
["w"] = "open_with_window_picker",
|
||||
-- -- enter preview mode, which shows the current node without focusing
|
||||
--["P"] = "toggle_preview",
|
||||
["C"] = "close_node",
|
||||
-- ['C'] = 'close_all_subnodes',
|
||||
["z"] = "close_all_nodes",
|
||||
--["Z"] = "expand_all_nodes",
|
||||
["a"] = {
|
||||
"add",
|
||||
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc).
|
||||
-- see `:h neo-tree-file-actions` for details
|
||||
-- some commands may take optional config options,
|
||||
-- see `:h neo-tree-mappings` for details
|
||||
config = {
|
||||
-- "none", "relative", "absolute"
|
||||
show_path = "relative",
|
||||
},
|
||||
},
|
||||
-- also accepts the optional config.show_path option like "add".
|
||||
-- this also supports BASH style brace expansion.
|
||||
["A"] = "add_directory",
|
||||
["d"] = "delete",
|
||||
["r"] = "rename",
|
||||
["y"] = "copy_to_clipboard",
|
||||
["x"] = "cut_to_clipboard",
|
||||
["p"] = "paste_from_clipboard",
|
||||
-- takes text input for destination, also accepts the optional config.show_path option like "add":
|
||||
-- ["c"] = {
|
||||
-- "copy",
|
||||
-- config = {
|
||||
-- show_path = "none" -- "none", "relative", "absolute"
|
||||
-- }
|
||||
--}
|
||||
["c"] = "copy",
|
||||
-- takes text input for destination, also accepts the optional config.show_path option like "add".
|
||||
["m"] = "move",
|
||||
["q"] = "close_window",
|
||||
["R"] = "refresh",
|
||||
["?"] = "show_help",
|
||||
["<"] = "prev_source",
|
||||
[">"] = "next_source",
|
||||
},
|
||||
},
|
||||
nesting_rules = {},
|
||||
filesystem = {
|
||||
-- Add a custom command or override a global one using the same function name
|
||||
commands = {},
|
||||
components = {
|
||||
harpoon_index = function(config, node, _)
|
||||
local Marked = require("harpoon.mark")
|
||||
local path = node:get_id()
|
||||
local succuss, index = pcall(Marked.get_index_of, path)
|
||||
if succuss and index and index > 0 then
|
||||
return {
|
||||
text = string.format(" ⥤ %d", index), -- <-- Add your favorite harpoon like arrow here
|
||||
highlight = config.highlight or "NeoTreeDirectoryIcon",
|
||||
}
|
||||
else
|
||||
return {}
|
||||
end
|
||||
end,
|
||||
},
|
||||
renderers = {
|
||||
directory = {
|
||||
{ "indent" },
|
||||
{ "icon" },
|
||||
{ "current_filter" },
|
||||
{
|
||||
"container",
|
||||
width = "100%",
|
||||
right_padding = 0,
|
||||
--max_width = 60,
|
||||
content = {
|
||||
{ "name", zindex = 10 },
|
||||
{ "clipboard", zindex = 10 },
|
||||
{ "diagnostics", errors_only = true, zindex = 20, align = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
file = {
|
||||
{ "indent" },
|
||||
{ "icon" },
|
||||
{
|
||||
"container",
|
||||
width = "100%",
|
||||
right_padding = 0,
|
||||
--max_width = 60,
|
||||
content = {
|
||||
{
|
||||
"name",
|
||||
use_git_status_colors = false,
|
||||
zindex = 10,
|
||||
},
|
||||
-- {
|
||||
-- "symlink_target",
|
||||
-- zindex = 10,
|
||||
-- highlight = "NeoTreeSymbolicLinkTarget",
|
||||
-- },
|
||||
{ "clipboard", zindex = 10 },
|
||||
{ "bufnr", zindex = 10 },
|
||||
{ "harpoon_index", zindex = 20, align = "right" },
|
||||
{ "modified", zindex = 20, align = "right" },
|
||||
{ "diagnostics", zindex = 20, align = "right" },
|
||||
{ "git_status", zindex = 20, align = "right" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
filtered_items = {
|
||||
-- when true, they will just be displayed differently than normal items
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
-- only works on Windows for hidden files/directories
|
||||
hide_hidden = true,
|
||||
hide_by_name = {
|
||||
".git",
|
||||
".DS_Store",
|
||||
"thumbs.db",
|
||||
".idea",
|
||||
".mypy_cache",
|
||||
"node_modules",
|
||||
},
|
||||
-- uses glob style patterns
|
||||
hide_by_pattern = {
|
||||
--"*.meta",
|
||||
--"*/src/*/tsconfig.json",
|
||||
"*-cache",
|
||||
"*.cache",
|
||||
".null-ls_*",
|
||||
},
|
||||
never_show = { -- remains hidden even if visible is toggled to true
|
||||
".DS_Store",
|
||||
"thumbs.db",
|
||||
},
|
||||
always_show = { -- remains visible even if other settings would normally hide it
|
||||
".gitignore",
|
||||
".gitkeep",
|
||||
},
|
||||
},
|
||||
find_by_full_path_words = true,
|
||||
-- when true, empty folders will be grouped together
|
||||
group_empty_dirs = false,
|
||||
-- true creates a 2-way binding between vim's cwd and neo-tree's root
|
||||
bind_to_cwd = false,
|
||||
-- max number of search results when using filters
|
||||
search_limit = 50,
|
||||
follow_current_file = {
|
||||
-- This will find and focus the file in the active buffer every time
|
||||
-- the current file is changed while the tree is open.
|
||||
enabled = false,
|
||||
-- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
leave_dirs_open = false,
|
||||
},
|
||||
-- netrw disabled, opening a directory opens neo-tree
|
||||
-- in whatever position is specified in window.position
|
||||
-- "open_current", -- netrw disabled, opening a directory opens within the
|
||||
-- window like netrw would, regardless of window.position
|
||||
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
|
||||
hijack_netrw_behavior = "open_default",
|
||||
-- This will use the OS level file watchers to detect changes
|
||||
-- instead of relying on nvim autocmd events.
|
||||
use_libuv_file_watcher = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["."] = "set_root",
|
||||
["/"] = "fuzzy_finder",
|
||||
-- fuzzy sorting using the fzy algorithm
|
||||
["#"] = "fuzzy_sorter",
|
||||
["<bs>"] = "navigate_up",
|
||||
["<c-up>"] = "navigate_up",
|
||||
["<c-x>"] = "clear_filter",
|
||||
["D"] = "fuzzy_finder_directory",
|
||||
["f"] = "filter_on_submit",
|
||||
["gn"] = "next_git_modified",
|
||||
["gp"] = "prev_git_modified",
|
||||
["H"] = "toggle_hidden",
|
||||
},
|
||||
-- define keymaps for filter popup window in fuzzy_finder_mode
|
||||
fuzzy_finder_mappings = {
|
||||
["<down>"] = "move_cursor_down",
|
||||
["<C-n>"] = "move_cursor_down",
|
||||
["<up>"] = "move_cursor_up",
|
||||
["<C-p>"] = "move_cursor_up",
|
||||
},
|
||||
},
|
||||
},
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
-- This will find and focus the file in the active buffer every time
|
||||
-- the current file is changed while the tree is open.
|
||||
enabled = true,
|
||||
-- `false` closes auto expanded dirs, such as with `:Neotree reveal`
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
-- when true, empty folders will be grouped together
|
||||
group_empty_dirs = true,
|
||||
show_unloaded = true,
|
||||
window = {
|
||||
mappings = {
|
||||
["bd"] = "buffer_delete",
|
||||
["<bs>"] = "navigate_up",
|
||||
["."] = "set_root",
|
||||
},
|
||||
},
|
||||
},
|
||||
git_status = {
|
||||
window = {
|
||||
position = "float",
|
||||
mappings = {
|
||||
["A"] = "git_add_all",
|
||||
["gu"] = "git_unstage_file",
|
||||
["ga"] = "git_add_file",
|
||||
["gr"] = "git_revert_file",
|
||||
["gc"] = "git_commit",
|
||||
["gp"] = "git_push",
|
||||
["gg"] = "git_commit_and_push",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[nnoremap \ :Neotree reveal<cr>]])
|
||||
end,
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
-- A better annotation generator. Supports multiple languages and annotation conventions.
|
||||
-- https://github.com/danymat/neogen
|
||||
return {
|
||||
"danymat/neogen",
|
||||
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||
version = "*",
|
||||
cmd = "Neogen",
|
||||
opts = {
|
||||
snippet_engine = "luasnip",
|
||||
languages = {
|
||||
lua = { template = { annotation_convention = "ldoc" } },
|
||||
typescript = { template = { annotation_convention = "tsdoc" } },
|
||||
typescriptreact = { template = { annotation_convention = "tsdoc" } },
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>baa", function() require("neogen").generate({ type = "current" }) end, desc = "Current" },
|
||||
{ "<leader>bac", function() require("neogen").generate({ type = "class" }) end, desc = "Class" },
|
||||
{ "<leader>baf", function() require("neogen").generate({ type = "func" }) end, desc = "Function" },
|
||||
{ "<leader>bat", function() require("neogen").generate({ type = "type" }) end, desc = "Type" },
|
||||
{ "<leader>baF", function() require("neogen").generate({ type = "file" }) end, desc = "File" },
|
||||
},
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
return {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
local null_ls = require("null-ls")
|
||||
-- Check supported formatters and linters
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
||||
|
||||
-- Register any number of sources simultaneously
|
||||
null_ls.setup({
|
||||
-- filetypes = { "markdown", "text" },
|
||||
sources = {
|
||||
|
||||
-- Code Actions
|
||||
null_ls.builtins.code_actions.eslint,
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.code_actions.refactoring,
|
||||
null_ls.builtins.code_actions.shellcheck,
|
||||
|
||||
-- Diagnostics
|
||||
null_ls.builtins.diagnostics.actionlint,
|
||||
null_ls.builtins.diagnostics.alex,
|
||||
null_ls.builtins.diagnostics.ansiblelint,
|
||||
null_ls.builtins.diagnostics.dotenv_linter,
|
||||
null_ls.builtins.diagnostics.editorconfig_checker,
|
||||
null_ls.builtins.diagnostics.eslint,
|
||||
null_ls.builtins.diagnostics.jsonlint,
|
||||
null_ls.builtins.diagnostics.luacheck,
|
||||
null_ls.builtins.diagnostics.php,
|
||||
null_ls.builtins.diagnostics.phpcs,
|
||||
null_ls.builtins.diagnostics.phpstan,
|
||||
null_ls.builtins.diagnostics.psalm,
|
||||
null_ls.builtins.diagnostics.semgrep,
|
||||
null_ls.builtins.diagnostics.shellcheck,
|
||||
null_ls.builtins.diagnostics.stylelint,
|
||||
null_ls.builtins.diagnostics.tfsec,
|
||||
null_ls.builtins.diagnostics.trail_space,
|
||||
null_ls.builtins.diagnostics.tsc,
|
||||
null_ls.builtins.diagnostics.write_good,
|
||||
null_ls.builtins.diagnostics.zsh,
|
||||
|
||||
-- Formatting
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
null_ls.builtins.formatting.fixjson,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.jq,
|
||||
null_ls.builtins.formatting.phpcsfixer,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.rome,
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
args = { "-i", "1", "-bn", "-ci", "-sr", "-kb", "-fn" },
|
||||
}),
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
--
|
||||
-- Shows how to use the DAP plugin to debug your code.
|
||||
--
|
||||
-- https://github.com/mfussenegger/nvim-dap
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
"mfussenegger/nvim-dap",
|
||||
dependencies = {
|
||||
-- Creates a beautiful debugger UI
|
||||
"rcarriga/nvim-dap-ui",
|
||||
|
||||
-- Installs the debug adapters for you
|
||||
"williamboman/mason.nvim",
|
||||
"jay-babu/mason-nvim-dap.nvim",
|
||||
|
||||
-- Add your own debuggers here
|
||||
"leoluz/nvim-dap-go",
|
||||
},
|
||||
config = function()
|
||||
local dap = require("dap")
|
||||
local dapui = require("dapui")
|
||||
|
||||
require("mason-nvim-dap").setup({
|
||||
-- Makes a best effort to setup the various debuggers with
|
||||
-- reasonable debug configurations
|
||||
automatic_setup = true,
|
||||
automatic_installation = true,
|
||||
|
||||
-- You can provide additional configuration to the handlers,
|
||||
-- see mason-nvim-dap README for more information
|
||||
-- handlers = {},
|
||||
|
||||
-- You'll need to check that you have the required things installed
|
||||
-- online, please don't ask me how to install them :)
|
||||
ensure_installed = {
|
||||
-- Update this to ensure that you have the debuggers for the langs you want
|
||||
"bash",
|
||||
"delve",
|
||||
"jq",
|
||||
"js",
|
||||
"lua",
|
||||
"php",
|
||||
"python",
|
||||
"stylua",
|
||||
},
|
||||
handlers = {
|
||||
function(config)
|
||||
-- all sources with no handler get passed here
|
||||
|
||||
-- Keep original functionality
|
||||
require("mason-nvim-dap").default_setup(config)
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
-- Basic debugging keymaps, feel free to change to your liking!
|
||||
["<F5>"] = { dap.continue, "Debug: Start/Continue" },
|
||||
["<F1>"] = { dap.step_into, "Debug: Step Into" },
|
||||
["<F2>"] = { dap.step_over, "Debug: Step Over" },
|
||||
["<F3>"] = { dap.step_out, "Debug: Step Out" },
|
||||
["<leader>Db"] = { dap.toggle_breakpoint, "Debug: Toggle Breakpoint" },
|
||||
["<leader>DB"] = {
|
||||
function() dap.set_breakpoint(vim.fn.input("Breakpoint condition: ")) end,
|
||||
"Debug: Set Breakpoint",
|
||||
},
|
||||
-- Toggle to see last session result. Without this, you can't see session output in case of unhandled exception.
|
||||
["<F7>"] = { dapui.toggle, "Debug: See last session result." },
|
||||
}, { prefix = "", mode = "n" })
|
||||
|
||||
-- Dap UI setup
|
||||
-- For more information, see |:help nvim-dap-ui|
|
||||
dapui.setup({
|
||||
-- Set icons to characters that are more likely to work in every terminal.
|
||||
-- Feel free to remove or use ones that you like more! :)
|
||||
-- Don't feel like these are good choices.
|
||||
icons = { expanded = "▾", collapsed = "▸", current_frame = "*" },
|
||||
controls = {
|
||||
icons = {
|
||||
pause = "⏸",
|
||||
play = "▶",
|
||||
step_into = "⏎",
|
||||
step_over = "⏭",
|
||||
step_out = "⏮",
|
||||
step_back = "b",
|
||||
run_last = "▶▶",
|
||||
terminate = "⏹",
|
||||
disconnect = "⏏",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
dap.listeners.after.event_initialized["dapui_config"] = dapui.open
|
||||
dap.listeners.before.event_terminated["dapui_config"] = dapui.close
|
||||
dap.listeners.before.event_exited["dapui_config"] = dapui.close
|
||||
|
||||
-- Install golang specific config
|
||||
require("dap-go").setup()
|
||||
end,
|
||||
}
|
||||
@@ -1,87 +1,20 @@
|
||||
-- Quickstart configs for Nvim LSP
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
-- LSP auto-complete.
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
{ "williamboman/mason.nvim", config = true },
|
||||
{ "williamboman/mason-lspconfig.nvim" },
|
||||
|
||||
-- Useful status updates for LSP
|
||||
-- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
|
||||
-- NOTE: using tag legacy, fidget is being re-written completely
|
||||
{ "j-hui/fidget.nvim", event = "LspAttach", tag = "legacy", opts = {} },
|
||||
|
||||
-- Additional lua configuration, makes nvim stuff amazing!
|
||||
{ "folke/neodev.nvim" },
|
||||
},
|
||||
init = function()
|
||||
-- disable lsp watcher. Too slow on linux
|
||||
local ok, wf = pcall(require, "vim.lsp._watchfiles")
|
||||
if ok then
|
||||
wf._watchfunc = function()
|
||||
return function() end
|
||||
end
|
||||
end
|
||||
end,
|
||||
config = function()
|
||||
-- Switch for controlling whether you want autoformatting.
|
||||
-- Use :KickstartFormatToggle to toggle autoformatting on or off
|
||||
local format_is_enabled = true
|
||||
vim.api.nvim_create_user_command("KickstartFormatToggle", function()
|
||||
format_is_enabled = not format_is_enabled
|
||||
print("Setting autoformatting to: " .. tostring(format_is_enabled))
|
||||
end, {})
|
||||
|
||||
-- Create an augroup that is used for managing our formatting autocmds.
|
||||
-- We need one augroup per client to make sure that multiple clients
|
||||
-- can attach to the same buffer without interfering with each other.
|
||||
local _augroups = {}
|
||||
local get_augroup = function(client)
|
||||
if not _augroups[client.id] then
|
||||
local group_name = "kickstart-lsp-format-" .. client.name
|
||||
local id = vim.api.nvim_create_augroup(group_name, { clear = true })
|
||||
_augroups[client.id] = id
|
||||
end
|
||||
|
||||
return _augroups[client.id]
|
||||
end
|
||||
|
||||
-- Whenever an LSP attaches to a buffer, we will run this function.
|
||||
--
|
||||
-- See `:help LspAttach` for more information about this autocmd event.
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
group = vim.api.nvim_create_augroup("kickstart-lsp-attach-format", { clear = true }),
|
||||
-- This is where we attach the autoformatting for reasonable clients
|
||||
callback = function(args)
|
||||
local client_id = args.data.client_id
|
||||
local client = vim.lsp.get_client_by_id(client_id)
|
||||
local bufnr = args.buf
|
||||
|
||||
-- Only attach to clients that support document formatting
|
||||
if not client.server_capabilities.documentFormattingProvider then return end
|
||||
|
||||
-- Tsserver usually works poorly. Sorry you work with bad languages
|
||||
-- You can remove this line if you know what you're doing :)
|
||||
if client.name == "tsserver" then return end
|
||||
|
||||
-- Create an autocmd that will run *before* we save the buffer.
|
||||
-- Run the formatting command for the LSP that has just attached.
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = get_augroup(client),
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
if not format_is_enabled then return end
|
||||
|
||||
vim.lsp.buf.format({
|
||||
async = false,
|
||||
filter = function(c) return c.id == client.id end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
opts = {
|
||||
servers = {
|
||||
eslint = {},
|
||||
tflint = {},
|
||||
},
|
||||
setup = {
|
||||
eslint = function()
|
||||
require("lazyvim.util.lsp").on_attach(function(client)
|
||||
if client.name == "eslint" then
|
||||
client.server_capabilities.documentFormattingProvider = true
|
||||
elseif client.name == "tsserver" then
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
end
|
||||
end)
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
-- Nvim Treesitter configurations and abstraction layer
|
||||
-- https://github.com/nvim-treesitter/nvim-treesitter
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (or "all")
|
||||
ignore_install = {},
|
||||
|
||||
modules = {},
|
||||
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = "all",
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = {},
|
||||
--injections = {
|
||||
-- python = {
|
||||
-- docstrings: "markdown",
|
||||
-- },
|
||||
--}
|
||||
},
|
||||
indent = { enable = true },
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<c-space>",
|
||||
node_incremental = "<c-space>",
|
||||
scope_incremental = "<c-s>",
|
||||
node_decremental = "<M-space>",
|
||||
},
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["aa"] = "@parameter.outer",
|
||||
["ia"] = "@parameter.inner",
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
-- whether to set jumps in the jumplist
|
||||
set_jumps = true,
|
||||
goto_next_start = {
|
||||
["]m"] = "@function.outer",
|
||||
["]]"] = "@class.outer",
|
||||
},
|
||||
goto_next_end = {
|
||||
["]M"] = "@function.outer",
|
||||
["]["] = "@class.outer",
|
||||
},
|
||||
goto_previous_start = {
|
||||
["[m"] = "@function.outer",
|
||||
["[["] = "@class.outer",
|
||||
},
|
||||
goto_previous_end = {
|
||||
["[M"] = "@function.outer",
|
||||
["[]"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
["<leader>a"] = "@parameter.inner",
|
||||
},
|
||||
swap_previous = {
|
||||
["<leader>A"] = "@parameter.inner",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-context",
|
||||
lazy = false,
|
||||
enabled = true,
|
||||
opts = {
|
||||
enable = true,
|
||||
mode = "cursor", -- cursor, or topline
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
return {
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
cmd = { "Refactor" },
|
||||
opts = {},
|
||||
keys = {
|
||||
{
|
||||
"<leader>re",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Extract Function",
|
||||
},
|
||||
{
|
||||
"<leader>rf",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Extract Function To File",
|
||||
},
|
||||
{
|
||||
"<leader>rv",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Extract Variable",
|
||||
},
|
||||
{
|
||||
"<leader>ri",
|
||||
[[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]],
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"n",
|
||||
"v",
|
||||
"x",
|
||||
},
|
||||
desc = "Inline Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rb",
|
||||
function() require("refactoring").refactor("Extract Block") end,
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"n",
|
||||
},
|
||||
desc = "Extract Block",
|
||||
},
|
||||
{
|
||||
"<leader>rbf",
|
||||
function() require("refactoring").refactor("Extract Block To File") end,
|
||||
{ silent = true, expr = false },
|
||||
mode = {
|
||||
"n",
|
||||
},
|
||||
desc = "Extract Block To File",
|
||||
},
|
||||
{
|
||||
"<leader>rr",
|
||||
function() require("refactoring").select_refactor() end,
|
||||
{ silent = true, expr = false },
|
||||
desc = "Select Refactor",
|
||||
},
|
||||
{
|
||||
"<leader>rp",
|
||||
function() require("refactoring").debug.printf({ below = false }) end,
|
||||
mode = { "n" },
|
||||
desc = "Debug: Print Function",
|
||||
},
|
||||
{
|
||||
"<leader>rd",
|
||||
function() require("refactoring").debug.print_var({ normal = true, below = false }) end,
|
||||
mode = { "n" },
|
||||
desc = "Debug: Print Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rd",
|
||||
function() require("refactoring").debug.print_var({ below = false }) end,
|
||||
mode = { "v" },
|
||||
desc = "Debug: Print Variable",
|
||||
},
|
||||
{
|
||||
"<leader>rc",
|
||||
function() require("refactoring").debug.cleanup({}) end,
|
||||
mode = { "n" },
|
||||
desc = "Debug: Clean Up",
|
||||
},
|
||||
},
|
||||
}
|
||||
53
config/nvim/lua/plugins/supertab.lua
Normal file
53
config/nvim/lua/plugins/supertab.lua
Normal file
@@ -0,0 +1,53 @@
|
||||
return {
|
||||
-- Use <tab> for completion and snippets (supertab)
|
||||
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
keys = function()
|
||||
return {}
|
||||
end,
|
||||
},
|
||||
-- then: setup supertab in cmp
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-emoji",
|
||||
},
|
||||
---@param opts cmp.ConfigSchema
|
||||
opts = function(_, opts)
|
||||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
end
|
||||
|
||||
local luasnip = require("luasnip")
|
||||
local cmp = require("cmp")
|
||||
|
||||
opts.mapping = vim.tbl_extend("force", opts.mapping, {
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- this way you will only jump inside the snippet region
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,155 +0,0 @@
|
||||
-- Telescope, a see-all-through file manager.
|
||||
-- vim: ts=2 sw=2 si et
|
||||
-- luacheck: globals vim
|
||||
return {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
dependencies = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-lua/popup.nvim" },
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
-- Only load if `make` is available. Make sure you have the system
|
||||
-- requirements installed.
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
-- NOTE: If you are having trouble with this installation,
|
||||
-- refer to the README for telescope-fzf-native for more instructions.
|
||||
build = "make",
|
||||
cond = function() return vim.fn.executable("make") == 1 end,
|
||||
},
|
||||
{ "nvim-telescope/telescope-file-browser.nvim" },
|
||||
},
|
||||
config = function()
|
||||
local actions = require("telescope.actions")
|
||||
local sorters = require("telescope.sorters")
|
||||
local previewers = require("telescope.previewers")
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<ESC>"] = actions.close,
|
||||
["<C-u>"] = false,
|
||||
["<C-d>"] = false,
|
||||
},
|
||||
},
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"-L",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
},
|
||||
|
||||
prompt_prefix = " ",
|
||||
selection_caret = " ",
|
||||
entry_prefix = " ",
|
||||
initial_mode = "insert",
|
||||
selection_strategy = "reset",
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "horizontal",
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
prompt_position = "top",
|
||||
preview_width = 0.55,
|
||||
results_width = 0.8,
|
||||
},
|
||||
vertical = {
|
||||
mirror = false,
|
||||
},
|
||||
width = 0.87,
|
||||
height = 0.80,
|
||||
preview_cutoff = 120,
|
||||
},
|
||||
file_sorter = sorters.get_fuzzy_file,
|
||||
file_ignore_patterns = { "node_modules", "dotbot" },
|
||||
generic_sorter = sorters.get_generic_fuzzy_sorter,
|
||||
path_display = { "truncate" },
|
||||
winblend = 0,
|
||||
border = {},
|
||||
borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
|
||||
color_devicons = true,
|
||||
use_less = true,
|
||||
set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil,
|
||||
file_previewer = previewers.vim_buffer_cat.new,
|
||||
grep_previewer = previewers.vim_buffer_vimgrep.new,
|
||||
qflist_previewer = previewers.vim_buffer_qflist.new,
|
||||
-- Developer configurations: Not meant for general override
|
||||
buffer_previewer_maker = previewers.buffer_previewer_maker,
|
||||
},
|
||||
pickers = {
|
||||
buffers = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<c-d>"] = actions.delete_buffer + actions.move_to_top,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
extensions_list = { "themes", "terms" },
|
||||
})
|
||||
|
||||
pcall(require("telescope").load_extension, "fzf")
|
||||
pcall(require("telescope").load_extension, "file_browser")
|
||||
pcall(require("telescope").load_extension, "harpoon")
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
local tbi = require("telescope.builtin")
|
||||
local wk = require("which-key")
|
||||
wk.register({
|
||||
["?"] = {
|
||||
function() tbi.oldfiles() end,
|
||||
"[?] Find recently opened files",
|
||||
},
|
||||
["<space>"] = {
|
||||
function() tbi.buffers() end,
|
||||
"[ ] Find existing buffers",
|
||||
},
|
||||
["/"] = {
|
||||
function()
|
||||
-- You can pass additional configuration to telescope to change theme, layout, etc.
|
||||
tbi.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
}))
|
||||
end,
|
||||
"[/] Fuzzily search in current buffer",
|
||||
},
|
||||
|
||||
t = {
|
||||
b = {
|
||||
"<cmd>Telescope file_browser<CR>",
|
||||
"[T]elescope: File [B]rowser",
|
||||
},
|
||||
d = {
|
||||
function() tbi.diagnostics() end,
|
||||
"[T]elescope: Search [D]iagnostics",
|
||||
},
|
||||
|
||||
f = {
|
||||
function() tbi.find_files() end,
|
||||
"[T]elescope: Search [F]iles",
|
||||
},
|
||||
g = {
|
||||
function() tbi.git_files() end,
|
||||
"[T]elescope: Search [G]it files",
|
||||
},
|
||||
h = {
|
||||
function() tbi.help_tags() end,
|
||||
"[T]elescope: Search [H]elp",
|
||||
},
|
||||
r = {
|
||||
function() tbi.live_grep() end,
|
||||
"[T]elescope: Search by G[r]ep",
|
||||
},
|
||||
w = {
|
||||
function() tbi.grep_string() end,
|
||||
"[T]elescope: Search current [W]ord",
|
||||
},
|
||||
},
|
||||
}, { prefix = "<leader>" })
|
||||
end,
|
||||
}
|
||||
24
config/nvim/lua/plugins/tools.lua
Normal file
24
config/nvim/lua/plugins/tools.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
return {
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"actionlint",
|
||||
"ansible-lint",
|
||||
"bash-language-server",
|
||||
"commitlint",
|
||||
"flake8",
|
||||
"intelephense",
|
||||
"jsonlint",
|
||||
"luacheck",
|
||||
"phpcs",
|
||||
"phpmd",
|
||||
"shellcheck",
|
||||
"shfmt",
|
||||
"stylelint",
|
||||
"stylua",
|
||||
"yamllint",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
23
config/nvim/lua/plugins/treesitter.lua
Normal file
23
config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
vim.list_extend(opts.ensure_installed, {
|
||||
"bash",
|
||||
"html",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"yaml",
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
-- A pretty diagnostics, references, telescope results,
|
||||
-- quickfix and location list to help you solve all
|
||||
-- the trouble your code is causing.
|
||||
-- https://github.com/folke/trouble.nvim
|
||||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = "kyazdani42/nvim-web-devicons",
|
||||
config = {
|
||||
-- position of the list can be: bottom, top, left, right
|
||||
position = "bottom",
|
||||
-- height of the trouble list when position is top or bottom
|
||||
height = 6,
|
||||
-- width of the list when position is left or right
|
||||
width = 50,
|
||||
-- use devicons for filenames
|
||||
icons = true,
|
||||
-- "workspace_diagnostics", "document_diagnostics",
|
||||
-- "quickfix", "lsp_references", "loclist"
|
||||
mode = "workspace_diagnostics",
|
||||
-- icon used for open folds
|
||||
fold_open = "",
|
||||
-- icon used for closed folds
|
||||
fold_closed = "",
|
||||
-- group results by file
|
||||
group = true,
|
||||
-- add an extra new line on top of the list
|
||||
padding = true,
|
||||
-- key mappings for actions in the trouble list
|
||||
action_keys = {
|
||||
-- map to {} to remove a mapping, for example:
|
||||
-- close = {},
|
||||
|
||||
-- close the list
|
||||
close = "q",
|
||||
-- cancel the preview and get back to your last window / buffer / cursor
|
||||
cancel = "<esc>",
|
||||
-- manually refresh
|
||||
refresh = "r",
|
||||
-- jump to the diagnostic or open / close folds
|
||||
jump = { "<cr>", "<tab>" },
|
||||
-- open buffer in new split
|
||||
open_split = { "<c-x>" },
|
||||
-- open buffer in new vsplit
|
||||
open_vsplit = { "<c-v>" },
|
||||
-- open buffer in new tab
|
||||
open_tab = { "<c-t>" },
|
||||
-- jump to the diagnostic and close the list
|
||||
jump_close = { "o" },
|
||||
-- toggle between "workspace" and "document" diagnostics mode
|
||||
toggle_mode = "m",
|
||||
-- toggle auto_preview
|
||||
toggle_preview = "P",
|
||||
-- opens a small popup with the full multiline message
|
||||
hover = "K",
|
||||
-- preview the diagnostic location
|
||||
preview = "p",
|
||||
-- close all folds
|
||||
close_folds = { "zM", "zm" },
|
||||
-- open all folds
|
||||
open_folds = { "zR", "zr" },
|
||||
-- toggle fold of current file
|
||||
toggle_fold = { "zA", "za" },
|
||||
-- preview item
|
||||
previous = "k",
|
||||
-- next item
|
||||
next = "j",
|
||||
},
|
||||
-- add an indent guide below the fold icons
|
||||
indent_lines = true,
|
||||
-- automatically open the list when you have diagnostics
|
||||
auto_open = false,
|
||||
-- automatically close the list when you have no diagnostics
|
||||
auto_close = true,
|
||||
-- automatically preview the location of the diagnostic.
|
||||
-- <esc> to close preview and go back to last window
|
||||
auto_preview = true,
|
||||
-- automatically fold a file trouble list at creation
|
||||
auto_fold = false,
|
||||
-- for the given modes, automatically jump if there is only a single result
|
||||
auto_jump = { "lsp_definitions" },
|
||||
signs = {
|
||||
-- icons / text used for a diagnostic
|
||||
error = "",
|
||||
warning = "",
|
||||
hint = "",
|
||||
information = "",
|
||||
other = "",
|
||||
},
|
||||
-- enabling this will use the signs defined in your lsp client
|
||||
use_diagnostic_signs = false,
|
||||
},
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
-- Twilight dims inactive portions of the
|
||||
-- code you're editing using TreeSitter
|
||||
-- https://github.com/folke/twilight.nvim
|
||||
return {
|
||||
"folke/twilight.nvim",
|
||||
config = {
|
||||
dimming = {
|
||||
-- amount of dimming
|
||||
alpha = 0.2,
|
||||
-- when true, other windows will be fully dimmed (unless they contain the same buffer)
|
||||
inactive = false,
|
||||
},
|
||||
-- amount of lines we will try to show around the current line
|
||||
context = 3,
|
||||
-- use treesitter when available for the filetype
|
||||
-- treesitter is used to automatically expand the visible text,
|
||||
-- but you can further control the types of nodes that should always be fully expanded
|
||||
|
||||
treesitter = true,
|
||||
|
||||
-- for treesitter, we we always try to expand to the top-most ancestor with these types
|
||||
expand = {
|
||||
"function",
|
||||
"while_statement",
|
||||
"for_statement",
|
||||
"switch_statement",
|
||||
"method",
|
||||
"table",
|
||||
"if_statement",
|
||||
},
|
||||
exclude = {}, -- exclude these filetypes
|
||||
},
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user