move to one folder

This commit is contained in:
2024-05-26 05:54:35 -05:00
parent b1d1c138a7
commit f2772f88bc
23 changed files with 117 additions and 52 deletions

View File

@@ -34,9 +34,9 @@ lspconfig.pyright.setup({
capabilities = capabilities, capabilities = capabilities,
filetypes = {"python"}, filetypes = {"python"},
}) })
lspconfig.powershell_es.setup({ lspconfig.powershell_es.setup({
bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services/" bundle_path = vim.fn.stdpath("data") .. "/mason/packages/powershell-editor-services/",
settings = { powershell = { codeFormatting = { Preset = 'OTBS' } } }
}) })
lspconfig.bashls.setup({}) lspconfig.bashls.setup({})

View File

@@ -0,0 +1,11 @@
local parser_config = require 'nvim-treesitter.parsers'.get_parser_configs()
--parser_config.powershell_es = {
-- install_info = {
-- url = "/home/user/.local/share/tree-sitter-PowerShell",
-- files = { "src/parser.c" },
-- generate_requires_npm = false,
-- requires_generate_from_grammar = false,
-- },
-- filetype = "ps1",
--}
return parser_config

View File

@@ -156,6 +156,8 @@ local plugins = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = function() opts = function()
local opts = require "plugins.configs.treesitter" local opts = require "plugins.configs.treesitter"
require "custom.configs.treesitter"
require'nvim-treesitter.install'.prefer_git = true
opts.ensure_installed = { opts.ensure_installed = {
"lua", "lua",
"javascript", "javascript",

View File

@@ -1,4 +1,3 @@
clear-host
oh-my-posh init pwsh --config ~/.config/powershell/config.json | Invoke-Expression oh-my-posh init pwsh --config ~/.config/powershell/config.json | Invoke-Expression
Set-PSReadLineOption -PredictionSource History Set-PSReadLineOption -PredictionSource History

Submodule .config/tmux/plugins/catppuccin-tmux added at b4e0715356

Submodule .config/tmux/plugins/tmux-sensible added at 25cb91f42d

Submodule .config/tmux/plugins/tmux-yank added at acfd36e4fc

Submodule .config/tmux/plugins/tpm added at 99469c4a9b

Submodule .config/tmux/plugins/vim-tmux-navigator added at 38b1d0402c

54
.config/tmux/tmux.conf Normal file
View File

@@ -0,0 +1,54 @@
set-option -sa terminal-overrides ",xterm*:Tc"
set -g mouse on
set -g set-clipboard on
set -g @yank_selection_mouse 'clipboard'
set -g @yank_selection 'clipboard'
unbind C-b
set -g prefix C-Space
bind C-Space send-prefix
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
set -g @catppuccin_flavour 'mocha'
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'dreamsofcode-io/catppuccin-tmux'
set -g @plugin 'tmux-plugins/tmux-yank'
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel "xsel -i --clipboard"
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
run '~/.tmux/plugins/tpm/tpm'

View File

@@ -15,49 +15,9 @@ alias k=kubectl
alias ls='ls --color' alias ls='ls --color'
alias vim='nvim' alias vim='nvim'
alias c='clear' alias c='clear'
alias pwsh='pwsh -NoLogo'
source ~/.fzf.completion.zsh
source ~/.fzf.key-bindings.zsh
unlockbw ()
{
export BW_SESSION="$(bw unlock --raw)"
export GITLAB_TOKEN="$(bw get password cli-gitlab)"
export VAULT_UNSEAL="$(bw get password cli-vault-unseal)"
export VAULT_TOKEN="$(bw get password vault.internal.durp.info)"
}
lockbw ()
{
unset BW_SESSION
unset GITLAB_TOKEN
unset VAULT_UNSEAL
unset VAULT_TOKEN
}
unlockvault() {
local POD_NAME="vault-0"
local NAMESPACE="vault"
local UNSEAL_KEY=$VAULT_UNSEAL
local PASSWORD=$VAULT_TOKEN
local K8S_API_SERVER=$(kubectl exec -it $POD_NAME -n $NAMESPACE -- printenv | grep KUBERNETES_SERVICE_HOST | cut -d "=" -f2)
local JWT=$(kubectl exec -it $POD_NAME -n $NAMESPACE -- cat /var/run/secrets/kubernetes.io/serviceaccount/token)
kubectl exec -it $POD_NAME -n $NAMESPACE -- /bin/sh << EOF
vault operator unseal $UNSEAL_KEY
vault login $PASSWORD
vault write auth/kubernetes/config \
token_reviewer_jwt="${JWT}" \
kubernetes_host="https://${K8S_API_SERVER}:443" \
kubernetes_ca_cert=@/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
EOF
}
load-profile () {
ansible-playbook /home/user/.dotfiles/ansible/.config/ansible/local.yml -K
}
#eval "$(bw completion --shell zsh); compdef _bw bw;"
# #
typeset -g POWERLEVEL9K_INSTANT_PROMPT=quiet
## Initialization code that may require console input (password prompts, [y/n] ## Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below. # confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
@@ -140,8 +100,49 @@ zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls --color $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath' zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-preview 'ls --color $realpath'
# Shell integrations # Shell integrations
#eval "$(fzf --zsh)" eval "$(fzf --zsh)"
eval "$(zoxide init --cmd cd zsh)" eval "$(zoxide init --cmd cd zsh)"
eval "$(bw completion --shell zsh); compdef _bw bw;"
source ~/.fzf.completion.zsh
source ~/.fzf.key-bindings.zsh
unlockbw ()
{
export BW_SESSION="$(bw unlock --raw)"
export GITLAB_TOKEN="$(bw get password cli-gitlab)"
export VAULT_UNSEAL="$(bw get password cli-vault-unseal)"
export VAULT_TOKEN="$(bw get password vault.internal.durp.info)"
}
lockbw ()
{
unset BW_SESSION
unset GITLAB_TOKEN
unset VAULT_UNSEAL
unset VAULT_TOKEN
}
unlockvault() {
local POD_NAME="vault-0"
local NAMESPACE="vault"
local UNSEAL_KEY=$VAULT_UNSEAL
local PASSWORD=$VAULT_TOKEN
local K8S_API_SERVER=$(kubectl exec -it $POD_NAME -n $NAMESPACE -- printenv | grep KUBERNETES_SERVICE_HOST | cut -d "=" -f2)
local JWT=$(kubectl exec -it $POD_NAME -n $NAMESPACE -- cat /var/run/secrets/kubernetes.io/serviceaccount/token)
kubectl exec -it $POD_NAME -n $NAMESPACE -- /bin/sh << EOF
vault operator unseal $UNSEAL_KEY
vault login $PASSWORD
vault write auth/kubernetes/config \
token_reviewer_jwt="${JWT}" \
kubernetes_host="https://${K8S_API_SERVER}:443" \
kubernetes_ca_cert=@/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
EOF
}
load-profile () {
ansible-playbook /home/user/.dotfiles/ansible/.config/ansible/local.yml -K
}
function omz_urlencode() { function omz_urlencode() {
emulate -L zsh emulate -L zsh
@@ -231,10 +232,3 @@ function open_command() {
${=open_cmd} "$@" &>/dev/null ${=open_cmd} "$@" &>/dev/null
} }
# take functions
# mkcd is equivalent to takedir
function mkcd takedir() {
mkdir -p $@ && cd ${@:$#}
}