Compare commits

..

8 Commits

13 changed files with 57 additions and 14 deletions

View File

@ -1,3 +1,4 @@
# shellcheck shell=bash
# vim: set ft=bash : # vim: set ft=bash :
# Alias aliases # Alias aliases

View File

@ -1,3 +1,4 @@
# shellcheck shell=bash
# vim: set ft=bash : # vim: set ft=bash :
reboot-to-windows () reboot-to-windows ()

View File

@ -1,3 +1,4 @@
# shellcheck shell=bash
# vim: set ft=bash : # vim: set ft=bash :
source "$HOME/.bash_aliases/dualboot" source "$HOME/.bash_aliases/dualboot"

View File

@ -1,3 +1,4 @@
# shellcheck shell=bash
# vim: set ft=bash : # vim: set ft=bash :
# Set NeoVim as default editor # Set NeoVim as default editor

View File

@ -1,4 +1,5 @@
# Laptop configuration # shellcheck shell=bash
# vim: set ft=bash :
# >>> mamba initialize >>> # >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !! # !! Contents within this block are managed by 'mamba init' !!

View File

@ -1,4 +1,6 @@
# shellcheck shell=bash
# vim: set ft=bash : # vim: set ft=bash :
get_branch_name() { get_branch_name() {
git symbolic-ref --quiet --short HEAD 2>/dev/null \ git symbolic-ref --quiet --short HEAD 2>/dev/null \
|| git rev-parse --short HEAD 2>/dev/null \ || git rev-parse --short HEAD 2>/dev/null \

3
.bin/calc Executable file
View File

@ -0,0 +1,3 @@
#!/usr/env/bin bash
ipython -i /home/h/.bin/calc.py

View File

@ -1,5 +1,6 @@
vim.cmd([[ require("vim")
set runtimepath^=~/.vim runtimepath+=~/.vim/after require("ftdetect")
let &packpath = &runtimepath require("keymaps")
source ~/.vimrc" require("highlight")
]])
-- vim.opt.background = "dark"

View File

@ -0,0 +1,5 @@
vim.filetype.add({
filename = {
[".lintstagedrc"] = "json",
},
})

View File

@ -0,0 +1,14 @@
local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local function yank_highlight()
vim.highlight.on_yank({ higroup = "Visual", timeout = 150 })
end
-- Yanked text highlight feedback (source: https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua)
augroup("YankHighlight", { clear = true })
autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = "YankHighlight",
callback = yank_highlight,
})

View File

@ -0,0 +1,13 @@
local set = vim.keymap.set
set("n", "<leader>cx", "<cmd>!chmod +x %<CR>", { silent = true, desc = "Run `chmod +x` on current file" })
set("n", "yp", "<cmd>let @+ = expand('%r')<CR>:p<CR>", { silent = true, desc = "Yank path" })
-- Remap native NeoVim comment keymaps
set({ "n", "x" }, "<leader>c", "gc", { remap = true, desc = "Toggle comment" })
set("n", "<leader>cc", "gcc", { remap = true, desc = "Toggle comment line" })
set("o", "<leader>c", "gc", { remap = true, desc = "Comment textobject" })
-- Move lines
set("v", "K", ": '<,'>move '<-2<cr>gv")
set("v", "J", ": '<,'>move '>+1<cr>gv")

5
.config/nvim/lua/vim.lua Normal file
View File

@ -0,0 +1,5 @@
vim.cmd([[
set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath
source ~/.vimrc"
]])

View File

@ -167,7 +167,7 @@ myModMask = mod4Mask
myConfig = myConfig =
def def
{ terminal = "alacritty", { terminal = "kitty",
modMask = myModMask, modMask = myModMask,
workspaces = withScreen 1 myWorkspaces ++ withScreen 2 mySharedWorkspaces, workspaces = withScreen 1 myWorkspaces ++ withScreen 2 mySharedWorkspaces,
-- Styling -- Styling
@ -197,7 +197,6 @@ myKeys =
("M-<Space> M-<Space>", nextLayout), -- ..fat finger ("M-<Space> M-<Space>", nextLayout), -- ..fat finger
("M-<Space> M-S-<Space>", defaultLayout), -- ("M-<Space> M-S-<Space>", defaultLayout), --
("<F8>", spawnKeepassXC), ("<F8>", spawnKeepassXC),
("M-z", spawnZettelkasten),
("M-p", spawnLauncher), ("M-p", spawnLauncher),
("M-w", spawnWindowSwitcher), ("M-w", spawnWindowSwitcher),
("M-S-w", spawnWifiMenu), ("M-S-w", spawnWifiMenu),
@ -217,7 +216,6 @@ myKeys =
("M-S-<XF86MonBrightnessUp>", resetTemp), -- ("M-S-<XF86MonBrightnessUp>", resetTemp), --
("M-S-<XF86MonBrightnessDown>", resetTemp), -- ("M-S-<XF86MonBrightnessDown>", resetTemp), --
("M-S-b", fullscreenBrowser), ("M-S-b", fullscreenBrowser),
("<XF86Calculator>", spawnCalculator),
("<XF86PowerOff>", spawn "systemctl suspend"), --TODO: Only enable this on laptop ("<XF86PowerOff>", spawn "systemctl suspend"), --TODO: Only enable this on laptop
("M-c", windows copyToAll), ("M-c", windows copyToAll),
("M-S-c", killAllOtherCopies), ("M-S-c", killAllOtherCopies),
@ -255,9 +253,6 @@ nextLayout = sendMessage NextLayout
defaultLayout :: X () defaultLayout :: X ()
defaultLayout = setLayout $ Layout myLayoutHook defaultLayout = setLayout $ Layout myLayoutHook
spawnZettelkasten :: X ()
spawnZettelkasten = spawn "alacritty --class Zettelkasten,Zettelkasten -e nvim $(cat ~/.zk/current-zettel.txt)"
spawnKeepassXC :: X () spawnKeepassXC :: X ()
spawnKeepassXC = spawn "keepassxc" spawnKeepassXC = spawn "keepassxc"
@ -265,12 +260,12 @@ fullscreenBrowser :: X ()
fullscreenBrowser = spawn "firefox --fullscreen" fullscreenBrowser = spawn "firefox --fullscreen"
spawnWindowSwitcher = spawn "rofi -show window -show-icons" spawnWindowSwitcher = spawn "rofi -show window -show-icons"
spawnWifiMenu = spawn "rofi -show wifi -modi \"wifi:iwdrofimenu\"" spawnWifiMenu = spawn "rofi -show wifi -modi \"wifi:iwdrofimenu\""
spawnLauncher, spawnClipManager, spawnCalculator :: X () spawnLauncher, spawnClipManager :: X ()
spawnLauncher = spawn "rofi -show drun -show-icons" spawnLauncher = spawn "rofi -show drun -show-icons"
spawnClipManager = spawn "rofi -modi 'clipboard:greenclip print' -show clipboard -run-command '{cmd}'" spawnClipManager = spawn "rofi -modi 'clipboard:greenclip print' -show clipboard -run-command '{cmd}'"
spawnCalculator = spawn "alacritty --class 'Calculator' -e ipython -i /home/h/.bin/calc.py"
printScreen :: X () printScreen :: X ()
printScreen = spawn "flameshot gui" printScreen = spawn "flameshot gui"