Compare commits

...

5 commits

Author SHA1 Message Date
cdde7294ff
nvim: after/ftplugin/haskell: Lint on save
Now that we use static-ls as Haskell LSP which does not
have hlint support for diagnostics yet, lint on save to
get hlint diagnostics.
2024-11-30 18:46:05 +05:30
bd98551ec9
ghc: Miscellaneous updates and clean up 2024-11-30 18:44:55 +05:30
198d333a79
Switch back to using foot as the default terminal 2024-11-30 18:44:55 +05:30
45dd7c4e20
arch-packages: Update package list 2024-11-30 18:44:55 +05:30
aab3d5bee3
fish: functions: Move HieDb helpers to functions
Using abbreviations for shell commands does not seem clean. They also
seem out of place along with other cabal abbreviations.

While at it, we also add a helper to nuke all Haskell build artefacts.
This is convenient instead of running cabal clean in every project or
relying on Kondo.

For deleting directories, we replace -delete with -exec rm -rv {} + or
-exec rm -rv {} \ which should delete directories recursively without
error. + at the end will result in rm -rv file1 file2 ... while using
\ will result in rm -rv file1; rm -rv file2; ...
2024-11-30 18:44:10 +05:30
10 changed files with 47 additions and 22 deletions

View file

@ -147,10 +147,6 @@ multiplier = 3
save_to_clipboard = true
semantic_escape_chars = ",│`|:\"' ()[]{}<>"
[terminal.shell]
args = ["attach", "-t", "scratch"]
program = "tmux"
[window]
decorations = "none"
dynamic_padding = true

View file

@ -47,8 +47,6 @@ cups
cups-pdf
d-spy
dconf-editor
debian-archive-keyring
debootstrap
debugedit
debuginfod
deno
@ -273,6 +271,7 @@ powerline-fonts
ppp
pptpclient
python
python-dbus
python-lxml
python-pandocfilters
python-pygments
@ -351,6 +350,7 @@ usbutils
uv
v4l2loopback-dkms
valgrind
vesktop-bin
vulkan-mesa-layers
vulkan-radeon
wdisplays
@ -364,7 +364,9 @@ wireless_tools
wireplumber
wireshark-qt
wl-clipboard
wlr-randr
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
xdg-user-dirs-gtk
xed

View file

@ -37,5 +37,3 @@ abbr cpD 'cabal-plan dot'
abbr cpdp 'cabal-plan dot-png'
abbr cpt 'cabal-plan topo'
abbr cplr 'cabal-plan license-reportate'
abbr chi 'hiedb -D .hiedb index .hiefiles --src-base-dir .'
abbr chic 'find . -name .hiefiles | awk \'{print $1" "substr($1, 1, length($1) - length(".hiefiles"))}\' | xargs -n2 sh -c \'hiedb -D .hiedb index $0 --src-base-dir=$1 --skip-types\''

View file

@ -0,0 +1,3 @@
function hclean --description "Clean all Haskell build artefacts"
find . -name .hiedb -type f -delete && find . -name .hiefiles -type d -exec rm -rf {} + && find . -name dist-newstyle -type d -exec rm -rf {} + && find . -name tags -type f -delete && find . -name ".ghc.environment*" -type f -delete
end

View file

@ -0,0 +1,3 @@
function hieg --description "Generate HieDb"
hiedb -D .hiedb index .hiefiles --src-base-dir .
end

View file

@ -0,0 +1,3 @@
function hier --description "Generate HieDb for multi-project workspace"
find . -name .hiefiles | awk '{print $1" "substr($1, 1, length($1) - length(".hiefiles"))}' | xargs -n2 sh -c 'hiedb -D .hiedb index $0 --src-base-dir=$1 --skip-types'
end

View file

@ -2,6 +2,7 @@
term = foot-extra
login-shell = no
shell = tmux attach -t scratch
font = monospace:style=Medium Italic:size=26
font-bold = monospace:style=Bold:size=26

View file

@ -1,22 +1,33 @@
-- -------------------------------------------------------------------- --
-- Default Extensions
-- https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html
-- GHC2024 gives errors with various projects
:set -XRankNTypes
:set -XGADTs
:set -XTypeFamilies
:set -XTypeApplications
:set -XBangPatterns
:set -XConstraintKinds
:set -XDataKinds
:set -XDuplicateRecordFields
:set -XFlexibleContexts
:set -XGADTs
:set -XMagicHash
:set -XMultiParamTypeClasses
:set -XPatternSynonyms
:set -XDataKinds
:set -XConstraintKinds
:set -XOverloadedStrings
:set -XNumericUnderscores
:set -XFlexibleContexts
:set -XScopedTypeVariables
:set -XOverloadedRecordDot
:set -XDuplicateRecordFields
:set -XOverloadedStrings
:set -XPatternSynonyms
:set -XRankNTypes
:set -XScopedTypeVariables
:set -XTypeApplications
-- -------------------------------------------------------------------- --
-- Useful flags
:set -fprint-explicit-foralls
:set -fprint-explicit-kinds
:set -ferror-spans
-- Enable multi-line expressions with :{ and :}
:set +m
-- Colorizing and pretty-printing ghci output
:set -interactive-print=Text.Pretty.Simple.pPrint
-- -------------------------------------------------------------------- --
@ -42,7 +53,8 @@
-- -------------------------------------------------------------------- --
-- Util cmds
:def fzf const . pure $ ":! cat $HOME/.ghc/ghci_history | fzf --height 25"
:def hlint const . return $ ":! hlint \"src\""
:def hoogle \s -> return $ ":! hoogle --color --count=15 " ++ show s
:def rg \s -> return $ ":! rg " ++ s
:def fzf const . pure $ ":! cat $HOME/.ghc/ghci_history | fzf --height 25"
:def tags \_ -> return ":! fast-tags --fully-qualified -R ."

View file

@ -4,3 +4,10 @@ local hls_config = lsp_utils.hls_config()
vim.lsp.start(hls_config)
vim.bo.makeprg = 'cabal build --write-ghc-environment-files=always all'
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
buffer = 0,
callback = function()
require("lint").try_lint()
end,
})

View file

@ -1,8 +1,8 @@
set $mod Mod4
set $prev bracketleft
set $next bracketright
set $term alacritty
set $alt_term foot
set $term foot
set $alt_term alacritty
set $menu fuzzel
set $screenshot grim $(xdg-user-dir PICTURES)/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png
set $screenclip slurp | grim -g - $(xdg-user-dir PICTURES)/screenshots/scrn-$(date +"%Y-%m-%d-%H-%M-%S").png