From 3cd018123fe3c9459d42c4871db0710cb02fd296 Mon Sep 17 00:00:00 2001 From: Rachel Lambda Samuelsson Date: Sun, 15 Oct 2023 13:10:57 +0200 Subject: [PATCH] configure haskell lsp and agda input --- home/rachel.nix | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/home/rachel.nix b/home/rachel.nix index fe4d7ae..9ff68a1 100644 --- a/home/rachel.nix +++ b/home/rachel.nix @@ -14,6 +14,11 @@ let username = "rachel"; mv "$downloadedFile" "$out/share/fonts/truetype/SAX2.ttf" ''; }; + hpkgs = pkgs.haskellPackages; + hls_wrapper = pkgs.writeScript "hls" '' + export PATH="${hpkgs.haskell-language-server}/bin:$PATH" + exec ${hpkgs.haskell-language-server}/bin/haskell-language-server-wrapper "$@" + ''; in { home = { @@ -34,7 +39,7 @@ in acpi julia-bin python3 - ghc + hpkgs.ghc firefox sxiv zathura @@ -183,17 +188,36 @@ in extraLuaConfig = '' require("tmux").setup({ copy_sync = { redirect_to_clipboard = true } }); require('Comment').setup() + local lspcfg = require('lspconfig') + lspcfg.typst_lsp.setup({ + cmd = { '${pkgs.typst-lsp}/bin/typst-lsp' } + }) + lspcfg.hls.setup({ + cmd = { '${hls_wrapper}', 'lsp' } + }) + lspcfg.pyright.setup({ + cmd = { '${pkgs.nodePackages.pyright}/bin/pyright-langserver', '--stdio' } + }) + + vim.api.nvim_create_autocmd('LspAttach', { + callback = function(args) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, { buffer = args.buf }) + end, + }) ''; extraConfig = '' set rnu nu set ts=2 sw=2 expandtab set clipboard=unnamedplus set laststatus=3 noshowmode + set signcolumn=no let g:cornelis_use_global_binary = 1 let g:lightline = { 'colorscheme': 'gruvbox' } colorscheme gruvbox hi Normal guibg=NONE ctermbg=NONE + runtime agda-input.vim + au BufRead,BufNewFile *.agda call AgdaFiletype() au BufRead,BufNewFile *.lagda.* call AgdaFiletype() function! AgdaFiletype() @@ -221,6 +245,7 @@ in lightline-gruvbox-vim tmux-nvim cornelis-vim + nvim-lspconfig ]; }; @@ -324,7 +349,7 @@ in read -p "Name? " -r n ${pkgs.tmux}/bin/tmux new -s "$n" ;; "Raw Shell") - ${pkgs.bash}/bin/bash ;; + ${pkgs.bash}/bin/bash --login ;; *) ${pkgs.tmux}/bin/tmux attach-session -t "''${c%%:*}" ;; esac