Compare commits

...

32 Commits

Author SHA1 Message Date
e0c6d7e4f4 chore(nvim): update plugins 2023-09-24 22:45:36 +03:00
1937e72f17 chore(config): starship username tweak 2023-09-24 22:45:11 +03:00
228ba78341 feat(nvim): nvim-ufo, indent-blankline, gitsigns 2023-09-21 13:14:49 +03:00
c8c34dcc81 chore(nvim): tweak settings, update plugins 2023-09-21 13:14:15 +03:00
3d65fdee43 chore(config): tweak starship config 2023-09-21 13:11:31 +03:00
1897f49906 chore(nvim): transparency, edgy, configs, updates 2023-09-20 11:13:48 +03:00
d86785ad47 chore(repo): new screenshot, updated readme 2023-09-20 11:12:56 +03:00
1c3c04a6f3 fix(scripts): git-profile completion file name 2023-09-20 09:53:37 +03:00
debb79ee09 fix(cheat): save common to tldr root, fix names 2023-09-20 09:52:57 +03:00
c1dda8a230 feat(shell): eza, a modern replacement for ‘ls’ 2023-09-20 09:49:21 +03:00
5c74383dda chore(shell): add aliases and cleanup zsh plugins 2023-09-20 09:48:28 +03:00
da1473547a chore(nvim): plugin updates 2023-09-20 08:29:12 +03:00
43df368ec1 chore(nvim): configuration and plugin updates 2023-09-20 08:27:14 +03:00
6f3f977100 chore(docs): update tmux bindings 2023-09-19 09:10:17 +03:00
ab8e654c2a chore(deps): update Brewfile & nvim lazy plugins 2023-09-19 09:04:55 +03:00
1a4113e3cd chore(scripts): shfmt scripts 2023-09-19 09:04:02 +03:00
b3445d7e7a feat(dfm): shfmt now run with cargo installed fd 2023-09-19 09:03:08 +03:00
50fc1ea279 chore(config): starship: show hostname always 2023-09-19 08:48:53 +03:00
d61f53196d feat(dfm): install pip/python packages 2023-09-19 08:47:45 +03:00
7769af68b5 feat(tmux): tmux-window-name 2023-09-19 08:46:14 +03:00
05aa4ba092 feat(scripts): use bkt for command caching 2023-09-19 02:23:03 +03:00
a26f160326 feat(dfm): install rust/cargo packages 2023-09-19 02:22:05 +03:00
00de4a7b83 chore(nvim): plugins, updates 2023-09-19 01:34:42 +03:00
020012eb60 chore(config): exports for lakka 2023-09-19 01:31:55 +03:00
cf92bc9a69 feat(nvim): anuvyklack/windows.nvim 2023-09-18 09:23:49 +03:00
1c17ee28cb feat(nvim): language support, updated plugins 2023-09-18 08:52:46 +03:00
0919a9732e chore(repo): clean up yamlfmt exclude list 2023-09-15 17:41:04 +03:00
52a941f0fa chore(dotbot): updated install script 2023-09-15 17:40:16 +03:00
e661f6d942 chore(config): tweak alacritty opacity 2023-09-15 17:39:48 +03:00
b5160bbbfa feat(nvim): Switched to LazyVim with tweaks 2023-09-15 17:39:21 +03:00
2df27d2a0e chore(nvim): tweaks, docs, updates 2023-09-13 10:29:05 +03:00
ivuorinen
0c0f3823e4 chore(git): Update submodules (automated)
dotbot v1.20.1
2023-09-11 03:04:42 +00:00
66 changed files with 1069 additions and 2880 deletions

24
.github/README.md vendored
View File

@@ -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
![screenshot of tmux with powerlevel10k](./screenshots/tmux-powerlevel10k-130x20.png)
## tmux + nvim (astronvim) editing this repository
![screenshot of tmux showing nvim](./screenshots/tmux-astronvim-130x40.png)
![screenshot of tmux with nvim editing this repo](./screenshots/tmux-nvim.png)
## 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:

BIN
.github/screenshots/tmux-nvim.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

3
.gitmodules vendored
View File

@@ -44,3 +44,6 @@
[submodule "tmux/tmux-yank"]
path = config/tmux/plugins/tmux-yank
url = https://github.com/tmux-plugins/tmux-yank.git
[submodule "tmux/tmux-window-name"]
path = config/tmux/plugins/tmux-window-name
url = https://github.com/ofirgall/tmux-window-name.git

View File

@@ -18,7 +18,5 @@ include:
- ./**/*.{yml,yaml}
exclude:
- ./tools/dotbot/**
- ./tools/dotbot-*/**
- ./config/astronvim/**
- ./tools/**
- ./config/nvim/**

View File

@@ -20,5 +20,7 @@ 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-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

View File

@@ -29,7 +29,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

View File

@@ -55,6 +55,60 @@ if [[ $(uname) == 'Darwin' ]]; then
alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl"
fi
# Be nice
alias please="sudo "
! have eza && alias ls='ls --color=auto'
have eza && {
alias ls='eza -h -s=type --git --icons --group-directories-first'
}
# Easier navigation: .., ..., ....
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
# Colors for ls
alias ll="ls -l"
alias l="ls"
# Prevent common typos
alias cd..="cd .."
alias sl="ls"
# List only directories
alias lsd="ls -lF | grep '^d'"
# Recursively delete `.pyc` files
alias rmpyc="find . -type f -name '*.pyc' -ls -delete"
# Recursively delete `.DS_Store` files
alias rmds="find . -type f -name '*.DS_Store' -ls -delete"
# IP addresses
alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
alias localip="ipconfig getifaddr en1"
alias ips="ifconfig -a | grep -o 'inet6\? \(\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\)\|[a-fA-F0-9:]\+\)' | sed -e 's/inet6* //'"
# Show/hide hidden files in Finder
alias show="defaults write com.apple.finder AppleShowAllFiles -bool true; killall Finder"
alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false; killall Finder"
# Pipe public key to clipboard.
alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
# Flush Directory Service cache
alias flush="dscacheutil -flushcache"
# Update locatedb
alias updatedb="sudo /usr/libexec/locate.updatedb"
# Always return full history
alias history="history 1"
alias pip="pip3 "
alias python="python3 "
# tmux: automatically attach or create session with name 'main'
alias tmux='tmux new-session -A -s main'
# tmux: attach or create new session

7
config/exports-lakka Normal file
View File

@@ -0,0 +1,7 @@
# lakka exports
## LUA
have luarocks && $(luarocks path --bin)
path_append "$HOME/.local/go/bin"

View File

@@ -67,15 +67,11 @@ x-default-antigen-bundles()
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

View File

@@ -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
@@ -108,8 +110,6 @@ brew "eg-examples"
brew "entr"
# Perl lib for reading and writing EXIF metadata
brew "exiftool"
# Simple, fast and user-friendly alternative to find
brew "fd"
# Banner-like program prints strings as ASCII art
brew "figlet"
# Libraries to talk to Microsoft SQL Server and Sybase databases
@@ -152,8 +152,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
@@ -278,6 +276,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 +314,10 @@ 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"
# Turn audio CDs and files into audiobooks
cask "audiobook-builder"
# Text editor
@@ -435,6 +437,7 @@ 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.vscode-github-actions"
vscode "GitHub.vscode-pull-request-github"
@@ -473,6 +476,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"

View File

@@ -1 +1,8 @@
session.vim
tt.*
.tests
doc/tags
debug
.repro
foo.*
*.log
data

15
config/nvim/.neoconf.json Normal file
View File

@@ -0,0 +1,15 @@
{
"neodev": {
"library": {
"enabled": true,
"plugins": true
}
},
"neoconf": {
"plugins": {
"lua_ls": {
"enabled": true
}
}
}
}

View File

@@ -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
View 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.

View File

@@ -1 +0,0 @@
vim.api.nvim_command("set formatoptions-=cro")

View File

@@ -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")

View File

@@ -1,52 +1,69 @@
{
"barbecue.nvim": { "branch": "main", "commit": "cd7e7da622d68136e13721865b4d919efd6325ed" },
"LazyVim": { "branch": "main", "commit": "a72a84972d85e5bbc6b9d60a0983b37efef21b8a" },
"LuaSnip": { "branch": "master", "commit": "1fd22fa96c11573248f9fdd09f25e724c7bb3dd4" },
"SchemaStore.nvim": { "branch": "main", "commit": "d2a3d1da007549c921f7b0e22521d1c20d09c8a7" },
"alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" },
"animation.nvim": { "branch": "main", "commit": "fb77091ab72ec9971aee0562e7081182527aaa6a" },
"bufdelete.nvim": { "branch": "master", "commit": "07d1f8ba79dec59d42b975a4df1c732b2e4e37b4" },
"catppuccin": { "branch": "main", "commit": "a937d546f4783a1ff67f84043d2d7871ad4ecd83" },
"close-buffers.nvim": { "branch": "master", "commit": "3acbcad1211572342632a6c0151f839e7dead27f" },
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
"catppuccin": { "branch": "main", "commit": "3d9a5ed556e289bce6c1fb0af89ec838360641b2" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"comment-box.nvim": { "branch": "main", "commit": "dd1a48f8d06102e9b87ae1e0069bc365c006979b" },
"dressing.nvim": { "branch": "master", "commit": "c1e1d5fa44fe08811b6ef4aadac2b50e602f9504" },
"fidget.nvim": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" },
"gitsigns.nvim": { "branch": "main", "commit": "983f1a216cca1a079399ba050bc4b9ce130de83a" },
"edgy.nvim": { "branch": "main", "commit": "4ccc1c67ae2b1a0c55f18c83d03b714e2bb1bae4" },
"flash.nvim": { "branch": "main", "commit": "cc8c7e03987134997d74ee87e55a5717279f2d05" },
"friendly-snippets": { "branch": "main", "commit": "ebf6d6e83494cdd88a54a429340256f4dbb6a052" },
"gitsigns.nvim": { "branch": "main", "commit": "bdeba1cec3faddd89146690c10b9a87949c0ee66" },
"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" },
"indent-blankline.nvim": { "branch": "master", "commit": "9637670896b68805430e2f72cf5d16be5b97a22a" },
"lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" },
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "2451adb9bdb0fd32140bf3aa8dbc17ff60050db3" },
"mason.nvim": { "branch": "main", "commit": "d66c60e17dd6fd8165194b1d14d21f7eb2c1697a" },
"middleclass": { "branch": "master", "commit": "9fab4d5bca67262614960960ca35c4740eb2be2c" },
"mini.ai": { "branch": "main", "commit": "7ae226f331885e6f30e9a8229e113debc59308ae" },
"mini.animate": { "branch": "main", "commit": "989ac014933ab5cd14ab83f2fce4b9a08ca6d81e" },
"mini.bufremove": { "branch": "main", "commit": "7821606e35c1ac931b56d8e3155f45ffe76ee7e5" },
"mini.comment": { "branch": "main", "commit": "877acea5b2a32ff55f808fc0ebe9aa898648318c" },
"mini.indentscope": { "branch": "main", "commit": "f60e9b51a6214c73a170ffc5445ce91560981031" },
"mini.pairs": { "branch": "main", "commit": "dfa9f6e2576bb8853be277d96b735af59d9be7c2" },
"mini.surround": { "branch": "main", "commit": "9d1956b576d7051da3a483b251dfc778121c60db" },
"neo-tree.nvim": { "branch": "v3.x", "commit": "71f1841ba6c652908678cece623f52c1fea8a6cd" },
"neoconf.nvim": { "branch": "main", "commit": "360805250fe45391d30b96b6640d03e2c35597ee" },
"neodev.nvim": { "branch": "main", "commit": "ddf29935af5a510307850919d6772ea6a4e2c008" },
"neogen": { "branch": "main", "commit": "cb1f384df804c1bf729332c4f728253fe17962d4" },
"noice.nvim": { "branch": "main", "commit": "74c2902146b080035beb19944baf6f014a954720" },
"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-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
"nvim-lspconfig": { "branch": "master", "commit": "ede4114e1fd41acb121c70a27e1b026ac68c42d6" },
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
"nvim-notify": { "branch": "master", "commit": "94859430020f5cf32a1b97ddd9e596fed9db7981" },
"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" },
"nvim-spectre": { "branch": "master", "commit": "97cfd1b0f5a6ab35979ce1bee6c17f54745fd1e5" },
"nvim-treesitter": { "branch": "master", "commit": "0960322686bfa38afd4f1e0b9660473cf77e24b6" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "bd103502252027434ec42f628d2dbf54821d4ce6" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "95e9ba9de4289d221666b66fd930d157c7ca08c6" },
"nvim-ufo": { "branch": "main", "commit": "6f2ccdf2da390d62f8f9e15fc5ddbcbd312e1e66" },
"nvim-web-devicons": { "branch": "master", "commit": "480a756df82a0c231622c9bf2173bb6634713716" },
"persistence.nvim": { "branch": "main", "commit": "4b8051c01f696d8849a5cb8afa9767be8db16e40" },
"plenary.nvim": { "branch": "master", "commit": "9ce85b0f7dcfe5358c0be937ad23e456907d410b" },
"promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" },
"stickybuf.nvim": { "branch": "master", "commit": "e3db41f2c1bb2df3ee6ff964ee74fe991f6f9566" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "bc25c56083939f274edcfe395c6ff7de23b67c50" },
"telescope.nvim": { "branch": "master", "commit": "ed9574dd6dde143d009b2528ea6d79bd34bbe6c8" },
"todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" },
"tokyonight.nvim": { "branch": "main", "commit": "9a01eada39558dc3243278e6805d90e8dff45dc0" },
"transparent.nvim": { "branch": "main", "commit": "3af6232c8d39d51062702e875ff6407c1eeb0391" },
"trouble.nvim": { "branch": "main", "commit": "3f85d8ed30e97ceeddbbcf80224245d347053711" },
"twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" },
"venv-selector.nvim": { "branch": "main", "commit": "14d6e866070f759e9014a8053954f835294f56f9" },
"vim-illuminate": { "branch": "master", "commit": "6acf7d4a18255a3ddc43770866c8e148fe85af7b" },
"vim-startuptime": { "branch": "master", "commit": "454b3de856b7bd298700de33d79774ca9b9e3875" },
"vim-wakatime": { "branch": "master", "commit": "0d2efa2daff34b27b0d227d4c3b136811c93db93" },
"which-key.nvim": { "branch": "main", "commit": "7ccf476ebe0445a741b64e36c78a682c1c6118b7" },
"wilder.nvim": { "branch": "master", "commit": "679f348dc90d80ff9ba0e7c470c40a4d038dcecf" }
"windows.nvim": { "branch": "main", "commit": "c7492552b23d0ab30325e90b56066ec51242adc8" }
}

View File

@@ -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,
})

View 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

View 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" })

View File

@@ -0,0 +1,61 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
spec = {
-- add LazyVim and import its plugins
{
"LazyVim/LazyVim",
import = "lazyvim.plugins",
opts = {
colorscheme = "catppuccin",
},
},
-- import any extras modules here
{ import = "lazyvim.plugins.extras.formatting.prettier" },
{ import = "lazyvim.plugins.extras.lang.docker" },
{ import = "lazyvim.plugins.extras.lang.go" },
{ import = "lazyvim.plugins.extras.lang.json" },
{ import = "lazyvim.plugins.extras.lang.python" },
{ import = "lazyvim.plugins.extras.lang.tailwind" },
{ import = "lazyvim.plugins.extras.lang.terraform" },
{ import = "lazyvim.plugins.extras.lang.typescript" },
{ import = "lazyvim.plugins.extras.lang.yaml" },
{ import = "lazyvim.plugins.extras.linting.eslint" },
{ import = "lazyvim.plugins.extras.ui.edgy" },
{ import = "lazyvim.plugins.extras.ui.mini-animate" },
-- import/override with your plugins
{ import = "plugins" },
},
defaults = {
-- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
-- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
lazy = false,
-- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
-- have outdated releases, which may break your Neovim install.
version = false, -- always use the latest git commit
-- version = "*", -- try installing the latest stable version for plugins that support semver
},
install = { colorscheme = { "catppuccin" } },
checker = { enabled = true }, -- automatically check for plugin updates
performance = {
rtp = {
-- disable some rtp plugins
disabled_plugins = {
"gzip",
-- "matchit",
-- "matchparen",
-- "netrwPlugin",
"tarPlugin",
"tohtml",
"tutor",
"zipPlugin",
},
},
},
})

View File

@@ -0,0 +1,13 @@
-- Options are automatically loaded before lazy.nvim startup
-- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua
-- Add any additional options here
local opt = vim.opt
opt.number = true
opt.relativenumber = true
opt.modeline = true
opt.spelllang = { "en", "fi" }
-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et

View File

@@ -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",
},
})

View File

@@ -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)

View File

@@ -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({})

View File

@@ -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
},
}

View File

@@ -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)

View File

@@ -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)

View File

@@ -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 = "",
},
},
}

View File

@@ -0,0 +1,91 @@
return {
-- A better annotation generator. Supports multiple languages and annotation conventions.
-- https://github.com/danymat/neogen
{
"danymat/neogen",
dependencies = "nvim-treesitter/nvim-treesitter",
version = "*",
cmd = "Neogen",
opts = {
snippet_engine = "luasnip",
languages = {
lua = { template = { annotation_convention = "ldoc" } },
typescript = { template = { annotation_convention = "tsdoc" } },
typescriptreact = { template = { annotation_convention = "tsdoc" } },
},
},
keys = {
{
"<leader>baa",
function()
require("neogen").generate({ type = "current" })
end,
desc = "Current",
},
{
"<leader>bac",
function()
require("neogen").generate({ type = "class" })
end,
desc = "Class",
},
{
"<leader>baf",
function()
require("neogen").generate({ type = "func" })
end,
desc = "Function",
},
{
"<leader>bat",
function()
require("neogen").generate({ type = "type" })
end,
desc = "Type",
},
{
"<leader>baF",
function()
require("neogen").generate({ type = "file" })
end,
desc = "File",
},
},
},
-- Describe the regexp under the cursor
-- https://github.com/bennypowers/nvim-regexplainer
{
"bennypowers/nvim-regexplainer",
dependencies = {
"nvim-treesitter/nvim-treesitter",
"MunifTanjim/nui.nvim",
},
opts = {
-- automatically show the explainer when the cursor enters a regexp
auto = true,
},
},
-- Clarify and beautify your comments using boxes and lines.
-- https://github.com/LudoPinelli/comment-box.nvim
{ "LudoPinelli/comment-box.nvim", opts = {} },
-- Tabnine Client for Neovim
-- https://github.com/codota/tabnine-nvim
{
"codota/tabnine-nvim",
name = "tabnine",
enabled = false,
build = vim.loop.os_uname().sysname == "Windows_NT" and "pwsh.exe -file .\\dl_binaries.ps1" or "./dl_binaries.sh",
cmd = { "TabnineStatus", "TabnineDisable", "TabnineEnable", "TabnineToggle" },
event = "User",
opts = {
accept_keymap = "<C-e>",
dismiss_keymap = "<C-Esc>",
},
},
-- Vim plugin for automatic time tracking and metrics generated from your programming activity.
-- https://github.com/wakatime/vim-wakatime
{ "wakatime/vim-wakatime", lazy = false, enabled = true },
}

View File

@@ -0,0 +1,266 @@
-- since this is just an example spec, don't actually load anything here and return an empty spec
-- stylua: ignore
if true then return {} end
-- every spec file under the "plugins" directory will be loaded automatically by lazy.nvim
--
-- In your plugin files, you can:
-- * add extra plugins
-- * disable/enabled LazyVim plugins
-- * override the configuration of LazyVim plugins
return {
-- add gruvbox
{ "ellisonleao/gruvbox.nvim" },
-- Configure LazyVim to load gruvbox
{
"LazyVim/LazyVim",
opts = {
colorscheme = "gruvbox",
},
},
-- change trouble config
{
"folke/trouble.nvim",
-- opts will be merged with the parent spec
opts = { use_diagnostic_signs = true },
},
-- disable trouble
{ "folke/trouble.nvim", enabled = false },
-- add symbols-outline
{
"simrat39/symbols-outline.nvim",
cmd = "SymbolsOutline",
keys = { { "<leader>cs", "<cmd>SymbolsOutline<cr>", desc = "Symbols Outline" } },
config = true,
},
-- override nvim-cmp and add cmp-emoji
{
"hrsh7th/nvim-cmp",
dependencies = { "hrsh7th/cmp-emoji" },
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local cmp = require("cmp")
opts.sources = cmp.config.sources(vim.list_extend(opts.sources, { { name = "emoji" } }))
end,
},
-- change some telescope options and a keymap to browse plugin files
{
"nvim-telescope/telescope.nvim",
keys = {
-- add a keymap to browse plugin files
-- stylua: ignore
{
"<leader>fp",
function() require("telescope.builtin").find_files({ cwd = require("lazy.core.config").options.root }) end,
desc = "Find Plugin File",
},
},
-- change some options
opts = {
defaults = {
layout_strategy = "horizontal",
layout_config = { prompt_position = "top" },
sorting_strategy = "ascending",
winblend = 0,
},
},
},
-- add telescope-fzf-native
{
"telescope.nvim",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
config = function()
require("telescope").load_extension("fzf")
end,
},
},
-- add pyright to lspconfig
{
"neovim/nvim-lspconfig",
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- pyright will be automatically installed with mason and loaded with lspconfig
pyright = {},
},
},
},
-- add tsserver and setup with typescript.nvim instead of lspconfig
{
"neovim/nvim-lspconfig",
dependencies = {
"jose-elias-alvarez/typescript.nvim",
init = function()
require("lazyvim.util").on_attach(function(_, buffer)
-- stylua: ignore
vim.keymap.set("n", "<leader>co", "TypescriptOrganizeImports", { buffer = buffer, desc = "Organize Imports" })
vim.keymap.set("n", "<leader>cR", "TypescriptRenameFile", { desc = "Rename File", buffer = buffer })
end)
end,
},
---@class PluginLspOpts
opts = {
---@type lspconfig.options
servers = {
-- tsserver will be automatically installed with mason and loaded with lspconfig
tsserver = {},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
-- example to setup with typescript.nvim
tsserver = function(_, opts)
require("typescript").setup({ server = opts })
return true
end,
-- Specify * to use this function as a fallback for any server
-- ["*"] = function(server, opts) end,
},
},
},
-- for typescript, LazyVim also includes extra specs to properly setup lspconfig,
-- treesitter, mason and typescript.nvim. So instead of the above, you can use:
{ import = "lazyvim.plugins.extras.lang.typescript" },
-- add more treesitter parsers
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
-- since `vim.tbl_deep_extend`, can only merge tables and not lists, the code above
-- would overwrite `ensure_installed` with the new value.
-- If you'd rather extend the default config, use the code below instead:
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
-- add tsx and treesitter
vim.list_extend(opts.ensure_installed, {
"tsx",
"typescript",
})
end,
},
-- the opts function can also be used to change the default opts:
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function(_, opts)
table.insert(opts.sections.lualine_x, "😄")
end,
},
-- or you can return new options to override all the defaults
{
"nvim-lualine/lualine.nvim",
event = "VeryLazy",
opts = function()
return {
--[[add your custom lualine config here]]
}
end,
},
-- use mini.starter instead of alpha
{ import = "lazyvim.plugins.extras.ui.mini-starter" },
-- add jsonls and schemastore packages, and setup treesitter for json, json5 and jsonc
{ import = "lazyvim.plugins.extras.lang.json" },
-- add any tools you want to have installed below
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"stylua",
"shellcheck",
"shfmt",
"flake8",
},
},
},
-- Use <tab> for completion and snippets (supertab)
-- first: disable default <tab> and <s-tab> behavior in LuaSnip
{
"L3MON4D3/LuaSnip",
keys = function()
return {}
end,
},
-- then: setup supertab in cmp
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-emoji",
},
---@param opts cmp.ConfigSchema
opts = function(_, opts)
local has_words_before = function()
unpack = unpack or table.unpack
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
local luasnip = require("luasnip")
local cmp = require("cmp")
opts.mapping = vim.tbl_extend("force", opts.mapping, {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
-- this way you will only jump inside the snippet region
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
})
end,
},
}

View File

@@ -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,
},
},
}

View 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,
},
}

View File

@@ -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,
},
}

View File

@@ -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,
}

View File

@@ -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,
}

View File

@@ -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" },
},
}

View 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,
}

View File

@@ -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,
}

View File

@@ -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").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,
},
},
}

View File

@@ -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
},
},
}

View File

@@ -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",
},
},
}

View File

@@ -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,
}

View 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",
},
},
},
}

View File

@@ -0,0 +1,23 @@
return {
{
"nvim-treesitter/nvim-treesitter",
opts = {
ensure_installed = {
"bash",
"html",
"javascript",
"json",
"lua",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"tsx",
"typescript",
"vim",
"yaml",
},
},
},
}

View File

@@ -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,
},
}

View File

@@ -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
},
}

View File

@@ -0,0 +1,137 @@
-- luacheck: globals vim
return {
-- The theme of choise, catppuccin
-- https://github.com/catppuccin/nvim
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
enabled = true,
config = function()
vim.cmd.colorscheme("catppuccin")
end,
opts = {
flavour = "mocha",
},
},
-- Remove all background colors to make nvim transparent
-- https://github.com/xiyaowong/transparent.nvim
{
"xiyaowong/transparent.nvim",
lazy = false,
enabled = true,
config = function()
vim.g.transparent_groups = vim.list_extend(
vim.g.transparent_groups or {},
vim.tbl_map(function(v)
return v.hl_group
end, vim.tbl_values(require("bufferline.config").highlights))
)
end,
},
-- A fancy, configurable, notification manager for NeoVim
-- https://github.com/rcarriga/nvim-notify
{
"rcarriga/nvim-notify",
opts = {
-- Set background color to black so transparent doesn't mess stuff up
background_colour = "#000000",
},
},
-- Not UFO in the sky, but an ultra fold in Neovim.
-- https://github.com/kevinhwang91/nvim-ufo/
{
"kevinhwang91/nvim-ufo",
lazy = false,
enabled = true,
dependencies = {
"kevinhwang91/promise-async",
{ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" },
},
init = function()
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
vim.o.foldcolumn = "1" -- '0' is not bad
vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value
vim.o.foldlevelstart = 99
vim.o.foldenable = true
end,
opts = {
open_fold_hl_timeout = 150,
close_fold_kinds = { "imports", "comment" },
preview = {
win_config = {
border = { "", "", "", "", "", "", "", "" },
winhighlight = "Normal:Folded",
winblend = 0,
},
mappings = {
scrollU = "<C-u>",
scrollD = "<C-d>",
jumpTop = "[",
jumpBot = "]",
},
},
provider_selector = function(bufnr, filetype, buftype)
return { "treesitter", "indent" }
end,
fold_virt_text_handler = function(virtText, lnum, endLnum, width, truncate)
local newVirtText = {}
local suffix = (" 󰁂 %d "):format(endLnum - lnum)
local sufWidth = vim.fn.strdisplaywidth(suffix)
local targetWidth = width - sufWidth
local curWidth = 0
for _, chunk in ipairs(virtText) do
local chunkText = chunk[1]
local chunkWidth = vim.fn.strdisplaywidth(chunkText)
if targetWidth > curWidth + chunkWidth then
table.insert(newVirtText, chunk)
else
chunkText = truncate(chunkText, targetWidth - curWidth)
local hlGroup = chunk[2]
table.insert(newVirtText, { chunkText, hlGroup })
chunkWidth = vim.fn.strdisplaywidth(chunkText)
-- str width returned from truncate() may less than 2nd argument, need padding
if curWidth + chunkWidth < targetWidth then
suffix = suffix .. (" "):rep(targetWidth - curWidth - chunkWidth)
end
break
end
curWidth = curWidth + chunkWidth
end
table.insert(newVirtText, { suffix, "MoreMsg" })
return newVirtText
end,
},
},
-- Indent guides for Neovim
-- https://github.com/lukas-reineke/indent-blankline.nvim
{ "lukas-reineke/indent-blankline.nvim" },
-- Git integration for buffers
-- https://github.com/lewis6991/gitsigns.nvim
{ "lewis6991/gitsigns.nvim" },
-- Getting you where you want with the fewest keystrokes.
-- https://github.com/ThePrimeagen/harpoon
{ "ThePrimeagen/harpoon" },
-- Close buffer without messing up with the window.
-- https://github.com/famiu/bufdelete.nvim
{ "famiu/bufdelete.nvim" },
-- Neovim plugin for locking a buffer to a window
-- https://github.com/stevearc/stickybuf.nvim
{ "stevearc/stickybuf.nvim", opts = {} },
-- Automatically expand width of the current window.
-- Maximizes and restore it. And all this with nice animations!
-- https://github.com/anuvyklack/windows.nvim
{
"anuvyklack/windows.nvim",
dependencies = {
"anuvyklack/middleclass",
"anuvyklack/animation.nvim",
},
config = function()
vim.o.winwidth = 15
vim.o.winminwidth = 10
vim.o.equalalways = false
require("windows").setup()
end,
},
}

View File

@@ -1,32 +0,0 @@
-- A more adventurous wildmenu
-- https://github.com/gelguy/wilder.nvim
return {
'gelguy/wilder.nvim',
config = function()
local wilder = require('wilder')
wilder.setup({ modes = { ':', '/', '?' } })
local gradient = {
'#f4468f', '#fd4a85', '#ff507a', '#ff566f', '#ff5e63',
'#ff6658', '#ff704e', '#ff7a45', '#ff843d', '#ff9036',
'#f89b31', '#efa72f', '#e6b32e', '#dcbe30', '#d2c934',
'#c8d43a', '#bfde43', '#b6e84e', '#aff05b'
}
for i, fg in ipairs(gradient) do
gradient[i] = wilder.make_hl('WilderGradient' .. i, 'Pmenu', { { a = 1 }, { a = 1 }, { foreground = fg } })
end
wilder.set_option('renderer', wilder.popupmenu_renderer({
highlights = {
-- must be set
-- selected_gradient key can be set to apply gradient highlighting for the selected candidate.
gradient = gradient,
},
highlighter = wilder.highlighter_with_gradient({
wilder.basic_highlighter(), -- or wilder.lua_fzy_highlighter(),
}),
}))
end,
}

3
config/nvim/stylua.toml Normal file
View File

@@ -0,0 +1,3 @@
indent_type = "Spaces"
indent_width = 2
column_width = 120

View File

@@ -7,7 +7,7 @@ $directory\
$git_branch\
$git_state\
$git_status\
$fill\
$fill \
$battery\
$username\
$hostname\
@@ -23,7 +23,7 @@ $line_break\
$character"""
# Timeout for commands executed by starship (in milliseconds).
# command_timeout = 1000
command_timeout = 1500
[character]
success_symbol = "[→](bold green)"
@@ -43,16 +43,18 @@ style = "blue"
[docker_context]
symbol = " "
format = '[$symbol$context]($style) '
[fill]
symbol = '·'
style = 'bold black'
[gcloud]
format = ' [($symbol)$account(@$domain)(\($region\))]($style) '
format = '[($symbol)$account(@$domain)(\($region\))]($style) '
[git_branch]
symbol = " "
format = '[$symbol$branch(:$remote_branch)]($style) '
truncation_length = 20
truncation_symbol = '…'
ignore_branches = ['master', 'main']
@@ -72,9 +74,15 @@ disabled = false
[golang]
symbol = " "
format = '[$symbol($version )]($style) '
[hostname]
ssh_symbol = " "
ssh_only = false
format = '[$ssh_symbol](bold blue)[$hostname](bold red) '
[lua]
format = '[$symbol($version )]($style)'
[nodejs]
symbol = " "
@@ -139,5 +147,7 @@ version_format = '${major}.${minor}'
[python]
symbol = " "
format = "[$virtualenv]($style) "
style = "bright-black"
[username]
format = "[$user]($style) "

View File

@@ -94,6 +94,7 @@ set -g @tpm_plugins ' \
catppuccin/tmux \
tmux-plugins/tmux-continuum \
jaclu/tmux-menus \
ofirgall/tmux-window-name \
tmux-plugins/tmux-resurrect \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-sessionist \
@@ -108,6 +109,13 @@ set -g @tpm_plugins ' \
## https://github.com/jaclu/tmux-menus
set -g @menus_trigger 'm'
## A plugin to name your tmux windows smartly.
## https://github.com/ofirgall/tmux-window-name
### Maximum name length of a window
set -g @tmux_window_name_max_name_len "20"
### Replace $HOME with ~ in window names
set -g @tmux_window_name_use_tilde "True"
## https://github.com/catppuccin/tmux
set -g @catppuccin_flavour "mocha" # latte/frappe/macchiato/mocha
set -g @catppuccin_window_tabs_enabled on # or off to disable window_tabs

View File

@@ -31,7 +31,7 @@ bind-key -T copy-mode P send-keys -X toggle-position
bind-key -T copy-mode R send-keys -X rectangle-toggle
bind-key -T copy-mode T command-prompt -1 -p "(jump to backward)" { send-keys -X jump-to-backward "%%" }
bind-key -T copy-mode X send-keys -X set-mark
bind-key -T copy-mode Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer -p"
bind-key -T copy-mode Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
bind-key -T copy-mode f command-prompt -1 -p "(jump forward)" { send-keys -X jump-forward "%%" }
bind-key -T copy-mode g command-prompt -p "(goto line)" { send-keys -X goto-line "%%" }
bind-key -T copy-mode n send-keys -X search-again
@@ -41,7 +41,7 @@ bind-key -T copy-mode t command-prompt -1 -p "(jump to
bind-key -T copy-mode y send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode MouseDown1Pane select-pane
bind-key -T copy-mode MouseDrag1Pane select-pane \; send-keys -X begin-selection
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
bind-key -T copy-mode WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
bind-key -T copy-mode DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
@@ -75,7 +75,7 @@ bind-key -T copy-mode M-r send-keys -X middle-line
bind-key -T copy-mode M-v send-keys -X page-up
bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode M-x send-keys -X jump-to-mark
bind-key -T copy-mode M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer -p"
bind-key -T copy-mode M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer"
bind-key -T copy-mode "M-{" send-keys -X previous-paragraph
bind-key -T copy-mode "M-}" send-keys -X next-paragraph
bind-key -T copy-mode M-Up send-keys -X halfpage-up
@@ -87,16 +87,13 @@ bind-key -T copy-mode-vi C-c send-keys -X cancel
bind-key -T copy-mode-vi C-d send-keys -X halfpage-down
bind-key -T copy-mode-vi C-e send-keys -X scroll-down
bind-key -T copy-mode-vi C-f send-keys -X page-down
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R
bind-key -T copy-mode-vi C-h send-keys -X cursor-left
bind-key -T copy-mode-vi C-j send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi C-u send-keys -X halfpage-up
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi C-y send-keys -X scroll-up
bind-key -T copy-mode-vi Escape send-keys -X clear-selection
bind-key -T copy-mode-vi C-\ select-pane -l
bind-key -T copy-mode-vi Space send-keys -X begin-selection
bind-key -T copy-mode-vi ! send-keys -X copy-pipe-and-cancel "tr -d '
' | pbcopy"
@@ -136,7 +133,7 @@ bind-key -T copy-mode-vi T command-prompt -1 -p "(jump to
bind-key -T copy-mode-vi V send-keys -X select-line
bind-key -T copy-mode-vi W send-keys -X next-space
bind-key -T copy-mode-vi X send-keys -X set-mark
bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer -p"
bind-key -T copy-mode-vi Y send-keys -X copy-pipe-and-cancel "tmux paste-buffer"
bind-key -T copy-mode-vi ^ send-keys -X back-to-indentation
bind-key -T copy-mode-vi b send-keys -X previous-word
bind-key -T copy-mode-vi e send-keys -X next-word-end
@@ -158,7 +155,7 @@ bind-key -T copy-mode-vi \{ send-keys -X previous-paragraph
bind-key -T copy-mode-vi \} send-keys -X next-paragraph
bind-key -T copy-mode-vi MouseDown1Pane select-pane
bind-key -T copy-mode-vi MouseDrag1Pane select-pane \; send-keys -X begin-selection
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel pbcopy
bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel
bind-key -T copy-mode-vi WheelUpPane select-pane \; send-keys -X -N 5 scroll-up
bind-key -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 5 scroll-down
bind-key -T copy-mode-vi DoubleClick1Pane select-pane \; send-keys -X select-word \; run-shell -d 0.3 \; send-keys -X copy-pipe-and-cancel
@@ -171,24 +168,15 @@ bind-key -T copy-mode-vi Down send-keys -X cursor-down
bind-key -T copy-mode-vi Left send-keys -X cursor-left
bind-key -T copy-mode-vi Right send-keys -X cursor-right
bind-key -T copy-mode-vi M-x send-keys -X jump-to-mark
bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer -p"
bind-key -T copy-mode-vi M-y send-keys -X copy-pipe-and-cancel "pbcopy; tmux paste-buffer"
bind-key -T copy-mode-vi C-Up send-keys -X scroll-up
bind-key -T copy-mode-vi C-Down send-keys -X scroll-down
bind-key -T join-pane \" run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
bind-key -T join-pane \% run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
bind-key -T join-pane - run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
bind-key -T join-pane @ run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-b'"
bind-key -T join-pane f run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-b'"
bind-key -T join-pane h run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
bind-key -T join-pane v run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-v'"
bind-key -T join-pane | run-shell "'/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh' 'join-pane' '-b' '-h'"
bind-key -T prefix C-Space run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/promote_window.sh '#{session_name}' '#{window_id}' '#{window_name}' '#{pane_current_path}'"
bind-key -T prefix Enter run-shell -b "/Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/notify.sh false true"
bind-key -T prefix C-Space send-prefix
bind-key -T prefix C-n next-window
bind-key -T prefix C-o rotate-window
bind-key -T prefix C-p previous-window
bind-key -T prefix C-r run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-resurrect/scripts/restore.sh
bind-key -T prefix C-s run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-resurrect/scripts/save.sh
bind-key -T prefix C-r run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/scripts/restore.sh
bind-key -T prefix C-s run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-resurrect/scripts/save.sh
bind-key -T prefix C-z suspend-client
bind-key -T prefix Escape copy-mode
bind-key -T prefix Space next-layout
@@ -196,7 +184,7 @@ bind-key -T prefix ! split-window -h -c "#{pane_curr
bind-key -T prefix \" split-window -v -c "#{pane_current_path}"
bind-key -T prefix \# list-buffers
bind-key -T prefix \$ command-prompt -I "#S" { rename-session "%%" }
bind-key -T prefix \% split-window -h -c "#{pane_current_path}"
bind-key -T prefix \% split-window -h
bind-key -T prefix & confirm-before -p "kill-window #W? (y/n)" kill-window
bind-key -T prefix \' command-prompt -T window-target -p index { select-window -t ":%%" }
bind-key -T prefix ( switch-client -p
@@ -221,40 +209,42 @@ bind-key -T prefix < display-menu -T "#[align=centre
bind-key -T prefix = choose-buffer -Z
bind-key -T prefix > display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -x P -y P "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
bind-key -T prefix ? list-keys -N
bind-key -T prefix @ run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/promote_pane.sh '#{session_name}' '#{pane_id}' '#{pane_current_path}'"
bind-key -T prefix C run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/new_session_prompt.sh
bind-key -T prefix @ run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/promote_pane.sh '#{session_name}' '#{pane_id}' '#{pane_current_path}'"
bind-key -T prefix C run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/new_session_prompt.sh
bind-key -T prefix D choose-client -Z
bind-key -T prefix E select-layout -E
bind-key -T prefix I run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/install_plugins
bind-key -T prefix I run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/install_plugins
bind-key -T prefix L switch-client -l
bind-key -T prefix M run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/cancel.sh
bind-key -T prefix M select-pane -M
bind-key -T prefix N new-window
bind-key -T prefix R run-shell " tmux source-file /Users/ivuorinen/.config/tmux/tmux.conf > /dev/null; tmux display-message 'Sourced /Users/ivuorinen/.config/tmux/tmux.conf!'"
bind-key -T prefix R run-shell " \
tmux source-file ~/.tmux.conf > /dev/null; \
tmux display-message \"Sourced .tmux.conf!\""
bind-key -T prefix S switch-client -l
bind-key -T prefix U run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/update_plugins
bind-key -T prefix X run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/kill_session_prompt.sh '#{session_name}' '#{session_id}'"
bind-key -T prefix Y run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh
bind-key -T prefix U run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/update_plugins
bind-key -T prefix X run-shell "$HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/kill_session_prompt.sh '#{session_name}' '#{session_id}'"
bind-key -T prefix Y run-shell -b $HOME/.dotfiles/config/tmux/plugins/tmux-yank/scripts/copy_pane_pwd.sh
bind-key -T prefix ] paste-buffer -p
bind-key -T prefix c new-window
bind-key -T prefix d detach-client
bind-key -T prefix f command-prompt { find-window -Z "%%" }
bind-key -T prefix g run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/goto_session.sh
bind-key -T prefix g run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-sessionist/scripts/goto_session.sh
bind-key -T prefix h select-pane -L
bind-key -T prefix i display-message
bind-key -T prefix j select-pane -D
bind-key -T prefix k select-pane -U
bind-key -T prefix l run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-fzf/main.sh
bind-key -T prefix m run-shell /Users/ivuorinen/.config/tmux/plugins/tmux-menus/items/main.sh
bind-key -T prefix l select-pane -R
bind-key -T prefix m run-shell $HOME/.dotfiles/config/tmux/plugins/tmux-menus/items/main.sh
bind-key -T prefix n next-window
bind-key -T prefix o select-pane -t :.+
bind-key -T prefix p paste-buffer
bind-key -T prefix q display-panes
bind-key -T prefix r source-file /Users/ivuorinen/.dotfiles/config/tmux/tmux.conf \; display-message "tmux cfg reloaded!"
bind-key -T prefix r source-file $HOME/.dotfiles/config/tmux/tmux.conf \; display-message "tmux cfg reloaded!"
bind-key -T prefix s choose-tree -Zs
bind-key -T prefix t run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-sessionist/scripts/join_pane.sh 'join-pane' '-b'"
bind-key -T prefix t clock-mode
bind-key -T prefix w choose-tree -Zw
bind-key -T prefix x run-shell "tmux split-window -l 10 \"/Users/ivuorinen/.config/tmux/plugins/tmux-1password/scripts/main.sh '#{pane_id}'\""
bind-key -T prefix y run-shell -b /Users/ivuorinen/.config/tmux/plugins/tmux-yank/scripts/copy_line.sh
bind-key -T prefix x confirm-before -p "kill-pane #P? (y/n)" kill-pane
bind-key -T prefix y run-shell -b $HOME/.dotfiles/config/tmux/plugins/tmux-yank/scripts/copy_line.sh
bind-key -T prefix z resize-pane -Z
bind-key -T prefix \{ swap-pane -U
bind-key -T prefix \} swap-pane -D
@@ -265,17 +255,16 @@ bind-key -r -T prefix Up select-pane -U
bind-key -r -T prefix Down select-pane -D
bind-key -r -T prefix Left select-pane -L
bind-key -r -T prefix Right select-pane -R
bind-key -T prefix M-Enter run-shell -b "/Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/notify.sh true true"
bind-key -T prefix M-1 select-layout even-horizontal
bind-key -T prefix M-2 select-layout even-vertical
bind-key -T prefix M-3 select-layout main-horizontal
bind-key -T prefix M-4 select-layout main-vertical
bind-key -T prefix M-5 select-layout tiled
bind-key -T prefix M-m run-shell -b "/Users/ivuorinen/.config/tmux/plugins/tmux-notify/scripts/notify.sh true"
bind-key -T prefix M-c attach-session -c "#{pane_current_path}"
bind-key -T prefix M-n next-window -a
bind-key -T prefix M-o rotate-window -D
bind-key -T prefix M-p previous-window -a
bind-key -T prefix M-u run-shell /Users/ivuorinen/.config/tmux/plugins/tpm/bindings/clean_plugins
bind-key -T prefix M-u run-shell $HOME/.dotfiles/config/tmux/plugins/tpm/bindings/clean_plugins
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
@@ -288,11 +277,6 @@ bind-key -r -T prefix S-Up refresh-client -U 10
bind-key -r -T prefix S-Down refresh-client -D 10
bind-key -r -T prefix S-Left refresh-client -L 10
bind-key -r -T prefix S-Right refresh-client -R 10
bind-key -T root C-h if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-h" "select-pane -L"
bind-key -T root C-j if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-j" "select-pane -D"
bind-key -T root C-k if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-k" "select-pane -U"
bind-key -T root C-l if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-l" "select-pane -R"
bind-key -T root C-\ if-shell "ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(S+/)?g?(view|l?n?vim?x?)(diff)?$'" "send-keys C-\\" "select-pane -l"
bind-key -T root MouseDown1Pane select-pane -t = \; send-keys -M
bind-key -T root MouseDown1Status select-window -t =
bind-key -T root MouseDown2Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { paste-buffer -p }
@@ -306,16 +290,12 @@ bind-key -T root WheelUpStatus previous-window
bind-key -T root WheelDownStatus next-window
bind-key -T root DoubleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-word ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
bind-key -T root TripleClick1Pane select-pane -t = \; if-shell -F "#{||:#{pane_in_mode},#{mouse_any_flag}}" { send-keys -M } { copy-mode -H ; send-keys -X select-line ; run-shell -d 0.3 ; send-keys -X copy-pipe-and-cancel }
bind-key -T root F12 run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-suspend/scripts/suspend.sh \"\" \" @mode_indicator_custom_prompt:: ---- , @mode_indicator_custom_mode_style::bg=brightblack\,fg=black, \""
bind-key -T root M-H previous-window
bind-key -T root M-L next-window
bind-key -T root M-MouseDown3Pane display-menu -T "#[align=centre]#{pane_index} (#{pane_id})" -t = -x M -y M "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Top,}" < { send-keys -X history-top } "#{?#{m/r:(copy|view)-mode,#{pane_mode}},Go To Bottom,}" > { send-keys -X history-bottom } '' "#{?mouse_word,Search For #[underscore]#{=/9/...:mouse_word},}" C-r { if-shell -F "#{?#{m/r:(copy|view)-mode,#{pane_mode}},0,1}" "copy-mode -t=" ; send-keys -X -t = search-backward "#{q:mouse_word}" } "#{?mouse_word,Type #[underscore]#{=/9/...:mouse_word},}" C-y { copy-mode -q ; send-keys -l "#{q:mouse_word}" } "#{?mouse_word,Copy #[underscore]#{=/9/...:mouse_word},}" c { copy-mode -q ; set-buffer "#{q:mouse_word}" } "#{?mouse_line,Copy Line,}" l { copy-mode -q ; set-buffer "#{q:mouse_line}" } '' "Horizontal Split" h { split-window -h } "Vertical Split" v { split-window -v } '' "#{?#{>:#{window_panes},1},,-}Swap Up" u { swap-pane -U } "#{?#{>:#{window_panes},1},,-}Swap Down" d { swap-pane -D } "#{?pane_marked_set,,-}Swap Marked" s { swap-pane } '' Kill X { kill-pane } Respawn R { respawn-pane -k } "#{?pane_marked,Unmark,Mark}" m { select-pane -m } "#{?#{>:#{window_panes},1},,-}#{?window_zoomed_flag,Unzoom,Zoom}" z { resize-pane -Z }
bind-key -T root M-Up select-pane -U
bind-key -T root M-Down select-pane -D
bind-key -T root M-Left select-pane -L
bind-key -T root M-Right select-pane -R
bind-key -T root S-Left previous-window
bind-key -T root S-Right next-window
bind-key -T suspended F12 run-shell "/Users/ivuorinen/.config/tmux/plugins/tmux-suspend/scripts/resume.sh \"\""
bind-key -T root C-Tab previous-window
bind-key -T root C-S-Tab next-window
```

View File

@@ -10,9 +10,9 @@ BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOTBOT_BIN_PATH="${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}"
DOTBOT_HOST="$(hostname -s)"
cd "$BASEDIR"
git submodule sync --quiet --recursive
git submodule update --init --recursive
cd "${BASEDIR}"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive "${DOTBOT_DIR}"
"${DOTBOT_BIN_PATH}" \
-d "${BASEDIR}" \

View File

@@ -28,6 +28,7 @@ function section_install
MENU=(
"all:Installs everything in the correct order"
"antigen:Updates the antigen.zsh file"
"cargo:Install rust/cargo packages"
"cheat-databases:Install cheat external cheatsheet databases"
"composer:Install composer"
"dotenv:Install dotenv-linter"
@@ -40,6 +41,7 @@ function section_install
"nvm:Install Node Version Manager (nvm)"
"npm:Install NPM Packages"
"ntfy:Install ntfy"
"pip:Install pip/python packages"
"z:Install z"
)
@@ -48,6 +50,8 @@ function section_install
$0 install macos
$0 install antigen
$0 brew install
$0 install pip
$0 install cargo
$0 install composer
$0 install dotenv
$0 install fzf
@@ -65,6 +69,10 @@ function section_install
curl -sSfL git.io/antigen -o "$DOTFILES/local/bin/antigen.zsh" \
&& msg_yay "New antigen installed!"
;;
cargo)
bash "$DOTFILES/scripts/install-cargo-packages.sh" \
&& msg_yay "cargo packages installed!"
;;
cheat-databases)
for database in "$DOTFILES"/scripts/install-cheat-*; do
bash "$database" \
@@ -126,6 +134,10 @@ function section_install
bash "$DOTFILES/scripts/install-ntfy.sh" \
&& msg_yay "ntfy installed!"
;;
pip)
bash "$DOTFILES/scripts/install-pip-packages.sh" \
&& msg_yay "pip/python packages installed!"
;;
z)
bash "$DOTFILES/scripts/install-z.sh" \
&& msg_yay "z has been installed!"
@@ -249,18 +261,9 @@ function section_dotfiles
;;
shfmt)
# Format shell scripts according to following rules.
find "$DOTFILES" \
-type f -executable \
-not -path '*/.git/*' \
-not -path '*dotbot*' \
-not -path '*config/fzf*' \
-not -path '*bin/fzf*' \
-not -path '*tmux/plugins*' \
-not -name '*.pl' \
-not -name '*.py' \
-not -name '*.php' \
-not -name '*.zsh' \
-exec shfmt \
fd --full-path "$DOTFILES" -tx \
-E '*.pl' -E '*.php' -E '*.py' -E '*.zsh' -E 'plugins' -E 'fzf' -E 'dotbot' \
-x shfmt \
--language-dialect bash \
--func-next-line --list --write \
--indent 2 --case-indent --space-redirects \

View File

@@ -2,8 +2,9 @@
# fzf-tmux: starts fzf in a tmux pane
# usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
fail() {
>&2 echo "$1"
fail()
{
echo >&2 "$1"
exit 2
}
@@ -19,8 +20,9 @@ term=""
[[ -n "$LINES" ]] && lines=$LINES || lines=$(tput lines) || lines=$(tmux display-message -p "#{pane_height}")
[[ -n "$COLUMNS" ]] && columns=$COLUMNS || columns=$(tput cols) || columns=$(tmux display-message -p "#{pane_width}")
help() {
>&2 echo 'usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
help()
{
echo >&2 'usage: fzf-tmux [LAYOUT OPTIONS] [--] [FZF OPTIONS]
LAYOUT OPTIONS:
(default layout: -d 50%)
@@ -55,7 +57,7 @@ while [[ $# -gt 0 ]]; do
echo "fzf-tmux (with fzf $("$fzf" --version))"
exit
;;
-p*|-w*|-h*|-x*|-y*|-d*|-u*|-r*|-l*)
-p* | -w* | -h* | -x* | -y* | -d* | -u* | -r* | -l*)
if [[ "$arg" =~ ^-[pwhxy] ]]; then
[[ "$opt" =~ "-E" ]] || opt="-E"
elif [[ "$arg" =~ ^.[lr] ]]; then
@@ -93,9 +95,9 @@ while [[ $# -gt 0 ]]; do
elif [[ "$arg" =~ ^-[whxy] ]]; then
opt="$opt ${arg:0:2}$size"
elif [[ "$size" =~ %$ ]]; then
size=${size:0:((${#size}-1))}
size=${size:0:((${#size} - 1))}
if [[ -n "$swap" ]]; then
opt="$opt -p $(( 100 - size ))"
opt="$opt -p $((100 - size))"
else
opt="$opt -p $size"
fi
@@ -106,7 +108,7 @@ while [[ $# -gt 0 ]]; do
else
max=$lines
fi
size=$(( max - size ))
size=$((max - size))
[[ $size -lt 0 ]] && size=0
opt="$opt -l $size"
else
@@ -152,13 +154,14 @@ fifo1="${TMPDIR:-/tmp}/fzf-fifo1-$id"
fifo2="${TMPDIR:-/tmp}/fzf-fifo2-$id"
fifo3="${TMPDIR:-/tmp}/fzf-fifo3-$id"
if tmux_win_opts=$(tmux show-options -p remain-on-exit \; show-options -p synchronize-panes 2> /dev/null); then
tmux_win_opts=( $(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts") )
tmux_win_opts=($(sed '/ off/d; s/synchronize-panes/set-option -p synchronize-panes/; s/remain-on-exit/set-option -p remain-on-exit/; s/$/ \\;/' <<< "$tmux_win_opts"))
tmux_off_opts='; set-option -p synchronize-panes off ; set-option -p remain-on-exit off'
else
tmux_win_opts=( $(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/') )
tmux_win_opts=($(tmux show-window-options remain-on-exit \; show-window-options synchronize-panes | sed '/ off/d; s/^/set-window-option /; s/$/ \\;/'))
tmux_off_opts='; set-window-option synchronize-panes off ; set-window-option remain-on-exit off'
fi
cleanup() {
cleanup()
{
\rm -f $argsf $fifo1 $fifo2 $fifo3
# Restore tmux window options
@@ -196,7 +199,7 @@ if [[ "$opt" =~ "-E" ]]; then
exit 2
fi
fi
[[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")"
[[ -n "$FZF_DEFAULT_OPTS" ]] && envs="$envs FZF_DEFAULT_OPTS=$(printf %q "$FZF_DEFAULT_OPTS")"
[[ -n "$FZF_DEFAULT_COMMAND" ]] && envs="$envs FZF_DEFAULT_COMMAND=$(printf %q "$FZF_DEFAULT_COMMAND")"
[[ -n "$RUNEWIDTH_EASTASIAN" ]] && envs="$envs RUNEWIDTH_EASTASIAN=$(printf %q "$RUNEWIDTH_EASTASIAN")"
[[ -n "$BAT_THEME" ]] && envs="$envs BAT_THEME=$(printf %q "$BAT_THEME")"
@@ -236,6 +239,9 @@ fi
tmux \
split-window -c "$PWD" $opt "bash -c 'exec -a fzf bash $argsf'" $swap \
$tmux_off_opts \
> /dev/null 2>&1 || { "$fzf" "${args[@]}"; exit $?; }
> /dev/null 2>&1 || {
"$fzf" "${args[@]}"
exit $?
}
cat $fifo2
exit "$(cat $fifo3)"

View File

@@ -17,6 +17,9 @@ KB=$(tmux list-keys)
H="# tmux keybindings\n"
L="\n\nLeader: \`<ctrl><space>\`\n\n"
# Generalize expanded $HOME to "$HOME"
KB="${KB//$HOME/\$HOME}"
msg "Outputting tmux keybindings to $TMUX_KEYBINDINGS_DOCS"
echo -e "${H}${L}${CB}${KB}${CB}" > "$TMUX_KEYBINDINGS_DOCS"
msg_done "Done!"

View File

@@ -10,9 +10,9 @@
# Modified by Ismo Vuorinen <https://github.com/ivuorinen> 2023
# Determine width of terminal
hr_col_count="$( (tput cols - 4) )"
hr_col_count="$( (tput cols - 4))"
if [ -z "${hr_col_count+set}" ] || [ "$hr_col_count" -lt 1 ]; then
hr_col_count="${COLUMNS:-80}"
hr_col_count="${COLUMNS:-80}"
fi
# Colors
@@ -21,20 +21,21 @@ hr_color="${hr_color:=$CLR_RED}"
hr_reset="\033[0m"
# Prints the HR line
hr_draw_char() {
local CHAR="$1"
local LINE=""
LINE=$(printf "%*s" "$((hr_col_count - 3))" " ")
LINE="${LINE// /${CHAR}}"
echo -e "${hr_color}${LINE:0:${hr_col_count}}${hr_reset}"
hr_draw_char()
{
local CHAR="$1"
local LINE=""
LINE=$(printf "%*s" "$((hr_col_count - 3))" " ")
LINE="${LINE// /${CHAR}}"
echo -e "${hr_color}${LINE:0:${hr_col_count}}${hr_reset}"
}
# Passes param and calls hr()
hr() {
for WORD in "${@:--}"; do
hr_draw_char "$WORD"
done
hr()
{
for WORD in "${@:--}"; do
hr_draw_char "$WORD"
done
}
hr "$@"

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Install cargo/rust packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
! have cargo && {
msg "cargo could not be found. installing cargo with rustup.rs"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
}
packages=(
# a subprocess caching utility
"bkt"
# a structural diff that understands syntax
"difftastic"
# a modern replacement for ls.
"eza"
# A simple, fast and user-friendly alternative to 'find'
"fd-find"
)
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
cargo install $pkg
echo ""
done

View File

@@ -38,6 +38,9 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
# echo "-> $DIRNAME ($d)"
SECTION_DIR="${TLDR_CHEAT_DEST}/$DIRNAME"
[ "$DIRNAME" = "common" ] && SECTION_DIR="${TLDR_CHEAT_DEST}"
TLDR_TAGS="tags: [$DIRNAME]"
if [ ! -d "$SECTION_DIR" ]; then
@@ -48,7 +51,7 @@ for d in "$TLDR_TEMP_DIR"/pages/*; do
BASENAME=$(basename "$FILE" .md)
FILENAME="${BASENAME%%.*}"
# echo "-> $FILE = $FILENAME"
TLDR_FILE="$SECTION_DIR/${FILENAME}"
TLDR_FILE="$SECTION_DIR/${BASENAME}"
# echo "-> dest: $TLDR_FILE"
# Update the original file for making the replacable value comparable

View File

@@ -25,4 +25,3 @@ msg "Installing git-crypt"
fi
}
msg_done "Done installing git-crypt"

View File

@@ -41,7 +41,7 @@ done
msg "Installing completions for selected packages"
have git-profile && {
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/git-profile" \
git-profile completion zsh > "$ZSH_CUSTOM_COMPLETION_PATH/_git-profile" \
&& msg_yay "Installed completions for git-profile"
}

24
scripts/install-pip-packages.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Install python/pip packages.
#
# shellcheck source=shared.sh
source "$HOME/.dotfiles/scripts/shared.sh"
! have pip && {
msg_err "Could not find pip, something really terrible is going on." && exit 1
}
packages=(
"libtmux"
)
for pkg in "${packages[@]}"; do
# Trim spaces
pkg=${pkg// /}
# Skip comments
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
python3 -m pip install --user $pkg
echo ""
done

View File

@@ -197,11 +197,32 @@ function menu_usage()
done
}
# Cache commands using bkt if installed
if command -v bkt >&/dev/null; then
bkt()
{
command 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
# shorthand for checking if the system has the bin in path.
# usage: have php && php -v
function have
{
command -v "$1" >&/dev/null
bkt -- command -v "$1" >&/dev/null
}
function brew_installed
{
bkt -- brew list
}
# shorthand for checking if brew package is installed
@@ -210,7 +231,7 @@ function have_brew
{
! have brew && return 125
if brew list "$1" &> /dev/null; then
if bkt -- brew list "$1" &> /dev/null; then
return 0
else
return 1