Compare commits
No commits in common. "25182187ae9978ab5ef29a34ca460c63ec158a04" and "9e5306707872672787ed653469a7792dd16f3c6d" have entirely different histories.
25182187ae
...
9e53067078
6 changed files with 12 additions and 123 deletions
51
bash/.bashrc
51
bash/.bashrc
|
@ -9,10 +9,14 @@ alias ls='ls --color=auto'
|
||||||
PS1='[\u@\h \W]\$ '
|
PS1='[\u@\h \W]\$ '
|
||||||
|
|
||||||
# Execute tmux in Alacritty
|
# Execute tmux in Alacritty
|
||||||
if [[ "$TERM" == "alacritty" || "$TERM_PROGRAM" == "WezTerm" ]]; then
|
if [ "$TERM" == "alacritty" ]; then
|
||||||
exec tmux
|
exec tmux
|
||||||
fi
|
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
|
# SSH without checking or adding host keys to known_hosts
|
||||||
# Useful for cloud server rescue environment & installation
|
# Useful for cloud server rescue environment & installation
|
||||||
alias sshtmp="ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no'"
|
alias sshtmp="ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no'"
|
||||||
|
@ -20,12 +24,10 @@ alias moshtmp="mosh --ssh=\"ssh -o 'UserKnownHostsFile /dev/null' -o 'StrictHost
|
||||||
|
|
||||||
# SSH with automatic "screen"
|
# SSH with automatic "screen"
|
||||||
function sshscr() {
|
function sshscr() {
|
||||||
[ -z "$1" ] && return
|
|
||||||
ssh -t $@ screen -RR -d
|
ssh -t $@ screen -RR -d
|
||||||
}
|
}
|
||||||
|
|
||||||
function moshscr() {
|
function moshscr() {
|
||||||
[ -z "$1" ] && return
|
|
||||||
mosh $@ -- screen -RR -d
|
mosh $@ -- screen -RR -d
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,48 +45,5 @@ function sshunlock() {
|
||||||
set +o pipefail
|
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
|
# Add local to path
|
||||||
export PATH="$PATH:~/.local/bin"
|
export PATH="$PATH:~/.local/bin"
|
||||||
|
|
|
@ -31,10 +31,6 @@ set autoindent
|
||||||
" Syntax highlighting
|
" Syntax highlighting
|
||||||
set syntax=on
|
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'
|
let g:special_filetype_pattern = 'neo-tree\|toggleterm\|minimap'
|
||||||
|
|
||||||
" Show line numbers on non-toolbar buffers
|
" Show line numbers on non-toolbar buffers
|
||||||
|
@ -59,10 +55,3 @@ function _G.set_terminal_keymaps()
|
||||||
end
|
end
|
||||||
EOF
|
EOF
|
||||||
autocmd TermOpen term://* lua set_terminal_keymaps()
|
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]]
|
vim.cmd [[packadd packer.nvim]]
|
||||||
|
|
||||||
return require('packer').startup({function(use)
|
return require('packer').startup(function(use)
|
||||||
-- Packer can manage itself
|
-- Packer can manage itself
|
||||||
use 'wbthomason/packer.nvim'
|
use 'wbthomason/packer.nvim'
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ return require('packer').startup({function(use)
|
||||||
use {
|
use {
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
branch = "v2.x",
|
branch = "v2.x",
|
||||||
requires = {
|
requires = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"kyazdani42/nvim-web-devicons",
|
"kyazdani42/nvim-web-devicons",
|
||||||
"MunifTanjim/nui.nvim",
|
"MunifTanjim/nui.nvim",
|
||||||
|
@ -66,9 +66,6 @@ return require('packer').startup({function(use)
|
||||||
position = "left",
|
position = "left",
|
||||||
width = 36,
|
width = 36,
|
||||||
},
|
},
|
||||||
filesystem = {
|
|
||||||
use_libuv_file_watcher = true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
require("neo-tree.sources.manager").show("filesystem")
|
require("neo-tree.sources.manager").show("filesystem")
|
||||||
end,
|
end,
|
||||||
|
@ -128,52 +125,4 @@ return require('packer').startup({function(use)
|
||||||
end,
|
end,
|
||||||
}) 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 $up k
|
||||||
set $right l
|
set $right l
|
||||||
# Your preferred terminal emulator
|
# Your preferred terminal emulator
|
||||||
set $term wezterm
|
set $term alacritty
|
||||||
# Your preferred application launcher
|
# Your preferred application launcher
|
||||||
# Note: pass the final command to swaymsg so that the resulting window can be opened
|
# 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.
|
# 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
|
output "*" bg $wallpaper fill
|
||||||
|
|
||||||
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 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 $mod+x exec bemenu-run | xargs swaymsg exec --
|
bindsym $mod+x exec bemenu-run | xargs swaymsg exec --
|
||||||
|
|
||||||
bindsym Print exec grimshot --notify save area
|
bindsym Print exec grimshot --notify save area
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Force 256color terminal (with true color capabilities)
|
# Pretend to be screen-256color
|
||||||
set-option -g default-terminal "tmux-256color"
|
set-option -g default-terminal "screen-256color"
|
||||||
set -as terminal-features ",xterm-256color:RGB"
|
|
||||||
|
|
||||||
# Allow mouse input (to switch window / panes)
|
# Allow mouse input (to switch window / panes)
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
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