mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-01-27 22:41:02 +00:00
Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af32dd6bf3 | ||
|
|
e519d98a68 | ||
| cde571de69 | |||
| b563ba5cd0 | |||
| f357d23559 | |||
|
|
b183fcbdb2 | ||
| 17ce1c6ee6 | |||
| 66de4b3323 | |||
| b55c1a17ba | |||
|
|
3d708861cf | ||
| 9dc647c4af | |||
|
|
3bd73bbbfb | ||
|
|
0a7d331a57 | ||
|
|
40b399a467 | ||
|
|
65dab98c3e | ||
|
|
64f1d7354e | ||
|
|
0d93f2dbb2 | ||
|
|
9dc1ed8b38 | ||
|
|
75b99dd117 | ||
|
|
305355beaf | ||
| 33a7de2dfc | |||
| f5f4f47655 | |||
|
|
4d8d70d390 | ||
|
|
cacc98a7d3 | ||
|
|
9c05733b5d |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
Brewfile.lock.json
|
||||
*.log
|
||||
|
||||
|
||||
12
.gitmodules
vendored
Normal file
12
.gitmodules
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
[submodule "config/nvim"]
|
||||
path = config/nvim
|
||||
url = git@github.com:AstroNvim/AstroNvim.git
|
||||
ignore = dirty
|
||||
branch = v3
|
||||
update = checkout
|
||||
[submodule "config/astronvim/lua/user"]
|
||||
path = config/astronvim/lua/user
|
||||
url = git@github.com:ivuorinen/astronvim_config.git
|
||||
update = rebase
|
||||
branch = main
|
||||
|
||||
13
Brewfile
13
Brewfile
@@ -32,6 +32,8 @@ brew "brew-php-switcher"
|
||||
brew "glib"
|
||||
# Manage compile and link flags for libraries
|
||||
brew "pkg-config"
|
||||
# Cross-platform make
|
||||
brew "cmake"
|
||||
# Open source suite of directory software
|
||||
brew "openldap"
|
||||
# Get a file from an HTTP, HTTPS or FTP server
|
||||
@@ -56,6 +58,8 @@ brew "difftastic"
|
||||
brew "dive"
|
||||
# Command-line DNS client
|
||||
brew "dog"
|
||||
# Tool to verify that your files are in harmony with your .editorconfig
|
||||
brew "editorconfig-checker"
|
||||
# Useful examples at the command-line
|
||||
brew "eg-examples"
|
||||
# CLI for templating and/or deploying FaaS functions
|
||||
@@ -112,6 +116,8 @@ brew "jq"
|
||||
brew "lazydocker"
|
||||
# Linguistic software and Finnish dictionary
|
||||
brew "libvoikko"
|
||||
# Package manager for the Lua programming language
|
||||
brew "luarocks"
|
||||
# Swiss Army Knife for macOS
|
||||
brew "m-cli"
|
||||
# Mac App Store command-line interface
|
||||
@@ -172,6 +178,8 @@ brew "tmux"
|
||||
brew "tree"
|
||||
# Modern watch command
|
||||
brew "viddy"
|
||||
# Command-line interface to the WakaTime api
|
||||
brew "wakatime-cli"
|
||||
# Executes a program periodically, showing output fullscreen
|
||||
brew "watch"
|
||||
# Internet file retriever
|
||||
@@ -280,10 +288,5 @@ cask "warp"
|
||||
cask "xbar"
|
||||
mas "1Password for Safari", id: 1569813296
|
||||
mas "Flow", id: 1423210932
|
||||
mas "GarageBand", id: 682658836
|
||||
mas "iMovie", id: 408981434
|
||||
mas "Keynote", id: 409183694
|
||||
mas "Numbers", id: 409203825
|
||||
mas "Pages", id: 409201541
|
||||
mas "pullBar", id: 1601913905
|
||||
mas "Tailscale", id: 1475387142
|
||||
|
||||
81
README.md
81
README.md
@@ -1,8 +1,9 @@
|
||||
# .dotfiles
|
||||
|
||||
Welcome to [ivuorinen](https://github.com/ivuorinen)'s .dotfiles repository. It's a hodgepodge of scripts
|
||||
and configurations, tests and mistakes I'm not aware of yet. As I find more interesting tools, configs and
|
||||
other stuff, this repository will live accordingly.
|
||||
Welcome to [ivuorinen](https://github.com/ivuorinen)'s .dotfiles repository.
|
||||
It's a hodgepodge of scripts and configurations, tests and mistakes I'm not
|
||||
aware of yet. As I find more interesting tools, configs and other stuff,
|
||||
this repository will live accordingly.
|
||||
|
||||
Please for the love of everything good do not use these 1:1 as your own dotfiles,
|
||||
fork or download the repo as a zip and go from there with your own configs.
|
||||
@@ -16,27 +17,28 @@ fork or download the repo as a zip and go from there with your own configs.
|
||||
3. ???
|
||||
4. Profit
|
||||
|
||||
Note: there's a bit chicken/egg situation, because settler assumes you don't have git,
|
||||
Note: there's a bit chicken/egg situation,
|
||||
because settler assumes you don't have git,
|
||||
and you need git to clone the repo. This will change soon™.
|
||||
|
||||
## Interesting files and locations
|
||||
|
||||
### Special folders
|
||||
### Interesting folders
|
||||
|
||||
| Path | Description |
|
||||
|--------------------|-------------------------------------------------------------------------------------|
|
||||
| `.github` | GitHub Repository configuration files. Not part of the dotfiles per se. |
|
||||
| `host-{hostname}/` | Host specific dotfiles. Configurations that should apply to that host only. |
|
||||
| `local/bin` | Helper scripts that I've collected or wrote to make life easier. |
|
||||
| `scripts` | Setup scripts. Some can be run many times, some are meant only for the first round. |
|
||||
| Path | Description |
|
||||
| ------------------ | --------------------------------------------------- |
|
||||
| `.github` | GitHub Repository configuration files. |
|
||||
| `host-{hostname}/` | Configurations that should apply to that host only. |
|
||||
| `local/bin` | Helper scripts that I've collected or wrote. |
|
||||
| `scripts` | Setup scripts. |
|
||||
|
||||
### dotfile folders
|
||||
|
||||
| Repo | Destination | Description |
|
||||
|-----------|-------------|------------------------------------------------------------------|
|
||||
| `config/` | `.config/` | Configurations for applications. |
|
||||
| `local/` | `.local/` | XDG Base folder, contains `bin`, `share` and `state` for example |
|
||||
| `ssh/` | `.ssh/` | SSH Configurations. |
|
||||
| Repo | Destination | Description |
|
||||
| --------- | ----------- | ------------------------------------------- |
|
||||
| `config/` | `.config/` | Configurations for applications. |
|
||||
| `local/` | `.local/` | XDG Base folder: `bin`, `share` and `state` |
|
||||
| `ssh/` | `.ssh/` | SSH Configurations. |
|
||||
|
||||
### dfm - the dotfiles manager
|
||||
|
||||
@@ -44,7 +46,8 @@ and you need git to clone the repo. This will change soon™.
|
||||
|
||||
### `scripts/install-dotfiles.sh` - dotfiles linker
|
||||
|
||||
The `scripts/install-dotfiles.sh` is a `rcm` generated shell script that does all the necessary linking.
|
||||
The `scripts/install-dotfiles.sh` is a `rcm` generated shell script
|
||||
that does all the necessary linking.
|
||||
|
||||
To refresh the file, you can run `dfm dotfiles update`
|
||||
|
||||
@@ -55,7 +58,7 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
||||
### XDG Variables
|
||||
|
||||
| Var | Default |
|
||||
|--------------------|----------------------|
|
||||
| ------------------ | -------------------- |
|
||||
| Executables | `$HOME/.local/bin` |
|
||||
| `$XDG_DATA_HOME` | `$HOME/.local/share` |
|
||||
| `$XDG_STATE_HOME` | `$HOME/.local/state` |
|
||||
@@ -67,17 +70,24 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
||||
- `$XDG_CONFIG_HOME` defines the base directory relative to which 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.
|
||||
- `$XDG_STATE_HOME` defines the base directory relative to which 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 portable enough to the user that it should be stored in `$XDG_DATA_HOME`.
|
||||
- `$XDG_STATE_HOME` defines the base directory relative
|
||||
to which 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 portable enough to the user that
|
||||
it should be stored in `$XDG_DATA_HOME`.
|
||||
It may contain:
|
||||
- actions history (logs, history, recently used files, …)
|
||||
- current state of the application that can be reused on a restart (view, layout, open files, undo history, …)
|
||||
- User-specific executable files may be stored in `$HOME/.local/bin`. Distributions should ensure this
|
||||
directory shows up in the UNIX `$PATH` environment variable, at an appropriate place.
|
||||
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories to search for data files in addition
|
||||
to the `$XDG_DATA_HOME` base directory. The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
|
||||
- actions history (logs, history, recently used files, …)
|
||||
- current state of the application that can be reused
|
||||
on a restart (view, layout, open files, undo history, …)
|
||||
- User-specific executable files may be stored in `$HOME/.local/bin`.
|
||||
Distributions should ensure this directory shows up in the UNIX `$PATH`
|
||||
environment variable, at an appropriate place.
|
||||
- `$XDG_DATA_DIRS` defines the preference-ordered set of base directories
|
||||
to search for data files in addition to the `$XDG_DATA_HOME` base directory.
|
||||
The directories in `$XDG_DATA_DIRS` should be seperated with a colon ':'.
|
||||
|
||||
[xdg]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
|
||||
@@ -85,12 +95,9 @@ The folder structure follows [XDG Base Directory Specification][xdg] where possi
|
||||
|
||||
### Interesting dotfiles repos
|
||||
|
||||
- https://dotfiles.github.io/inspiration/
|
||||
- https://github.com/frdmn/dotfiles - Ansible-based dotfile setup for macOS
|
||||
- https://github.com/mvdan/dotfiles - Here be dragons
|
||||
- https://github.com/vsouza/dotfiles - 🏡 My dotfiles
|
||||
- https://github.com/freekmurze/dotfiles - My personal dotfiles
|
||||
|
||||
### Interesting dotfiles tools
|
||||
|
||||
- https://github.com/zero-sh/zero.sh - Radically simple personal bootstrapping tool for macOS.
|
||||
- [https://dotfiles.github.io/inspiration/](dotfiles.github.io/inspiration)
|
||||
- [https://github.com/frdmn/dotfiles](github.com/frdmn/dotfiles) - Ansible-based
|
||||
dotfile setup for macOS
|
||||
- [https://github.com/mvdan/dotfiles](mvdan/dotfiles) - Here be dragons
|
||||
- [https://github.com/vsouza/dotfiles](vsouza/dotfiles) - 🏡 My dotfiles
|
||||
- [https://github.com/freekmurze/dotfiles](freekmurze/dotfiles) - My personal dotfiles
|
||||
|
||||
1
config/astronvim/lua/user
Submodule
1
config/astronvim/lua/user
Submodule
Submodule config/astronvim/lua/user added at 890023c86c
@@ -1,52 +1,55 @@
|
||||
[user]
|
||||
name = Ismo Vuorinen
|
||||
email = ismo@ivuorinen.net
|
||||
name = Ismo Vuorinen
|
||||
email = ismo@ivuorinen.net
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
|
||||
[alias]
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
|
||||
[diff]
|
||||
tool = difftastic
|
||||
tool = difftastic
|
||||
|
||||
[difftool]
|
||||
prompt = false
|
||||
prompt = false
|
||||
|
||||
[difftool "difftastic"]
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
defaultBranch = main
|
||||
|
||||
[pull]
|
||||
rebase = false
|
||||
rebase = true
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
|
||||
[color "status"]
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
|
||||
[submodule]
|
||||
recurse = true
|
||||
|
||||
1
config/nvim
Submodule
1
config/nvim
Submodule
Submodule config/nvim added at e283d6749f
@@ -1,705 +0,0 @@
|
||||
-- Install packer
|
||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
||||
local is_bootstrap = false
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
is_bootstrap = true
|
||||
vim.fn.system {
|
||||
'git', 'clone', '--depth', '1',
|
||||
'https://github.com/wbthomason/packer.nvim',
|
||||
install_path
|
||||
}
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
require('packer').startup(function(use)
|
||||
-- Package manager
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use { -- LSP Configuration & Plugins
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
-- Automatically install LSPs to stdpath for neovim
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
|
||||
-- Useful status updates for LSP
|
||||
'j-hui/fidget.nvim',
|
||||
},
|
||||
}
|
||||
|
||||
use { -- Autocompletion
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
}
|
||||
|
||||
use { -- Highlight, edit, and navigate code
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
pcall(require('nvim-treesitter.install').update { with_sync = true })
|
||||
end,
|
||||
}
|
||||
|
||||
use { -- Additional text objects via treesitter
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
after = 'nvim-treesitter',
|
||||
}
|
||||
|
||||
-- Theme based off the Material Pale Night
|
||||
use 'drewtempelmeyer/palenight.vim'
|
||||
-- Fancier statusline
|
||||
use 'nvim-lualine/lualine.nvim'
|
||||
-- Add indentation guides even on blank lines.
|
||||
use 'lukas-reineke/indent-blankline.nvim'
|
||||
-- "gc" to comment visual regions/lines
|
||||
use 'numToStr/Comment.nvim'
|
||||
-- Detect tabstop and shiftwidth automatically.
|
||||
use 'tpope/vim-sleuth'
|
||||
|
||||
-- Fuzzy Finder (files, lsp, etc)
|
||||
use { 'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x', requires = { 'nvim-lua/plenary.nvim' } }
|
||||
|
||||
-- Fuzzy Finder Algorithm which requires local dependencies to be built.
|
||||
-- Only load if `make` is available
|
||||
use { 'nvim-telescope/telescope-fzf-native.nvim',
|
||||
run = 'make', cond = vim.fn.executable 'make' == 1 }
|
||||
|
||||
-- Add custom plugins to packer from
|
||||
-- ~/.config/nvim/lua/custom/plugins.lua
|
||||
local has_plugins, plugins = pcall(require, 'custom.plugins')
|
||||
if has_plugins then
|
||||
plugins(use)
|
||||
end
|
||||
|
||||
if is_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
-- When we are bootstrapping a configuration, it doesn't
|
||||
-- make sense to execute the rest of the init.lua.
|
||||
--
|
||||
-- You'll need to restart nvim, and then it will work.
|
||||
if is_bootstrap then
|
||||
print '=================================='
|
||||
print ' Plugins are being installed'
|
||||
print ' Wait until Packer completes,'
|
||||
print ' then restart nvim'
|
||||
print '=================================='
|
||||
return
|
||||
end
|
||||
|
||||
-- Automatically source and re-compile packer
|
||||
-- whenever you save this init.lua, or packages.lua
|
||||
local packer_group = vim.api.nvim_create_augroup('Packer', { clear = true })
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
command = 'source <afile> | PackerCompile',
|
||||
group = packer_group,
|
||||
pattern = { vim.fn.expand '$MYVIMRC' },
|
||||
})
|
||||
-- Automatically run PackerSync for plugins.lua files.
|
||||
vim.api.nvim_create_autocmd('BufWritePost', {
|
||||
command = 'source <afile> | PackerSync | PackerCompile',
|
||||
group = packer_group,
|
||||
pattern = { '~/.dotfiles/config/nvim/**/plugins.lua' },
|
||||
})
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
|
||||
-- Set highlight on search
|
||||
vim.o.hlsearch = false
|
||||
|
||||
-- Make line numbers default, enabled relative line numbers
|
||||
vim.wo.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = 'a'
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
vim.o.undofile = true
|
||||
|
||||
-- Case insensitive searching UNLESS /C or capital in search
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
-- Decrease update time
|
||||
vim.o.updatetime = 250
|
||||
vim.wo.signcolumn = 'yes'
|
||||
|
||||
-- Set colorscheme
|
||||
vim.o.termguicolors = true
|
||||
vim.cmd.colorscheme('palenight')
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
|
||||
-- Configure and disable providers.
|
||||
vim.g.python3_host_prog = '/opt/homebrew/bin/python3'
|
||||
vim.g.loaded_ruby_provider = 0
|
||||
|
||||
-- Setup winbar
|
||||
-- See :h statusline
|
||||
vim.o.winbar = '%=%m %f'
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- Set <space> as the leader key
|
||||
-- See `:help mapleader`
|
||||
-- NOTE: Must happen before plugins are required
|
||||
-- (otherwise wrong leader will be used)
|
||||
vim.g.mapleader = ' '
|
||||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Keymaps for better default experience
|
||||
-- See `:help vim.keymap.set()`
|
||||
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
|
||||
|
||||
-- Misc options.
|
||||
vim.o.incsearch = true
|
||||
|
||||
-- Keymap settings, etc.
|
||||
-- ~/.config/nvim/lua/custom/keymaps.lua
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local default_options_table = {
|
||||
expr = true,
|
||||
silent = true,
|
||||
noremap = true,
|
||||
}
|
||||
|
||||
-- normal mode keymap setter
|
||||
---@param keys string Trigger keys
|
||||
---@param func string Function or command to run
|
||||
---@param opts table Optional table of vim.keymap.set options.
|
||||
---@param desc string Optional description
|
||||
local nmap = function(keys, func, opts, desc)
|
||||
if desc then
|
||||
desc = 'keymaps.nmap: ' .. desc
|
||||
end
|
||||
|
||||
local options = default_options_table
|
||||
|
||||
-- If we have options, merge them to the local options table
|
||||
if opts then
|
||||
for k, v in pairs(opts) do
|
||||
options[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, options)
|
||||
end
|
||||
|
||||
-- visual mode keymap setter
|
||||
---@param keys string Trigger keys
|
||||
---@param func string Function or command to run
|
||||
---@param opts table Optional table of vim.keymap.set options.
|
||||
---@param desc string Optional description
|
||||
local vmap = function(keys, func, opts, desc)
|
||||
if desc then
|
||||
desc = 'keymaps.vmap: ' .. desc
|
||||
end
|
||||
|
||||
local options = default_options_table
|
||||
|
||||
-- If we have options, merge them to the local options table
|
||||
if opts then
|
||||
for k, v in pairs(opts) do
|
||||
options[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set('v', keys, func, options)
|
||||
end
|
||||
|
||||
-- Format document
|
||||
nmap("<leader>D", ":Format")
|
||||
|
||||
-- Deal with word wrap
|
||||
nmap('k', "v:count == 0 ? 'gk' : 'k'")
|
||||
nmap('j', "v:count == 0 ? 'gj' : 'j'")
|
||||
|
||||
-- Diagnostic keymaps
|
||||
nmap('dz', vim.diagnostic.goto_prev)
|
||||
nmap('dx', vim.diagnostic.goto_next)
|
||||
nmap('<leader>e', vim.diagnostic.open_float)
|
||||
nmap('<leader>q', vim.diagnostic.setloclist)
|
||||
|
||||
--
|
||||
-- ThePrimeagen/refactoring.nvim
|
||||
-- https://github.com/ThePrimeagen/refactoring.nvim
|
||||
--
|
||||
|
||||
-- Remaps for the refactoring operations currently offered by the plugin
|
||||
local rf = { noremap = true, silent = true, expr = false }
|
||||
vmap("<leader>re", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function')<CR>]], rf)
|
||||
vmap("<leader>rf", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Function To File')<CR>]], rf)
|
||||
vmap("<leader>rv", [[ <Esc><Cmd>lua require('refactoring').refactor('Extract Variable')<CR>]], rf)
|
||||
vmap("<leader>ri", [[ <Esc><Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], rf)
|
||||
|
||||
-- Extract block doesn't need visual mode
|
||||
nmap("<leader>rb", [[ <Cmd>lua require('refactoring').refactor('Extract Block')<CR>]], rf)
|
||||
nmap("<leader>rbf", [[ <Cmd>lua require('refactoring').refactor('Extract Block To File')<CR>]], rf)
|
||||
|
||||
-- Inline variable can also pick up the identifier currently under the cursor without visual mode
|
||||
nmap("<leader>ri", [[ <Cmd>lua require('refactoring').refactor('Inline Variable')<CR>]], rf)
|
||||
|
||||
-- prompt for a refactor to apply when the remap is triggered
|
||||
vmap("<leader>rr", ":lua require('refactoring').select_refactor()<CR>", rf)
|
||||
|
||||
--
|
||||
--
|
||||
--
|
||||
|
||||
-- barbar keymaps
|
||||
local barbar_opts = { noremap = true, silent = true }
|
||||
|
||||
-- Move to previous/next
|
||||
map('n', '<C-,>', '<Cmd>BufferPrevious<CR>', barbar_opts)
|
||||
map('n', '<C-.>', '<Cmd>BufferNext<CR>', barbar_opts)
|
||||
-- Re-order to previous/next
|
||||
map('n', '<C-<>', '<Cmd>BufferMovePrevious<CR>', barbar_opts)
|
||||
map('n', '<C->>', '<Cmd>BufferMoveNext<CR>', barbar_opts)
|
||||
-- Goto buffer in position...
|
||||
map('n', '<leader>b1', '<Cmd>BufferGoto 1<CR>', barbar_opts)
|
||||
map('n', '<leader>b2', '<Cmd>BufferGoto 2<CR>', barbar_opts)
|
||||
map('n', '<leader>b3', '<Cmd>BufferGoto 3<CR>', barbar_opts)
|
||||
map('n', '<leader>b4', '<Cmd>BufferGoto 4<CR>', barbar_opts)
|
||||
map('n', '<leader>b5', '<Cmd>BufferGoto 5<CR>', barbar_opts)
|
||||
map('n', '<leader>b6', '<Cmd>BufferGoto 6<CR>', barbar_opts)
|
||||
map('n', '<leader>b7', '<Cmd>BufferGoto 7<CR>', barbar_opts)
|
||||
map('n', '<leader>b8', '<Cmd>BufferGoto 8<CR>', barbar_opts)
|
||||
map('n', '<leader>b9', '<Cmd>BufferGoto 9<CR>', barbar_opts)
|
||||
map('n', '<leader>b0', '<Cmd>BufferLast<CR>', barbar_opts)
|
||||
-- Pin/unpin buffer
|
||||
map('n', '<A-p>', '<Cmd>BufferPin<CR>', barbar_opts)
|
||||
-- Close buffer
|
||||
map('n', '<A-c>', '<Cmd>BufferClose<CR>', barbar_opts)
|
||||
-- Wipeout buffer
|
||||
-- :BufferWipeout
|
||||
-- Close commands
|
||||
-- :BufferCloseAllButCurrent
|
||||
-- :BufferCloseAllButPinned
|
||||
-- :BufferCloseAllButCurrentOrPinned
|
||||
-- :BufferCloseBuffersLeft
|
||||
-- :BufferCloseBuffersRight
|
||||
-- Magic buffer-picking mode
|
||||
map('n', '<C-p>', '<Cmd>BufferPick<CR>', barbar_opts)
|
||||
-- Sort automatically by...
|
||||
map('n', '<Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', barbar_opts)
|
||||
map('n', '<Space>bd', '<Cmd>BufferOrderByDirectory<CR>', barbar_opts)
|
||||
map('n', '<Space>bl', '<Cmd>BufferOrderByLanguage<CR>', barbar_opts)
|
||||
map('n', '<Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', barbar_opts)
|
||||
|
||||
-- Other:
|
||||
-- :BarbarEnable - enables barbar (enabled by default)
|
||||
-- :BarbarDisable - very bad command, should never be used
|
||||
|
||||
|
||||
local highlight_group = vim.api.nvim_create_augroup(
|
||||
'YankHighlight', { clear = true }
|
||||
)
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
||||
-- Set lualine as statusline
|
||||
-- See `:help lualine.txt`
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = '|',
|
||||
section_separators = '',
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable Comment.nvim
|
||||
require('Comment').setup()
|
||||
|
||||
-- Enable `lukas-reineke/indent-blankline.nvim`
|
||||
-- See `:help indent_blankline.txt`
|
||||
require('indent_blankline').setup {
|
||||
-- char = '┊',
|
||||
show_trailing_blankline_indent = true,
|
||||
space_char_blankline = " ",
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
}
|
||||
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-u>'] = false,
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable telescope fzf native, if installed
|
||||
pcall(require('telescope').load_extension, 'fzf')
|
||||
|
||||
local ks = vim.keymap.set
|
||||
local tl = require('telescope.builtin')
|
||||
|
||||
-- See `:help telescope.builtin`
|
||||
ks('n', '<leader>?', tl.oldfiles, { desc = '[?] Find recently opened files' })
|
||||
ks('n', '<leader><space>', tl.buffers, { desc = '[ ] Find existing buffers' })
|
||||
ks('n', '<leader>/', function()
|
||||
-- You can pass additional configuration to telescope to
|
||||
-- change theme, layout, etc.
|
||||
tl.current_buffer_fuzzy_find(
|
||||
require('telescope.themes').get_dropdown {
|
||||
winblend = 10,
|
||||
previewer = false,
|
||||
})
|
||||
end, { desc = '[/] Fuzzily search in current buffer]' })
|
||||
|
||||
ks('n', '<leader>sf', tl.find_files, { desc = '[S]earch [F]iles' })
|
||||
ks('n', '<leader>sh', tl.help_tags, { desc = '[S]earch [H]elp' })
|
||||
ks('n', '<leader>sw', tl.grep_string, { desc = '[S]earch current [W]ord' })
|
||||
ks('n', '<leader>sg', tl.live_grep, { desc = '[S]earch by [G]rep' })
|
||||
ks('n', '<leader>sd', tl.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
||||
|
||||
-- Add harpoon to telescope
|
||||
require("telescope").load_extension('harpoon')
|
||||
|
||||
-- [[ Configure Treesitter ]]
|
||||
-- See `:help nvim-treesitter`
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want
|
||||
-- installed for treesitter
|
||||
ensure_installed = {
|
||||
'bash',
|
||||
'c', 'comment', 'cpp',
|
||||
'diff', 'dockerfile',
|
||||
'gitattributes', 'gitignore', 'go',
|
||||
'html', 'http',
|
||||
'javascript', 'jq', 'jsdoc', 'json',
|
||||
'lua',
|
||||
'markdown',
|
||||
'org',
|
||||
'php', 'phpdoc', 'python',
|
||||
'regex', 'rust',
|
||||
'scss', 'sql',
|
||||
'typescript',
|
||||
'vim', 'vue',
|
||||
'yaml',
|
||||
'help',
|
||||
},
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
-- Required for spellcheck, some LaTex highlights and
|
||||
-- code block highlights that do not have ts grammar
|
||||
additional_vim_regex_highlighting = { 'org' },
|
||||
},
|
||||
|
||||
indent = { enable = true, disable = { 'python' } },
|
||||
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<c-space>',
|
||||
node_incremental = '<c-space>',
|
||||
scope_incremental = '<c-s>',
|
||||
node_decremental = '<c-backspace>',
|
||||
},
|
||||
},
|
||||
|
||||
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,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']m'] = '@function.outer',
|
||||
[']]'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']M'] = '@function.outer',
|
||||
[']['] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[m'] = '@function.outer',
|
||||
['[['] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[M'] = '@function.outer',
|
||||
['[]'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
swap = {
|
||||
enable = true,
|
||||
swap_next = {
|
||||
['<leader>a'] = '@parameter.inner',
|
||||
},
|
||||
swap_previous = {
|
||||
['<leader>A'] = '@parameter.inner',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- LSP settings.
|
||||
-- This function gets run when an LSP connects to a particular buffer.
|
||||
local on_attach = function(_, bufnr)
|
||||
-- NOTE: Remember that lua is a real programming language,
|
||||
-- and as such it is possible to define small helper and
|
||||
-- utility functions so you don't have to repeat yourself
|
||||
-- many times.
|
||||
--
|
||||
-- In this case, we create a function that lets us more
|
||||
-- easily define mappings specific for LSP related items.
|
||||
-- It sets the mode, buffer and description for us each time.
|
||||
local nm = function(keys, func, desc)
|
||||
if desc then
|
||||
desc = 'LSP: ' .. desc
|
||||
end
|
||||
|
||||
vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
end
|
||||
|
||||
local t = require('telescope.builtin')
|
||||
local vbuf = vim.lsp.buf
|
||||
|
||||
nm('<leader>rn', vbuf.rename, '[R]e[n]ame')
|
||||
nm('<leader>ca', vbuf.code_action, '[C]ode [A]ction')
|
||||
|
||||
nm('gd', vbuf.definition, '[G]oto [D]efinition')
|
||||
nm('gr', t.lsp_references, '[G]oto [R]eferences')
|
||||
nm('gI', vbuf.implementation, '[G]oto [I]mplementation')
|
||||
nm('<leader>D', vbuf.type_definition, 'Type [D]efinition')
|
||||
nm('<leader>ds', t.lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
nm('<leader>ws', t.lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
||||
|
||||
-- See `:help K` for why this keymap
|
||||
nm('K', vbuf.hover, 'Hover Documentation')
|
||||
nm('<C-k>', vbuf.signature_help, 'Signature Documentation')
|
||||
|
||||
-- Lesser used LSP functionality
|
||||
nm('gD', vbuf.declaration, '[G]oto [D]eclaration')
|
||||
nm('<leader>wa', vbuf.add_workspace_folder, '[W]orkspace [A]dd Folder')
|
||||
nm('<leader>wr', vbuf.remove_workspace_folder, '[W]orkspace [R]emove Folder')
|
||||
nm('<leader>wl', function()
|
||||
print(vim.inspect(vbuf.list_workspace_folders()))
|
||||
end, '[W]orkspace [L]ist Folders')
|
||||
|
||||
-- Create a command `:Format` local to the LSP buffer
|
||||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
if vim.lsp.buf.format then
|
||||
vim.lsp.buf.format()
|
||||
elseif vim.lsp.buf.formatting then
|
||||
vim.lsp.buf.formatting()
|
||||
end
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
end
|
||||
|
||||
-- Setup mason so it can manage external tooling
|
||||
require('mason').setup()
|
||||
require("null-ls").setup()
|
||||
|
||||
-- Enable the following language servers.
|
||||
-- Feel free to add/remove any LSPs that you want here.
|
||||
-- They will automatically be installed.
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim#available-lsp-servers
|
||||
local servers = {
|
||||
-- a
|
||||
'angularls',
|
||||
'ansiblels',
|
||||
-- b
|
||||
'bashls',
|
||||
-- c
|
||||
'clangd',
|
||||
'cssls',
|
||||
-- d
|
||||
'dockerls',
|
||||
-- e
|
||||
'eslint',
|
||||
'emmet_ls',
|
||||
-- f
|
||||
-- g
|
||||
'gopls',
|
||||
'graphql',
|
||||
-- h
|
||||
'html',
|
||||
-- i
|
||||
-- j
|
||||
'quick_lint_js', -- js
|
||||
'jsonls',
|
||||
-- k
|
||||
-- l
|
||||
'sumneko_lua', -- lua
|
||||
-- m
|
||||
'marksman', -- markdown
|
||||
-- n
|
||||
-- o
|
||||
-- p
|
||||
'intelephense', 'phpactor', 'psalm',
|
||||
'pyright',
|
||||
-- q
|
||||
-- r
|
||||
'rust_analyzer',
|
||||
-- s
|
||||
'sqlls',
|
||||
'stylelint_lsp',
|
||||
-- t
|
||||
'tailwindcss',
|
||||
'terraformls',
|
||||
'tflint',
|
||||
'tsserver',
|
||||
-- u
|
||||
-- v / w
|
||||
'volar', -- vue
|
||||
'vuels', -- vue
|
||||
-- x / y / z
|
||||
'lemminx', -- xml
|
||||
'yamlls', -- yaml
|
||||
}
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
require('mason-lspconfig').setup {
|
||||
ensure_installed = servers,
|
||||
}
|
||||
|
||||
require("mason-lspconfig").setup_handlers {
|
||||
-- The first entry (without a key) will be the default handler
|
||||
-- and will be called for each installed server that doesn't have
|
||||
-- a dedicated handler.
|
||||
function(server_name)
|
||||
-- default handler (optional)
|
||||
require("lspconfig")[server_name].setup {}
|
||||
end,
|
||||
}
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
require('lspconfig')[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
end
|
||||
|
||||
-- Turn on lsp status information
|
||||
require('fidget').setup()
|
||||
|
||||
-- Example custom configuration for lua.
|
||||
-- Make runtime files discoverable to the server
|
||||
local runtime_path = vim.split(package.path, ';')
|
||||
table.insert(runtime_path, 'lua/?.lua')
|
||||
table.insert(runtime_path, 'lua/?/init.lua')
|
||||
|
||||
require('lspconfig').sumneko_lua.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're
|
||||
-- using (most likely LuaJIT)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = runtime_path,
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized
|
||||
-- but unique identifier
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- nvim-cmp setup
|
||||
local cmp = require 'cmp'
|
||||
local luasnip = require 'luasnip'
|
||||
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
},
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
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' }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
vim.api.nvim_create_autocmd("BufWritePost",
|
||||
{ pattern = "plugins.lua", command = "source <afile> | PackerSync" })
|
||||
vim.api.nvim_create_autocmd("BufRead",
|
||||
{ pattern = "*/node_modules/*", command = "lua vim.diagnostic.disable(0)" })
|
||||
vim.api.nvim_create_autocmd("BufNewFile",
|
||||
{ pattern = "*/node_modules/*", command = "lua vim.diagnostic.disable(0)" })
|
||||
-- Enable spell checking for certain file types
|
||||
vim.api.nvim_create_autocmd({ "BufRead", "BufNewFile" },
|
||||
{ pattern = { "*.txt", "*.md", "*.tex" },
|
||||
command = "setlocal spell" })
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
-- vim: ts=2 sts=2 sw=2 et
|
||||
@@ -1,184 +0,0 @@
|
||||
return function(use)
|
||||
|
||||
-- 💥 Create key bindings that stick.
|
||||
-- WhichKey is a lua plugin that displays a popup with
|
||||
-- possible keybindings of the command you started typing.
|
||||
-- https://github.com/folke/which-key.nvim
|
||||
use({
|
||||
"folke/which-key.nvim",
|
||||
config = function()
|
||||
require("which-key").setup({})
|
||||
end
|
||||
})
|
||||
|
||||
-- 🍨 Soothing pastel theme for (Neo)vim
|
||||
-- https://github.com/catppuccin/nvim
|
||||
-- use { "catppuccin/nvim", as = "catppuccin" }
|
||||
-- vim.cmd.colorscheme('catppuccin-latte')
|
||||
|
||||
-- markdown preview plugin for (neo)vim
|
||||
-- https://github.com/iamcco/markdown-preview.nvim
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = function()
|
||||
vim.fn["mkdp#util#install"]()
|
||||
end,
|
||||
})
|
||||
|
||||
-- The neovim tabline plugin.
|
||||
-- https://github.com/romgrk/barbar.nvim
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
use { 'romgrk/barbar.nvim', wants = 'nvim-web-devicons' }
|
||||
|
||||
--
|
||||
-- Pretty UI
|
||||
--
|
||||
|
||||
-- Neovim plugin to improve the default vim.ui interfaces
|
||||
use 'stevearc/dressing.nvim'
|
||||
-- A fancy, configurable, notification manager for NeoVim
|
||||
use 'rcarriga/nvim-notify'
|
||||
-- Non-intrusive notification system for neovim
|
||||
use 'vigoux/notifier.nvim'
|
||||
-- ✅ Highlight, list and search todo comments in your projects
|
||||
use {
|
||||
'folke/todo-comments.nvim',
|
||||
requires = 'nvim-lua/plenary.nvim',
|
||||
config = function()
|
||||
require('todo-comments').setup {}
|
||||
end,
|
||||
}
|
||||
|
||||
-- The Refactoring library based off the Refactoring book by Martin Fowler
|
||||
-- https://github.com/ThePrimeagen/refactoring.nvim
|
||||
use {
|
||||
"ThePrimeagen/refactoring.nvim",
|
||||
requires = {
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
{ "nvim-treesitter/nvim-treesitter" }
|
||||
}
|
||||
}
|
||||
|
||||
-- harpoon, by ThePrimeagen
|
||||
-- https://github.com/ThePrimeagen/harpoon
|
||||
use {
|
||||
"ThePrimeagen/harpoon",
|
||||
requires = { { "nvim-lua/plenary.nvim" } }
|
||||
}
|
||||
|
||||
-- An asynchronous linter plugin for Neovim complementary to
|
||||
-- the built-in Language Server Protocol support.
|
||||
-- https://github.com/mfussenegger/nvim-lint
|
||||
use 'mfussenegger/nvim-lint'
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
-- Markdown support
|
||||
use 'preservim/vim-markdown'
|
||||
use 'godlygeek/tabular'
|
||||
|
||||
-- Creates missing folders on save
|
||||
-- https://github.com/jghauser/mkdir.nvim
|
||||
use { 'jghauser/mkdir.nvim' }
|
||||
|
||||
-- Neovim plugin for dimming the highlights of unused
|
||||
-- functions, variables, parameters, and more
|
||||
-- https://github.com/zbirenbaum/neodim
|
||||
use {
|
||||
"zbirenbaum/neodim",
|
||||
event = "LspAttach",
|
||||
config = function()
|
||||
require("neodim").setup({
|
||||
alpha = 0.75,
|
||||
blend_color = "#000000",
|
||||
update_in_insert = {
|
||||
enable = true,
|
||||
delay = 100,
|
||||
},
|
||||
hide = {
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = true,
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
-- EditorConfig plugin for Neovim
|
||||
-- https://github.com/gpanders/editorconfig.nvim
|
||||
use { 'gpanders/editorconfig.nvim' }
|
||||
|
||||
-- Use Neovim as a language server to inject LSP diagnostics, code actions, and more via Lua.
|
||||
-- https://github.com/jose-elias-alvarez/null-ls.nvim
|
||||
use {
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
local n = require("null-ls")
|
||||
local b = n.builtins
|
||||
require("null-ls").setup({
|
||||
b.code_actions.eslint,
|
||||
b.code_actions.shellcheck,
|
||||
b.code_actions.xo,
|
||||
b.completion.luasnip,
|
||||
b.completion.spell,
|
||||
b.diagnostics.actionlint,
|
||||
b.diagnostics.alex,
|
||||
b.diagnostics.ansiblelint,
|
||||
b.diagnostics.codespell,
|
||||
b.diagnostics.dotenv_linter,
|
||||
b.diagnostics.editorconfig_checker,
|
||||
b.diagnostics.eslint,
|
||||
b.diagnostics.hadolint,
|
||||
b.diagnostics.jsonlint,
|
||||
b.diagnostics.luacheck,
|
||||
b.diagnostics.markdownlint,
|
||||
b.diagnostics.php,
|
||||
b.diagnostics.phpcs,
|
||||
b.diagnostics.phpstan,
|
||||
b.diagnostics.psalm,
|
||||
b.diagnostics.shellcheck,
|
||||
b.diagnostics.spectral,
|
||||
b.diagnostics.stylelint,
|
||||
b.diagnostics.todo_comments,
|
||||
b.diagnostics.trail_space,
|
||||
b.diagnostics.xo,
|
||||
b.diagnostics.yamllint,
|
||||
b.formatting.blade_formatter,
|
||||
b.formatting.eslint,
|
||||
b.formatting.fixjson,
|
||||
b.formatting.lua_format,
|
||||
b.formatting.markdownlint,
|
||||
b.formatting.prettier,
|
||||
b.formatting.shfmt,
|
||||
b.formatting.stylelint,
|
||||
-- b.formatting.stylua,
|
||||
b.formatting.terraform_fmt,
|
||||
b.formatting.trim_whitespace,
|
||||
b.formatting.yamlfmt,
|
||||
})
|
||||
end,
|
||||
requires = { "nvim-lua/plenary.nvim" }
|
||||
}
|
||||
|
||||
-- mason-null-ls bridges mason.nvim with the null-ls plugin
|
||||
-- - making it easier to use both plugins together.
|
||||
-- https://github.com/jay-babu/mason-null-ls.nvim
|
||||
use {
|
||||
"jayp0521/mason-null-ls.nvim",
|
||||
config = function()
|
||||
require("mason-null-ls").setup({
|
||||
ensure_installed = nil,
|
||||
automatic_installation = true,
|
||||
automatic_setup = false,
|
||||
})
|
||||
end,
|
||||
requires = { "jose-elias-alvarez/null-ls.nvim" }
|
||||
}
|
||||
|
||||
-- WakaTime Support
|
||||
use { "wakatime/vim-wakatime" }
|
||||
|
||||
end
|
||||
1
config/nvim/plugin/.gitignore
vendored
1
config/nvim/plugin/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
packer_compiled.lua
|
||||
35
config/starship.toml
Normal file
35
config/starship.toml
Normal file
@@ -0,0 +1,35 @@
|
||||
# Get editor completions based on the config schema
|
||||
"$schema" = 'https://starship.rs/config-schema.json'
|
||||
|
||||
# Inserts a blank line between shell prompts
|
||||
add_newline = true
|
||||
|
||||
# Replace the '❯' symbol in the prompt with '➜'
|
||||
[character] # The name of the module we are configuring is 'character'
|
||||
success_symbol = '[➜](bold green)' # The 'success_symbol' segment is being set to '➜' with the color 'bold green'
|
||||
|
||||
[cmd_duration]
|
||||
disabled = true
|
||||
|
||||
[git_branch]
|
||||
symbol = '🌱 '
|
||||
truncation_length = 20
|
||||
truncation_symbol = '…'
|
||||
ignore_branches = ['master', 'main']
|
||||
|
||||
[git_status]
|
||||
up_to_date = '✓'
|
||||
staged = '[++\($count\)](green)'
|
||||
|
||||
[package]
|
||||
format = '[$symbol($version )]($style)'
|
||||
version_format = '${major}.${minor}'
|
||||
|
||||
[php]
|
||||
format = '[$symbol($version )]($style)'
|
||||
version_format = '${major}.${minor}'
|
||||
|
||||
[nodejs]
|
||||
format = '[$symbol($version )]($style)'
|
||||
version_format = '${major}.${minor}'
|
||||
|
||||
20
ecrc
Normal file
20
ecrc
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"Version": "2.7.0",
|
||||
"Verbose": false,
|
||||
"Debug": false,
|
||||
"IgnoreDefaults": false,
|
||||
"SpacesAftertabs": false,
|
||||
"NoColor": false,
|
||||
"Exclude": [],
|
||||
"AllowedContentTypes": [],
|
||||
"PassedFiles": [],
|
||||
"Disable": {
|
||||
"EndOfLine": false,
|
||||
"Indentation": false,
|
||||
"InsertFinalNewline": false,
|
||||
"TrimTrailingWhitespace": false,
|
||||
"IndentSize": false,
|
||||
"MaxLineLength": false
|
||||
}
|
||||
}
|
||||
|
||||
243
host-lakka/irssi/config
Normal file
243
host-lakka/irssi/config
Normal file
@@ -0,0 +1,243 @@
|
||||
# Reduce log fragmentation
|
||||
settings = {
|
||||
core = {
|
||||
write_buffer_size = "2MB";
|
||||
write_buffer_timeout = "5min";
|
||||
real_name = "Ismo Vuorinen";
|
||||
user_name = "viir";
|
||||
nick = "viir";
|
||||
};
|
||||
"fe-text" = { actlist_sort = "refnum"; };
|
||||
};
|
||||
|
||||
servers = (
|
||||
{
|
||||
address = "irc.tdc.fi";
|
||||
chatnet = "IRCnet";
|
||||
port = "6667";
|
||||
own_host = "kapsi.fi";
|
||||
family = "inet";
|
||||
autoconnect = "yes";
|
||||
},
|
||||
{
|
||||
address = "irc.fi.quakenet.org";
|
||||
chatnet = "QuakeNet";
|
||||
port = "6667";
|
||||
own_host = "kapsi.fi";
|
||||
family = "inet";
|
||||
},
|
||||
{ address = "irc.efnet.net"; chatnet = "EFNet"; port = "6667"; },
|
||||
{
|
||||
address = "irc.undernet.org";
|
||||
chatnet = "Undernet";
|
||||
port = "6667";
|
||||
},
|
||||
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },
|
||||
{
|
||||
address = "irc.quakenet.org";
|
||||
chatnet = "QuakeNet";
|
||||
port = "6667";
|
||||
},
|
||||
{ address = "silc.silcnet.org"; chatnet = "SILC"; port = "706"; },
|
||||
{ address = "irc.nerv.fi"; chatnet = "Nerv"; port = "706"; }
|
||||
);
|
||||
|
||||
chatnets = {
|
||||
IRCnet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "5";
|
||||
max_whois = "4";
|
||||
max_query_chans = "5";
|
||||
};
|
||||
EFNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "3";
|
||||
max_whois = "1";
|
||||
};
|
||||
Undernet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "3";
|
||||
max_whois = "30";
|
||||
};
|
||||
DALnet = {
|
||||
type = "IRC";
|
||||
max_kicks = "4";
|
||||
max_msgs = "3";
|
||||
max_whois = "30";
|
||||
};
|
||||
QuakeNet = {
|
||||
type = "IRC";
|
||||
max_kicks = "1";
|
||||
max_msgs = "3";
|
||||
max_whois = "30";
|
||||
};
|
||||
SILC = { type = "SILC"; };
|
||||
Nerv = { type = "IRC"; };
|
||||
};
|
||||
|
||||
channels = (
|
||||
{ name = "#kapsi.fi"; chatnet = "IRCNet"; autojoin = "No"; }
|
||||
);
|
||||
|
||||
aliases = {
|
||||
J = "join";
|
||||
WJOIN = "join -window";
|
||||
WQUERY = "query -window";
|
||||
LEAVE = "part";
|
||||
BYE = "quit";
|
||||
EXIT = "quit";
|
||||
SIGNOFF = "quit";
|
||||
DESCRIBE = "action";
|
||||
DATE = "time";
|
||||
HOST = "userhost";
|
||||
LAST = "lastlog";
|
||||
SAY = "msg *";
|
||||
WI = "whois";
|
||||
WII = "whois $0 $0";
|
||||
WW = "whowas";
|
||||
W = "who";
|
||||
N = "names";
|
||||
M = "msg";
|
||||
T = "topic";
|
||||
C = "clear";
|
||||
CL = "clear";
|
||||
K = "kick";
|
||||
KB = "kickban";
|
||||
KN = "knockout";
|
||||
BANS = "ban";
|
||||
B = "ban";
|
||||
MUB = "unban *";
|
||||
UB = "unban";
|
||||
IG = "ignore";
|
||||
UNIG = "unignore";
|
||||
SB = "scrollback";
|
||||
UMODE = "mode $N";
|
||||
WC = "window close";
|
||||
WN = "window new hide";
|
||||
SV = "say Irssi $J ($V) - http://irssi.org/";
|
||||
GOTO = "sb goto";
|
||||
CHAT = "dcc chat";
|
||||
RUN = "SCRIPT LOAD";
|
||||
CALC = "exec - if which bc &>/dev/null\\; then echo '$*' | bc | awk '{print \"$*=\"$$1}'\\; else echo bc was not found\\; fi";
|
||||
SBAR = "STATUSBAR";
|
||||
INVITELIST = "mode $C +I";
|
||||
Q = "QUERY";
|
||||
"MANUAL-WINDOWS" = "set use_status_window off;set autocreate_windows off;set autocreate_query_level none;set autoclose_windows off;set reuse_unused_windows on;save";
|
||||
EXEMPTLIST = "mode $C +e";
|
||||
ATAG = "WINDOW SERVER";
|
||||
};
|
||||
|
||||
statusbar = {
|
||||
# formats:
|
||||
# when using {templates}, the template is shown only if it's argument isn't
|
||||
# empty unless no argument is given. for example {sb} is printed always,
|
||||
# but {sb $T} is printed only if $T isn't empty.
|
||||
|
||||
items = {
|
||||
# start/end text in statusbars
|
||||
barstart = "{sbstart}";
|
||||
barend = "{sbend}";
|
||||
|
||||
topicbarstart = "{topicsbstart}";
|
||||
topicbarend = "{topicsbend}";
|
||||
|
||||
# treated "normally", you could change the time/user name to whatever
|
||||
time = "{sb $Z}";
|
||||
user = "{sb {sbnickmode $cumode}$N{sbmode $usermode}{sbaway $A}}";
|
||||
|
||||
# treated specially .. window is printed with non-empty windows,
|
||||
# window_empty is printed with empty windows
|
||||
window = "{sb $winref:$tag/$itemname{sbmode $M}}";
|
||||
window_empty = "{sb $winref{sbservertag $tag}}";
|
||||
prompt = "{prompt $[.15]itemname}";
|
||||
prompt_empty = "{prompt $winname}";
|
||||
topic = " $topic";
|
||||
topic_empty = " Irssi v$J - http://irssi.org/help/";
|
||||
|
||||
# all of these treated specially, they're only displayed when needed
|
||||
lag = "{sb Lag: $0-}";
|
||||
act = "{sb Act: $0-}";
|
||||
more = "-- more --";
|
||||
};
|
||||
|
||||
# there's two type of statusbars. root statusbars are either at the top
|
||||
# of the screen or at the bottom of the screen. window statusbars are at
|
||||
# the top/bottom of each split window in screen.
|
||||
default = {
|
||||
# the "default statusbar" to be displayed at the bottom of the window.
|
||||
# contains all the normal items.
|
||||
window = {
|
||||
disabled = "no";
|
||||
|
||||
# window, root
|
||||
type = "window";
|
||||
# top, bottom
|
||||
placement = "bottom";
|
||||
# number
|
||||
position = "1";
|
||||
# active, inactive, always
|
||||
visible = "active";
|
||||
|
||||
# list of items in statusbar in the display order
|
||||
items = {
|
||||
barstart = { priority = "100"; };
|
||||
time = { };
|
||||
user = { };
|
||||
window = { };
|
||||
window_empty = { };
|
||||
lag = { priority = "-1"; };
|
||||
act = { priority = "10"; };
|
||||
more = { priority = "-1"; alignment = "right"; };
|
||||
barend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
|
||||
# statusbar to use in inactive split windows
|
||||
window_inact = {
|
||||
type = "window";
|
||||
placement = "bottom";
|
||||
position = "1";
|
||||
visible = "inactive";
|
||||
items = {
|
||||
barstart = { priority = "100"; };
|
||||
window = { };
|
||||
window_empty = { };
|
||||
more = { priority = "-1"; alignment = "right"; };
|
||||
barend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
|
||||
# we treat input line as yet another statusbar :) It's possible to
|
||||
# add other items before or after the input line item.
|
||||
prompt = {
|
||||
type = "root";
|
||||
placement = "bottom";
|
||||
# we want to be at the bottom always
|
||||
position = "100";
|
||||
visible = "always";
|
||||
items = {
|
||||
prompt = { priority = "-1"; };
|
||||
prompt_empty = { priority = "-1"; };
|
||||
# treated specially, this is the real input line.
|
||||
input = { priority = "10"; };
|
||||
};
|
||||
};
|
||||
|
||||
# topicbar
|
||||
topic = {
|
||||
type = "root";
|
||||
placement = "top";
|
||||
position = "1";
|
||||
visible = "always";
|
||||
items = {
|
||||
topicbarstart = { priority = "100"; };
|
||||
topic = { };
|
||||
topic_empty = { };
|
||||
topicbarend = { priority = "100"; alignment = "right"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
294
host-lakka/irssi/default.theme
Normal file
294
host-lakka/irssi/default.theme
Normal file
@@ -0,0 +1,294 @@
|
||||
# When testing changes, the easiest way to reload the theme is with /RELOAD.
|
||||
# This reloads the configuration file too, so if you did any changes remember
|
||||
# to /SAVE it first. Remember also that /SAVE overwrites the theme file with
|
||||
# old data so keep backups :)
|
||||
|
||||
# TEMPLATES:
|
||||
|
||||
# The real text formats that irssi uses are the ones you can find with
|
||||
# /FORMAT command. Back in the old days all the colors and texts were mixed
|
||||
# up in those formats, and it was really hard to change the colors since you
|
||||
# might have had to change them in tens of different places. So, then came
|
||||
# this templating system.
|
||||
|
||||
# Now the /FORMATs don't have any colors in them, and they also have very
|
||||
# little other styling. Most of the stuff you need to change is in this
|
||||
# theme file. If you can't change something here, you can always go back
|
||||
# to change the /FORMATs directly, they're also saved in these .theme files.
|
||||
|
||||
# So .. the templates. They're those {blahblah} parts you see all over the
|
||||
# /FORMATs and here. Their usage is simply {name parameter1 parameter2}.
|
||||
# When irssi sees this kind of text, it goes to find "name" from abstracts
|
||||
# block below and sets "parameter1" into $0 and "parameter2" into $1 (you
|
||||
# can have more parameters of course). Templates can have subtemplates.
|
||||
# Here's a small example:
|
||||
# /FORMAT format hello {colorify {underline world}}
|
||||
# abstracts = { colorify = "%G$0-%n"; underline = "%U$0-%U"; }
|
||||
# When irssi expands the templates in "format", the final string would be:
|
||||
# hello %G%Uworld%U%n
|
||||
# ie. underlined bright green "world" text.
|
||||
# and why "$0-", why not "$0"? $0 would only mean the first parameter,
|
||||
# $0- means all the parameters. With {underline hello world} you'd really
|
||||
# want to underline both of the words, not just the hello (and world would
|
||||
# actually be removed entirely).
|
||||
|
||||
# COLORS:
|
||||
|
||||
# You can find definitions for the color format codes in docs/formats.txt.
|
||||
|
||||
# There's one difference here though. %n format. Normally it means the
|
||||
# default color of the terminal (white mostly), but here it means the
|
||||
# "reset color back to the one it was in higher template". For example
|
||||
# if there was /FORMAT test %g{foo}bar, and foo = "%Y$0%n", irssi would
|
||||
# print yellow "foo" (as set with %Y) but "bar" would be green, which was
|
||||
# set at the beginning before the {foo} template. If there wasn't the %g
|
||||
# at start, the normal behaviour of %n would occur. If you _really_ want
|
||||
# to use the terminal's default color, use %N.
|
||||
|
||||
#############################################################################
|
||||
|
||||
# default foreground color (%N) - -1 is the "default terminal color"
|
||||
default_color = "-1";
|
||||
|
||||
# print timestamp/servertag at the end of line, not at beginning
|
||||
info_eol = "false";
|
||||
|
||||
# these characters are automatically replaced with specified color
|
||||
# (dark grey by default)
|
||||
replaces = { "[]=" = "%K$*%n"; };
|
||||
|
||||
abstracts = {
|
||||
##
|
||||
## generic
|
||||
##
|
||||
|
||||
# text to insert at the beginning of each non-message line
|
||||
line_start = "%B-%n!%B-%n ";
|
||||
|
||||
# timestamp styling, nothing by default
|
||||
timestamp = "$*";
|
||||
|
||||
# any kind of text that needs hilighting, default is to bold
|
||||
hilight = "%_$*%_";
|
||||
|
||||
# any kind of error message, default is bright red
|
||||
error = "%R$*%n";
|
||||
|
||||
# channel name is printed
|
||||
channel = "%_$*%_";
|
||||
|
||||
# nick is printed
|
||||
nick = "%_$*%_";
|
||||
|
||||
# nick host is printed
|
||||
nickhost = "[$*]";
|
||||
|
||||
# server name is printed
|
||||
server = "%_$*%_";
|
||||
|
||||
# some kind of comment is printed
|
||||
comment = "[$*]";
|
||||
|
||||
# reason for something is printed (part, quit, kick, ..)
|
||||
reason = "{comment $*}";
|
||||
|
||||
# mode change is printed ([+o nick])
|
||||
mode = "{comment $*}";
|
||||
|
||||
##
|
||||
## channel specific messages
|
||||
##
|
||||
|
||||
# highlighted nick/host is printed (joins)
|
||||
channick_hilight = "%C$*%n";
|
||||
chanhost_hilight = "{nickhost %c$*%n}";
|
||||
|
||||
# nick/host is printed (parts, quits, etc.)
|
||||
channick = "%c$*%n";
|
||||
chanhost = "{nickhost $*}";
|
||||
|
||||
# highlighted channel name is printed
|
||||
channelhilight = "%c$*%n";
|
||||
|
||||
# ban/ban exception/invite list mask is printed
|
||||
ban = "%c$*%n";
|
||||
|
||||
##
|
||||
## messages
|
||||
##
|
||||
|
||||
# the basic styling of how to print message, $0 = nick mode, $1 = nick
|
||||
msgnick = "%K<%n$0$1-%K>%n %|";
|
||||
|
||||
# message from you is printed. "msgownnick" specifies the styling of the
|
||||
# nick ($0 part in msgnick) and "ownmsgnick" specifies the styling of the
|
||||
# whole line.
|
||||
|
||||
# Example1: You want the message text to be green:
|
||||
# ownmsgnick = "{msgnick $0 $1-}%g";
|
||||
# Example2.1: You want < and > chars to be yellow:
|
||||
# ownmsgnick = "%Y{msgnick $0 $1-%Y}%n";
|
||||
# (you'll also have to remove <> from replaces list above)
|
||||
# Example2.2: But you still want to keep <> grey for other messages:
|
||||
# pubmsgnick = "%K{msgnick $0 $1-%K}%n";
|
||||
# pubmsgmenick = "%K{msgnick $0 $1-%K}%n";
|
||||
# pubmsghinick = "%K{msgnick $1 $0$2-%n%K}%n";
|
||||
# ownprivmsgnick = "%K{msgnick $*%K}%n";
|
||||
# privmsgnick = "%K{msgnick %R$*%K}%n";
|
||||
|
||||
# $0 = nick mode, $1 = nick
|
||||
ownmsgnick = "{msgnick $0 $1-}";
|
||||
ownnick = "%_$*%n";
|
||||
|
||||
# public message in channel, $0 = nick mode, $1 = nick
|
||||
pubmsgnick = "{msgnick $0 $1-}";
|
||||
pubnick = "%N$*%n";
|
||||
|
||||
# public message in channel meant for me, $0 = nick mode, $1 = nick
|
||||
pubmsgmenick = "{msgnick $0 $1-}";
|
||||
menick = "%Y$*%n";
|
||||
|
||||
# public highlighted message in channel
|
||||
# $0 = highlight color, $1 = nick mode, $2 = nick
|
||||
pubmsghinick = "{msgnick $1 $0$2-%n}";
|
||||
|
||||
# channel name is printed with message
|
||||
msgchannel = "%K:%c$*%n";
|
||||
|
||||
# private message, $0 = nick, $1 = host
|
||||
privmsg = "[%R$0%K(%r$1-%K)%n] ";
|
||||
|
||||
# private message from you, $0 = "msg", $1 = target nick
|
||||
ownprivmsg = "[%r$0%K(%R$1-%K)%n] ";
|
||||
|
||||
# own private message in query
|
||||
ownprivmsgnick = "{msgnick $*}";
|
||||
ownprivnick = "%_$*%n";
|
||||
|
||||
# private message in query
|
||||
privmsgnick = "{msgnick %R$*%n}";
|
||||
|
||||
##
|
||||
## Actions (/ME stuff)
|
||||
##
|
||||
|
||||
# used internally by this theme
|
||||
action_core = "%_ * $*%n";
|
||||
|
||||
# generic one that's used by most actions
|
||||
action = "{action_core $*} ";
|
||||
|
||||
# own action, both private/public
|
||||
ownaction = "{action $*}";
|
||||
|
||||
# own action with target, both private/public
|
||||
ownaction_target = "{action_core $0}%K:%c$1%n ";
|
||||
|
||||
# private action sent by others
|
||||
pvtaction = "%_ (*) $*%n ";
|
||||
pvtaction_query = "{action $*}";
|
||||
|
||||
# public action sent by others
|
||||
pubaction = "{action $*}";
|
||||
|
||||
|
||||
##
|
||||
## other IRC events
|
||||
##
|
||||
|
||||
# whois
|
||||
whois = "%# $[8]0 : $1-";
|
||||
|
||||
# notices
|
||||
ownnotice = "[%r$0%K(%R$1-%K)]%n ";
|
||||
notice = "%K-%M$*%K-%n ";
|
||||
pubnotice_channel = "%K:%m$*";
|
||||
pvtnotice_host = "%K(%m$*%K)";
|
||||
servernotice = "%g!$*%n ";
|
||||
|
||||
# CTCPs
|
||||
ownctcp = "[%r$0%K(%R$1-%K)] ";
|
||||
ctcp = "%g$*%n";
|
||||
|
||||
# wallops
|
||||
wallop = "%_$*%n: ";
|
||||
wallop_nick = "%n$*";
|
||||
wallop_action = "%_ * $*%n ";
|
||||
|
||||
# netsplits
|
||||
netsplit = "%R$*%n";
|
||||
netjoin = "%C$*%n";
|
||||
|
||||
# /names list
|
||||
names_prefix = "";
|
||||
names_nick = "[%_$0%_$1-] ";
|
||||
names_nick_op = "{names_nick $*}";
|
||||
names_nick_halfop = "{names_nick $*}";
|
||||
names_nick_voice = "{names_nick $*}";
|
||||
names_users = "[%g$*%n]";
|
||||
names_channel = "%G$*%n";
|
||||
|
||||
# DCC
|
||||
dcc = "%g$*%n";
|
||||
dccfile = "%_$*%_";
|
||||
|
||||
# DCC chat, own msg/action
|
||||
dccownmsg = "[%r$0%K($1-%K)%n] ";
|
||||
dccownnick = "%R$*%n";
|
||||
dccownquerynick = "%_$*%n";
|
||||
dccownaction = "{action $*}";
|
||||
dccownaction_target = "{action_core $0}%K:%c$1%n ";
|
||||
|
||||
# DCC chat, others
|
||||
dccmsg = "[%G$1-%K(%g$0%K)%n] ";
|
||||
dccquerynick = "%G$*%n";
|
||||
dccaction = "%_ (*dcc*) $*%n %|";
|
||||
|
||||
##
|
||||
## statusbar
|
||||
##
|
||||
|
||||
# default background for all statusbars. You can also give
|
||||
# the default foreground color for statusbar items.
|
||||
sb_background = "%4%w";
|
||||
|
||||
# default backround for "default" statusbar group
|
||||
#sb_default_bg = "%4";
|
||||
# background for prompt / input line
|
||||
sb_prompt_bg = "%n";
|
||||
# background for info statusbar
|
||||
sb_info_bg = "%8";
|
||||
# background for topicbar (same default)
|
||||
#sb_topic_bg = "%4";
|
||||
|
||||
# text at the beginning of statusbars. sb-item already puts
|
||||
# space there,so we don't use anything by default.
|
||||
sbstart = "";
|
||||
# text at the end of statusbars. Use space so that it's never
|
||||
# used for anything.
|
||||
sbend = " ";
|
||||
|
||||
topicsbstart = "{sbstart $*}";
|
||||
topicsbend = "{sbend $*}";
|
||||
|
||||
prompt = "[$*] ";
|
||||
|
||||
sb = " %c[%n$*%c]%n";
|
||||
sbmode = "(%c+%n$*)";
|
||||
sbaway = " (%GzZzZ%n)";
|
||||
sbservertag = ":$0 (change with ^X)";
|
||||
sbnickmode = "$0";
|
||||
|
||||
# activity in statusbar
|
||||
|
||||
# ',' separator
|
||||
sb_act_sep = "%c$*";
|
||||
# normal text
|
||||
sb_act_text = "%c$*";
|
||||
# public message
|
||||
sb_act_msg = "%W$*";
|
||||
# hilight
|
||||
sb_act_hilight = "%M$*";
|
||||
# hilight with specified color, $0 = color, $1 = text
|
||||
sb_act_hilight_color = "$0$1-%n";
|
||||
};
|
||||
1
host-lakka/nanorc
Normal file
1
host-lakka/nanorc
Normal file
@@ -0,0 +1 @@
|
||||
set tabsize 2
|
||||
16
host-lakka/plan
Normal file
16
host-lakka/plan
Normal file
@@ -0,0 +1,16 @@
|
||||
. .
|
||||
/ `. .' \
|
||||
.---. < > < > .---.
|
||||
| \ \ - ~ ~ - / / |
|
||||
~-..-~ ~-..-~
|
||||
\~~~\.' `./~~~/
|
||||
.-~~^-. \__/ \__/
|
||||
.' O \ / / \ \
|
||||
(_____, `._.' | } \/~~~/
|
||||
`----. / } | / \__/
|
||||
`-. | / | / `. ,~~|
|
||||
~-.__| /_ - ~ ^| /- _ `..-' f: f:
|
||||
| / | / ~-. `-. _||_||_
|
||||
|_____| |_____| ~ - . _ _ _ _ _>
|
||||
|
||||
|
||||
72
host-lakka/zshrc
Normal file
72
host-lakka/zshrc
Normal file
@@ -0,0 +1,72 @@
|
||||
# Lakka zsh configuration.
|
||||
#
|
||||
# shellcheck shell=bash
|
||||
export PATH="/usr/local/bin:/usr/bin:/usr/sbin:$PATH"
|
||||
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
||||
|
||||
# z, https://github.com/rupa/z
|
||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
||||
|
||||
# composer, https://getcomposer.org/
|
||||
if command -v composer &> /dev/null; then
|
||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||
export PATH="$COMPOSER_BIN:$PATH"
|
||||
fi
|
||||
|
||||
# gem, rubygems
|
||||
if command -v gem &>/dev/null; then
|
||||
export GEM_HOME="$XDG_STATE_HOME/gem"
|
||||
export PATH="$GEM_HOME/bin:$PATH"
|
||||
fi
|
||||
|
||||
export PATH="$XDG_BIN_HOME:$HOME/bin:$HOME/.rvm/bin:$PATH"
|
||||
export LC_ALL=fi_FI.utf8
|
||||
|
||||
# Antigen configuration
|
||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
||||
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
||||
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
||||
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
||||
|
||||
# Try to load antigen, if present
|
||||
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
|
||||
|
||||
# If antigen was loaded
|
||||
if command -v antigen &> /dev/null; then
|
||||
antigen use oh-my-zsh
|
||||
|
||||
hash git 2>/dev/null && antigen bundle git
|
||||
hash php 2>/dev/null && antigen bundle php
|
||||
|
||||
antigen bundle autojump
|
||||
antigen bundle command-not-found
|
||||
antigen bundle jreese/zsh-titles
|
||||
antigen bundle zsh-users/zsh-syntax-highlighting
|
||||
antigen bundle zsh-users/zsh-completions
|
||||
antigen bundle unixorn/rvm-plugin
|
||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||
|
||||
antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
|
||||
|
||||
antigen apply
|
||||
fi
|
||||
|
||||
alias t='tail -f'
|
||||
alias logrotate='/usr/sbin/logrotate -s $HOME/logs/state'
|
||||
alias dn='du -chd1'
|
||||
alias nano='nano -wS -$'
|
||||
alias gpg=gpg2
|
||||
|
||||
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
|
||||
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" ]] # Load RVM into a shell session *as a function*
|
||||
. "$HOME/.acme.sh/acme.sh.env"
|
||||
@@ -1,66 +1,74 @@
|
||||
[user]
|
||||
name = Ismo Vuorinen
|
||||
email = ismo.vuorinen@vincit.fi
|
||||
name = Ismo Vuorinen
|
||||
email = ismo.vuorinen@vincit.fi
|
||||
signingkey = ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDLyOvkr1nRqMVv3UAizmk6C+q40H4khvw7qIXXXyOyFmzjwYx/Cuxoi4uZVjX+q4qFYJ+c312uu6YXiEtfyoCao3wub8r1cLBQ3eIvuyWp2K8Ixcd9JmFmLmoeiENpJxqyr0WPZLDkrCWUZCsQQh8zzGFnfciUdUdTiZ7s21AEhhmFRSdFlVfQSlGMFxU321psg1YilcP80bDwFd1FsL4TssSkwlbgP/twqnpZ4436TTo7kp0UnH/RZkfRdDWScKHaWgncBG0CZeQxGWnRp8fvZn/7gDnthcZhvnDALVBE7QFuZ90GxqVw3IGpHryV0mFO6EGQ9Ke9YX7pKVZPUXZjeCN4SVKsqFdVJ6AjaSJ9K7nL98rYK7qNzndT3cKqPNgPteyXWRulH68A51ecQqHrjTttZcdN9hKt9uBHpzuXsby2QObT+VB4MNjZapa+YYF/WgwJCml4lzn2xMFg1vYZD78pfoJ9e5f2cL1MMlUSDb0TNxmEXfDQ77H/pRpKDz0=
|
||||
|
||||
[core]
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
excludesfile = ~/.config/git/gitignore
|
||||
|
||||
[alias]
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
reset-origin = !git fetch origin && git reset --hard origin/master && git clean -f -d
|
||||
reset-upstream = !git fetch upstream && git reset --hard upstream/master && git clean -f -d
|
||||
nah = !git reset --hard && git clean -df
|
||||
undo-commit = reset HEAD~ --soft
|
||||
llog = log --pretty=fuller
|
||||
logs = log --graph --pretty=format:'%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) %C(cyan)<%an>%Creset' --abbrev-commit
|
||||
rl = reflog --format='%C(auto)%h %<|(20)%gd %C(blue)%cr%C(reset) %gs (%s)'
|
||||
tagdate = log --date-order --graph --tags --simplify-by-decoration --pretty=format:\"%ai %h %d\"
|
||||
branchbydate = for-each-ref --count=30 --sort=-committerdate refs/heads/ --format='%(refname:short)'
|
||||
branchcolor = "!for ref in $(git for-each-ref --sort=-committerdate --format=\"%(refname)\" refs/heads/ refs/remotes ); do git log -n1 $ref --pretty=format:\"%Cgreen%cr%Creset %C(yellow)%d%Creset %C(bold blue)<%an>%Creset%n\" | cat ; done | awk '! a[$0]++'"
|
||||
|
||||
[diff]
|
||||
tool = difftastic
|
||||
tool = difftastic
|
||||
|
||||
[difftool]
|
||||
prompt = false
|
||||
prompt = false
|
||||
|
||||
[difftool "difftastic"]
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
cmd = difft "$LOCAL" "$REMOTE"
|
||||
|
||||
[filter "lfs"]
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
clean = git-lfs clean -- %f
|
||||
smudge = git-lfs smudge -- %f
|
||||
process = git-lfs filter-process
|
||||
required = true
|
||||
|
||||
[init]
|
||||
defaultBranch = master
|
||||
defaultBranch = main
|
||||
|
||||
[pull]
|
||||
rebase = false
|
||||
rebase = true
|
||||
|
||||
[color]
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
ui = true
|
||||
diff = auto
|
||||
branch = auto
|
||||
status = auto
|
||||
|
||||
[color "status"]
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
added = green bold
|
||||
changed = yellow
|
||||
deleted = red bold strike
|
||||
untracked = cyan
|
||||
branch = yellow black bold ul
|
||||
|
||||
[gpg]
|
||||
format = ssh
|
||||
|
||||
[gpg "ssh"]
|
||||
program = /Applications/1Password.app/Contents/MacOS/op-ssh-sign
|
||||
allowedSignersFile = ~/.ssh/allowed_signers
|
||||
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[credential "https://github.com"]
|
||||
helper =
|
||||
helper =
|
||||
helper = !/opt/homebrew/bin/gh auth git-credential
|
||||
|
||||
[credential "https://gist.github.com"]
|
||||
helper =
|
||||
helper =
|
||||
helper = !/opt/homebrew/bin/gh auth git-credential
|
||||
|
||||
[submodule]
|
||||
recurse = true
|
||||
|
||||
@@ -16,6 +16,34 @@ SCRIPT=$(basename "$0")
|
||||
|
||||
source "$DOTFILES/scripts/shared.sh"
|
||||
|
||||
function section_reset
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT reset"
|
||||
case "$1" in
|
||||
all)
|
||||
msg_ok "Running all reset commands"
|
||||
$0 reset nvim
|
||||
;;
|
||||
nvim)
|
||||
rm -rf ~/.local/share/nvim ~/.local/state/nvim ~/.cache/nvim ~/.config/astronvim ~/.config/nvim
|
||||
msg_ok "Deleted old nvim files"
|
||||
ln -s ~/.dotfiles/config/astronvim ~/.config/astronvim
|
||||
ln -s ~/.dotfiles/config/nvim ~/.config/nvim
|
||||
msg_ok "Linked nvim and astronvim"
|
||||
$0 install brew
|
||||
$0 install ext_go
|
||||
$0 install ext_npm
|
||||
msg_ok "Installed brew, and packages for go and npm"
|
||||
msg_done "...and we are done!"
|
||||
;;
|
||||
*)
|
||||
menu_section "$USAGE_PREFIX" "all | nvim"
|
||||
menu_item "all" "Reset everything, runs all configured reset actions"
|
||||
menu_item "nvim" "Resets nvim. Deletes caches, removes nvim folders and relinks nvim folders"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
function section_install
|
||||
{
|
||||
USAGE_PREFIX="$SCRIPT install"
|
||||
@@ -43,16 +71,20 @@ function section_install
|
||||
ext_gh)
|
||||
bash "$DOTFILES/scripts/install-gh-extensions.sh" && msg_done "🎉 Extensions for GitHub CLI have been installed!"
|
||||
;;
|
||||
ext_npm)
|
||||
bash "$DOTFILES/scripts/install-npm-packages.sh" && msg_done "NPM Packages have been installed!"
|
||||
;;
|
||||
settler)
|
||||
bash "$DOTFILES/scripts/settler.sh" && msg_done "🎉 Settler has been run!"
|
||||
;;
|
||||
*)
|
||||
menu_section "$USAGE_PREFIX" "all | antigen | brew | ext_gh | ext_go | macos | settler"
|
||||
menu_section "$USAGE_PREFIX" "all | antigen | brew | ext_gh | ext_go | ext_npm | macos | settler"
|
||||
menu_item "all" "Installs antigen, macos, brew, ext_gh and ext_go"
|
||||
menu_item "antigen" "Updates the antigen.zsh file"
|
||||
menu_item "brew" "Install Brewfile contents"
|
||||
menu_item "ext_gh" "Install GitHub CLI Extensions"
|
||||
menu_item "ext_go" "Install Go Packages"
|
||||
menu_item "ext_npm" "Install NPM Packages"
|
||||
menu_item "macos" "Setup nice macOS defaults"
|
||||
menu_item "settler" "Runs the WIP settler.sh"
|
||||
;;
|
||||
@@ -159,11 +191,13 @@ function section_tests
|
||||
function usage
|
||||
{
|
||||
echo ""
|
||||
menu_section "Usage: $SCRIPT" "install | brew | dotfiles"
|
||||
menu_section "Usage: $SCRIPT" "install | reset | brew | dotfiles"
|
||||
echo $" All commands have their own subcommands."
|
||||
echo ""
|
||||
section_install
|
||||
echo ""
|
||||
section_reset
|
||||
echo ""
|
||||
section_brew
|
||||
echo ""
|
||||
section_dotfiles
|
||||
@@ -172,6 +206,7 @@ function usage
|
||||
# The main loop. first keyword after $0 triggers section, or help.
|
||||
case "$1" in
|
||||
install) section_install "$2" ;;
|
||||
reset) section_reset "$2" ;;
|
||||
brew) section_brew "$2" ;;
|
||||
dotfiles) section_dotfiles "$2" ;;
|
||||
tests) section_tests "$2" ;;
|
||||
|
||||
178
local/bin/iterm2_shell_integration.zsh
Executable file
178
local/bin/iterm2_shell_integration.zsh
Executable file
@@ -0,0 +1,178 @@
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
if [[ -o interactive ]]; then
|
||||
if [ "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "tmux-256color" -a "${ITERM_ENABLE_SHELL_INTEGRATION_WITH_TMUX-}""$TERM" != "screen" -a "${ITERM_SHELL_INTEGRATION_INSTALLED-}" = "" -a "$TERM" != linux -a "$TERM" != dumb ]; then
|
||||
ITERM_SHELL_INTEGRATION_INSTALLED=Yes
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
# Indicates start of command output. Runs just before command executes.
|
||||
iterm2_before_cmd_executes() {
|
||||
if [ "$TERM_PROGRAM" = "iTerm.app" ]; then
|
||||
printf "\033]133;C;\r\007"
|
||||
else
|
||||
printf "\033]133;C;\007"
|
||||
fi
|
||||
}
|
||||
|
||||
iterm2_set_user_var() {
|
||||
printf "\033]1337;SetUserVar=%s=%s\007" "$1" $(printf "%s" "$2" | base64 | tr -d '\n')
|
||||
}
|
||||
|
||||
# Users can write their own version of this method. It should call
|
||||
# iterm2_set_user_var but not produce any other output.
|
||||
# e.g., iterm2_set_user_var currentDirectory $PWD
|
||||
# Accessible in iTerm2 (in a badge now, elsewhere in the future) as
|
||||
# \(user.currentDirectory).
|
||||
whence -v iterm2_print_user_vars > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
iterm2_print_user_vars() {
|
||||
true
|
||||
}
|
||||
fi
|
||||
|
||||
iterm2_print_state_data() {
|
||||
local _iterm2_hostname="${iterm2_hostname-}"
|
||||
if [ -z "${iterm2_hostname:-}" ]; then
|
||||
_iterm2_hostname=$(hostname -f 2>/dev/null)
|
||||
fi
|
||||
printf "\033]1337;RemoteHost=%s@%s\007" "$USER" "${_iterm2_hostname-}"
|
||||
printf "\033]1337;CurrentDir=%s\007" "$PWD"
|
||||
iterm2_print_user_vars
|
||||
}
|
||||
|
||||
# Report return code of command; runs after command finishes but before prompt
|
||||
iterm2_after_cmd_executes() {
|
||||
printf "\033]133;D;%s\007" "$STATUS"
|
||||
iterm2_print_state_data
|
||||
}
|
||||
|
||||
# Mark start of prompt
|
||||
iterm2_prompt_mark() {
|
||||
printf "\033]133;A\007"
|
||||
}
|
||||
|
||||
# Mark end of prompt
|
||||
iterm2_prompt_end() {
|
||||
printf "\033]133;B\007"
|
||||
}
|
||||
|
||||
# There are three possible paths in life.
|
||||
#
|
||||
# 1) A command is entered at the prompt and you press return.
|
||||
# The following steps happen:
|
||||
# * iterm2_preexec is invoked
|
||||
# * PS1 is set to ITERM2_PRECMD_PS1
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is set to 1
|
||||
# * The command executes (possibly reading or modifying PS1)
|
||||
# * iterm2_precmd is invoked
|
||||
# * ITERM2_PRECMD_PS1 is set to PS1 (as modified by command execution)
|
||||
# * PS1 gets our escape sequences added to it
|
||||
# * zsh displays your prompt
|
||||
# * You start entering a command
|
||||
#
|
||||
# 2) You press ^C while entering a command at the prompt.
|
||||
# The following steps happen:
|
||||
# * (iterm2_preexec is NOT invoked)
|
||||
# * iterm2_precmd is invoked
|
||||
# * iterm2_before_cmd_executes is called since we detected that iterm2_preexec was not run
|
||||
# * (ITERM2_PRECMD_PS1 and PS1 are not messed with, since PS1 already has our escape
|
||||
# sequences and ITERM2_PRECMD_PS1 already has PS1's original value)
|
||||
# * zsh displays your prompt
|
||||
# * You start entering a command
|
||||
#
|
||||
# 3) A new shell is born.
|
||||
# * PS1 has some initial value, either zsh's default or a value set before this script is sourced.
|
||||
# * iterm2_precmd is invoked
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is initialized to 1
|
||||
# * ITERM2_PRECMD_PS1 is set to the initial value of PS1
|
||||
# * PS1 gets our escape sequences added to it
|
||||
# * Your prompt is shown and you may begin entering a command.
|
||||
#
|
||||
# Invariants:
|
||||
# * ITERM2_SHOULD_DECORATE_PROMPT is 1 during and just after command execution, and "" while the prompt is
|
||||
# shown and until you enter a command and press return.
|
||||
# * PS1 does not have our escape sequences during command execution
|
||||
# * After the command executes but before a new one begins, PS1 has escape sequences and
|
||||
# ITERM2_PRECMD_PS1 has PS1's original value.
|
||||
iterm2_decorate_prompt() {
|
||||
# This should be a raw PS1 without iTerm2's stuff. It could be changed during command
|
||||
# execution.
|
||||
ITERM2_PRECMD_PS1="$PS1"
|
||||
ITERM2_SHOULD_DECORATE_PROMPT=""
|
||||
|
||||
# Add our escape sequences just before the prompt is shown.
|
||||
# Use ITERM2_SQUELCH_MARK for people who can't mdoify PS1 directly, like powerlevel9k users.
|
||||
# This is gross but I had a heck of a time writing a correct if statetment for zsh 5.0.2.
|
||||
local PREFIX=""
|
||||
if [[ $PS1 == *"$(iterm2_prompt_mark)"* ]]; then
|
||||
PREFIX=""
|
||||
elif [[ "${ITERM2_SQUELCH_MARK-}" != "" ]]; then
|
||||
PREFIX=""
|
||||
else
|
||||
PREFIX="%{$(iterm2_prompt_mark)%}"
|
||||
fi
|
||||
PS1="$PREFIX$PS1%{$(iterm2_prompt_end)%}"
|
||||
ITERM2_DECORATED_PS1="$PS1"
|
||||
}
|
||||
|
||||
iterm2_precmd() {
|
||||
local STATUS="$?"
|
||||
if [ -z "${ITERM2_SHOULD_DECORATE_PROMPT-}" ]; then
|
||||
# You pressed ^C while entering a command (iterm2_preexec did not run)
|
||||
iterm2_before_cmd_executes
|
||||
if [ "$PS1" != "${ITERM2_DECORATED_PS1-}" ]; then
|
||||
# PS1 changed, perhaps in another precmd. See issue 9938.
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
fi
|
||||
fi
|
||||
|
||||
iterm2_after_cmd_executes "$STATUS"
|
||||
|
||||
if [ -n "$ITERM2_SHOULD_DECORATE_PROMPT" ]; then
|
||||
iterm2_decorate_prompt
|
||||
fi
|
||||
}
|
||||
|
||||
# This is not run if you press ^C while entering a command.
|
||||
iterm2_preexec() {
|
||||
# Set PS1 back to its raw value prior to executing the command.
|
||||
PS1="$ITERM2_PRECMD_PS1"
|
||||
ITERM2_SHOULD_DECORATE_PROMPT="1"
|
||||
iterm2_before_cmd_executes
|
||||
}
|
||||
|
||||
# If hostname -f is slow on your system set iterm2_hostname prior to
|
||||
# sourcing this script. We know it is fast on macOS so we don't cache
|
||||
# it. That lets us handle the hostname changing like when you attach
|
||||
# to a VPN.
|
||||
if [ -z "${iterm2_hostname-}" ]; then
|
||||
if [ "$(uname)" != "Darwin" ]; then
|
||||
iterm2_hostname=`hostname -f 2>/dev/null`
|
||||
# Some flavors of BSD (i.e. NetBSD and OpenBSD) don't have the -f option.
|
||||
if [ $? -ne 0 ]; then
|
||||
iterm2_hostname=`hostname`
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ -z ${precmd_functions-} ]] && precmd_functions=()
|
||||
precmd_functions=($precmd_functions iterm2_precmd)
|
||||
|
||||
[[ -z ${preexec_functions-} ]] && preexec_functions=()
|
||||
preexec_functions=($preexec_functions iterm2_preexec)
|
||||
|
||||
iterm2_print_state_data
|
||||
printf "\033]1337;ShellIntegrationVersion=14;shell=zsh\007"
|
||||
fi
|
||||
fi
|
||||
2
rcrc
2
rcrc
@@ -1,2 +1,2 @@
|
||||
EXCLUDES="*.md *.sh *.lock.json Brewfile scripts *-secret xbar"
|
||||
EXCLUDES="*.md *.sh *.lock.json Brewfile scripts *-secret xbar .github"
|
||||
HOSTNAME=$(hostname -s)
|
||||
|
||||
56
scripts/install-dotfiles.sh
Normal file → Executable file
56
scripts/install-dotfiles.sh
Normal file → Executable file
@@ -66,17 +66,68 @@ handle_file_ln() {
|
||||
handle_file_ln "$HOME/.dotfiles/bash_profile" "$HOME/.bash_profile"
|
||||
handle_file_ln "$HOME/.dotfiles/bashrc" "$HOME/.bashrc"
|
||||
handle_file_ln "$HOME/.dotfiles/config/alias" "$HOME/.config/alias"
|
||||
handle_file_ln "$HOME/.dotfiles/config/astronvim/lua/user/LICENSE" "$HOME/.config/astronvim/lua/user/LICENSE"
|
||||
handle_file_ln "$HOME/.dotfiles/config/astronvim/lua/user/init.lua" "$HOME/.config/astronvim/lua/user/init.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/exports" "$HOME/.config/exports"
|
||||
handle_file_ln "$HOME/.dotfiles/config/flipperdevices.com/qFlipper.ini" "$HOME/.config/flipperdevices.com/qFlipper.ini"
|
||||
handle_file_ln "$HOME/.dotfiles/config/functions" "$HOME/.config/functions"
|
||||
handle_file_ln "$HOME/.dotfiles/config/gh/config.yml" "$HOME/.config/gh/config.yml"
|
||||
handle_file_ln "$HOME/.dotfiles/config/git/config" "$HOME/.config/git/config"
|
||||
handle_file_ln "$HOME/.dotfiles/config/git/gitignore" "$HOME/.config/git/gitignore"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/LICENSE" "$HOME/.config/nvim/LICENSE"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/config.ld" "$HOME/.config/nvim/config.ld"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/init.lua" "$HOME/.config/nvim/init.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/custom/plugins.lua" "$HOME/.config/nvim/lua/custom/plugins.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/plugin/packer_compiled.lua" "$HOME/.config/nvim/plugin/packer_compiled.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/autocmds.lua" "$HOME/.config/nvim/lua/core/autocmds.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/bootstrap.lua" "$HOME/.config/nvim/lua/core/bootstrap.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/icons/nerd_font.lua" "$HOME/.config/nvim/lua/core/icons/nerd_font.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/icons/text.lua" "$HOME/.config/nvim/lua/core/icons/text.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/lazy.lua" "$HOME/.config/nvim/lua/core/lazy.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/mappings.lua" "$HOME/.config/nvim/lua/core/mappings.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/options.lua" "$HOME/.config/nvim/lua/core/options.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/buffer.lua" "$HOME/.config/nvim/lua/core/utils/buffer.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/ffi.lua" "$HOME/.config/nvim/lua/core/utils/ffi.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/git.lua" "$HOME/.config/nvim/lua/core/utils/git.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/init.lua" "$HOME/.config/nvim/lua/core/utils/init.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/lsp.lua" "$HOME/.config/nvim/lua/core/utils/lsp.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/mason.lua" "$HOME/.config/nvim/lua/core/utils/mason.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/status.lua" "$HOME/.config/nvim/lua/core/utils/status.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/ui.lua" "$HOME/.config/nvim/lua/core/utils/ui.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/core/utils/updater.lua" "$HOME/.config/nvim/lua/core/utils/updater.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/lazy_snapshot.lua" "$HOME/.config/nvim/lua/lazy_snapshot.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/alpha.lua" "$HOME/.config/nvim/lua/plugins/alpha.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/cmp.lua" "$HOME/.config/nvim/lua/plugins/cmp.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/alpha.lua" "$HOME/.config/nvim/lua/plugins/configs/alpha.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/guess-indent.lua" "$HOME/.config/nvim/lua/plugins/configs/guess-indent.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/heirline.lua" "$HOME/.config/nvim/lua/plugins/configs/heirline.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/lspconfig.lua" "$HOME/.config/nvim/lua/plugins/configs/lspconfig.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/lspkind.lua" "$HOME/.config/nvim/lua/plugins/configs/lspkind.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/luasnip.lua" "$HOME/.config/nvim/lua/plugins/configs/luasnip.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/mason-lspconfig.lua" "$HOME/.config/nvim/lua/plugins/configs/mason-lspconfig.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/mason-null-ls.lua" "$HOME/.config/nvim/lua/plugins/configs/mason-null-ls.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/mason-nvim-dap.lua" "$HOME/.config/nvim/lua/plugins/configs/mason-nvim-dap.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/mason.lua" "$HOME/.config/nvim/lua/plugins/configs/mason.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/notify.lua" "$HOME/.config/nvim/lua/plugins/configs/notify.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/nvim-autopairs.lua" "$HOME/.config/nvim/lua/plugins/configs/nvim-autopairs.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/nvim-dap-ui.lua" "$HOME/.config/nvim/lua/plugins/configs/nvim-dap-ui.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/nvim-treesitter.lua" "$HOME/.config/nvim/lua/plugins/configs/nvim-treesitter.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/nvim-web-devicons.lua" "$HOME/.config/nvim/lua/plugins/configs/nvim-web-devicons.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/telescope.lua" "$HOME/.config/nvim/lua/plugins/configs/telescope.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/configs/which-key.lua" "$HOME/.config/nvim/lua/plugins/configs/which-key.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/core.lua" "$HOME/.config/nvim/lua/plugins/core.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/dap.lua" "$HOME/.config/nvim/lua/plugins/dap.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/git.lua" "$HOME/.config/nvim/lua/plugins/git.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/heirline.lua" "$HOME/.config/nvim/lua/plugins/heirline.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/lsp.lua" "$HOME/.config/nvim/lua/plugins/lsp.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/mason.lua" "$HOME/.config/nvim/lua/plugins/mason.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/neo-tree.lua" "$HOME/.config/nvim/lua/plugins/neo-tree.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/telescope.lua" "$HOME/.config/nvim/lua/plugins/telescope.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/treesitter.lua" "$HOME/.config/nvim/lua/plugins/treesitter.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/plugins/ui.lua" "$HOME/.config/nvim/lua/plugins/ui.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/nvim/lua/user_example/init.lua" "$HOME/.config/nvim/lua/user_example/init.lua"
|
||||
handle_file_ln "$HOME/.dotfiles/config/starship.toml" "$HOME/.config/starship.toml"
|
||||
handle_file_ln "$HOME/.dotfiles/config/tmux/tmux.conf" "$HOME/.config/tmux/tmux.conf"
|
||||
handle_file_ln "$HOME/.dotfiles/config/wtf/config.yml" "$HOME/.config/wtf/config.yml"
|
||||
handle_file_ln "$HOME/.dotfiles/ecrc" "$HOME/.ecrc"
|
||||
handle_file_ln "$HOME/.dotfiles/git_profiles" "$HOME/.git_profiles"
|
||||
handle_file_ln "$HOME/.dotfiles/huskyrc" "$HOME/.huskyrc"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/antigen.zsh" "$HOME/.local/bin/antigen.zsh"
|
||||
@@ -93,6 +144,7 @@ handle_file_ln "$HOME/.dotfiles/local/bin/x-until-success" "$HOME/.local/bin/x-u
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-when-down" "$HOME/.local/bin/x-when-down"
|
||||
handle_file_ln "$HOME/.dotfiles/local/bin/x-when-up" "$HOME/.local/bin/x-when-up"
|
||||
handle_file_ln "$HOME/.dotfiles/rcrc" "$HOME/.rcrc"
|
||||
handle_file_ln "$HOME/.dotfiles/shellcheckrc" "$HOME/.shellcheckrc"
|
||||
handle_file_ln "$HOME/.dotfiles/ssh/allowed_signers" "$HOME/.ssh/allowed_signers"
|
||||
handle_file_ln "$HOME/.dotfiles/ssh/config" "$HOME/.ssh/config"
|
||||
handle_file_ln "$HOME/.dotfiles/vuerc" "$HOME/.vuerc"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
# Install GitHub CLI extensions
|
||||
|
||||
# shellcheck source="shared.sh"
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
if ! command -v gh &> /dev/null; then
|
||||
|
||||
0
scripts/install-go-packages.sh
Normal file → Executable file
0
scripts/install-go-packages.sh
Normal file → Executable file
39
scripts/install-npm-packages.sh
Executable file
39
scripts/install-npm-packages.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env zsh
|
||||
# Install npm packages globally.
|
||||
|
||||
source "$HOME/.dotfiles/scripts/shared.sh"
|
||||
|
||||
if ! command -v npm &> /dev/null; then
|
||||
msg_err "npm could not be found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
packages=(
|
||||
# This is a tool to check if your files consider your .editorconfig rules.
|
||||
"editorconfig-checker"
|
||||
# Node module to create a release or a changelog from
|
||||
# a tag and uses issues or commits to creating the release notes.
|
||||
"github-release-notes"
|
||||
"neovim"
|
||||
"prettier"
|
||||
"@bchatard/alfred-jetbrains"
|
||||
"@johnnymorganz/stylua-bin"
|
||||
"js-debug"
|
||||
"stylelint-lsp"
|
||||
"blade-formatter"
|
||||
"@loopback/cli"
|
||||
"corepack"
|
||||
"standardjs"
|
||||
)
|
||||
|
||||
for pkg in "${packages[@]}"; do
|
||||
# Trim spaces
|
||||
pkg=${pkg// /}
|
||||
# Skip comments
|
||||
if [[ ${pkg:0:1} == "#" ]]; then continue; fi
|
||||
|
||||
msg_run "Installing npm package:" "$pkg"
|
||||
npm install -g --no-fund --no-progress --no-timing "$pkg"
|
||||
echo ""
|
||||
done
|
||||
|
||||
0
scripts/shared.sh
Normal file → Executable file
0
scripts/shared.sh
Normal file → Executable file
7
shellcheckrc
Normal file
7
shellcheckrc
Normal file
@@ -0,0 +1,7 @@
|
||||
# This is shellcheck configuration file.
|
||||
|
||||
# Set whether or not to follow arbitrary file
|
||||
# paths in source statements (since 0.8.0).
|
||||
external-sources=true
|
||||
includeAllWorkspaceSymbols=true
|
||||
|
||||
92
zshrc
92
zshrc
@@ -1,12 +1,28 @@
|
||||
# Fig pre block. Keep at the top of this file.
|
||||
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.pre.zsh"
|
||||
# shellcheck shell=bash
|
||||
|
||||
autoload -U colors zsh/terminfo
|
||||
colors
|
||||
|
||||
export PATH="/opt/homebrew/opt/ruby/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/sbin:$PATH"
|
||||
# Defaults
|
||||
export DOTFILES="$HOME/.dotfiles"
|
||||
|
||||
# Explicitly set XDG folders
|
||||
# https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export XDG_BIN_HOME="$HOME/.local/bin" # this one is custom
|
||||
|
||||
# Homebrew configuration
|
||||
export HOMEBREW="/opt/homebrew"
|
||||
export HOMEBREW_BIN="$HOMEBREW/bin"
|
||||
export HOMEBREW_SBIN="$HOMEBREW/sbin"
|
||||
export HOMEBREW_PKG="$HOMEBREW/opt"
|
||||
export HOMEBREW_NO_ENV_HINTS=1
|
||||
|
||||
export PATH="$XDG_BIN_HOME:$HOMEBREW_BIN:$HOMEBREW_SBIN:/usr/local/sbin:$PATH"
|
||||
|
||||
# brew, https://brew.sh
|
||||
if [ command -v brew &> /dev/null ]; then
|
||||
BREW_BIN=$(brew --prefix)/bin
|
||||
BREW_SBIN=$(brew --prefix)/sbin
|
||||
@@ -31,22 +47,38 @@ if command -v nvim &> /dev/null; then
|
||||
export EDITOR="nvim"
|
||||
fi
|
||||
|
||||
LOCAL_BIN="$HOME/.local/bin"
|
||||
COMPOSER_DIR="$HOME/.composer/vendor/bin"
|
||||
export PATH="$LOCAL_BIN:$COMPOSER_DIR:$PATH"
|
||||
# z, https://github.com/rupa/z
|
||||
export _Z_DATA="$XDG_STATE_HOME/z"
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
# composer, https://getcomposer.org/
|
||||
if command -v composer &> /dev/null; then
|
||||
export COMPOSER_HOME="$XDG_STATE_HOME/composer"
|
||||
export COMPOSER_BIN="$COMPOSER_HOME/vendor/bin"
|
||||
export PATH="$COMPOSER_BIN:$PATH"
|
||||
fi
|
||||
|
||||
# gem, rubygems
|
||||
if command -v gem &>/dev/null; then
|
||||
export GEM_HOME="$XDG_STATE_HOME/gem"
|
||||
export GEM_PATH="$XDG_STATE_HOME/gem"
|
||||
fi
|
||||
|
||||
# nvm, the node version manager
|
||||
export NVM_DIR="$XDG_STATE_HOME/nvm"
|
||||
export NVM_LAZY_LOAD=true
|
||||
export NVM_COMPLETION=true
|
||||
export NVM_AUTO_USE=true
|
||||
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh"
|
||||
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm"
|
||||
[ -s "$HOMEBREW_PKG/nvm/nvm.sh" ] && \. "$HOMEBREW_PKG/nvm/nvm.sh"
|
||||
[ -s "$HOMEBREW_PKG/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PKG/nvm/etc/bash_completion.d/nvm"
|
||||
|
||||
# wakatime, https://github.com/wakatime/wakatime-cli
|
||||
export WAKATIME_HOME="$XDG_STATE_HOME/wakatime"
|
||||
|
||||
# Run x-load-configs in your terminal to reload the files.
|
||||
function x-load-configs()
|
||||
{
|
||||
# Load the shell dotfiles, and then some:
|
||||
for file in ~/.dotfiles/config/{exports,alias,functions}; do
|
||||
for file in $DOTFILES/config/{exports,alias,functions}; do
|
||||
[ -r "$file" ] && [ -f "$file" ] && source "$file"
|
||||
[ -r "$file-secret" ] && [ -f "$file-secret" ] && source "$file-secret"
|
||||
[ -r "$file-$HOSTNAME" ] && [ -f "$file-$HOSTNAME" ] && source "$file-$HOSTNAME"
|
||||
@@ -58,15 +90,19 @@ x-load-configs
|
||||
# Import ssh keys in keychain
|
||||
ssh-add -A 2>/dev/null;
|
||||
|
||||
# Antigen configuration
|
||||
# https://github.com/zsh-users/antigen/wiki/Configuration
|
||||
export ADOTDIR="$XDG_DATA_HOME/antigen"
|
||||
export ANTIGEN_SYSTEM_RECEIPT_F=".local/share/antigen/antigen_system_lastupdate"
|
||||
export ANTIGEN_PLUGIN_RECEIPT_F=".local/share/antigen/antigen_plugin_lastupdate"
|
||||
|
||||
# Try to load antigen, if present
|
||||
[[ -f "$HOME/.local/bin/antigen.zsh" ]] && source "$HOME/.local/bin/antigen.zsh"
|
||||
[[ -f "$XDG_BIN_HOME/antigen.zsh" ]] && source "$XDG_BIN_HOME/antigen.zsh"
|
||||
|
||||
# antigen is present
|
||||
if command -v antigen &> /dev/null; then
|
||||
antigen use oh-my-zsh
|
||||
|
||||
# antigen theme oskarkrawczyk/honukai-iterm-zsh honukai
|
||||
|
||||
antigen bundle ssh-agent
|
||||
antigen bundle colored-man-pages
|
||||
antigen bundle jreese/zsh-titles
|
||||
@@ -75,16 +111,14 @@ if command -v antigen &> /dev/null; then
|
||||
antigen bundle MichaelAquilina/zsh-you-should-use
|
||||
antigen bundle unixorn/autoupdate-antigen.zshplugin
|
||||
antigen bundle Sparragus/zsh-auto-nvm-use
|
||||
# antigen bundle git-auto-fetch
|
||||
|
||||
hash php 2>/dev/null && antigen bundle php
|
||||
hash nvm 2>/dev/null && antigen bundle nvm
|
||||
hash docker 2>/dev/null && antigen bundle docker
|
||||
hash ruby 2>/dev/null && antigen bundle ruby
|
||||
# hash ruby 2>/dev/null && antigen bundle ruby
|
||||
hash python 2>/dev/null && antigen bundle MichaelAquilina/zsh-autoswitch-virtualenv
|
||||
hash jq 2>/dev/null && antigen bundle reegnz/jq-zsh-plugin
|
||||
hash docker-compose 2>/dev/null && antigen bundle sroze/docker-compose-zsh-plugin
|
||||
# antigen bundle voronkovich/phpcs.plugin.zsh
|
||||
|
||||
# Platform dependant bundles
|
||||
if [[ $(uname) == 'Linux' ]]; then
|
||||
@@ -104,17 +138,27 @@ fi
|
||||
|
||||
# op (1Password cli) is present
|
||||
if hash op 2>/dev/null; then
|
||||
export OP_CACHE="$XDG_STATE_HOME/1password"
|
||||
mkdir -p $OP_CACHE;
|
||||
eval "$(op completion zsh)"; compdef _op op
|
||||
fi
|
||||
|
||||
# gcloud is present
|
||||
if hash gcloud 2>/dev/null; then
|
||||
GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
||||
[[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
||||
[[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
||||
# Ansible configuration
|
||||
# https://docs.ansible.com/ansible/latest/reference_appendices/config.html
|
||||
if hash ansible 2>/dev/null; then
|
||||
export ANSIBLE_HOME="$XDG_STATE_HOME/ansible"
|
||||
mkdir -p "$ANSIBLE_HOME"
|
||||
fi
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
# gcloud is present
|
||||
#if hash gcloud 2>/dev/null; then
|
||||
# GCLOUD_LOC=$(gcloud info --format="value(installation.sdk_root)" --quiet)
|
||||
# [[ -f "$GCLOUD_LOC/path.zsh.inc" ]] && builtin source "$GCLOUD_LOC/path.zsh.inc"
|
||||
# [[ -f "$GCLOUD_LOC/completion.zsh.inc" ]] && builtin source "$GCLOUD_LOC/completion.zsh.inc"
|
||||
#fi
|
||||
|
||||
# Fig post block. Keep at the bottom of this file.
|
||||
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] && builtin source "$HOME/.fig/shell/zshrc.post.zsh"
|
||||
# Load iterm2 shell integration
|
||||
# https://iterm2.com/documentation-shell-integration.html
|
||||
[[ -f "$XDG_BIN_HOME/iterm2_shell_integration.zsh" ]] && source "$XDG_BIN_HOME/iterm2_shell_integration.zsh"
|
||||
|
||||
eval "$(starship init zsh)"
|
||||
|
||||
Reference in New Issue
Block a user