Compare commits
11 commits
9e53067078
...
25182187ae
Author | SHA1 | Date | |
---|---|---|---|
25182187ae | |||
190c3559e4 | |||
f7495a6373 | |||
6ed2bd98aa | |||
ed3fe5cce1 | |||
29a8c73a7c | |||
6e75fed013 | |||
05ce66a920 | |||
0e1e5ce1de | |||
3e0f4970f0 | |||
f889f445c3 |
6 changed files with 123 additions and 12 deletions
51
bash/.bashrc
51
bash/.bashrc
|
@ -9,14 +9,10 @@ alias ls='ls --color=auto'
|
|||
PS1='[\u@\h \W]\$ '
|
||||
|
||||
# Execute tmux in Alacritty
|
||||
if [ "$TERM" == "alacritty" ]; then
|
||||
if [[ "$TERM" == "alacritty" || "$TERM_PROGRAM" == "WezTerm" ]]; then
|
||||
exec tmux
|
||||
fi
|
||||
|
||||
# Set TERM to screen-256color inside tmux
|
||||
# (Needs tmux.conf changes)
|
||||
[[ $TMUX != "" ]] && export TERM="screen-256color"
|
||||
|
||||
# SSH without checking or adding host keys to known_hosts
|
||||
# Useful for cloud server rescue environment & installation
|
||||
alias sshtmp="ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no'"
|
||||
|
@ -24,10 +20,12 @@ alias moshtmp="mosh --ssh=\"ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHost
|
|||
|
||||
# SSH with automatic "screen"
|
||||
function sshscr() {
|
||||
[ -z "$1" ] && return
|
||||
ssh -t $@ screen -RR -d
|
||||
}
|
||||
|
||||
function moshscr() {
|
||||
[ -z "$1" ] && return
|
||||
mosh $@ -- screen -RR -d
|
||||
}
|
||||
|
||||
|
@ -45,5 +43,48 @@ function sshunlock() {
|
|||
set +o pipefail
|
||||
}
|
||||
|
||||
|
||||
# Show a menu of all known Tailscale nodes for the user to select from
|
||||
function tsselect() {
|
||||
local items=()
|
||||
local hostnames=()
|
||||
while read -r line; do
|
||||
local name=$(echo "$line" | awk '{ print $2 }')
|
||||
local ip=$(echo "$line" | awk '{ print $1 }')
|
||||
items+=("$name ($ip)")
|
||||
hostnames+=("$name")
|
||||
done <<< $(tailscale status --self=false | sort -k 2)
|
||||
|
||||
_COLUMNS=$COLUMNS
|
||||
# Force options to display in one column
|
||||
COLUMNS=80
|
||||
select item in "${items[@]}" Cancel; do
|
||||
if [ $REPLY -eq ${#items[@]} ]; then
|
||||
echo ""
|
||||
fi
|
||||
echo ${hostnames[$((REPLY - 1))]}
|
||||
break;
|
||||
done
|
||||
COLUMNS=$_COLUMNS
|
||||
}
|
||||
|
||||
# SSH shorthands, same as before but for tailscale nodes
|
||||
function moshscrts() {
|
||||
moshscr $(tsselect)
|
||||
}
|
||||
|
||||
function sshscrts() {
|
||||
sshscr $(tsselect)
|
||||
}
|
||||
|
||||
function _ssh() {
|
||||
[ -z "$1" ] && return
|
||||
ssh $@
|
||||
}
|
||||
|
||||
function sshts() {
|
||||
_ssh $(tsselect)
|
||||
}
|
||||
|
||||
# Add local to path
|
||||
export PATH="$PATH:~/.local/bin"
|
||||
|
|
|
@ -31,6 +31,10 @@ set autoindent
|
|||
" Syntax highlighting
|
||||
set syntax=on
|
||||
|
||||
" LaTeX
|
||||
let g:vimtex_view_general_viewer = 'okular'
|
||||
let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
|
||||
|
||||
let g:special_filetype_pattern = 'neo-tree\|toggleterm\|minimap'
|
||||
|
||||
" Show line numbers on non-toolbar buffers
|
||||
|
@ -55,3 +59,10 @@ function _G.set_terminal_keymaps()
|
|||
end
|
||||
EOF
|
||||
autocmd TermOpen term://* lua set_terminal_keymaps()
|
||||
|
||||
" Spell checking
|
||||
autocmd FileType tex,markdown setlocal spell spelllang=en_us
|
||||
|
||||
" Editor integration
|
||||
let $GIT_EDITOR = 'nvr -cc split --remote-wait --servername ' . v:servername
|
||||
autocmd FileType gitcommit,gitrebase,gitconfig set bufhidden=delete
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
return require('packer').startup({function(use)
|
||||
-- Packer can manage itself
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
|
@ -66,6 +66,9 @@ return require('packer').startup(function(use)
|
|||
position = "left",
|
||||
width = 36,
|
||||
},
|
||||
filesystem = {
|
||||
use_libuv_file_watcher = true,
|
||||
},
|
||||
})
|
||||
require("neo-tree.sources.manager").show("filesystem")
|
||||
end,
|
||||
|
@ -125,4 +128,52 @@ return require('packer').startup(function(use)
|
|||
end,
|
||||
}) end,
|
||||
}
|
||||
end)
|
||||
|
||||
-- Session Manager
|
||||
use {
|
||||
"olimorris/persisted.nvim",
|
||||
config = function()
|
||||
require("persisted").setup({
|
||||
autoload = true,
|
||||
before_save = function()
|
||||
require('neo-tree.sources.manager').close('filesystem')
|
||||
for _, term in pairs(require("toggleterm.terminal").get_all()) do
|
||||
term:close()
|
||||
end
|
||||
end,
|
||||
after_save = function()
|
||||
require('neo-tree.sources.manager').show('filesystem')
|
||||
end,
|
||||
before_source = function()
|
||||
require('neo-tree.sources.manager').close('filesystem')
|
||||
end,
|
||||
after_source = function()
|
||||
require('neo-tree.sources.manager').show('filesystem')
|
||||
-- Reload LSP
|
||||
vim.lsp.stop_client(vim.lsp.get_active_clients())
|
||||
end,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
-- Mini.nvim tools
|
||||
use {
|
||||
"echasnovski/mini.nvim",
|
||||
config = function()
|
||||
-- Trailing space highlighter
|
||||
require("mini.trailspace").setup({
|
||||
only_in_normal_buffers = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
-- LaTeX plugin
|
||||
use "lervag/vimtex"
|
||||
end,
|
||||
config = {
|
||||
display = {
|
||||
open_fn = require('packer.util').float,
|
||||
},
|
||||
-- Let's reload manually
|
||||
auto_reload_compiled = false,
|
||||
}})
|
||||
|
|
|
@ -14,7 +14,7 @@ set $down j
|
|||
set $up k
|
||||
set $right l
|
||||
# Your preferred terminal emulator
|
||||
set $term alacritty
|
||||
set $term wezterm
|
||||
# Your preferred application launcher
|
||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
||||
# on the original workspace that the command was run on.
|
||||
|
@ -224,7 +224,7 @@ include /home/peter/.config/sway/local.d/*
|
|||
|
||||
output "*" bg $wallpaper fill
|
||||
|
||||
bindsym Ctrl+Mod1+l exec swaylock -i $wallpaper --clock --fade-in 1 --indicator --indicator-thickness 6 --ring-color ebdbb2 --inside-color 00000055 --key-hl-color 4d4d4d --line-uses-ring --separator-color 00000000 --text-color ebdbb2 --timestr "%H:%M"
|
||||
bindsym Ctrl+Mod1+l exec swaylock -i $wallpaper --indicator-thickness 6 --ring-color ebdbb2 --inside-color 00000055 --key-hl-color 4d4d4d --line-uses-ring --separator-color 00000000 --text-color ebdbb2
|
||||
bindsym $mod+x exec bemenu-run | xargs swaymsg exec --
|
||||
|
||||
bindsym Print exec grimshot --notify save area
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
# Pretend to be screen-256color
|
||||
set-option -g default-terminal "screen-256color"
|
||||
# Force 256color terminal (with true color capabilities)
|
||||
set-option -g default-terminal "tmux-256color"
|
||||
set -as terminal-features ",xterm-256color:RGB"
|
||||
|
||||
# Allow mouse input (to switch window / panes)
|
||||
set -g mouse on
|
||||
|
|
7
wezterm/.config/wezterm/wezterm.lua
Normal file
7
wezterm/.config/wezterm/wezterm.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
local wezterm = require("wezterm")
|
||||
return {
|
||||
color_scheme = "Gruvbox Dark",
|
||||
font = wezterm.font("FiraCode Nerd Font Mono"),
|
||||
font_size = 10.5,
|
||||
enable_tab_bar = false, -- I use tmux
|
||||
}
|
Loading…
Add table
Reference in a new issue