Compare commits

..

3 Commits

Author SHA1 Message Date
Hektor Misplon e11085ca91
Add section link snippet 2024-01-09 12:45:49 +01:00
Hektor Misplon 4e625a45fa
Update .gitignore 2024-01-03 19:39:59 +01:00
Hektor Misplon 2793ac2349
Update 'shiftAndView' 2024-01-03 19:39:15 +01:00
3 changed files with 12 additions and 1 deletions

1
.gitignore vendored
View File

@ -83,6 +83,7 @@ dkms.conf
# Dotenv
.env
.bash_history
.bash_aliases/private
.bashrc.d/private
desg/

View File

@ -57,6 +57,9 @@ def code_inline():
def code():
return code_inline() or code_block()
def slugify(text):
return re.sub('\s+', '-', text.lower())
def linkify(text, link):
return f"[{text}]({link})"
@ -741,6 +744,12 @@ for i in range(int(match.group(1)), int(match.group(2)) + 1):
`
endsnippet
snippet "sec([\sA-z]+)" "Link section titled ..." r
`!p
snip.rv = "* " + linkify(match.group(1), f"{snip.basename}_{slugify(match.group(1))}")
`
endsnippet
snippet cp(\d+) "Comment current page (and date)" r
`!p snip.rv = "<!--" + datetime.now().strftime("%Y-%m-%d") + " p. " + match.group(1) + "-->"`
endsnippet

View File

@ -3,6 +3,7 @@
import XMonad
import XMonad.Actions.CopyWindow (copyToAll, killAllOtherCopies)
import XMonad.Actions.FloatSnap
import Control.Monad (liftM2)
import XMonad.Hooks.DynamicProperty
import XMonad.Hooks.EwmhDesktops
import XMonad.Hooks.ManageDocks
@ -60,7 +61,7 @@ pp =
-- Workspaces & screens {{{
-- Shift to workspace and view workspace
shiftAndView id = doF (W.view id) <> doF (W.shift id)
shiftAndView = doF . liftM2 (.) W.greedyView W.shift
-- }}}